/*
  Components and layout. All values come from tokens.css.

  MODULAR GRID
  The page is a grid of square modules: --cols columns, and rows as tall as one column is wide
  (--mod). Blocks start at module edges and section spacing is one module. Hierarchy comes from
  size, weight, position and white space; rules appear only where they do a job
  (form controls, buttons, checkboxes, progress bars).
*/

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--sp-4)); }
html, body { margin: 0; background: var(--c-paper); color: var(--c-ink); }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (hover: hover) { a:hover { text-decoration-thickness: 2px; } }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::placeholder { color: var(--c-placeholder); }
:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--pad); top: -100px; z-index: 50; background: var(--c-ink); color: var(--c-paper); padding: var(--btn-pad); }
.skip:focus { top: var(--sp-2); }

/* Typography */
.hero { color: var(--c-display); font-size: var(--fs-hero); line-height: var(--lh-hero); letter-spacing: var(--tr-display); font-weight: var(--fw-bold); }
.h1 { color: var(--c-display); font-size: var(--fs-h1); line-height: var(--lh-display); letter-spacing: var(--tr-display); font-weight: var(--fw-bold); overflow-wrap: break-word; hyphens: auto; }
.h2 { font-size: var(--fs-h2); line-height: var(--lh-heading); letter-spacing: var(--tr-heading); font-weight: var(--fw-regular); overflow-wrap: break-word; hyphens: auto; }
.h3 { font-size: var(--fs-h3); line-height: var(--lh-heading); letter-spacing: -.01em; font-weight: var(--fw-regular); }
.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); max-width: 34ch; }
.label { font-size: var(--fs-label); line-height: 1.4; letter-spacing: var(--tr-label); font-weight: var(--fw-bold); text-transform: uppercase; }
.note { font-size: var(--fs-note); line-height: var(--lh-note); font-style: italic; color: var(--c-muted); max-width: var(--measure); }
.prose { max-width: var(--measure); }
.muted { color: var(--c-muted); }
.num { font-variant-numeric: tabular-nums; }
.strong { font-weight: var(--fw-bold); }

/* Grid */
.main, .sheet__body { container-type: inline-size; }
.grid, .mgrid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--gutter); }
.mgrid { row-gap: var(--gutter); grid-auto-rows: minmax(var(--mod), auto); }
.grid > *, .mgrid > * { grid-column: 1 / -1; min-width: 0; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  min-height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--pad) 0;
  background: var(--c-paper);
}
.header__brand { display: flex; align-items: baseline; gap: var(--sp-3); min-width: 0; }
.header__home { font-size: 16px; font-weight: var(--fw-bold); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.header__actions { display: flex; gap: var(--sp-2); }
.sync { font-size: var(--fs-label); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--c-muted); white-space: nowrap; }

/* Shell */
.main { padding: var(--sp-4) var(--pad) calc(var(--mod) * 2 + env(safe-area-inset-bottom)); outline: none; min-width: 0; }
.side { display: none; }
@media (min-width: 1100px) {
  .shell { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); padding: 0 var(--pad); }
  .side {
    display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-6);
    grid-column: 1 / span 3; position: sticky; top: var(--header-h); align-self: start;
    height: calc(100dvh - var(--header-h)); padding: var(--sp-4) 0 var(--pad); overflow: auto;
  }
  .main { grid-column: 4 / -1; --cols: 9; padding-left: 0; padding-right: 0; }
  .header .menu-btn { display: none; }
}

/* Navigation */
.nav { display: flex; flex-direction: column; }
.nav__link { display: block; padding: 6px 0; text-decoration: none; font-size: clamp(28px, 8vw, 44px); line-height: var(--lh-heading); letter-spacing: var(--tr-heading); }
.nav__link[aria-current='page'] { color: var(--c-display); font-weight: var(--fw-bold); }
.nav--side .nav__link { font-size: var(--fs-lead); padding: 3px 0; }
@media (hover: hover) { .nav__link:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; } }
.backup { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.account { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-4); }

