/* «Биржа АБН» — диспетчерская бетонной стройки.
   Graphite chrome, warm concrete ground, orange signal accents, hazard stripe as the one loud detail.
   CSP: no inline styles in HTML; JS only sets custom properties / transforms via CSSOM. */

/* ---------------------------------------------------------------- tokens */
:root {
  /* palette (fixed values) */
  --g-900: #16191b;
  --g-800: #1f2427;
  --g-700: #2b3236;
  --g-600: #3a4247;
  --c-100: #eceae4;
  --c-200: #dedbd2;
  --c-300: #c8c4b8;
  --c-500: #8d8a80;
  --o-500: #ff6a1a;
  --o-600: #e5540a;
  --o-700: #b8420a;
  --o-btn: #c2480b;      /* white text 4.97:1 */
  --steel: #2f5d73;
  --green: #2e7d4f;
  --red: #b3261e;

  /* semantic (light) */
  --page: var(--c-100);
  --page-image: url("../assets/pattern-concrete.svg");
  --surface: #fbfaf7;
  --surface-2: #f3f1eb;
  --field: #ffffff;
  --ink: var(--g-900);
  --ink-2: var(--g-700);
  --ink-muted: var(--g-600);
  --line: var(--c-300);
  --line-strong: var(--c-500);
  --accent-text: var(--o-700);   /* orange text on light: AA */
  --steel-text: var(--steel);
  /* v0.1.1: darker than --green so green text keeps ≥ 4.5:1 on --green-bg and light surfaces */
  --green-text: #23663f;
  --red-text: var(--red);
  --open-bg: #fff3ea;
  --steel-bg: #e7eff3;
  --green-bg: #e8f3ec;
  --red-bg: #fbeeed;
  --stub: var(--g-900);
  --stub-ink: var(--c-100);
  --focus: var(--o-600);         /* 3.1:1 on concrete, 3.75:1 on white */
  --shadow-card: 0 1px 0 rgba(22, 25, 27, .06), 0 10px 24px -18px rgba(22, 25, 27, .55);
  --shadow-lift: 0 2px 0 rgba(22, 25, 27, .06), 0 18px 32px -18px rgba(22, 25, 27, .6);
  --hazard: repeating-linear-gradient(135deg, var(--o-500) 0 10px, var(--g-900) 10px 20px);

  --font-head: "Bahnschrift", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --radius: 4px;
  --radius-lg: 6px;
  --gutter: 16px;
  --topbar-h: 64px;
  --tabbar-h: 64px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: var(--g-900);
    --page-image: none;
    --surface: var(--g-800);
    --surface-2: var(--g-700);
    --field: #121517;
    --ink: var(--c-100);
    --ink-2: var(--c-200);
    --ink-muted: var(--c-300);
    --line: var(--g-600);
    --line-strong: var(--c-500);
    --accent-text: var(--o-500);
    --steel-text: #9cc0d2;
    --green-text: #86cfa2;
    --red-text: #f2a39d;
    --open-bg: rgba(255, 106, 26, .12);
    --steel-bg: rgba(47, 93, 115, .35);
    --green-bg: rgba(46, 125, 79, .25);
    --red-bg: rgba(179, 38, 30, .22);
    --stub: #0f1213;
    --stub-ink: var(--c-100);
    --focus: var(--o-500);
    --shadow-card: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 24px -16px rgba(0, 0, 0, .8);
    --shadow-lift: 0 2px 0 rgba(0, 0, 0, .3), 0 18px 32px -16px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--page);
  background-image: var(--page-image);
  background-size: 320px 320px;
  font: 400 16px/1.5 var(--font-body);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
a { color: var(--accent-text); text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-muted); font-weight: 400; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 12px 16px; background: var(--o-btn); color: #fff; font-weight: 700; border-radius: var(--radius);
  text-decoration: none; transition: transform .15s;
}
.skip-link:focus { top: 12px; }

.hazard { height: 6px; background: var(--hazard); }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--g-900); color: var(--c-100); }
/* Header height (topbar + hazard + toast strip) is published by app.js as --header-h. */
html { scroll-padding-top: calc(var(--header-h, var(--topbar-h)) + 12px); }
.topbar-inner {
  display: flex; align-items: center; gap: 24px;
  max-width: 1240px; height: var(--topbar-h); margin: 0 auto; padding: 0 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--c-100); text-decoration: none; min-height: 48px; }
.brand-mark { width: 36px; height: 36px; object-fit: contain; flex: none; overflow: hidden; color: transparent; }
.brand-name {
  font: 700 23px/1 var(--font-head); font-stretch: condensed; font-variation-settings: "wdth" 75;
  letter-spacing: .01em; text-transform: uppercase; white-space: nowrap;
}
.brand-name b { font-weight: 700; }

