/* ==========================================================================================
   faktjo.eu — liquid-glass design system
   ==========================================================================================
   The one discipline this file enforces: GLASS ON CHROME, SOLID UNDER NUMBERS.
   Translucency belongs to the nav rail, headers, panels and popovers. Every surface that
   carries money sits on --surface-solid, because blurred aurora behind a VAT figure is a
   legibility problem and, on a tax document, a liability one.
   ========================================================================================== */

:root {
  /* Ground. Glass needs something with colour and depth behind it or it reads as grey plastic. */
  --bg:               #0B0D1B;
  --surface-glass:    rgba(255, 255, 255, .06);
  --surface-glass-2:  rgba(255, 255, 255, .10);
  --surface-solid:    rgba(17, 20, 40, .82);
  --surface-sunken:   rgba(8, 10, 24, .6);

  --line:             rgba(255, 255, 255, .11);
  --line-strong:      rgba(255, 255, 255, .17);

  --text:             #F2F3F8;
  --text-dim:         #B4B9D4;
  /* ~7.6:1 on --bg. Caption grey is what fails contrast most often, so this is deliberately
     lighter than it looks like it needs to be. */
  --text-muted:       #A9AEC9;
  --text-faint:       #7A80A0;

  /* Two accents, close in chroma and lightness, far apart in hue. They also differ in
     lightness so they stay distinguishable without relying on hue alone. */
  --accent:           #4FD1B0;
  --accent-deep:      #2FB294;
  --accent-ink:       #04231C;
  --warn:             #E2A14A;
  --warn-text:        #F0BE7C;
  --info:            #7874FF;
  --info-text:        #B6B3FF;

  --radius-lg: 22px;
  --radius:    18px;
  --radius-sm: 12px;

  --blur: 26px;
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .18);
  --glass-shadow: 0 22px 44px rgba(4, 5, 14, .42);
  --focus: 0 0 0 3px rgba(120, 116, 255, .28);

  --font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: 'Bricolage Grotesque', Georgia, serif;
}

* { box-sizing: border-box; }
/* The hidden attribute wins over any display a class sets (a hidden .notice is still display:flex otherwise). */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  /* Every amount column aligns on the digit. Set once, globally, rather than per table. */
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1000px 640px at 10% -10%, rgba(79, 209, 176, .26), transparent 60%),
    radial-gradient(1100px 760px at 90% 4%, rgba(120, 116, 255, .30), transparent 58%),
    radial-gradient(800px 560px at 55% 110%, rgba(226, 161, 74, .16), transparent 62%);
  /* One painted layer behind everything, rather than a stack of blurred divs that each
     recomposite on scroll. backdrop-filter already forces its own layer per panel. */
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
/* A whisper of grain over the aurora, so glass has something to blur and large flat areas do not
   band. Fixed, non-interactive, and gone for anyone who asked for less transparency. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.shell, .auth-shell { position: relative; z-index: 1; }

/* Keyboard users get one consistent ring; mouse users do not get it on click. */
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }
/* A heading focused by the router after navigation (for screen readers) needs no ring. */
h1:focus-visible, h2:focus-visible, [tabindex="-1"]:focus-visible { box-shadow: none; }
::selection { background: rgba(79, 209, 176, .35); }

a { color: #8FE3CE; text-decoration: none; }
a:hover { color: #C2F2E6; }

h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-family: var(--font-display); font-size: 2.15rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 600; }

/* ---------- glass ------------------------------------------------------------------------ */

.glass {
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 1px solid var(--line);
  /* The inset top highlight is what actually sells the rim. Without it glass reads flat. */
  box-shadow: var(--glass-edge), var(--glass-shadow);
  border-radius: var(--radius);
}

/* Floating chrome (menus): nearly opaque, because it sits on content — a QR code or a figure bleeding
   through a menu makes both unreadable. */
.popover {
  background: rgba(21, 24, 46, .97);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 1px solid var(--line-strong);
  box-shadow: var(--glass-edge), var(--glass-shadow);
}

/* Data surfaces: nearly opaque, so no aurora bleeds through a number. */
.panel {
  background: var(--surface-solid);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), var(--glass-shadow);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Someone who has asked their OS for less transparency gets none of it. Opt-out, not opt-in. */
@media (prefers-reduced-transparency: reduce) {
  .glass, .panel, .popover { backdrop-filter: none !important; background: #191C33 !important; }
  body::before { display: none; }
}
/* Same for reduced motion — all transitions here are decorative. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- app shell ------------------------------------------------------------------- */

.shell {
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  /* The rail and the content wrap onto two lines on a phone; without this a page shorter than the
     screen has its lines spread out (stretch is the default), and a gap opens above the heading. */
  align-content: flex-start;
  gap: 20px;
  padding: 20px;
  /* The layout answers to the shell's own width (a container query), not the viewport. */
  container: shell / inline-size;
}

/* Sticky beside the content on a wide screen, so the menu is at hand on a long settings page;
   on a phone it turns into a compact bar across the top (see the media query at the end). */
.rail {
  flex: 0 0 228px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-radius: var(--radius-lg);
}

.rail__brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 0; }
/* drop-shadow, not box-shadow: it follows the squircle's outline instead of a rounded box behind it. */
.rail__mark { display: block; flex: 0 0 auto; filter: drop-shadow(0 5px 12px rgba(124, 108, 255, .34)); }
.rail__name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; }
/* The domain is part of the name, said more quietly. */
.rail__tld { color: var(--text-muted); font-weight: 500; }

