/* Tositeo design tokens
   ink      #0F2342  text and dark surfaces
   cobalt   #2747C9  actions and brand
   paper    #FFFFFF  cards, receipts
   frost    #F2F5F9  page background
   line     #D9E0EA  rules and borders
   matched  #0B7A5E  matched/approved
   missing  #C0392B  missing/rejected
   pending  #A86A0C  waiting
*/
:root {
  --ink: #0f2342;
  --ink-2: #3a4b66;
  --muted: #5b6b82;
  --cobalt: #2747c9;
  --cobalt-dark: #1c369e;
  --cobalt-soft: #e8edfc;
  --paper: #ffffff;
  --frost: #f2f5f9;
  --line: #d9e0ea;
  --line-strong: #b9c4d4;
  --matched: #0b7a5e;
  --matched-soft: #e3f4ee;
  --missing: #c0392b;
  --missing-soft: #fbe9e7;
  --pending: #a86a0c;
  --pending-soft: #fdf1dc;
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 18px;
  --shadow: 0 1px 2px rgba(15, 35, 66, 0.06), 0 8px 24px -12px rgba(15, 35, 66, 0.18);
  --font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;
  --step-5: 3.4rem;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--frost);
}
/* No tabular figures: Schibsted Grotesk widens the decimal comma with them. */
[hidden] {
  display: none !important;
}
fieldset {
  min-width: 0;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--cobalt);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--cobalt-dark);
}
h1,
h2,
h3,
h4 {
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 {
  font-size: var(--step-3);
  font-weight: 800;
}
h2 {
  font-size: var(--step-2);
  font-weight: 750;
}
h3 {
  font-size: var(--step-1);
  font-weight: 700;
}
p {
  margin: 0 0 1em;
  text-wrap: pretty;
}
:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  z-index: 100;
}
.skip:focus {
  left: 8px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: var(--step--1);
}
.nowrap {
  white-space: nowrap;
}
.right {
  text-align: right;
}
.stack > * + * {
  margin-top: 1rem;
}
.row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.spacer {
  flex: 1;
}

/* Buttons */
.btn {
  --b: var(--cobalt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--b);
  background: var(--b);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover {
  background: var(--cobalt-dark);
  border-color: var(--cobalt-dark);
  color: #fff;
}
.btn.secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn.secondary:hover {
  border-color: var(--ink);
  background: var(--paper);
  color: var(--ink);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--cobalt);
  padding-inline: 0.6rem;
}
.btn.ghost:hover {
  background: var(--cobalt-soft);
  color: var(--cobalt-dark);
}
.btn.danger {
  --b: var(--missing);
}
.btn.danger:hover {
  background: #9b2c20;
  border-color: #9b2c20;
}
.btn.ok {
  --b: var(--matched);
}
.btn.ok:hover {
  background: #075c47;
  border-color: #075c47;
}
.btn.small {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}
.btn.large {
  padding: 1rem 1.4rem;
  font-size: 1.05rem;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--cobalt);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* Forms */
.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.field > label,
.label {
  font-weight: 650;
  font-size: 0.92rem;
}
.hint {
  font-size: 0.85rem;
  color: var(--muted);
}
.error-text {
  font-size: 0.85rem;
  color: var(--missing);
  font-weight: 600;
}
input:not([type]),
input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='datetime-local'],
input[type='month'],
input[type='search'],
input[type='tel'],
select,
textarea {
  font: inherit;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--paper);
  color: var(--ink);
  min-height: 44px;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px var(--cobalt-soft);
}
.invalid input,
.invalid select,
.invalid textarea {
  border-color: var(--missing);
}
.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 500;
}
.check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--cobalt);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
  align-items: start;
}
.field {
  align-content: start;
}
.field input,
.field select {
  min-width: 0;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 1rem;
  align-items: start;
}
@media (max-width: 640px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}
.money-input {
  position: relative;
}
.money-input input {
  padding-right: 2rem;
  text-align: right;
  font-weight: 650;
}
.money-input::after {
  content: '€';
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

/* Flash */
.flash {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-s);
  margin-bottom: 1rem;
  font-weight: 550;
  border-left: 4px solid;
}
.flash.success {
  background: var(--matched-soft);
  border-color: var(--matched);
}
.flash.error {
  background: var(--missing-soft);
  border-color: var(--missing);
}
.flash.info {
  background: var(--cobalt-soft);
  border-color: var(--cobalt);
}