.topnav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.topnav-link {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 14px; border-radius: var(--radius);
  color: var(--c-200); text-decoration: none; font: 600 16px/1 var(--font-head); white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.topnav-link:hover { background: var(--g-700); color: #fff; }
.topnav-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 3px;
  background: var(--o-500); transform: scaleX(0); transform-origin: left; transition: transform .22s var(--ease-out);
}
.topnav-link[aria-current="page"] { color: #fff; }
.topnav-link[aria-current="page"]::after { transform: scaleX(1); }
.topnav-link.is-primary { margin-left: 8px; background: var(--o-btn); color: #fff; }
.topnav-link.is-primary:hover { background: var(--o-700); }
.topnav-link.is-primary::after { display: none; }
.topnav-link.is-primary[aria-current="page"] { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3); }

.whoami { display: flex; align-items: center; gap: 14px; margin-left: auto; min-width: 0; }
.whoami-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; min-width: 0; }
.whoami-name { font-weight: 600; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami-role { font-size: 13px; color: var(--c-300); }

/* ---------------------------------------------------------------- layout */
.main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 72px; outline: none; }
body[data-route="login"] .main, body[data-route="register"] .main { padding-top: 32px; }
.view { min-height: 50vh; }
.boot { padding: 80px 0; text-align: center; color: var(--ink-muted); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head-text { min-width: 0; }
.page-title {
  font: 700 clamp(30px, 4.2vw, 46px)/.95 var(--font-head); font-stretch: condensed; font-variation-settings: "wdth" 75;
  letter-spacing: -.01em; text-transform: uppercase; outline: none;
}
.page-sub { margin-top: 10px; max-width: 62ch; color: var(--ink-muted); }
.page-actions { display: flex; gap: 10px; align-items: center; }

.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -8px 0 8px -6px; padding: 0 8px;
  color: var(--ink-2); text-decoration: none; font: 600 15px/1 var(--font-head); border-radius: var(--radius);
}
.back:hover { color: var(--accent-text); }

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 1.5px solid transparent; border-radius: var(--radius);
  font: 600 16px/1.1 var(--font-head); text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .12s var(--ease-out), box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .72; }
.btn-primary { background: var(--o-btn); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.btn-primary:hover:not(:disabled) { background: var(--o-700); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink-2); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--red); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.btn-danger:hover:not(:disabled) { background: #9a1f18; }
.btn-danger-outline { background: transparent; color: var(--red-text); border-color: currentColor; }
.btn-danger-outline:hover:not(:disabled) { background: var(--red-bg); }
.btn-ghost-dark { background: transparent; color: var(--c-100); border-color: var(--g-600); }
.btn-ghost-dark:hover { background: var(--g-700); }
.btn-icon { width: 48px; padding: 0; background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-icon:hover { border-color: var(--ink-2); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 18px; }
.btn-block { width: 100%; }
.btn.is-busy .icon { visibility: hidden; }
.btn.is-busy::before {
  content: ""; position: absolute; left: 18px; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn-block.is-busy::before { left: calc(50% - 90px); }

/* ---------------------------------------------------------------- cards: путевой лист */
.cards { display: grid; gap: 14px; }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }

.ticket {
  position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); overflow: hidden;
  animation: card-in .28s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms);
  transition: transform .18s var(--ease-out), box-shadow .18s, border-color .18s;
}
.ticket.no-enter { animation: none; }
.ticket.is-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.ticket.is-link:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.ticket-link { color: inherit; text-decoration: none; outline: none; }
.ticket-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }

.stub {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 16px 8px 16px 4px; background: var(--stub); color: var(--stub-ink); text-align: center;
}
/* punched holes between stub and body */
.stub::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: -4px; width: 8px;
  background: radial-gradient(circle at 4px 6px, var(--surface) 3px, transparent 3.5px) 0 0 / 8px 14px repeat-y;
}
.stub-day { font: 700 46px/.9 var(--font-head); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: -.02em; }
.stub-month { font: 600 14px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--c-300); }
.stub-time {
  margin-top: 8px; padding: 3px 8px; border: 1.5px solid var(--o-500); border-radius: 3px;
  color: var(--o-500); font: 700 19px/1.1 var(--font-head); letter-spacing: .02em;
}
.stub-rel { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--c-100); background: var(--g-600); padding: 1px 7px; border-radius: 99px; }

.ticket-body { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px 18px 16px 20px; }
.ticket-body::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: transparent; }
.status-open .ticket-body::before { background: var(--hazard); }
.status-assigned .ticket-body::before { background: var(--steel); }
.status-completed .ticket-body::before { background: var(--green); }
.ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.ticket-title { font: 700 20px/1.15 var(--font-head); letter-spacing: .005em; }
.ticket-badges { display: flex; flex-wrap: wrap; gap: 6px; position: relative; z-index: 2; pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px;
  font: 600 15px/1.2 var(--font-head); color: var(--ink);
}
.chip .icon { width: 17px; height: 17px; color: var(--ink-muted); }