.rail__nav { display: flex; flex-direction: column; gap: 14px; }
/* Links are grouped by what the person is doing: documents, money, the company. */
.rail__group { display: flex; flex-direction: column; gap: 2px; }
.rail__group-label {
  padding: 0 12px 4px; font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint);
}
.rail__link {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 11px;
  min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: .92rem;
  border: 1px solid transparent;
  transition: background .12s ease, color .12s ease;
}
.rail__link:hover { background: var(--surface-glass); color: var(--text); }
.rail__link.active {
  background: var(--surface-glass-2); color: var(--text);
  font-weight: 600; border-color: var(--line);
}
/* The active page gets a mint bar beside its name as well as the bolder text. */
.rail__link.active::before {
  content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.rail__link > span:first-child { display: flex; align-items: center; gap: 11px; }
.rail__link svg { opacity: .8; }
.rail__link.active svg, .rail__link:hover svg { opacity: 1; }

.rail__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.rail__feed { padding: 11px 12px; gap: 6px; }
.rail__feed-title { font-size: .78rem; font-weight: 600; }
.rail__feed-label { font-size: .72rem; color: var(--text-muted); line-height: 1.45; }
.rail__user { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.rail__email { font-size: .75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__logout { justify-content: flex-start; }

.main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* A short reveal when a page arrives: content, not chrome, and only for those who want motion. */
@media (prefers-reduced-motion: no-preference) {
  .main > * { animation: page-in .28s cubic-bezier(.2, .7, .2, 1) both; }
  .main > :nth-child(2) { animation-delay: .04s; }
  .main > :nth-child(3) { animation-delay: .08s; }
  .main > :nth-child(n + 4) { animation-delay: .12s; }
  @keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px; padding: 4px 2px;
}
.page-head__sub { margin: 5px 0 0; font-size: .92rem; color: var(--text-muted); }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.page-head__hint { font-size: .8rem; color: var(--text-muted); }
.page-head__hint--warn { color: var(--warn-text); font-weight: 500; }
/* A page whose primary action is at the top but whose form runs long (Nastavení) keeps the header,
   and with it the save button, in view. Combined with .glass: it floats over the content as chrome. */
.page-head--sticky { position: sticky; top: 12px; z-index: 20; padding: 12px 16px; }
/* A glass header is its own stacking context (backdrop-filter), so a menu opened from it would paint
   under the panels that follow. Lift the header while one is open. */
.page-head:has(.split__menu) { position: relative; z-index: 30; }

/* ---------- controls -------------------------------------------------------------------- */

/* 44px minimum on every hit target. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border-radius: 13px; border: 1px solid var(--line-strong);
  background: var(--surface-glass); backdrop-filter: blur(18px);
  color: var(--text); font: inherit; font-size: .9rem; font-weight: 500;
  cursor: pointer; transition: background .12s ease;
}
.btn:hover { background: var(--surface-glass-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn--primary {
  border: none;
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  color: var(--accent-ink); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 24px rgba(47, 178, 148, .3);
}
.btn--primary:hover { filter: brightness(1.06); background: linear-gradient(160deg, var(--accent), var(--accent-deep)); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: .84rem; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-glass); color: var(--text); }
.btn--dashed { border: 1px dashed var(--line-strong); background: transparent; color: var(--text-dim); }
.btn--icon { padding: 0; width: 44px; }
.btn--icon.btn--sm { width: 36px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: .82rem; color: var(--text-dim); }

.input, select.input, textarea.input {
  min-height: 44px; padding: 0 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-sunken); color: var(--text);
  font: inherit; font-size: .9rem; font-variant-numeric: tabular-nums;
  width: 100%;
}
textarea.input { padding: 11px 13px; min-height: 90px; resize: vertical; }
.input:hover { border-color: var(--line-strong); }
.input:focus, .input:focus-visible {
  outline: none; border-color: rgba(146, 142, 255, .6);
  box-shadow: var(--focus); border-radius: var(--radius-sm);
}
.input::placeholder { color: var(--text-faint); }
.input--num { text-align: right; }
/* Fields inside a table row (the line editor, a pricelist row being edited): sized by what they hold,
   so the description gets the room. On a phone the row is a card and they go full width (below). */
.input--qty { width: 90px; }
.input--unit { width: 70px; }
.input--price { width: 110px; }
.input--pct { width: 70px; }
.input--rate { width: 90px; }

/* ---------- stats ----------------------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }

.stat { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.stat__label {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted);
}
.stat__value { font-family: var(--font-display); font-size: 2.35rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.stat { position: relative; overflow: hidden; }
/* A soft highlight in the corner, so the three figures read as objects, not boxes. */
.stat::after { content: ""; position: absolute; right: -40px; top: -60px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .07), transparent); pointer-events: none; }
.stat__note { font-size: .85rem; color: var(--text-muted); }

.stat--warn { background: rgba(226, 161, 74, .13); border-color: rgba(226, 161, 74, .34); }
.stat--warn .stat__label { color: var(--warn-text); }
.stat--warn .stat__note { color: #E4D3B6; }
.stat--good { background: rgba(79, 209, 176, .11); border-color: rgba(79, 209, 176, .30); }
.stat--good .stat__label { color: #7FE0C6; }
.stat--good .stat__note { color: #B6DED3; }

/* ---------- tables ---------------------------------------------------------------------- */

.panel__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 17px 20px; border-bottom: 1px solid rgba(255, 255, 255, .085);
}
.panel__foot { padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, .085); }

/* A wide table scrolls inside its own box rather than pushing the page sideways. */
.table-scroll { overflow-x: auto; }

/* Sortable headers: the whole label is the button, so the hit target is the header, not the arrow. */
.th-sort {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0;
  background: none; border: 0; color: inherit; font: inherit; letter-spacing: inherit;
  text-transform: inherit; cursor: pointer;
}
.th-sort:hover { color: var(--text); }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--text); }
th.num .th-sort { flex-direction: row-reverse; }