/* Status chips: shape follows meaning, colour follows state */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 650;
  padding: 0.2rem 0.55rem 0.2rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--frost);
  color: var(--ink-2);
}
.status::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}
.status.draft {
  color: var(--muted);
}
.status.submitted,
.status.open {
  background: var(--pending-soft);
  color: var(--pending);
}
.status.approved,
.status.matched,
.status.paid {
  background: var(--matched-soft);
  color: var(--matched);
}
.status.processed {
  background: var(--cobalt-soft);
  color: var(--cobalt);
}
.status.rejected,
.status.missing {
  background: var(--missing-soft);
  color: var(--missing);
}
.status.ignored {
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line-strong);
}

/* Cards and tables */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card + .card {
  margin-top: 1rem;
}
.card h2 {
  font-size: var(--step-1);
}
.table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
table.data th {
  text-align: left;
  font-weight: 650;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fafbfd;
}
table.data td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tr:last-child td {
  border-bottom: 0;
}
table.data tbody tr:hover {
  background: #fafbfd;
}
table.data .amount {
  text-align: right;
  font-weight: 650;
  white-space: nowrap;
}
table.data a.rowlink {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
table.data a.rowlink:hover {
  color: var(--cobalt);
  text-decoration: underline;
}
.neg {
  color: var(--ink);
}
.pos {
  color: var(--matched);
}
.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
}

/* ----- Public site ----- */
.wrap {
  width: min(1160px, 100% - 32px);
  margin-inline: auto;
}
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand:hover {
  color: var(--ink);
}
.brand svg {
  flex: none;
}
.site-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex: 1;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 550;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-s);
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--ink);
  background: var(--frost);
}
.site-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.lang-switch {
  display: flex;
  gap: 2px;
  font-size: 0.82rem;
}
.lang-switch a {
  padding: 0.25rem 0.4rem;
  text-decoration: none;
  color: var(--muted);
  border-radius: 4px;
  font-weight: 600;
}
.lang-switch a[aria-current='true'] {
  color: var(--ink);
  background: var(--frost);
}
.menu-toggle {
  display: none;
}
@media (max-width: 1100px) {
  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .site-nav,
  .site-actions {
    display: none;
  }
  .site-header.open .wrap {
    flex-wrap: wrap;
    padding-bottom: 1rem;
  }
  .site-header.open .site-nav,
  .site-header.open .site-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
}

.section {
  padding: 5rem 0;
}
.section.tight {
  padding: 3rem 0;
}
.section.paper {
  background: var(--paper);
  border-block: 1px solid var(--line);
}
.section.ink {
  background: var(--ink);
  color: #e6ecf5;
}
.section.ink h2,
.section.ink h3 {
  color: #fff;
}
.section-head {
  max-width: 44rem;
  margin-bottom: 2.5rem;
}
.section-head p {
  font-size: var(--step-1);
  color: var(--muted);
  line-height: 1.45;
}
.section.ink .section-head p {
  color: #b8c4d8;
}

/* Hero: the receipt being read */
.hero {
  padding: 4.5rem 0 5rem;
  background: linear-gradient(180deg, var(--paper) 0%, var(--frost) 100%);
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 3rem;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, var(--step-5));
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin-bottom: 1.25rem;
}
.hero .lede {
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: 34rem;
  line-height: 1.45;
}
.hero .cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 2rem 0 1rem;
}
.hero .proof {
  font-size: 0.92rem;
  color: var(--muted);
}
@media (max-width: 1080px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .scan-stage {
    max-width: 640px;
  }
  .hero {
    padding-top: 3rem;
  }
}