.ticket-place, .ticket-cond { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); min-width: 0; }
.ticket-place .icon, .ticket-cond .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--accent-text); }
.ticket-place .place-text { font-weight: 600; overflow-wrap: anywhere; }
.ticket-cond span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; color: var(--ink-muted); overflow-wrap: anywhere; }
.ticket-cond .icon { color: var(--ink-muted); }
.ticket-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 2px; padding-top: 10px; border-top: 1px dashed var(--line); }
.meta-count { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-muted); }
.meta-count.has { color: var(--ink); font-weight: 600; }
.meta-count .icon { width: 18px; height: 18px; }
.my-price { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); font-size: 15px; }
.my-price strong { color: var(--ink); font: 700 18px/1 var(--font-head); }
.my-price .icon { width: 18px; height: 18px; }

/* status-dependent muting */
.ticket.status-cancelled { background: var(--surface-2); box-shadow: none; }
.ticket.status-cancelled .stub { background: var(--c-300); color: var(--g-800); }
.ticket.status-cancelled .stub-month { color: var(--g-700); }
.ticket.status-cancelled .stub-time { color: var(--g-700); border-color: var(--g-600); }
.ticket.status-cancelled .stub::after { background-image: radial-gradient(circle at 4px 6px, var(--surface-2) 3px, transparent 3.5px); }
.ticket.status-cancelled .chip { background: transparent; }
.ticket.status-completed .stub-time { color: #8fd3a9; border-color: #8fd3a9; }
.ticket.status-assigned .stub-time { color: #a9cbdb; border-color: #a9cbdb; }

.ticket.is-preview { border-style: dashed; border-width: 1.5px; border-color: var(--line-strong); }
.ticket.is-preview .ticket-body::before { background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 14px); height: 2px; }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px 3px 8px;
  border: 1.5px solid currentColor; border-radius: 99px; white-space: nowrap;
  font: 700 14px/1.1 var(--font-head); letter-spacing: .01em;
}
.badge .icon { width: 16px; height: 16px; }
.badge-open { color: var(--accent-text); background: var(--open-bg); border-color: var(--o-600); }
.badge-assigned { color: var(--steel-text); background: var(--steel-bg); }
.badge-completed { color: var(--green-text); background: var(--green-bg); }
.badge-cancelled { color: var(--ink-muted); background: var(--c-200); border-color: var(--c-500); }
.badge-draft { color: var(--ink-2); border-style: dashed; background: transparent; }
.badge-resp-pending { color: var(--accent-text); border-style: dashed; background: transparent; }
.badge-resp-selected, .badge-selected { color: #fff; background: var(--green); border-color: var(--green); }
.badge-resp-rejected { color: var(--ink-muted); background: var(--c-200); border-color: var(--c-500); }
@media (prefers-color-scheme: dark) {
  .badge-cancelled, .badge-resp-rejected { background: var(--g-700); }
  .ticket.status-cancelled .stub { background: var(--g-600); color: var(--c-100); }
  .ticket.status-cancelled .stub-month, .ticket.status-cancelled .stub-time { color: var(--c-200); border-color: var(--c-500); }
}

.pulse { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--o-500); flex: none; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--o-500);
  animation: pulse 1.8s var(--ease-out) infinite;
}
.badge.is-changed { animation: badge-pop .5s var(--ease-out) both; }

/* ---------------------------------------------------------------- filters */
.filters { display: flex; gap: 8px; margin: -6px 0 18px; padding: 6px 2px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 8px 0 16px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 99px; color: var(--ink);
  font: 600 15px/1 var(--font-head); transition: background-color .15s, color .15s, border-color .15s, transform .12s;
}
.filter:hover { border-color: var(--ink-2); }
.filter:active { transform: scale(.98); }
.filter[aria-pressed="true"] { background: var(--g-900); border-color: var(--g-900); color: var(--c-100); }
.filter-count { min-width: 28px; padding: 3px 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink); text-align: center; font-size: 14px; }
.filter[aria-pressed="true"] .filter-count { background: var(--o-btn); color: #fff; }
@media (prefers-color-scheme: dark) { .filter[aria-pressed="true"] { background: var(--c-100); color: var(--g-900); border-color: var(--c-100); } }
.list-note { padding: 24px; color: var(--ink-muted); text-align: center; }

/* ---------------------------------------------------------------- states */
.state {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px 48px; text-align: center;
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  animation: view-in .26s var(--ease-out) both;
}
.state-art { width: 200px; height: 160px; object-fit: contain; color: var(--ink-muted); font-size: 13px; }
.state-title { font: 700 28px/1 var(--font-head); font-stretch: condensed; font-variation-settings: "wdth" 75; text-transform: uppercase; }
.state-text { max-width: 46ch; color: var(--ink-muted); }
.state .btn { margin-top: 8px; }
.state-error { border-color: var(--red); border-style: solid; border-left-width: 4px; }

.skeleton { animation: none; box-shadow: none; }
.skeleton .stub { background: var(--c-300); min-height: 150px; }
.skeleton .stub::after { display: none; }
.sk { position: relative; display: block; overflow: hidden; border-radius: 3px; background: var(--c-200); }
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent);
  animation: shimmer 1.3s ease-in-out infinite;
}
.sk-title { width: 45%; height: 22px; }
.sk-chips { width: 85%; height: 32px; }
.sk-line { width: 65%; height: 16px; }
@media (prefers-color-scheme: dark) {
  .skeleton .stub { background: var(--g-700); }
  .sk { background: var(--g-700); }
  .sk::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent); }
}