/* Menu (mobile) */
.menu {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column;
  background: var(--c-paper); overflow: auto; overscroll-behavior: contain;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-ui) var(--ease-ui), visibility 0s linear var(--dur-ui);
}
.menu.is-open { opacity: 1; visibility: visible; transition: opacity var(--dur-ui) var(--ease-ui); }
.menu__nav { padding: var(--sp-4) var(--pad) 0; }
.menu__foot { margin-top: auto; padding: var(--sp-7) var(--pad) calc(var(--sp-6) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: var(--sp-4); }
@keyframes menu-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.menu.is-open .nav__link { animation: menu-in .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * var(--stagger)); }

/* Page header */
.page-head { row-gap: var(--gutter); margin-bottom: var(--mod); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.page-head__actions > .seg { flex: 1 1 auto; max-width: 320px; }
@media (min-width: 720px) {
  .page-head__lead, .page-head__actions { grid-column: 4 / -1; }
}

/* Sections: one module apart, title at the top-left of its module */
.section { margin-top: var(--mod); }
.section:first-child, .page-head + .section { margin-top: 0; }
.section__head { align-items: baseline; row-gap: var(--sp-2); margin-bottom: var(--sp-5); }
.section__head.has-aside .section__title { grid-column: 1 / -2; }
.section__aside { grid-column: -2 / -1; text-align: right; color: var(--c-muted); line-height: 1.35; }
@media (min-width: 720px) {
  .section__head.has-aside .section__title { grid-column: 1 / -3; }
  .section__aside { grid-column: -3 / -1; }
}
.section__title { font-weight: var(--fw-bold); }
.empty { display: flex; flex-direction: column; gap: var(--sp-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: var(--btn-pad);
  border: var(--line); border-radius: 0; background: transparent; color: var(--c-ink);
  font-size: var(--fs-label); letter-spacing: var(--tr-label); text-transform: uppercase; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
@media (hover: hover) { .btn:hover { background: var(--c-ink); color: var(--c-paper); text-decoration: none; } }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--c-ink); color: var(--c-paper); }
.btn--sm { min-height: 36px; padding: var(--btn-pad-sm); }
.btn--lg { padding: var(--btn-pad-lg); }
.btn--block { width: 100%; }
.btn--link { min-height: 0; padding: 0; border: 0; background: none; color: var(--c-muted); text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) { .btn--link:hover { background: none; color: var(--c-ink); } }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.linkish { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--c-hairline); text-underline-offset: 4px; }
.linkish.h3 { font-size: var(--fs-h3); line-height: var(--lh-heading); letter-spacing: -.01em; }
@media (hover: hover) { .linkish:hover { text-decoration-color: currentColor; } }

/* Segmented control */
.seg { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); border: var(--line); }
.seg__btn {
  min-height: var(--tap); padding: 0 2px; border: 0; border-left: var(--line); border-radius: 0;
  background: transparent; font-size: var(--fs-label); letter-spacing: var(--tr-seg); text-transform: uppercase;
  cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast);
}
.seg__btn:first-child { border-left: 0; }
.seg__btn.is-on { background: var(--c-accent); color: var(--c-on-accent); }
@media (hover: hover) { .seg__btn:not(.is-on):hover { background: var(--c-ink); color: var(--c-paper); } }

/* Chips: statuses keep an outline because the outline carries meaning; other tags are plain text */
.chip {
  display: inline-flex; align-items: center; padding: var(--chip-pad); border: var(--line);
  font-size: var(--fs-chip); letter-spacing: var(--tr-chip); font-weight: var(--fw-bold); text-transform: uppercase; line-height: 1.2;
  white-space: nowrap; vertical-align: middle;
}
.chip--sm { padding: var(--chip-pad-sm); font-size: var(--fs-label); letter-spacing: var(--tr-label); }
.chip--plain { border: 0; padding: 0; color: var(--c-muted); }
button.chip { cursor: pointer; background: transparent; }
.chip.is-on { background: var(--c-ink); color: var(--c-paper); }
.chip--accent { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent); }
.status--idea { border-style: dashed; }
.status--booked { background: var(--c-ink); color: var(--c-paper); }
.status--paid { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent); }
.status--paid::before { content: '\2713'; margin-right: .5em; letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }

