/* Kvitto Korrekt — the public site.
   Same palette as the app icon and the listing material: paper, deep blue,
   and the green reserved for things that are confirmed. */

:root {
  --paper: #f7f5f0;
  --ink: #1f2429;
  --muted: #5c6670;
  --blue: #1e3a52;
  --blue-dark: #16303f;
  --blue-soft: #2b4c68;
  --green: #2e7d5b;
  --line: #e3dfd5;
  --line-blue: #34556f;
  --white: #fff;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.5rem; }
.wrap-wide { max-width: 62rem; margin: 0 auto; padding: 0 1.5rem; }

/* --- header ------------------------------------------------------------- */

header { background: var(--white); border-bottom: 1px solid var(--line); }

header .wrap-wide {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

header img { width: 32px; height: 32px; border-radius: 7px; display: block; }

header a.brand {
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: -0.01em;
}

/* --- hero --------------------------------------------------------------- */

.hero {
  background: var(--blue);
  color: var(--white);
  padding: 4.5rem 0 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero h1 {
  margin: 0 0 1.15rem;
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  line-height: 1.13;
  letter-spacing: -0.028em;
  color: var(--white);
}

.hero p.lead {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.6;
  color: #c8d4de;
}

.market {
  display: inline-block;
  margin-top: 1.9rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line-blue);
  border-radius: 999px;
  font-size: 0.84rem;
  color: #a9bcca;
}

/* --- the receipt, drawn rather than photographed ------------------------ */

.receipt {
  background: var(--white);
  color: var(--ink);
  border-radius: 4px 4px 0 0;
  padding: 1.5rem 1.5rem 2rem;
  font-size: 0.8rem;
  line-height: 1.5;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  /* Six teeth along the bottom edge — the same shape as the app icon, and
     what makes a receipt read as a receipt rather than an invoice. */
  clip-path: polygon(
    0 0, 100% 0, 100% 96%,
    91.6% 100%, 83.3% 96%, 75% 100%, 66.6% 96%, 58.3% 100%,
    50% 96%, 41.6% 100%, 33.3% 96%, 25% 100%, 16.6% 96%, 8.3% 100%, 0 96%
  );
}

.receipt .r-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 0.5rem;
  margin-bottom: 0.85rem;
}

.receipt .r-title { font-weight: 700; letter-spacing: 0.08em; font-size: 0.82rem; }
.receipt .r-no { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.74rem; }

.receipt .r-seller { color: var(--muted); font-size: 0.72rem; margin-bottom: 1rem; }

.receipt .r-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 0.22rem 0;
  font-variant-numeric: tabular-nums;
}

.receipt .r-row span:last-child { white-space: nowrap; }

.receipt .r-rule { border-top: 1px solid var(--line); margin: 0.7rem 0; }

.receipt .r-vat { color: var(--muted); font-size: 0.72rem; }

.receipt .r-total {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  font-weight: 700;
  border-top: 1.5px solid var(--ink);
  padding-top: 0.5rem;
  margin-top: 0.55rem;
  font-variant-numeric: tabular-nums;
}

/* --- sections ----------------------------------------------------------- */

section { padding: 3.5rem 0; }
section.tint { background: var(--paper); }
section.tint + section.tint { padding-top: 0; }

h2 {
  margin: 0 0 1.4rem;
  font-size: 1.4rem;
  letter-spacing: -0.018em;
  color: var(--blue);
}

h3 { margin: 2rem 0 0.55rem; font-size: 1.03rem; color: var(--blue); }

p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

ul.points { list-style: none; margin: 0; padding: 0; }

ul.points li { position: relative; padding-left: 1.9rem; margin-bottom: 1.05rem; }

ul.points li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.5rem;
  width: 0.8rem;
  height: 0.42rem;
  border-left: 2.5px solid var(--green);
  border-bottom: 2.5px solid var(--green);
  transform: rotate(-45deg);
}

/* The not-doing list, deliberately quieter than the doing list. */
.plain { list-style: none; margin: 0; padding: 0; color: var(--muted); }
.plain li { padding-left: 1.9rem; position: relative; margin-bottom: 0.85rem; }
.plain li::before { content: "—"; position: absolute; left: 0.2rem; color: #b9b2a4; }

/* --- footer ------------------------------------------------------------- */

footer {
  background: var(--blue);
  color: #a9bcca;
  padding: 2.5rem 0 3.25rem;
  font-size: 0.9rem;
}

footer a { color: var(--white); }
footer nav { margin-bottom: 1.15rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

/* --- document pages (generated from markdown) --------------------------- */

.doc { padding: 3rem 0 3.5rem; }
.doc h1 { font-size: 1.9rem; letter-spacing: -0.022em; color: var(--blue); margin: 0 0 1.5rem; }
.doc h2 { margin-top: 2.5rem; font-size: 1.18rem; }
.doc table { border-collapse: collapse; width: 100%; margin: 0 0 1.5rem; font-size: 0.93rem; }
.doc th, .doc td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--blue); font-weight: 600; }
.doc code { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.9em; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.doc ul, .doc ol { padding-left: 1.35rem; }
.doc li { margin-bottom: 0.5rem; }

/* Wide tables scroll inside their own box; the page never does. */
.scroll { overflow-x: auto; }

.draft {
  background: #fff8e6;
  border: 1px solid #e8d9a8;
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  font-size: 0.92rem;
  margin-bottom: 2rem;
  color: var(--ink);
}

/* --- narrow screens ------------------------------------------------------ */

@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.75rem; }
  /* The receipt stays, but stops competing with the headline for width. */
  .receipt { max-width: 21rem; }
}

@media (max-width: 34rem) {
  body { font-size: 16px; }
  .hero { padding: 3.25rem 0 3.5rem; }
  section { padding: 2.75rem 0; }

  /* Two-column tables in the documents are label/value pairs, and they are
     unreadable squeezed onto a phone. Stacking each row into a block keeps
     every value whole; sideways scrolling hid text behind an edge that gave
     no sign it could be moved. */
  .doc table.stack,
  .doc table.stack tbody,
  .doc table.stack tr,
  .doc table.stack td,
  .doc table.stack th { display: block; width: 100%; }

  .doc table.stack tr {
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 0;
  }

  .doc table.stack td,
  .doc table.stack th { border: 0; padding: 0.1rem 0; }

  /* The first cell is the label. */
  .doc table.stack td:first-child {
    color: var(--blue);
    font-weight: 600;
    font-size: 0.88rem;
  }

  /* Wider tables keep scrolling, but say so. */
  .scroll { position: relative; }
  .scroll::after {
    content: "Dra i sidled för att se hela tabellen";
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    padding-top: 0.4rem;
  }
  .scroll:has(table.stack)::after { content: none; }
}