/* Search and filters above a grid. */
.grid-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grid-toolbar .input { width: auto; min-width: 0; }
.grid-toolbar__search { flex: 1 1 220px; max-width: 340px; }
.grid-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
/* "Řadit podle": the phone's sort control. Above the phone breakpoint the column headers sort. */
.grid-sort { display: none; }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; padding: 12px 10px; font-weight: 600;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
  white-space: nowrap; background: rgba(255, 255, 255, .025);
}
.table td { padding: 13px 10px; border-top: 1px solid rgba(255, 255, 255, .07); vertical-align: middle; }
/* The SUM row: a stronger rule above, figures in the display face, what it left out said quietly. */
.table-sum th, .table-sum td { padding: 14px 10px; border-top: 1px solid var(--line-strong); vertical-align: top; }
.table-sum th { text-align: left; font-weight: 600; font-size: .92rem; letter-spacing: 0; text-transform: none;
  color: var(--text); background: none; }
.table-sum td.num { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
/* A payment's date with its "Opravit"; the picker and its buttons replace it in place. */
.redate { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.redate .redate__open { font-size: .8rem; color: var(--accent); }
.paid-part { color: var(--info-text); font-size: .82rem; }
.table-sum td.table-sum__split { font-size: .85rem; color: var(--text-dim); }
.table-sum__note { display: block; margin-top: 3px; font-size: .78rem; font-weight: 400; color: var(--text-muted); white-space: normal; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child,  .table td:last-child  { padding-right: 20px; }
.table tbody tr { transition: background .1s ease; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .045); }
.table .num { text-align: right; font-weight: 600; white-space: nowrap; }
.table .dim { color: var(--text-dim); }
/* A value cell (one that says what it is, data-label) with nothing in it prints a dash in the column;
   on a phone the same empty cell is left out of the card (below), so the label never stands alone. */
.table td[data-label]:empty::after { content: "—"; color: var(--text-dim); }
.table tr.is-selected td { background: rgba(120, 116, 255, .09); }
.table td > a > strong { color: var(--text); }
.table tbody tr:hover td > a > strong { color: #C2F2E6; }

.empty { padding: 44px 20px; text-align: center; color: var(--text-muted); font-size: .92rem; line-height: 1.6; }
/* An empty list that is good news (nothing overdue, nothing unmatched): say so in mint, with a mark. */
.empty--good { color: #9FE6D2; }
.empty--good svg { display: block; margin: 0 auto 8px; color: var(--accent); }

/* A button that reads as a link — for a table cell whose text opens the row's editor. The hit target
   stays 44px tall by bleeding into the cell padding. */
.link-btn { background: none; border: 0; padding: 0; margin: -10px 0; min-height: 44px; font: inherit; color: var(--text);
  cursor: pointer; text-align: left; display: inline-flex; align-items: center; }
.link-btn:hover { color: #C2F2E6; }

/* ---------- chips ----------------------------------------------------------------------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 9px;
  background: var(--surface-glass); border: 1px solid var(--line);
  color: var(--text-dim); font-size: .8rem; font-weight: 500; white-space: nowrap; line-height: 1.3;
}
/* Colour is reserved for what needs a decision or a glance: overdue, paid, partly paid. The
   everyday state (issued) stays neutral so the exceptions stand out in a long list. */
.chip--draft { border-style: dashed; color: var(--text-muted); background: transparent; }
.chip--off { color: var(--text-faint); background: transparent; border-color: rgba(255, 255, 255, .07); }
.chip--warn { background: rgba(226, 161, 74, .2); border-color: rgba(226, 161, 74, .42); color: var(--warn-text); font-weight: 600; }
.chip--good { background: rgba(79, 209, 176, .16); border-color: rgba(79, 209, 176, .36); color: #7FE0C6; font-weight: 600; }
.chip--info { background: rgba(120, 116, 255, .18); border-color: rgba(146, 142, 255, .4); color: var(--info-text); font-weight: 600; }
.chip--count { background: var(--warn); border-color: transparent; color: #241703; font-weight: 700; min-width: 20px; justify-content: center; }

/* ---------- feed status ----------------------------------------------------------------- */

/* The ČSOB feed's health is permanently visible. A broken parser then shows as a stale
   timestamp instead of hiding as an absence of payments. */
.feed {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
  padding: 14px 18px; border-radius: var(--radius);
  background: rgba(79, 209, 176, .09); backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(79, 209, 176, .26); box-shadow: var(--glass-edge);
  font-size: .85rem; color: #B6DED3;
}
.feed strong { color: var(--text); font-weight: 600; }
.feed--stale { background: rgba(226, 161, 74, .12); border-color: rgba(226, 161, 74, .32); color: #E4D3B6; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--accent); }
.dot--warn { background: var(--warn); }

/* ---------- layout helpers -------------------------------------------------------------- */

.row-wrap { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
/* A collapsible block inside a card (<details>), for settings set once and rarely revisited. */
/* Its content sits in a .stack: <details> does not reliably lay out its children as flex items. */
.subsection { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.subsection > summary { cursor: pointer; font-size: .86rem; min-height: 24px; }
.subsection[open] > summary { margin-bottom: 12px; }

/* Date picker: a typed field with a calendar button, and a calendar popover. */
.datepicker { position: relative; display: flex; flex-direction: column; gap: 4px; }
.datepicker__field { display: flex; }
.datepicker__input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.datepicker__input.is-invalid { border-color: var(--warn); }
.datepicker__toggle {
  flex: 0 0 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-glass); color: var(--text-muted); cursor: pointer;
}
.datepicker__toggle:hover:not(:disabled) { color: var(--text); }
.datepicker__toggle:disabled { opacity: .5; cursor: default; }
.datepicker__hint { font-size: .74rem; color: var(--text-muted); min-height: 1em; }
.datepicker__hint.is-invalid { color: var(--warn-text); }
.datepicker__popover {
  position: absolute; top: calc(100% - 14px); left: 0; z-index: 31;
  width: min(340px, calc(100vw - 32px)); padding: 12px; border-radius: 16px;
}
/* A panel clips its content (rounded corners) and is its own stacking context (backdrop-filter),
   so while a calendar is open its panel lets it overflow and is lifted above the panels after it. */
.panel:has(.datepicker__popover) { overflow: visible; position: relative; z-index: 30; }
/* A horizontally scrolling table clips vertically too: let an open calendar out while it is open. */
.table-scroll:has(.datepicker__popover) { overflow: visible; }
.datepicker__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.datepicker__head strong { text-transform: capitalize; }
.datepicker__nav {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; background: transparent; color: var(--text); cursor: pointer;
}
.datepicker__nav:hover { background: var(--surface-glass); }
.datepicker__grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.datepicker__grid th { font-size: .72rem; font-weight: 600; color: var(--text-muted); padding: 4px 0; text-transform: uppercase; }
.datepicker__grid td { padding: 1px; text-align: center; }
.datepicker__day {
  width: 100%; aspect-ratio: 1; min-height: 40px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--text); font: inherit; font-size: .88rem; cursor: pointer;
}
.datepicker__day:hover { background: var(--surface-glass); }
.datepicker__day:focus-visible { outline: none; border-color: rgba(146, 142, 255, .7); box-shadow: 0 0 0 3px rgba(120, 116, 255, .22); }
.datepicker__day.is-outside { color: var(--text-muted); opacity: .55; }
/* Today: outlined; selected: filled. Both are also in the button's accessible name, in words. */
.datepicker__day.is-today { border-color: var(--line-strong); font-weight: 600; }
.datepicker__day.is-selected { background: var(--accent); color: #06231C; font-weight: 700; }
.datepicker__foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Split button: a main action and an arrow that opens its alternatives. */
.split { position: relative; display: inline-flex; }
.split__main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split__toggle { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 12px;
  border-left: 1px solid rgba(0, 0, 0, .18); }
.split__backdrop { position: fixed; inset: 0; z-index: 30; background: transparent; border: 0; cursor: default; }
.split__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 31; min-width: 260px;
  display: flex; flex-direction: column; padding: 6px; border-radius: 14px; }
.split__item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-height: 44px;
  border-radius: 10px; color: var(--text); text-decoration: none; }
.split__item span { font-size: .8rem; color: var(--text-muted); }
.split__item:hover, .split__item:focus-visible { background: var(--surface-glass); }
/* A menu item that is a button (an action) rather than a link, styled the same. */
button.split__item { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.split__item--warn, .split__item--warn:hover { color: var(--warn-text); }
.split__sep { height: 1px; margin: 4px 6px; background: var(--line); }

/* A payment in the queue: the amount is the headline, the rest is context. */
.pay__amount { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; letter-spacing: -.025em; line-height: 1; }
/* One candidate invoice for a payment: what it is, what differs, and the one button that posts it. */
.proposal {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 12px 14px; border-radius: 13px; background: var(--surface-glass); border: 1px solid var(--line);
}
.proposal:hover { border-color: var(--line-strong); }

/* Visible to screen readers only — for a control whose purpose the surrounding layout already shows. */
.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; }

/* ---------- settings -------------------------------------------------------------------- */

/* Nastavení: a section menu (chrome, glass) beside the section's cards. Every section is a page with
   its own URL, so "Nastavení → Banka" in an error message is a link someone can follow. The menu is
   the rail's pattern one level down: grouped links with eyebrow labels, the active one marked by
   aria-current (NavLink), bold text and a mint bar — and flattened to a row that scrolls sideways
   when the settings area is narrow (a container query on .settings, not the viewport). */
/* The container is a wrapper of its own: a container query cannot restyle the element it measures,
   so the grid that has to collapse sits one level inside it. */
.settings { container: settings / inline-size; }
.settings__grid { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings__nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; padding: 10px; }
.settings__group { display: flex; flex-direction: column; gap: 2px; }
.settings__group-label {
  padding: 0 12px 4px; font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-faint);
}
.settings__link {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: .9rem; border: 1px solid transparent;
  transition: background .12s ease, color .12s ease;
}
.settings__link:hover { background: var(--surface-glass); color: var(--text); }
.settings__link.active { background: var(--surface-glass-2); color: var(--text); font-weight: 600; border-color: var(--line); }
.settings__link.active::before {
  content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.settings__link svg { flex: 0 0 auto; opacity: .8; }
.settings__link.active svg, .settings__link:hover svg { opacity: 1; }
/* Forms read best under ~70 characters a line; the cards stop growing before the column does. */
.settings__body { display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 780px; }

/* Each card saves itself: the footer holds its button and says "Uloženo" in words once it did. */
.card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: #9FE6D2; }

/* Fields side by side. The modifiers name what sits in the row, not its widths, so a narrow card can
   stack them (below). align-items: end puts a button on the input's baseline, not the label's. */
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.form-row--zip { grid-template-columns: 120px minmax(0, 1fr); }
.form-row--action { grid-template-columns: minmax(0, 1fr) auto; }
.form-row--server { grid-template-columns: minmax(0, 3fr) minmax(88px, 1fr) minmax(128px, 1.3fr); }
.form-row--split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; align-items: start; }
/* A titled group of fields inside a card (the invoice series beside the proforma series). */
.subform { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.subform > legend { padding: 0; margin-bottom: 2px; font-weight: 600; font-size: .92rem; }

/* A list of things with actions (bank accounts, passkeys, invitations, users): one row each, the
   name first, what is known about it quietly, the buttons at the end. */
.rows { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 240px; }
.row__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.row__meta { font-size: .8rem; color: var(--text-muted); overflow-wrap: anywhere; }
.row__actions { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }

/* Images printed on paper or scanned by a phone sit on white whatever the theme. */
.logo-preview { max-width: 220px; max-height: 70px; align-self: flex-start; background: #fff; padding: 6px; border-radius: 8px; }
.qr-preview { align-self: flex-start; background: #fff; padding: 8px; border-radius: 10px; }
.codes { margin: 0; padding-left: 18px; columns: 2; column-gap: 24px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; line-height: 1.7; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; padding: 1px 5px; border-radius: 6px; background: var(--surface-sunken); border: 1px solid var(--line); }

@container settings (max-width: 719px) {
  .settings__grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .settings__nav { position: static; flex-direction: row; gap: 2px; padding: 6px; border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
  .settings__nav::-webkit-scrollbar { display: none; }
  .settings__group { display: contents; }
  .settings__group-label { display: none; }
  .settings__link { flex: 0 0 auto; min-height: 38px; padding: 0 11px; font-size: .86rem; white-space: nowrap; }
  .settings__link.active::before { left: 10px; right: 10px; top: auto; bottom: -1px; width: auto; height: 2px; border-radius: 2px 2px 0 0; }
}
@container settings (max-width: 559px) {
  .form-row:not(.form-row--zip):not(.form-row--action) { grid-template-columns: minmax(0, 1fr); }
  .codes { columns: 1; }
}

/* A choice between a few options as a row of labelled radios (the mail provider). */
.segmented { display: flex; flex-wrap: wrap; gap: 8px 18px; border: 0; padding: 0; margin: 0; }
.segmented legend { width: 100%; margin-bottom: 2px; }
.segmented label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: .9rem; cursor: pointer; }

/* Secondary explanatory text under a control or in a card. */
.muted-note { margin: 0; font-size: .82rem; color: var(--text-muted); line-height: 1.5; }
/* An e-mail text's placeholders (Texty e-mailů) and the prepared e-mail as it will leave. */
.placeholders { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0 0 10px; font-size: .84rem; line-height: 1.45; }
.placeholders dt, .placeholders dd { margin: 0; }
.placeholders dd { color: var(--text-dim); }
.mail-preview { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--line); font-size: .86rem; line-height: 1.5; }
.mail-preview pre { margin: 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* A date or a document number is one token: broken across two lines it is misread. */
.nowrap { white-space: nowrap; }
.spacer { margin-left: auto; }
.card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card > h2 { font-family: var(--font-display); font-size: 1.12rem; letter-spacing: -.015em; }
.panel__head > h2 { font-family: var(--font-display); font-size: 1.12rem; letter-spacing: -.015em; }
.notice {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 12px 13px; border-radius: 13px; font-size: .82rem; line-height: 1.5;
  background: var(--surface-sunken); border: 1px solid var(--line);
  color: var(--text-dim);
}
.notice--warn { background: rgba(226, 161, 74, .12); border-color: rgba(226, 161, 74, .32); color: #E4D3B6; }
.notice--good { background: rgba(79, 209, 176, .10); border-color: rgba(79, 209, 176, .30); color: #B6DED3; }
.notice svg { flex: 0 0 auto; margin-top: 2px; }

/* ---------- totals ---------------------------------------------------------------------- */

.totals { display: flex; flex-direction: column; gap: 7px; font-size: .88rem; }
.totals__row { display: flex; justify-content: space-between; gap: 12px; }
.totals__row > span:first-child { color: var(--text-dim); }
.totals__due {
  padding: 14px; border-radius: 14px; margin-top: 4px;
  background: rgba(79, 209, 176, .12); border: 1px solid rgba(79, 209, 176, .32);
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.totals__due strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }

/* ---------- blazor plumbing ------------------------------------------------------------- */

.validation-message { color: var(--warn-text); font-size: .8rem; }

#blazor-error-ui {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  padding: 14px 20px;
  background: var(--warn); color: #241703; font-size: .9rem; font-weight: 500;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ---- Signed-out pages (login, first-run setup) ------------------------------------------- */
.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
}
.auth-card {
  width: min(400px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 16px;
}
.auth-card h1 { font-size: 1.6rem; margin: 0; }
.auth-card .rail__name { font-size: 1.45rem; }
.auth-card p { margin: 0; font-size: .86rem; color: var(--text-dim); line-height: 1.5; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: .88rem; color: var(--text-dim); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Report bars (Přehledy): one series, the accent hue, thin marks rounded at the data end and anchored
   to the baseline, recessive axis. Values sit in a table beside every chart; the bar is the second
   signal, never the only one. */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 180px;
        padding: 0 2px; border-bottom: 1px solid var(--line); }
.bars__bar { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.bars__fill { width: min(22px, 70%); min-height: 2px; background: var(--accent-deep); border-radius: 4px 4px 0 0; }
.bars__bar:hover .bars__fill, .bars__bar:focus-visible .bars__fill { filter: brightness(1.15); }
.bars__labels { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; font-size: .72rem; color: var(--text-muted); text-align: center; }
.hbar { height: 8px; background: var(--accent-deep); border-radius: 0 4px 4px 0; min-width: 2px; }
@media (prefers-reduced-motion: no-preference) { .bars__fill, .hbar { transition: height .2s, width .2s; } }

/* Přehled, second row: two "unpaid" stats stacked beside the year's income. */
.dash-row { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); gap: 16px; margin-bottom: 18px; }
.dash-row__stats { display: grid; gap: 16px; }
.income__body { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.income__figures { display: flex; flex-wrap: wrap; gap: 12px 36px; }
.income__figures > div { display: flex; flex-direction: column; gap: 6px; }
.income__label { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.income__value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.income__value--sub { font-size: 1.35rem; color: var(--text-dim); align-self: flex-start; margin-top: auto; }
.income__verdict { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; color: var(--text-dim); line-height: 1.5; }
.income__verdict strong { color: var(--text); }
.income__verdict--warn { color: var(--warn-text); }
.income__verdict--warn svg { flex: 0 0 auto; margin-top: 3px; }

/* The paušální daň meter: a bullet chart. Bands are the neutral backdrop, lighter as they rise, 2px
   apart; the income is one thin accent bar rounded at its data end; the pace continues it hatched.
   Amber is reserved for the exception (past the ceiling, or a pace that leaves the band). */
.meter { padding-top: 22px; container-type: inline-size; }
/* In a narrow column the band names collide; the axis figures and the sentence below carry it. */
@container (max-width: 440px) { .meter__band-label { display: none; } .meter { padding-top: 4px; } }
.meter__track { position: relative; height: 40px; }
.meter__band, .meter__beyond { position: absolute; top: 0; bottom: 0; border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--line); }
.meter__band { background: rgba(255, 255, 255, .05); border-right: 2px solid var(--surface-solid); }
.meter__band + .meter__band { background: rgba(255, 255, 255, .085); }
.meter__band + .meter__band + .meter__band { background: rgba(255, 255, 255, .12); }
.meter__beyond { background: repeating-linear-gradient(135deg, rgba(226, 161, 74, .10) 0 6px, transparent 6px 12px); }
.meter__band-label { position: absolute; bottom: calc(100% + 5px); left: 2px; white-space: nowrap;
  font-size: .72rem; color: var(--text-muted); }
.meter__beyond .meter__band-label { left: auto; right: 2px; }
.meter__fill, .meter__pace { position: absolute; top: 13px; height: 14px; left: 0; min-width: 2px; }
.meter__fill { background: var(--accent); border-radius: 0 4px 4px 0; box-shadow: 0 0 0 2px var(--surface-solid); }
.meter__fill--warn { background: var(--warn); }
.meter__pace { border-radius: 0 4px 4px 0; box-shadow: inset 0 0 0 1.5px rgba(79, 209, 176, .55);
  background: repeating-linear-gradient(135deg, rgba(79, 209, 176, .32) 0 3px, transparent 3px 7px); }
.meter__pace--warn { box-shadow: inset 0 0 0 1.5px rgba(226, 161, 74, .7);
  background: repeating-linear-gradient(135deg, rgba(226, 161, 74, .38) 0 3px, transparent 3px 7px); }
.meter__fill:hover, .meter__fill:focus-visible, .meter__pace:hover, .meter__pace:focus-visible { filter: brightness(1.18); outline: none; }
.meter__fill:focus-visible, .meter__pace:focus-visible { box-shadow: var(--focus); }
.meter__axis { position: relative; height: 18px; margin-top: 6px; font-size: .74rem; color: var(--text-muted); }
.meter__axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.meter__axis span:first-child { transform: none; }
@media (prefers-reduced-motion: no-preference) { .meter__fill, .meter__pace { transition: width .3s, left .3s; } }
.meter__band--chosen { box-shadow: inset 0 0 0 2px var(--accent-deep); }
.meter__band--chosen .meter__band-label { color: var(--text); }

/* Přehledy: a KPI row of small tiles; the delta against the previous year is a second signal in words. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(168px, 100%), 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi__label { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.kpi__value { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.kpi__note { font-size: .78rem; color: var(--text-muted); line-height: 1.4; }
.kpi__note--up { color: #7FE0C6; }
.kpi__note--down { color: var(--warn-text); }

/* Paired bars: this year is the point (accent), the previous year is context (de-emphasis grey) — one
   axis, a 2px surface gap between the pair, and a legend because there are two series. */
.bars--pair .bars__bar { gap: 2px; }
.bars--pair .bars__fill { width: min(14px, 42%); }
.bars__fill--prev { background: rgba(255, 255, 255, .20); }
.bars__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .78rem; color: var(--text-muted); }
.bars__legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent-deep); margin-right: 6px; vertical-align: -1px; }
.bars__legend .bars__legend--prev::before { background: rgba(255, 255, 255, .20); }
.bars__legend .bars__legend--projected::before { background: none; border-top: 2px dashed var(--accent); height: 0; width: 14px; vertical-align: 3px; }

/* The running-total line: the year so far solid, the projection dashed on from it, the previous year
   grey behind. Hairline solid grid; the numbers also sit in the table beside the chart. */
.charts-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 18px; }
.linechart { display: block; width: 100%; height: auto; overflow: visible; }
.linechart__grid { stroke: var(--line); stroke-width: 1; }
.linechart__prev { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.linechart__actual { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.linechart__projected { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 5; stroke-linecap: round; }
.linechart__dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.linechart__hit { fill: transparent; }
.linechart__hit:hover { fill: rgba(255, 255, 255, .06); }
.linechart__label { font-size: 11px; fill: var(--text-muted); }
.linechart__title { font-size: .86rem; font-weight: 600; margin: 0 0 6px; }

/* The year's taxes: a definition list of figures, solid under them. */
.tax-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px 24px; margin: 0; }
.tax-grid > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tax-grid dt { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.tax-grid dd { margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
.tax-grid dd small { display: block; font-family: inherit; font-size: .78rem; font-weight: 400; color: var(--text-muted); letter-spacing: 0; }

/* Customer picker (invoice form): a search field over a listbox popover, "Nový zákazník" at its foot,
   and a short form in place for a new one. Rows are 44px targets; the active row is the keyboard's. */
.cpick { position: relative; display: flex; flex-direction: column; gap: 10px; }
.cpick__field { position: relative; display: flex; align-items: center; }
.cpick__field > svg { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.cpick__input { padding-left: 36px; padding-right: 40px; width: 100%; }
.cpick__clear { position: absolute; right: 4px; width: 36px; height: 36px; display: grid; place-items: center;
  background: none; border: 0; color: var(--text-muted); cursor: pointer; border-radius: 8px; }
.cpick__clear:hover { color: var(--text); }
.cpick__list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 31; margin: 0; padding: 6px;
  list-style: none; max-height: min(360px, 60vh); overflow-y: auto; border-radius: var(--radius-sm); }
.cpick__option { width: 100%; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 1px;
  padding: 6px 10px; text-align: left; background: none; border: 0; border-radius: 8px; color: var(--text); font: inherit; cursor: pointer; }
.cpick__option.is-active { background: var(--surface-glass-2); }
.cpick__name { font-weight: 600; font-size: .92rem; }
.cpick__meta { font-size: .78rem; color: var(--text-muted); }
.cpick__none { padding: 10px; font-size: .85rem; color: var(--text-muted); }
.cpick__new { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; color: var(--accent);
  font-weight: 600; font-size: .9rem; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
.cpick__change { align-self: flex-start; }
.cpick__chosen { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-glass); border: 1px solid var(--line); }
.cpick__new-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px;
  background: var(--surface-sunken); border: 1px solid var(--line-strong); }
.cpick__note { font-size: .82rem; color: #B6DED3; }
.cpick__note.is-warn { color: var(--warn-text); }
.panel:has(.cpick__list) { overflow: visible; position: relative; z-index: 30; }

/* Passkey sign-in under the password form: an "or" rule, then an ordinary button. */
.auth-alt { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.auth-alt__or { display: flex; align-items: center; gap: 12px; font-size: .78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.auth-alt__or::before, .auth-alt__or::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .1); }
.auth-alt .btn { justify-content: center; }

/* ---------- responsive ------------------------------------------------------------------ */

@media (max-width: 759px) { .shell { padding: 10px; gap: 12px; } }

@container shell (min-width: 760px) {
  .rail { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin; }
}

/* A phone: the rail becomes a bar across the top — brand, feed dot and logout on one row, the
   links on a second row that scrolls sideways. Groups flatten; the active link is still marked. */
@container shell (max-width: 759px) {
  .rail {
    /* width pinned: a flex item's automatic minimum would otherwise grow to the nav's full length */
    flex: 1 1 100%; width: 100%; min-width: 0; max-width: 100%; position: sticky; top: 8px; z-index: 25;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    padding: 10px 10px 6px; border-radius: 16px;
  }
  .rail__brand { padding: 0 2px; }
  .rail__name { font-size: 1.1rem; }
  .rail__nav { order: 3; flex: 1 1 100%; width: 100%; min-width: 0; flex-direction: row; gap: 2px; overflow-x: auto; scrollbar-width: none;
    padding-bottom: 2px; margin: 2px -4px 0; padding-inline: 4px; }
  .rail__nav::-webkit-scrollbar { display: none; }
  .rail__group { display: contents; }
  .rail__group-label { display: none; }
  .rail__link { flex: 0 0 auto; min-height: 38px; padding: 0 11px; font-size: .86rem; }
  .rail__link.active::before { left: 10px; right: 10px; top: auto; bottom: -1px; width: auto; height: 2px; border-radius: 2px 2px 0 0; }
  .rail__foot { order: 2; margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 8px; }
  /* Small enough to sit beside the brand on a 390px phone: three items on one row, not two rows. */
  .rail__foot { gap: 6px; }
  .rail__feed { padding: 0 9px; min-height: 36px; justify-content: center; border-radius: 10px; }
  .rail__feed-title { font-size: .72rem; }
  .rail__feed-label { display: none; }
  .rail__user { padding: 0; }
  .rail__email, .rail__logout-text { display: none; }
  .rail__logout { width: 36px; padding: 0; justify-content: center; }
  .main { gap: 14px; }
  .page-head--sticky { position: static; padding: 12px; }
  h1 { font-size: 1.7rem; }
  /* A table that stays a table (the small numeric ones: a VAT recap, a return's lines, a month per
     row): cells on one line and the panel scrolls sideways — a wrapped date makes every row tall. */
  .table { font-size: .88rem; }
  .table:not(.table--cards) th, .table:not(.table--cards) td { white-space: nowrap; }
  /* Two figures a row: four full-width cards would fill the whole screen before any document shows. */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dash-row__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .income__body { padding: 4px 14px 16px; }
  .income__value { font-size: 1.5rem; }
  /* No room above the narrow hatched strip; the "2 mil." tick and the sentence below carry it. */
  .meter__beyond .meter__band-label { display: none; }
  .stat { padding: 14px; gap: 8px; }
  .stat__label { font-size: .68rem; letter-spacing: .05em; }
  .stat__value { font-size: 1.4rem; }
  .stat__note { font-size: .78rem; }
  .table:not(.table--cards) th:first-child, .table:not(.table--cards) td:first-child { padding-left: 14px; }
  .table:not(.table--cards) th:last-child,  .table:not(.table--cards) td:last-child  { padding-right: 14px; }
  .panel__head { padding: 14px 14px; }
  .card { padding: 14px; }

  /* The grid toolbar: the search on a line of its own, the filters two to a row, then the sort control. */
  .grid-toolbar__search { flex: 1 1 100%; max-width: none; }
  .grid-toolbar > select.input { flex: 1 1 calc(50% - 4px); }
  .grid-sort { display: flex; flex: 1 1 100%; gap: 8px; }
  .grid-sort__field { display: flex; flex: 1 1 auto; min-width: 0; }
  .grid-sort__field > select { flex: 1 1 auto; min-width: 0; }
  .grid-sort > .btn { flex: 0 0 auto; }

  /* ---- A list grid on a phone: every row a card, nothing scrolls sideways ---------------------
     Eight columns do not fit a phone; a table that scrolls sideways hides the amount, which is the
     one column people came for. So a .table--cards row becomes a card: the first cell is its title
     (or the one marked .c-title), .c-status sits beside it, .c-sub takes a line, every other cell
     says what it is through data-label ("Splatnost 15. 10. 2026") and wraps with its neighbours,
     and figures (.num) stand two to a row under an eyebrow label. The headers are gone — the
     .grid-sort control in the toolbar sorts instead. Tables not marked keep scrolling. */
  .table--cards, .table--cards tbody, .table--cards tfoot { display: block; }
  .table--cards thead { display: none; }
  .table--cards tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
    padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .07);
  }
  .table--cards tbody tr:first-child { border-top: 0; }
  .table--cards td, .table--cards th,
  .table--cards td:first-child, .table--cards th:first-child,
  .table--cards td:last-child, .table--cards th:last-child { display: block; padding: 0; border: 0; min-width: 0; font-size: .86rem; }
  .table--cards td:empty { display: none; }
  /* The row, not each cell, is what a hover or a selection tints: tinted cells with gaps between them read as patches. */
  .table--cards tbody tr:hover td, .table--cards tr.is-selected td { background: none; }
  .table--cards tbody tr:hover { background: rgba(255, 255, 255, .045); }
  .table--cards tr.is-selected { background: rgba(120, 116, 255, .09); }
  .table--cards tr:not(:has(.c-title)) > td:first-child:not(.c-field), .table--cards td.c-title {
    flex: 1 1 auto; order: -3; font-size: 1rem; font-weight: 600; color: var(--text);
  }
  .table--cards td.c-status { order: -2; margin-left: auto; }
  .table--cards td.c-sub { flex: 1 1 100%; }
  /* Two line breaks (zero-height items across the card): one after the title row, so "IČO …" never
     sits beside the status chip, and one before the figures, so "Zaplaceno —" never shares a line
     with "Celkem". Ordered: title, status, break, text cells, break, figures, actions. */
  .table--cards tr::before, .table--cards tr::after { content: ""; flex: 1 1 100%; height: 0; }
  .table--cards tr::before { order: -1; }
  .table--cards tr::after { order: 0; }
  .table--cards td.num, .table--cards td.c-fig { order: 1; }
  .table--cards td.c-actions { order: 2; }
  .table--cards td[data-label]::before { content: attr(data-label) " "; color: var(--text-muted); font-size: .78rem; }
  .table--cards td.num { flex: 1 1 calc(50% - 7px); text-align: left; white-space: nowrap; }
  /* .c-fig: a cell that is not a figure but stands like one (a list of reminders under its eyebrow). */
  .table--cards td.c-fig { flex: 1 1 calc(50% - 7px); }
  .table--cards td.c-fig--wide { flex-basis: 100%; }
  .table--cards td.num[data-label]::before, .table--cards td.c-fig[data-label]::before {
    display: block; font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1px;
  }
  .table--cards td.c-actions { flex: 1 1 100%; margin-top: 2px; }
  /* A field in a card: its label above, the field across half the card (or all of it, --wide). */
  .table--cards td.c-field { flex: 1 1 calc(50% - 7px); font-size: .86rem; font-weight: 400; }
  .table--cards td.c-field--wide { flex-basis: 100%; }
  .table--cards td.c-field > .input, .table--cards td.c-field .stack > .input, .table--cards td.c-field .stack > select { width: 100%; }
  .table--cards td.c-field[data-label]::before {
    display: block; font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px;
  }
  /* The cell's padding the link-button bled into is gone; keep the 44px target by its own padding. */
  .table--cards .link-btn { margin: -6px 0; min-height: 36px; }
  /* The sum: its heading across the card, the figures under their labels like any row's. */
  .table--cards .table-sum { border-top: 1px solid var(--line-strong); }
  .table--cards .table-sum th { flex: 1 1 100%; order: -2; font-size: .92rem; }
}