.scan-stage {
  position: relative;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
}
@media (max-width: 520px) {
  .scan-stage {
    grid-template-columns: minmax(0, 1fr);
  }
}
.receipt {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--paper);
  color: #23262b;
  padding: 1.4rem 1.2rem 1.6rem;
  position: relative;
  box-shadow: var(--shadow);
  transform: rotate(-2.2deg);
  --tooth: 9px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
  padding-bottom: calc(1.6rem + var(--tooth));
}
.receipt .r-center {
  text-align: center;
}
.receipt .r-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.receipt hr {
  border: 0;
  border-top: 1px dashed #9aa3ad;
  margin: 0.5rem 0;
}
.receipt mark {
  background: transparent;
  color: inherit;
  border-radius: 3px;
  transition: background 0.4s, box-shadow 0.4s;
}
.receipt mark.hit {
  background: rgba(39, 71, 201, 0.14);
  box-shadow: 0 0 0 2px rgba(39, 71, 201, 0.35);
}
.scan-beam {
  position: absolute;
  left: -6px;
  right: -6px;
  height: 46px;
  top: 0;
  background: linear-gradient(180deg, rgba(39, 71, 201, 0) 0%, rgba(39, 71, 201, 0.16) 70%, rgba(39, 71, 201, 0.6) 100%);
  border-bottom: 2px solid var(--cobalt);
  pointer-events: none;
  opacity: 0;
}
.scan-stage.run .scan-beam {
  animation: beam 2.6s cubic-bezier(0.45, 0, 0.3, 1) 0.4s 1 forwards;
}
@keyframes beam {
  0% {
    top: 0;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: calc(100% - 40px);
    opacity: 0;
  }
}
.entry {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.entry dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem 1rem;
  font-size: 0.92rem;
}
.entry dt {
  color: var(--muted);
}
.entry dd {
  margin: 0;
  font-weight: 650;
  text-align: right;
  opacity: 0.15;
  transform: translateX(6px);
  transition: opacity 0.35s, transform 0.35s;
}
.entry dd.on {
  opacity: 1;
  transform: none;
}
.entry .entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
  font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
  .scan-stage.run .scan-beam {
    animation: none;
  }
  .entry dd {
    opacity: 1;
    transform: none;
  }
}

/* Feature list: three jobs, one per row with a real UI fragment */
.jobs {
  display: grid;
  gap: 1.25rem;
}
.job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 2.5rem;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}
.job:first-child {
  border-top: 0;
}
.job h3 {
  font-size: var(--step-2);
}
.job p {
  color: var(--ink-2);
  font-size: 1.05rem;
}
.job ul {
  padding-left: 1.1rem;
  color: var(--ink-2);
  margin: 0 0 1rem;
}
.job ul li {
  margin-bottom: 0.3rem;
}
@media (max-width: 820px) {
  .job {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
}
.fragment {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}
.fragment table {
  width: 100%;
  border-collapse: collapse;
}
.fragment td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
.fragment tr:last-child td {
  border-bottom: 0;
}
.fragment .total-line {
  display: flex;
  justify-content: space-between;
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  border-top: 2px solid var(--ink);
  font-weight: 750;
  font-size: 1.05rem;
}

.logos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 1.05rem;
}

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 3rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cobalt);
  color: #fff;
  font-weight: 800;
}
.steps h3 {
  font-size: 1.15rem;
}
@media (max-width: 760px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}
.plan {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}
.plan.featured {
  border: 2px solid var(--cobalt);
  box-shadow: var(--shadow);
}
.plan .tag {
  align-self: flex-start;
  background: var(--cobalt);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.plan .price {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0.5rem 0;
}
.plan .price small {
  font-size: 0.95rem;
  font-weight: 550;
  color: var(--muted);
  letter-spacing: 0;
}
.plan ul {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 1.5rem;
  flex: 1;
}
.plan li {
  padding: 0.4rem 0 0.4rem 1.6rem;
  position: relative;
}
.plan li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.75rem;
  width: 0.7rem;
  height: 0.38rem;
  border-left: 2px solid var(--matched);
  border-bottom: 2px solid var(--matched);
  transform: rotate(-45deg);
}
.plan .fine {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.75rem;
}
@media (max-width: 900px) {
  .plans {
    grid-template-columns: minmax(0, 1fr);
  }
}