/* ---------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fieldset { margin: 0; padding: 0; border: 0; }
.label { padding: 0; font-weight: 650; font-size: 16px; color: var(--ink); }
.req { color: var(--accent-text); font-weight: 700; }
.hint { font-size: 14px; color: var(--ink-muted); line-height: 1.4; }
.input {
  width: 100%; min-height: 48px; padding: 11px 14px;
  background: var(--field); border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  font-size: 16px; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 104px; resize: vertical; line-height: 1.45; }
.input:hover { border-color: var(--ink-2); }
.input:focus { border-color: var(--ink); outline: 3px solid var(--focus); outline-offset: 1px; }
.input::placeholder { color: #6d6a62; opacity: 1; }
.input[aria-invalid="true"] { border-color: var(--red); background: var(--red-bg); }
input[type="date"].input, input[type="time"].input { max-width: 260px; font-variant-numeric: tabular-nums; }
.input-wrap { position: relative; }
.input-wrap.has-suffix .input { padding-right: 52px; }
.input-suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font: 600 16px/1 var(--font-head); pointer-events: none; }
.error { font-size: 14px; font-weight: 600; color: var(--red-text); line-height: 1.35; }
.error:empty { display: none; }
.error.is-shown { animation: err-in .2s var(--ease-out) both; }
.form-alert {
  padding: 12px 14px; border-left: 4px solid var(--red); background: var(--red-bg); color: var(--red-text);
  font-weight: 600; border-radius: 0 var(--radius) var(--radius) 0;
}
.form-legend { font-size: 14px; color: var(--ink-muted); }
.counter { align-self: flex-end; font-size: 13px; color: var(--ink-muted); }

/* choices */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice-face {
  display: flex; align-items: center; gap: 10px; min-height: 52px; height: 100%; padding: 10px 14px;
  background: var(--field); border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  font: 600 17px/1.2 var(--font-head); color: var(--ink); pointer-events: none;
  transition: background-color .15s, border-color .15s, color .15s, transform .12s var(--ease-out);
}
.choice-icon { color: var(--ink-muted); }
.choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-sub { font: 400 14px/1.35 var(--font-body); color: var(--ink-muted); }
.choice-tick {
  display: grid; place-items: center; width: 24px; height: 24px; margin-left: auto; flex: none;
  border-radius: 50%; background: var(--o-500); color: var(--g-900);
  transform: scale(0); transition: transform .2s var(--ease-out);
}
.choice-tick .icon { width: 15px; height: 15px; }
.choice:hover .choice-face { border-color: var(--ink-2); }
.choice:active .choice-face { transform: scale(.98); }
.choice input:checked + .choice-face { background: var(--g-900); border-color: var(--g-900); color: var(--c-100); }
.choice input:checked + .choice-face .choice-icon { color: var(--o-500); }
.choice input:checked + .choice-face .choice-tick { transform: scale(1); }
.choice input:focus-visible + .choice-face { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice input[aria-invalid="true"] + .choice-face { border-color: var(--red); background: var(--red-bg); }
@media (prefers-color-scheme: dark) {
  .choice input:checked + .choice-face { background: var(--c-100); border-color: var(--c-100); color: var(--g-900); }
  .choice input:checked + .choice-face .choice-icon { color: var(--o-700); }
}

/* role cards on registration */
.choices-roles .choice-face { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 128px; padding: 16px; }
.choices-roles .choice-icon { width: 40px; height: 40px; padding: 8px; border-radius: var(--radius); background: var(--surface-2); color: var(--ink); }
.choices-roles .choice-label { font-size: 20px; }
.choices-roles .choice-tick { position: absolute; top: 12px; right: 12px; }
.choices-roles .choice input:checked + .choice-face { background: var(--open-bg); border-color: var(--o-600); color: var(--ink); box-shadow: inset 0 0 0 1px var(--o-600); }
.choices-roles .choice input:checked + .choice-face .choice-icon { background: var(--o-btn); color: #fff; }
.choices-roles .choice input:checked + .choice-face .choice-sub { color: var(--ink-2); }

/* ---------------------------------------------------------------- auth */
.auth {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  max-width: 1120px; margin: 0 auto; min-height: 620px;
  background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lift);
  animation: view-in .26s var(--ease-out) both;
}
.auth-hero {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  padding: 40px 40px 46px; background: var(--g-900); color: var(--c-100); overflow: hidden;
}
.auth-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 60% at 78% 18%, rgba(255, 106, 26, .2), transparent 70%);
}
.auth-hero-art { position: relative; display: flex; justify-content: center; align-items: center; flex: 1; min-height: 200px; }
.auth-hero-img { width: 100%; max-width: 520px; height: auto; aspect-ratio: 4 / 3; object-fit: contain; color: var(--c-300); font-size: 14px; }
.auth-hero-copy { position: relative; display: flex; flex-direction: column; gap: 12px; }
.auth-hero-lead {
  font: 700 clamp(30px, 3.6vw, 44px)/.95 var(--font-head); font-stretch: condensed; font-variation-settings: "wdth" 75;
  text-transform: uppercase; letter-spacing: -.01em; max-width: 14ch;
}
.auth-hero-text { max-width: 44ch; color: var(--c-300); }
.hazard-hero { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 40px clamp(20px, 5vw, 56px); }
.auth-title { font: 700 40px/1 var(--font-head); font-stretch: condensed; font-variation-settings: "wdth" 75; text-transform: uppercase; outline: none; }
.auth-sub { color: var(--ink-muted); margin-bottom: 16px; }
.auth-form .btn-block { margin-top: 6px; }
.auth-switch { margin-top: 18px; color: var(--ink-muted); }
.auth-switch a { font-weight: 700; display: inline-block; padding: 10px 2px; }