/* Forms */
.field { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: var(--input-pad);
  border: var(--line); border-radius: 0; background: transparent;
  font-size: 16px; line-height: 1.3; outline: none; -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus, .textarea:focus { box-shadow: inset 0 0 0 1px var(--c-ink); }
.select {
  padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-ink) 50%), linear-gradient(135deg, var(--c-ink) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.textarea { field-sizing: content; min-height: 3.2em; line-height: 1.5; resize: vertical; }
.form { gap: var(--sp-4) var(--gutter); }
.form .f-half-a { grid-column: 1 / 3; }
.form .f-half-b { grid-column: 3 / -1; }
@media (min-width: 720px) {
  .form .f-paid { grid-column: 1 / 5; }
  .form .f-for { grid-column: 5 / -1; }
  .form .f-amount { grid-column: 1 / 4; }
  .form .f-cur { grid-column: 4 / 6; }
  .form .f-cat { grid-column: 6 / -1; }
  .form .f-desc { grid-column: 1 / -3; }
  .form .f-date { grid-column: -3 / -1; }
}

/* Checkbox */
.check { position: relative; display: grid; grid-template-columns: var(--check) minmax(0, 1fr); gap: var(--sp-3); align-items: start; min-height: var(--tap); padding: var(--sp-2) 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.check input, .tick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.check__box { display: grid; place-items: center; width: var(--check); height: var(--check); margin-top: 1px; border: var(--line); transition: background var(--dur-fast); }
input:checked + .check__box { background: var(--c-ink); }
input:checked + .check__box::after { content: ''; width: 10px; height: 5px; border-left: 2px solid var(--c-paper); border-bottom: 2px solid var(--c-paper); transform: translateY(-1px) rotate(-45deg); }
input:focus-visible + .check__box { outline: 2px solid var(--c-ink); outline-offset: 2px; }
.check input:checked ~ .check__text { color: var(--c-muted); text-decoration: line-through; }
.check--edit { cursor: default; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
.check--field { padding: var(--sp-2) 0 0; min-height: 0; }
.checks { column-gap: var(--gutter); }
@media (min-width: 720px) { .checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tick { position: relative; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: -12px -12px 0 0; cursor: pointer; flex-shrink: 0; }

/* Packing rows */
.pack-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.pack-row > .check { flex: 1 1 auto; }
.pack-row__text { padding: var(--sp-2) 0; flex: 1 1 auto; }
.pack-row__tag { padding-top: var(--sp-2); font-size: var(--fs-small); white-space: nowrap; }
.pack-row__checks { display: flex; gap: var(--sp-4); flex-shrink: 0; }
.check--mini { gap: var(--sp-2); font-size: var(--fs-small); }
.check--mini .check__text { padding-top: 1px; }
.check--mini input:checked ~ .check__text { text-decoration: none; }

/* Key–value rows: label in the first column module, value in the rest. No rules. */
.kv { display: flex; flex-direction: column; gap: var(--sp-4); }
.kv__row { display: grid; column-gap: var(--gutter); row-gap: var(--sp-1); }
.kv__row dt { padding-top: .3em; }
.kv__row dd { min-width: 0; }
.kv--page .kv__row { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.kv--page dt { grid-column: 1 / 2; }
.kv--page dd { grid-column: 2 / -1; }
@media (min-width: 720px) {
  .kv--page dt { grid-column: 1 / 3; }
  .kv--page dd { grid-column: 3 / -1; }
}
.kv--card .kv__row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.list { display: flex; flex-direction: column; gap: var(--sp-2); }
.li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); }
.li__t { min-width: 3.1em; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: var(--sp-2); }
.rows { display: flex; flex-direction: column; gap: var(--sp-3); }

/* Cards: separated by white space only, one module apart vertically */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--mod) var(--gutter); }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); }
.card__sub { color: var(--c-muted); }