.quote {
  font-size: var(--step-1);
  line-height: 1.45;
  max-width: 46rem;
  margin: 0;
}
.quote footer {
  font-size: 0.95rem;
  margin-top: 1rem;
  color: #b8c4d8;
}

.cta-band {
  background: var(--cobalt);
  color: #fff;
  border-radius: var(--radius-l);
  padding: 2.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cta-band h2 {
  color: #fff;
  margin: 0 0 0.3rem;
}
.cta-band p {
  margin: 0;
  color: #dbe3ff;
}
.cta-band .btn {
  background: #fff;
  color: var(--cobalt);
  border-color: #fff;
}
.cta-band .btn:hover {
  background: var(--cobalt-soft);
}

.posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.post-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.post-card:hover {
  border-color: var(--cobalt);
  color: var(--ink);
}
.post-card h3 {
  font-size: 1.1rem;
  margin: 0;
}
.post-card p {
  color: var(--muted);
  font-size: 0.93rem;
  margin: 0;
}
@media (max-width: 860px) {
  .posts {
    grid-template-columns: minmax(0, 1fr);
  }
}
.prose {
  max-width: 44rem;
  font-size: 1.06rem;
}
.prose h2 {
  margin-top: 2rem;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
  background: var(--paper);
}
.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  text-align: left;
}
.prose th {
  background: var(--frost);
}

.page-hero {
  padding: 3.5rem 0 2.5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.page-hero h1 {
  font-size: clamp(2rem, 4vw, var(--step-4));
  max-width: 48rem;
}
.page-hero p {
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: 42rem;
  line-height: 1.45;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}
.faq summary {
  font-weight: 700;
  cursor: pointer;
  font-size: 1.05rem;
}
.faq details p {
  margin: 0.75rem 0 0;
  color: var(--ink-2);
}

.site-footer {
  background: var(--ink);
  color: #b8c4d8;
  padding: 3.5rem 0 2rem;
  font-size: 0.93rem;
}
.site-footer .cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
}
.site-footer h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}
.site-footer a {
  color: #dfe6f1;
  text-decoration: none;
  display: block;
  padding: 0.2rem 0;
}
.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.site-footer .brand {
  color: #fff;
}
.site-footer .legal {
  border-top: 1px solid #263a5c;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
@media (max-width: 760px) {
  .site-footer .cols {
    grid-template-columns: 1fr 1fr;
  }
}

/* Auth pages */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.auth-side {
  background: var(--ink);
  color: #dbe3ef;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-side .brand {
  color: #fff;
}
.auth-side blockquote {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.45;
  color: #fff;
  max-width: 30rem;
}
.auth-side ul {
  padding-left: 1.1rem;
  line-height: 1.9;
}
.auth-main {
  display: grid;
  place-items: center;
  padding: 2rem 16px;
  background: var(--paper);
}
.auth-box {
  width: min(420px, 100%);
}
.auth-box h1 {
  font-size: var(--step-3);
}
@media (max-width: 860px) {
  .auth {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-side {
    display: none;
  }
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.segmented label {
  text-align: center;
  padding: 0.65rem;
  font-weight: 650;
  cursor: pointer;
  font-size: 0.92rem;
}
.segmented input {
  position: absolute;
  opacity: 0;
}
.segmented label:has(input:checked) {
  background: var(--ink);
  color: #fff;
}
.segmented label:has(input:focus-visible) {
  outline: 3px solid var(--cobalt);
  outline-offset: -3px;
}

/* ----- App shell ----- */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--ink);
  color: #c9d3e3;
  padding: 1.1rem 0.8rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar .brand {
  color: #fff;
  padding: 0.3rem 0.5rem;
}
.company-switch select {
  background: #1a3157;
  border-color: #2a4470;
  color: #fff;
  font-weight: 600;
  min-height: 40px;
  font-size: 0.9rem;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-nav .group {
  font-size: 0.78rem;
  color: #8a9ab3;
  padding: 0.9rem 0.6rem 0.3rem;
  font-weight: 600;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #d5deeb;
  text-decoration: none;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-s);
  font-weight: 550;
  font-size: 0.94rem;
}
.side-nav a svg {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.85;
}
.side-nav a:hover {
  background: #1a3157;
  color: #fff;
}
.side-nav a[aria-current='page'] {
  background: #fff;
  color: var(--ink);
}
.side-nav .badge {
  margin-left: auto;
  background: var(--pending);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
}
.sidebar .side-foot {
  margin-top: auto;
  font-size: 0.85rem;
  padding: 0 0.5rem;
}
.sidebar .side-foot a {
  color: #d5deeb;
}
.main {
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.75rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .who {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cobalt-soft);
  color: var(--cobalt);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}
.bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--ink-2);
}
.bell:hover {
  background: var(--frost);
}
.bell .dot {
  position: absolute;
  top: 4px;
  right: 3px;
  background: var(--missing);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}