/* ---------------------------------------------------------------- compose (new order) */
.compose { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "aside" "actions"; }
.compose-main { grid-area: main; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 8px 24px 24px; box-shadow: var(--shadow-card); }
.compose-preview { grid-area: aside; display: flex; flex-direction: column; gap: 12px; }
.compose-actions { grid-area: actions; display: flex; gap: 12px; flex-wrap: wrap; }
.compose-actions .btn-lg { flex: 1 1 260px; }
@media (min-width: 1000px) {
  .compose { grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "main aside" "actions aside"; align-items: start; column-gap: 28px; }
  .compose-preview { position: sticky; top: calc(var(--header-h, var(--topbar-h)) + 24px); }
  .compose-actions .btn-lg { flex: 0 1 auto; }
}
.compose-form { gap: 0; }
.compose-form > .form-alert { margin-top: 16px; }
.compose-form > .form-legend { padding: 16px 0 4px; }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.step:last-child { border-bottom: 0; padding-bottom: 4px; }
.step-num {
  display: grid; place-items: center; width: 34px; height: 34px; margin-top: -2px;
  background: var(--g-900); color: var(--c-100); font: 700 17px/1 var(--font-head);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%); transition: background-color .2s;
}
.step:focus-within .step-num { background: var(--o-btn); color: #fff; }
.step:has([aria-invalid="true"]) .step-num { background: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { .step-num { background: var(--c-100); color: var(--g-900); } }

.loc-kind:empty { display: none; }
.loc-kind { align-self: flex-start; padding: 2px 10px; border-radius: 99px; font: 600 13px/1.5 var(--font-head); border: 1px solid currentColor; }
.loc-kind.is-map { color: var(--steel-text); background: var(--steel-bg); }
.loc-kind.is-address { color: var(--ink-2); }
.loc-kind.is-bad { color: var(--red-text); background: var(--red-bg); }

.grade-box { margin-top: 14px; padding: 14px 16px 16px; background: var(--surface-2); border-left: 4px solid var(--o-600); border-radius: 0 var(--radius) var(--radius) 0; }
.grade-box.is-revealing { animation: reveal .24s var(--ease-out) both; }
.grade-box .input { max-width: 200px; }
.grade-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.grade-pill {
  min-height: 44px; min-width: 64px; padding: 0 14px; border-radius: 99px;
  background: var(--field); border: 1.5px solid var(--line); color: var(--ink); font: 600 15px/1 var(--font-head);
  transition: border-color .15s, transform .12s;
}
.grade-pill:hover { border-color: var(--ink-2); }
.grade-pill:active { transform: scale(.97); }

.preview-title { font: 700 20px/1.15 var(--font-head); text-transform: uppercase; font-stretch: condensed; font-variation-settings: "wdth" 75; }
.meter { height: 6px; background: var(--c-200); border-radius: 99px; overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--o-500); transform: scaleX(0); transform-origin: left; transition: transform .26s var(--ease-out), background-color .2s; }
.compose-preview.is-complete .meter-fill { background: var(--green); }
.meter-text { font-size: 14px; color: var(--ink-muted); }
.compose-preview.is-complete .meter-text { color: var(--green-text); font-weight: 600; }
.preview-note { font-size: 13px; color: var(--ink-muted); padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); }
.preview-slot .ticket { grid-template-columns: 92px minmax(0, 1fr); }
@media (prefers-color-scheme: dark) { .meter { background: var(--g-700); } }

/* ---------------------------------------------------------------- order detail */
.detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-status .badge { min-height: 36px; padding: 6px 14px 6px 12px; font-size: 16px; }
.detail-skeleton { max-width: 680px; }