/* Cells: module blocks (2 columns wide, at least 1 module tall); label on top, value below */
.cells { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gutter); grid-auto-rows: minmax(var(--mod), auto); }
.cell { grid-column: span 2; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; color: inherit; text-decoration: none; }
.cell__value { order: 2; font-size: var(--fs-stat); line-height: 1; letter-spacing: var(--tr-display); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cell .label { order: 1; }
.cell--wide { grid-column: 1 / -1; }
a.cell .cell__value, button.cell .cell__value { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; text-decoration-color: var(--c-hairline); }
@media (hover: hover) { a.cell:hover .cell__value, button.cell:hover .cell__value { text-decoration-color: currentColor; } }
button.cell { font: inherit; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }

/* Home */
.home-hero { margin-bottom: var(--mod); }
.home-hero .hero { grid-row: span 2; margin-bottom: var(--sp-5); }
.home-hero .home-hero__a { grid-column: 1 / 3; font-size: var(--fs-lead); line-height: 1.3; }
.home-hero .home-hero__b { grid-column: 3 / -1; font-size: var(--fs-lead); line-height: 1.3; }
@media (min-width: 720px) {
  .home-hero .home-hero__a { grid-column: 1 / 4; }
  .home-hero .home-hero__b { grid-column: 4 / 7; }
}

.count { align-items: start; }
.count .count__num { grid-row: span 2; color: var(--c-display); font-size: var(--fs-numeral); line-height: .78; letter-spacing: var(--tr-numeral); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; margin-left: -.05em; }
.count .count__unit { grid-column: 1 / 3; font-size: var(--fs-lead); }
.count .count__rest { grid-column: 3 / -1; font-size: var(--fs-lead); }
@media (min-width: 720px) {
  .count .count__unit { grid-column: 1 / 4; }
  .count .count__rest { grid-column: 4 / -1; }
}

/* The next deadline is the one filled module block on the page */
.next { grid-auto-rows: auto; align-content: space-between; min-height: calc(var(--mod) * 2 + var(--gutter)); row-gap: var(--sp-4); padding: var(--sp-4); background: var(--c-ink); color: var(--c-paper); text-decoration: none; }
.next .next__date { grid-column: 1 / 3; font-size: var(--fs-h2); line-height: 1; letter-spacing: var(--tr-display); font-weight: var(--fw-bold); }
.next .next__rel { grid-column: 3 / -1; text-align: right; }
.next__title { font-size: var(--fs-h3); line-height: var(--lh-heading); }
.next__more { opacity: .75; }
.next .chip { background: transparent; color: inherit; border-color: currentColor; }
@media (hover: hover) { .next:hover .next__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; } }

.route { display: flex; flex-direction: column; gap: var(--sp-3); }
.route__row { align-items: baseline; }
.route__row .route__dates { grid-column: 1 / 2; }
.route__row .route__place { grid-column: 2 / -2; }
.route__row .route__n { grid-column: -2 / -1; text-align: right; color: var(--c-muted); }
@media (min-width: 720px) {
  .route__row .route__dates { grid-column: 1 / 3; }
  .route__row .route__place { grid-column: 3 / -3; }
  .route__row .route__n { grid-column: -3 / -1; }
}
.route__row.is-gap .route__place, .route__row.is-transit .route__place { color: var(--c-muted); }