.content {
  padding: 1.75rem;
  max-width: 1280px;
}
.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-title h1 {
  margin: 0;
  font-size: var(--step-3);
}
.page-title p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}
.trial-bar {
  background: var(--pending-soft);
  color: #6b4508;
  padding: 0.55rem 1.75rem;
  font-size: 0.9rem;
  font-weight: 550;
  border-bottom: 1px solid #f0dcb4;
}
.trial-bar a {
  color: #6b4508;
  font-weight: 700;
}
.mobile-nav-toggle {
  display: none;
}
@media (max-width: 960px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.2s;
    z-index: 50;
  }
  .shell.nav-open .sidebar {
    transform: none;
    box-shadow: 0 0 0 100vmax rgba(15, 35, 66, 0.45);
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
  .content {
    padding: 1.1rem 16px;
  }
  .topbar {
    padding: 0.6rem 16px;
  }
  .trial-bar {
    padding: 0.55rem 16px;
  }
}

/* Dashboard */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--ink);
  display: block;
}
a.kpi:hover {
  border-color: var(--cobalt);
  color: var(--ink);
}
.kpi .k-label {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
}
.kpi .k-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 0.2rem;
}
.kpi .k-sub {
  font-size: 0.85rem;
  color: var(--muted);
}
.kpi.alert {
  border-left: 4px solid var(--missing);
}
.kpi.wait {
  border-left: 4px solid var(--pending);
}
@media (max-width: 1100px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .kpis {
    grid-template-columns: minmax(0, 1fr);
  }
}
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 1000px) {
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}
.spark {
  width: 100%;
  height: 120px;
}
.quick {
  display: grid;
  gap: 0.6rem;
}
.quick a {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-weight: 650;
  background: var(--paper);
}
.quick a:hover {
  border-color: var(--cobalt);
  color: var(--ink);
}
.quick .ico {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-s);
  background: var(--cobalt-soft);
  color: var(--cobalt);
  display: grid;
  place-items: center;
  flex: none;
}
.quick small {
  display: block;
  font-weight: 450;
  color: var(--muted);
}