.track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 22px; padding: 0; list-style: none; }
.track-step { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding-right: 10px; color: var(--ink-muted); }
.track-step:not(:last-child)::after { content: ""; flex: 1; height: 3px; min-width: 12px; background: var(--line); border-radius: 2px; }
.track-step.is-done::after { background: var(--green); }
.track-dot {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--surface); font: 700 15px/1 var(--font-head); color: var(--ink-muted);
}
.track-dot .icon { width: 17px; height: 17px; }
.track-label { font: 600 15px/1.15 var(--font-head); }
.track-step.is-done { color: var(--ink); }
.track-step.is-done .track-dot { background: var(--green); border-color: var(--green); color: #fff; }
.track-step.is-current { color: var(--ink); }
.track-step.is-current .track-dot { background: var(--o-btn); border-color: var(--o-btn); color: #fff; animation: badge-pop .5s var(--ease-out) both; }
.track-step.is-current:last-child .track-dot { background: var(--green); border-color: var(--green); }
.track-cancelled { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 12px 16px; background: var(--c-200); border-radius: var(--radius); color: var(--ink-2); font-weight: 600; }
@media (prefers-color-scheme: dark) { .track-cancelled { background: var(--g-700); } }

.detail-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .detail-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 24px; } }

.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; animation: view-in .26s var(--ease-out) both; }
.sheet-top { display: grid; grid-template-columns: 124px minmax(0, 1fr); position: relative; }
.sheet-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }
.sheet.status-open .sheet-top::after { background: var(--hazard); }
.sheet.status-assigned .sheet-top::after { background: var(--steel); }
.sheet.status-completed .sheet-top::after { background: var(--green); }
.sheet .stub { padding: 22px 8px 26px 4px; }
.sheet .stub-day { font-size: 56px; }
.sheet-when { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 18px 22px 22px; }
.sheet-when-label { font-size: 14px; color: var(--ink-muted); }
.sheet-when-date { font: 700 26px/1.1 var(--font-head); }
.sheet-when-time { display: inline-flex; align-items: center; gap: 8px; font: 700 22px/1.1 var(--font-head); color: var(--accent-text); }
.sheet-grid { margin: 0; padding: 6px 22px 14px; }
.sheet-row { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 4px 16px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.sheet-row:last-child { border-bottom: 0; }
.sheet-row dt { display: flex; align-items: center; gap: 8px; color: var(--ink-muted); font-size: 15px; }
.sheet-row dt .icon { width: 18px; height: 18px; }
.sheet-row dd { margin: 0; font-weight: 600; font-size: 16px; overflow-wrap: anywhere; white-space: pre-line; }
.map-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; color: var(--accent-text); }
.map-place { display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 0; }
.map-url { color: var(--ink-2); font-weight: 500; font-size: .92em; overflow-wrap: anywhere; }
.map-tag { color: var(--ink-2); font-weight: 600; }
.confirm.is-waiting .btn[aria-busy="true"] { cursor: progress; }
.confirm.is-waiting .btn[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; margin-right: 8px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite;
}
.map-link .icon { width: 20px; height: 20px; }
.sheet.status-cancelled .stub { background: var(--c-300); color: var(--g-800); }
.sheet.status-cancelled .stub-month, .sheet.status-cancelled .stub-time { color: var(--g-700); border-color: var(--g-600); }

.panel { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); animation: view-in .3s var(--ease-out) both; animation-delay: 60ms; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-title { font: 700 24px/1 var(--font-head); font-stretch: condensed; font-variation-settings: "wdth" 75; text-transform: uppercase; }
.panel-count { color: var(--ink-muted); font-weight: 600; }
.panel-sub { color: var(--ink-muted); font-size: 15px; margin-top: -6px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 16px; }
.panel-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 8px 4px; text-align: center; color: var(--ink-muted); }
.panel-empty-art { width: 120px; height: 96px; object-fit: contain; font-size: 12px; }

.resps { display: flex; flex-direction: column; gap: 10px; }
.resp {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field);
  animation: card-in .26s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms);
}
.resp-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.resp-who { display: flex; align-items: center; gap: 6px; font-weight: 600; overflow-wrap: anywhere; }
.resp-who .icon { width: 18px; height: 18px; color: var(--ink-muted); }
.resp-price { font: 700 28px/1 var(--font-head); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: -.01em; }
.resp-comment { font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-line; }
.resp-time { font-size: 13px; color: var(--ink-muted); }
.resp-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.resp.is-selected { border: 2px solid var(--green); background: var(--green-bg); padding: 13px 15px; }
.resp.is-closed { background: var(--surface-2); }
.resp.is-closed .resp-price { color: var(--ink-muted); }