/* Days */
.day { margin-top: var(--mod); scroll-margin-top: calc(var(--header-h) + var(--sp-3)); }
.day:first-child { margin-top: 0; }
.day__head { row-gap: var(--sp-1); margin-bottom: var(--sp-5); align-items: baseline; }
.day__head .day__date { grid-column: 1 / 2; display: flex; align-items: baseline; gap: 4px; font-size: var(--fs-h2); line-height: 1; letter-spacing: var(--tr-display); font-weight: var(--fw-bold); color: var(--c-display); text-decoration: none; }
.day__mon { font-size: var(--fs-small); font-weight: var(--fw-regular); letter-spacing: 0; color: var(--c-ink); }
.day__head .day__main { grid-column: 2 / -1; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: var(--sp-1); }
.day__head .day__wd { grid-column: 1 / 2; font-size: var(--fs-small); color: var(--c-muted); }
.day__place { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.day.is-unplanned .day__place .h2 { color: var(--c-muted); }
@media (min-width: 720px) {
  .day__head .day__date, .day__head .day__wd { grid-column: 1 / 3; }
  .day__head .day__main { grid-column: 3 / -1; }
}
.day__foot { margin-top: var(--sp-5); }
.pager { margin-top: var(--mod); row-gap: var(--gutter); }
.pager .pager__prev { grid-column: 1 / 3; }
.pager .pager__next { grid-column: 3 / -1; }
@media (min-width: 720px) {
  .pager .pager__prev { grid-column: 1 / 4; }
  .pager .pager__next { grid-column: -4 / -1; }
}

/* Comparison table: aligned columns, no rules */
.compare { width: 100%; border-collapse: collapse; margin-bottom: var(--mod); font-variant-numeric: tabular-nums; }
.compare th { text-align: left; padding: 0 var(--sp-3) var(--sp-3) 0; vertical-align: bottom; }
.compare td { padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; vertical-align: top; }
.compare .r { text-align: right; }
.compare th:last-child, .compare td:last-child { padding-right: 0; text-align: right; }

/* Budget */
.btable { display: flex; flex-direction: column; gap: var(--sp-4); }
.btable__row { align-items: baseline; }
.btable__row > * { grid-column: auto; }
.btable__row .btable__n { text-align: right; font-variant-numeric: tabular-nums; }
.btable__row--total { font-weight: var(--fw-bold); padding-top: var(--sp-3); }
@media (min-width: 720px) {
  .btable__row .btable__name { grid-column: 1 / -7; }
  .btable__row .btable__n:nth-child(2) { grid-column: -7 / -5; }
  .btable__row .btable__n:nth-child(3) { grid-column: -5 / -3; }
  .btable__row .btable__n:nth-child(4) { grid-column: -3 / -1; }
}
.btable__row .bar { grid-column: 1 / -1; }
.bar { position: relative; height: 3px; margin-top: var(--sp-2); background: var(--c-hairline); overflow: hidden; }
.bar__fill { position: absolute; inset: 0 auto 0 0; background: var(--c-ink); }
.over { font-weight: var(--fw-bold); }

.exps { display: flex; flex-direction: column; gap: var(--sp-4); }
.exp { align-items: baseline; }
.exp .exp__date { grid-column: 1 / 2; }
.exp .exp__desc { grid-column: 2 / -2; }
.exp .exp__amt { grid-column: -2 / -1; text-align: right; font-variant-numeric: tabular-nums; }
@media (min-width: 720px) {
  .exp .exp__date { grid-column: 1 / 3; }
  .exp .exp__desc { grid-column: 3 / -3; }
  .exp .exp__amt { grid-column: -3 / -1; }
}

.conv { row-gap: var(--sp-5); }
.conv .conv__amount { grid-column: 1 / 3; }
.conv .conv__cur { grid-column: 3 / -1; }
.conv__out { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); }
.conv__val { font-size: var(--fs-h2); line-height: var(--lh-heading); letter-spacing: var(--tr-heading); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (min-width: 720px) {
  .conv .conv__amount { grid-column: 1 / 4; }
  .conv .conv__cur { grid-column: 4 / 6; }
}

/* Deadlines */
.dls { display: flex; flex-direction: column; gap: var(--sp-5); }
.dl { align-items: start; }
.dl .dl__when { grid-column: 1 / 2; display: flex; flex-direction: column; gap: 2px; }
.dl .dl__body { grid-column: 2 / -1; display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
@media (min-width: 720px) {
  .dl .dl__when { grid-column: 1 / 3; }
  .dl .dl__body { grid-column: 3 / -1; }
}
.dl__date { font-size: var(--fs-lead); line-height: 1.2; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.dl__rel { font-size: var(--fs-small); color: var(--c-muted); }
.dl__text { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; }
.dl__title { font-size: var(--fs-lead); line-height: 1.3; }
.dl__links { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); align-items: baseline; }
.dl.is-done .dl__title, .dl.is-done .dl__date { color: var(--c-muted); text-decoration: line-through; }

/* Filters */
.filters { row-gap: var(--sp-3); margin-bottom: var(--mod); }
.filters .filters__label { grid-column: 1 / 2; padding-top: 5px; }
.filters .filters__chips { grid-column: 2 / -1; }
@media (min-width: 720px) {
  .filters .filters__label { grid-column: 1 / 3; }
  .filters .filters__chips { grid-column: 3 / -1; }
}
.insp__top { display: flex; justify-content: space-between; gap: var(--sp-3); }

/* Notice */
.banner { margin-bottom: var(--sp-5); padding: var(--sp-3) var(--sp-4); background: var(--c-ink); color: var(--c-paper); font-size: var(--fs-small); line-height: var(--lh-note); }

/* Editor sheet: full screen on phones, centred panel on larger screens */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; align-items: flex-end; visibility: hidden; opacity: 0; transition: opacity var(--dur-ui) var(--ease-ui), visibility 0s linear var(--dur-ui); }
.sheet.is-open { visibility: visible; opacity: 1; transition: opacity var(--dur-ui) var(--ease-ui); }
.sheet__backdrop { position: absolute; inset: 0; background: var(--c-scrim); }
.sheet__panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: var(--sheet-w); height: 100dvh;
  background: var(--c-paper); outline: none;
  transform: translateY(24px); transition: transform .5s var(--ease-out);
}
.sheet.is-open .sheet__panel { transform: none; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: calc(var(--header-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--pad) 0; }
.sheet__title { font-size: var(--fs-lead); font-weight: var(--fw-bold); letter-spacing: -.01em; line-height: 1.2; }
.sheet__body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: var(--sp-4) var(--pad) var(--sp-6); }
.sheet__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--pad) calc(var(--sp-3) + env(safe-area-inset-bottom)); }
@media (min-width: 720px) {
  .sheet { align-items: center; padding: var(--pad); }
  .sheet__panel { height: auto; max-height: calc(100dvh - 2 * var(--pad)); border: var(--line); }
  .sheet__head { min-height: var(--header-h); padding-top: 0; }
}
.editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--gutter); }
.editor > * { grid-column: 1 / -1; }
.editor > .field--half { grid-column: auto; }
.editor .banner { margin: 0; }
.fieldset { padding: 0; border: 0; min-width: 0; gap: var(--sp-3); }
.fieldset legend { padding: 0; margin-bottom: var(--sp-2); }
.money { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--sp-2); }
.money .money__per { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .money { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
  .money .money__per { grid-column: auto; }
}

/* Sign-in page */
.login { min-height: 100dvh; padding-top: var(--pad); }
.login .login__title { grid-row: span 2; }
.login .login__meta { font-size: var(--fs-lead); }
.login .login__form { display: flex; flex-direction: column; gap: var(--sp-5); max-width: 420px; }
@media (min-width: 720px) {
  .login .login__meta { grid-column: 1 / 4; }
  .login .login__form { grid-column: 4 / -1; }
}

/* Motion */
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-in { animation: page-in var(--dur-page) var(--ease-panel) both; }
@keyframes rise { from { opacity: 0; transform: translateY(.18em); } to { opacity: 1; transform: none; } }
.rise { display: inline-block; animation: rise 1s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