/* Filters */
.filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.filters .field {
  margin: 0;
  min-width: 150px;
}
.filters .field.grow {
  flex: 1;
  min-width: 200px;
}
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a {
  padding: 0.6rem 0.9rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 650;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs a[aria-current='true'] {
  color: var(--ink);
  border-color: var(--cobalt);
}
.tabs a .n {
  font-size: 0.78rem;
  background: var(--frost);
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.3rem;
}

/* Receipt editor */
.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 1240px) {
  .editor {
    grid-template-columns: minmax(0, 1fr);
  }
}
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  position: relative;
  cursor: pointer;
}
.dropzone.drag {
  border-color: var(--cobalt);
  background: var(--cobalt-soft);
}
.dropzone input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone .dz-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  color: var(--cobalt);
}
.preview {
  background: #e7ebf1;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.preview img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  margin: 0 auto;
}
.preview iframe {
  width: 100%;
  height: 70vh;
  border: 0;
  background: #fff;
}
.ocr-status {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-s);
  background: var(--cobalt-soft);
  color: var(--cobalt-dark);
  margin-bottom: 1rem;
}
.ocr-status progress {
  flex: 1;
  height: 6px;
  accent-color: var(--cobalt);
}
.ocr-filled {
  animation: filled 1.2s ease-out;
}
@keyframes filled {
  0% {
    box-shadow: 0 0 0 3px rgba(39, 71, 201, 0.45);
    background: var(--cobalt-soft);
  }
  100% {
    box-shadow: none;
  }
}
.method-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.method-picker label {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  background: var(--paper);
}
.method-picker input {
  position: absolute;
  opacity: 0;
}
.method-picker label:has(input:checked) {
  border-color: var(--cobalt);
  background: var(--cobalt-soft);
  color: var(--cobalt-dark);
}
.method-picker label:has(input:focus-visible) {
  outline: 3px solid var(--cobalt);
}
@media (max-width: 480px) {
  .method-picker {
    grid-template-columns: minmax(0, 1fr);
  }
}
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 0.9rem 0;
  margin-top: 0.5rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.kv {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: 0.6rem 1.25rem;
  margin: 0;
}
.kv dt {
  color: var(--muted);
  font-size: 0.92rem;
}
.kv dd {
  margin: 0;
  font-weight: 600;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
}
.timeline li {
  padding: 0.45rem 0 0.45rem 1rem;
  border-left: 2px solid var(--line);
  position: relative;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 0.85rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* Travel */
.route-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.route-row {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) 110px 40px;
  gap: 0.5rem;
  align-items: center;
}
.route-row .pin {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid var(--cobalt);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--cobalt);
  background: var(--paper);
}
.route-row:first-child .km {
  visibility: hidden;
}
.calc {
  position: sticky;
  top: 80px;
}
.calc .line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}
.calc .line span:last-child {
  font-weight: 650;
  white-space: nowrap;
}
.calc .grand {
  display: flex;
  justify-content: space-between;
  padding-top: 0.9rem;
  font-size: 1.35rem;
  font-weight: 800;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chips label {
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--paper);
}
.chips input {
  position: absolute;
  opacity: 0;
}
.chips label:has(input:checked) {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.chips label:has(input:focus-visible) {
  outline: 3px solid var(--cobalt);
}

.firm-grid {
  display: grid;
  gap: 0.75rem;
}
.notice-list a {
  display: block;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.notice-list a.unread {
  font-weight: 700;
  background: var(--cobalt-soft);
}

.admin-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.admin-nav a {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-s);
  text-decoration: none;
  font-weight: 650;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
}
.admin-nav a[aria-current='page'] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.error-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 16px;
}

@media print {
  .sidebar,
  .topbar,
  .sticky-actions,
  .btn {
    display: none !important;
  }
  .shell {
    display: block;
  }
}

/* Phones: keep the top bar to one row */
@media (max-width: 560px) {
  .topbar {
    gap: 0.5rem;
  }
  .topbar .btn span {
    display: none;
  }
  .page-title .btn {
    width: 100%;
  }
}
.card-scroll {
  overflow-x: auto;
}
/* Scroll containers must be positioned so absolutely placed children (.sr-only) are clipped too. */
.table-wrap,
.tabs,
.card-scroll {
  position: relative;
}
.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 760px) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .btn.large {
    white-space: normal;
    text-align: center;
  }
}