.notice { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; background: var(--surface-2); border-left: 4px solid var(--line-strong); border-radius: 0 var(--radius) var(--radius) 0; }
.notice p + p { margin-top: 2px; font-size: 15px; color: var(--ink-2); }
.notice-title { font: 700 18px/1.2 var(--font-head); }
.notice-icon { width: 28px; height: 28px; color: var(--ink-muted); }
.notice-art { width: 56px; height: 56px; object-fit: contain; flex: none; font-size: 0; }
.notice-success { background: var(--green-bg); border-left-color: var(--green); animation: badge-pop .45s var(--ease-out) both; }
.notice-success .notice-title { color: var(--green-text); }
.notice-steel { background: var(--steel-bg); border-left-color: var(--steel); }
.notice-steel .notice-icon { color: var(--steel-text); }
.notice-wait { background: var(--open-bg); border-left-color: var(--o-600); }
.notice-wait .notice-icon { color: var(--accent-text); }
.my-offer { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--ink-muted); }
.my-offer strong { font: 700 30px/1 var(--font-head); color: var(--ink); font-stretch: condensed; font-variation-settings: "wdth" 75; }
.my-offer-comment { color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- 404 */
.nf { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; max-width: 560px; padding: 32px 0; }
.nf-code {
  font: 700 clamp(120px, 22vw, 220px)/.8 var(--font-head); font-stretch: condensed; font-variation-settings: "wdth" 75;
  letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 3px var(--ink);
  background: var(--hazard); -webkit-background-clip: text; background-clip: text;
}

/* ---------------------------------------------------------------- toasts */
/* v0.1.1: toasts live in a strip inside the sticky header (in normal flow), so they push the page
   down instead of floating over buttons. Empty strip takes no space. */
.toasts {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  max-width: 1240px; margin: 0 auto; padding: 10px 24px;
}
.toasts:empty { display: none; }
.toast {
  display: flex; align-items: center; gap: 12px; width: min(520px, 100%); padding: 8px 6px 8px 14px;
  background: var(--g-800); color: var(--c-100); border-left: 5px solid var(--c-500); border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  animation: toast-in .26s var(--ease-out) both;
}
.toast.is-leaving { animation: toast-out .22s ease-in both; }
.toast-success { border-left-color: #4caf78; }
.toast-error { border-left-color: var(--o-500); }
.toast-art { width: 44px; height: 44px; object-fit: contain; flex: none; font-size: 0; }
.toast-glyph { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--g-700); color: var(--o-500); }
.toast-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 15px; line-height: 1.35; }
.toast-title { font: 700 17px/1.2 var(--font-head); }
.toast-action {
  flex: none; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--o-500); border-radius: var(--radius);
  background: transparent; color: var(--o-500); font: 700 15px/1 var(--font-head);
}
.toast-action:hover { background: var(--o-500); color: var(--g-900); }
.toast-close {display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: var(--radius); background: transparent; color: var(--c-300); }
.toast-close:hover { background: var(--g-700); color: #fff; }

/* ---------------------------------------------------------------- dialog */
.confirm {
  width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
}
.confirm[open] { animation: dialog-in .22s var(--ease-out) both; }
.confirm::backdrop { background: rgba(22, 25, 27, .62); }
.confirm-inner { display: flex; flex-direction: column; gap: 12px; padding: 0 24px 22px; }
.confirm-stripe { height: 8px; margin: 0 -24px 10px; background: var(--hazard); }
.confirm.is-danger .confirm-stripe { background: repeating-linear-gradient(135deg, var(--red) 0 10px, var(--g-900) 10px 20px); }
.confirm-title { font: 700 26px/1.05 var(--font-head); font-stretch: condensed; font-variation-settings: "wdth" 75; text-transform: uppercase; }
.confirm-text { color: var(--ink-2); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- tab bar (mobile) */
.tabbar { display: none; }
.hide-mobile { }

@media (max-width: 719.98px) {
  :root { --topbar-h: 56px; }
  .topbar-inner { padding: 0 var(--gutter); gap: 12px; }
  .brand-name { font-size: 21px; }
  .brand-mark { width: 32px; height: 32px; }
  .topnav, .btn-logout { display: none; }
  .whoami-name { max-width: 16ch; font-size: 15px; }
  .hazard { height: 4px; }
  .main { padding: 20px var(--gutter) 48px; }
  body[data-role="customer"] .main, body[data-role="executor"] .main { padding-bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
  .hide-mobile { display: none !important; }

  .tabbar:not([hidden]) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; align-items: stretch; justify-content: space-around;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
    background: var(--g-900); box-shadow: 0 -10px 24px -12px rgba(0, 0, 0, .5);
  }
  .tabbar::before { content: ""; position: absolute; left: 0; right: 0; top: -4px; height: 4px; background: var(--hazard); }
  .tab {
    position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-width: 64px; min-height: 56px; padding: 6px 4px; border: 0; background: transparent;
    color: var(--c-300); text-decoration: none; font: 600 13px/1.1 var(--font-head);
    -webkit-tap-highlight-color: transparent;
  }
  .tab .icon { width: 24px; height: 24px; }
  .tab[aria-current="page"] { color: var(--o-500); }
  .tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; background: var(--o-500); border-radius: 0 0 3px 3px; }
  .tab:active .tab-icon { transform: scale(.92); }
  .tab-icon { display: grid; place-items: center; transition: transform .12s; }
  /* FAB docked into the tab bar */
  .tab-label { white-space: nowrap; }
  .tab-fab { color: var(--c-100); }
  .tab-fab .tab-icon {
    width: 60px; height: 60px; margin-top: -30px; border-radius: 50%;
    background: var(--o-btn); color: #fff; box-shadow: 0 0 0 5px var(--g-900), 0 10px 20px -6px rgba(194, 72, 11, .7);
  }
  .tab-fab .icon { width: 28px; height: 28px; }
  .tab-fab[aria-current="page"] { color: var(--c-100); }
  .tab-fab[aria-current="page"]::before { display: none; }
  .tab-fab[aria-current="page"] .tab-icon { background: var(--o-700); }

  .toasts { padding: 8px var(--gutter); align-items: stretch; }
  .toast { width: 100%; }

  .page-head { margin-bottom: 18px; flex-wrap: nowrap; align-items: flex-start; }
  .page-head .page-actions { flex: none; }
  .ticket { grid-template-columns: 84px minmax(0, 1fr); }
  .stub-day { font-size: 38px; }
  .stub-time { font-size: 16px; padding: 2px 6px; }
  .stub-month { font-size: 12.5px; }
  .ticket-body { padding: 14px 14px 14px 16px; }
  .ticket-title { font-size: 18px; }
  .chip { font-size: 14px; padding: 3px 8px; min-height: 30px; }

  .auth { grid-template-columns: 1fr; min-height: 0; margin: -20px calc(-1 * var(--gutter)) 0; border-radius: 0; box-shadow: none; background: transparent; }
  .auth-hero { flex-direction: row; align-items: center; justify-content: flex-start; gap: 16px; padding: 18px var(--gutter) 24px; }
  .auth-hero-art { flex: 0 0 112px; min-height: 0; }
  .auth-hero-img { max-width: 112px; }
  .auth-hero-text { display: none; }
  .auth-hero-lead { font-size: 25px; }
  .hazard-hero { height: 6px; }
  .auth-panel { padding: 24px var(--gutter) 32px; }
  .auth-title { font-size: 34px; }

  .compose-main { padding: 4px 14px 18px; margin: 0 calc(-1 * var(--gutter) + 4px); }
  .step { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .step-num { width: 28px; height: 28px; font-size: 15px; }
  .compose-actions { flex-direction: column; }
  .compose-actions .btn, .compose-actions .btn-lg { width: 100%; flex: none; }

  .track-label { font-size: 13px; }
  .track-step { gap: 6px; padding-right: 6px; }
  .track-dot { width: 28px; height: 28px; }
  .sheet-top { grid-template-columns: 100px minmax(0, 1fr); }
  .sheet .stub-day { font-size: 46px; }
  .sheet-when { padding: 14px 16px 18px; }
  .sheet-when-date { font-size: 21px; }
  .sheet-grid { padding: 4px 16px 10px; }
  .sheet-row { grid-template-columns: 1fr; gap: 2px; padding: 11px 0; }
  .panel { padding: 16px; }
  .resp { grid-template-columns: 1fr; }
  .resp-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .resp-side .btn { flex: 1; }
  .confirm-actions { flex-direction: column; }
  .confirm-actions .btn { width: 100%; }
}

/* v0.1.1: below ~480px two columns are too narrow for icon + word + tick (the tick covered the text) */
@media (max-width: 479.98px) {
  .choices { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .choices-roles { grid-template-columns: 1fr; }
  .choices-roles .choice-face { min-height: 0; flex-direction: row; align-items: center; }
  .whoami-name { max-width: 11ch; }
  .track-label { font-size: 12px; }
}

/* ---------------------------------------------------------------- motion */
.view-enter { animation: view-in .22s var(--ease-out) both; }

@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes err-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes badge-pop { 0% { transform: scale(.85); opacity: .4; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .pulse::after, .sk::after { display: none; }
  .btn.is-busy::before { animation: none; border-right-color: currentColor; opacity: .6; }
}

/* ---------------------------------------------------------------- PWA (v0.2.0) */
.netbar { padding: 8px 24px; background: #7a2a12; color: #fff; font: 600 14px/1.35 var(--font-body); text-align: center; }
.page-settings .settings-block { margin-bottom: 18px; }
.settings-steps { margin: 8px 0 0; padding-left: 22px; line-height: 1.55; }
.settings-steps li { margin: 4px 0; }
.settings-status { margin: 10px 0 0; font-weight: 600; }
.settings-ok { display: flex; align-items: center; gap: 8px; color: var(--green-text); font-weight: 600; }
/* Installed (standalone): respect the notch / home indicator on iPhone */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
  .topbar-inner { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
}
.legal { max-width: 820px; line-height: 1.6; }
.legal h2 { margin: 26px 0 8px; font: 700 22px/1.2 var(--font-head); }
.legal ul { padding-left: 22px; }
.legal li { margin: 6px 0; }
