/* ==========================================================================
   Residenze · Unit portal design system
   Warm neutrals, ink as the primary action color, status color only.
   All text colors meet WCAG 2.2 AA on their backgrounds.
   ========================================================================== */

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  --bg: #fafaf9;
  --surface: #ffffff;
  --sunken: #f5f5f4;
  --line: #ebe9e6;
  --line-strong: #d9d6d1;

  --ink: #1c1917;
  --text: #292524;
  --muted: #6b6560;
  --faint: #a8a29e;

  --accent: #0f766e;
  --focus: #0f766e;

  --pending: #b45309;  --pending-bg: #fef6e7;
  --success: #15803d;  --success-bg: #effbf3;
  --danger: #b91c1c;   --danger-bg: #fdf1f1;
  --info: #1d4ed8;     --info-bg: #eff4ff;

  --airbnb: #e0484f;
  --booking: #2f5bd3;
  --direct: #1f9d55;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 2px 6px -2px rgba(28, 25, 23, .04);
  --shadow-pop: 0 10px 30px -10px rgba(28, 25, 23, .18), 0 2px 6px rgba(28, 25, 23, .06);

  --header-h: 64px;
  --maxw: 1200px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; }
h1 { font-size: 1.875rem; font-weight: 650; letter-spacing: -.025em; }
h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: .9375rem; font-weight: 600; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; padding: .625rem 1rem; border-radius: var(--r-sm); background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 1rem; }
.icon { width: 18px; height: 18px; flex: none; stroke-width: 1.75; }
.icon-sm { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: 1rem; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; gap: 2rem; max-width: var(--maxw); height: var(--header-h); margin: 0 auto; padding: 0 1.5rem; }
.logo { display: flex; align-items: center; gap: .625rem; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 1.0625rem; letter-spacing: -.02em; }
.logo-mark { width: 28px; height: 28px; }
.mainnav { display: flex; align-self: stretch; gap: .25rem; }
.mainnav a { position: relative; display: flex; align-items: center; gap: .375rem; padding: 0 .75rem; color: var(--muted); font-weight: 500; font-size: .9375rem; text-decoration: none; }
.mainnav a:hover { color: var(--ink); }
.mainnav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.mainnav a[aria-current="page"]::after { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.mainnav .pill-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: #fff; font-size: .6875rem; font-weight: 700; line-height: 18px; text-align: center; }
.header-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.unit-switch { position: relative; display: flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .5rem 0 .25rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.unit-switch:hover { border-color: var(--line-strong); }
.unit-switch:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.unit-switch img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.unit-switch select { appearance: none; border: 0; background: transparent; padding: 0 1.25rem 0 .125rem; font-weight: 600; font-size: .875rem; color: var(--ink); cursor: pointer; }
.unit-switch select:focus { outline: none; }
.unit-switch .icon { position: absolute; right: .625rem; pointer-events: none; color: var(--muted); width: 14px; height: 14px; }

.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--sunken); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--airbnb); box-shadow: 0 0 0 2px #fff; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--sunken); color: var(--text); font-weight: 600; font-size: .8125rem; letter-spacing: .01em; }
.avatar.lg { width: 48px; height: 48px; font-size: .9375rem; }
.avatar.ink { background: var(--ink); color: #fff; }

/* ---------- Page ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.5rem 6rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.page-head p { margin-top: .375rem; color: var(--muted); }
.eyebrow { font-size: .8125rem; font-weight: 500; color: var(--muted); margin-bottom: .375rem; }
.view[hidden] { display: none; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2rem; align-items: start; }
.sec + .sec { margin-top: 2.5rem; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.link { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; font-size: .875rem; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--ink); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 40px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .875rem; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--sunken); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ink:hover { background: #3a3532; border-color: #3a3532; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--sunken); }
.btn-sm { height: 34px; padding: 0 .75rem; font-size: .8125rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Pills / filters ---------- */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter { display: inline-flex; align-items: center; gap: .375rem; height: 36px; padding: 0 .875rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .875rem; font-weight: 500; color: var(--text); cursor: pointer; }
.filter:hover { border-color: var(--line-strong); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter b { font-weight: 600; }

.status { display: inline-flex; align-items: center; gap: .375rem; font-size: .8125rem; font-weight: 600; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.pending { color: var(--pending); }
.status.success { color: var(--success); }
.status.info { color: var(--info); }
.status.neutral { color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: .375rem; height: 24px; padding: 0 .5rem; border-radius: 6px; background: var(--sunken); color: var(--text); font-size: .75rem; font-weight: 500; white-space: nowrap; }
.tag .ch { width: 7px; height: 7px; border-radius: 2px; }
.tag.pending { background: var(--pending-bg); color: var(--pending); }
.tag.success { background: var(--success-bg); color: var(--success); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel-pad { padding: 1.25rem 1.375rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.125rem 1.375rem; border-bottom: 1px solid var(--line); }
.divided > * + * { border-top: 1px solid var(--line); }

/* ---------- Reservation cards ---------- */
.res-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.res { display: flex; flex-direction: column; padding: 1.25rem 1.375rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s; }
.res:hover { box-shadow: var(--shadow-pop); border-color: var(--line-strong); }
.res-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.res-name { margin-top: .625rem; font-size: 1.125rem; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.res-meta { margin-top: .25rem; font-size: .875rem; color: var(--muted); }
.res-foot { display: flex; align-items: center; gap: .5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.res-foot .spacer { flex: 1; }

/* ---------- Row list (iOS-settings style) ---------- */
.rows > li + li, .rows > details + details { border-top: 1px solid var(--line); }
.rows > details:first-child > summary { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.row-link { display: flex; align-items: center; gap: 1rem; width: 100%; padding: 1rem 1.375rem; border: 0; background: none; text-align: left; text-decoration: none; color: inherit; cursor: pointer; }
a.row-link:hover, button.row-link:hover { background: #fcfcfb; }
.row-ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--sunken); color: var(--ink); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; color: var(--ink); font-size: .9375rem; }
.row-sub { font-size: .8125rem; color: var(--muted); margin-top: 1px; }
.row-end { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .875rem; }
.chev { color: var(--faint); transition: transform .2s; }

/* ---------- Notice ---------- */
.notice { display: flex; gap: .875rem; align-items: flex-start; padding: 1rem 1.25rem; border-radius: var(--r); background: var(--pending-bg); color: #7c2d12; font-size: .875rem; }
.notice .icon { color: var(--pending); margin-top: 2px; }
.notice strong { color: #7c2d12; }

/* ---------- Unit card ---------- */
.unit-photo { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--sunken); }
.unit-photo img { width: 100%; height: 100%; object-fit: cover; }
.unit-photo .badge-float { position: absolute; left: .875rem; top: .875rem; display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .625rem; border-radius: 999px; background: rgba(255, 255, 255, .95); font-size: .75rem; font-weight: 600; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--direct); box-shadow: 0 0 0 3px rgba(31, 157, 85, .18); }
.facts { padding: .25rem 1.375rem 1rem; }
.facts li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .625rem 0; font-size: .875rem; }
.facts li + li { border-top: 1px dashed var(--line); }
.facts dt, .facts .k { display: flex; align-items: center; gap: .5rem; color: var(--muted); }
.facts .v { font-weight: 600; color: var(--ink); }
.copy-field { display: flex; align-items: center; gap: .5rem; margin: 0 1.375rem 1.375rem; padding: .375rem .375rem .375rem .875rem; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); }
.copy-field input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: .8125rem; color: var(--text); }
.copy-field input:focus { outline: none; }

/* ---------- Earnings ---------- */
.big { font-size: 2rem; font-weight: 650; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.delta { display: inline-flex; align-items: center; gap: .25rem; font-size: .8125rem; font-weight: 600; color: var(--success); }
.chart { display: flex; align-items: flex-end; gap: .625rem; height: 96px; margin-top: 1.25rem; }
.chart div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .375rem; height: 100%; justify-content: flex-end; }
.chart i { display: block; width: 100%; height: var(--h); border-radius: 4px; background: #e7e5e2; }
.chart div:last-child i { background: var(--ink); }
.chart span { font-size: .6875rem; color: var(--muted); }
.split { display: grid; grid-template-columns: 1fr 1fr; margin-top: 1.25rem; border-top: 1px solid var(--line); }
.split > div { padding-top: .875rem; }
.split > div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
.split .k { font-size: .75rem; color: var(--muted); }
.split .v { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Approval card ---------- */
.approval { padding: 1.375rem; }
.approval-head { display: flex; align-items: center; gap: 1rem; }
.approval-head .grow { flex: 1; min-width: 0; }
.dl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; padding: 1rem 1.125rem; border-radius: var(--r); background: var(--sunken); }
.dl dt { font-size: .75rem; color: var(--muted); }
.dl dd { margin: .125rem 0 0; font-size: .875rem; font-weight: 600; color: var(--ink); }
.approval-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ---------- Door code ---------- */
.code { display: flex; gap: .5rem; }
.code span { display: grid; place-items: center; width: 44px; height: 52px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font: 600 1.375rem var(--mono); color: var(--ink); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .375rem; }
.field label, fieldset legend { font-size: .8125rem; font-weight: 600; color: var(--ink); }
.hint { font-size: .8125rem; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: .625rem .875rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(28, 25, 23, .08); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.choice { display: inline-flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .875rem; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; font-size: .875rem; font-weight: 500; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--sunken); }
.choice input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }

/* ---------- Accordion ---------- */
details.acc > summary { list-style: none; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc[open] > summary .chev { transform: rotate(90deg); }
details.acc[open] > summary { border-bottom: 1px solid var(--line); }
.acc-body { padding: 1.25rem 1.375rem 1.375rem; }

/* ---------- Tabs / segmented ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line); }
.seg button, .seg [role="tab"] { height: 32px; padding: 0 .875rem; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .8125rem; font-weight: 600; cursor: pointer; }
.seg [aria-selected="true"], .seg [aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 25, 23, .1); }
.tab-panel[hidden] { display: none; }

/* ---------- Table ---------- */
.table th, .table td { padding: .875rem 1.375rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .875rem; }
.table th { font-size: .75rem; font-weight: 500; color: var(--muted); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table td.r { font-weight: 600; color: var(--ink); }

/* ---------- Stats strip ---------- */
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.strip > div { padding: 1.375rem; }
.strip > div + div { border-left: 1px solid var(--line); }
.strip .k { font-size: .8125rem; color: var(--muted); }
.strip .v { margin-top: .25rem; font-size: 1.625rem; font-weight: 650; letter-spacing: -.025em; color: var(--ink); font-variant-numeric: tabular-nums; }
.strip .s { margin-top: .25rem; font-size: .8125rem; color: var(--muted); }

/* ---------- Calendar ---------- */
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: .625rem .75rem; font-size: .75rem; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal-week { grid-template-rows: 34px 30px 30px 12px; border-bottom: 1px solid var(--line); }
.cal-week:last-child { border-bottom: 0; }
.cal-day { grid-row: 1 / -1; padding: .5rem .75rem; border-right: 1px solid var(--line); font-size: .8125rem; font-weight: 500; color: var(--text); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.today span { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -3px 0 0 -5px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; }
.ev { z-index: 1; margin: 2px 4px; padding: 0 .625rem; border: 0; border-radius: 6px; font-size: .75rem; font-weight: 600; line-height: 26px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: var(--ink); background: var(--sunken); box-shadow: inset 3px 0 0 var(--faint); }
.ev.airbnb { background: #fdf0f0; box-shadow: inset 3px 0 0 var(--airbnb); }
.ev.booking { background: #eef3fe; box-shadow: inset 3px 0 0 var(--booking); }
.ev.direct { background: #edf9f2; box-shadow: inset 3px 0 0 var(--direct); }
.ev.pending { background: repeating-linear-gradient(-45deg, #fef6e7 0 6px, #fdeccc 6px 12px); box-shadow: inset 3px 0 0 var(--pending); color: #7c2d12; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8125rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .375rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- People ---------- */
.perm-list { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .5rem; }
.perm { display: inline-flex; align-items: center; gap: .25rem; height: 24px; padding: 0 .5rem; border-radius: 6px; font-size: .75rem; font-weight: 500; background: var(--sunken); color: var(--text); }
.perm .icon { width: 13px; height: 13px; }
.perm.no { color: var(--muted); background: transparent; border: 1px dashed var(--line-strong); }

/* ---------- QR ---------- */
.qr { width: 132px; height: 132px; flex: none; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.qr svg { width: 100%; height: 100%; }

/* ---------- Preview switch (prototype only) ---------- */
.preview { position: fixed; left: 1rem; bottom: 1rem; z-index: 60; display: flex; align-items: center; gap: .625rem; padding: .375rem .375rem .375rem .875rem; border-radius: 12px; background: var(--ink); color: #e7e5e4; font-size: .75rem; font-weight: 500; box-shadow: var(--shadow-pop); }
.preview .seg { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); }
.preview .seg button { color: #d6d3d1; height: 28px; }
.preview .seg [aria-pressed="true"] { background: #fff; color: var(--ink); }
.preview :focus-visible { outline-color: #fff; }

/* ---------- Mobile tab bar ---------- */
.tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .aside > * + * { margin-top: 0 !important; }
}
@media (max-width: 860px) {
  .mainnav { display: none; }
  .header-in { gap: 1rem; padding: 0 1rem; }
  .page { padding: 1.5rem 1rem 8rem; }
  h1 { font-size: 1.5rem; }
  .res-grid, .aside { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip { grid-template-columns: minmax(0, 1fr); }
  .strip > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .cal-day { padding: .375rem; }
  .ev { font-size: 0; padding: 0; }
  .tabbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: flex; padding: .375rem .5rem calc(.375rem + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: .375rem .25rem; color: var(--muted); font-size: .6875rem; font-weight: 500; text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
  .tabbar a[hidden] { display: none; }
  .tabbar .icon { width: 22px; height: 22px; }
  .preview { bottom: calc(4.75rem + env(safe-area-inset-bottom)); left: auto; right: .75rem; padding: .25rem; white-space: nowrap; }
  .preview > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media (forced-colors: active) { .btn, .panel, .res, .filter, .tag, .perm { border: 1px solid CanvasText; } }

/* ==========================================================================
   Shared components for the other mockups (office, staff, platform, site, form)
   ========================================================================== */
.strip.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.meter { height: 6px; margin-top: .625rem; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.meter.seg3 { display: flex; gap: 2px; background: transparent; }
.meter.seg3 > span { border-radius: 2px; }
.ctx-switch { display: flex; align-items: center; gap: .5rem; height: 40px; padding: 0 .75rem 0 .25rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); position: relative; }
.ctx-switch img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; }
.ctx-switch select { appearance: none; border: 0; background: transparent; padding-right: 1.25rem; font-weight: 600; font-size: .875rem; color: var(--ink); cursor: pointer; }
.ctx-switch select:focus { outline: none; }
.ctx-switch:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.ctx-switch .icon { position: absolute; right: .625rem; width: 14px; height: 14px; color: var(--muted); pointer-events: none; }
.env-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 .5rem; border-radius: 6px; background: var(--ink); color: #fff; font-size: .6875rem; font-weight: 600; letter-spacing: .02em; }
.table-wrap { overflow-x: auto; }
.table td .sub { display: block; font-size: .8125rem; color: var(--muted); }
.table td.name { font-weight: 600; color: var(--ink); }
.table tbody tr:hover { background: #fcfcfb; }
.chart.lg { height: 160px; }
.mix li { padding: .875rem 0; }
.mix li + li { border-top: 1px solid var(--line); }
.mix .row { display: flex; justify-content: space-between; font-size: .875rem; }
.mix .row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Staff mobile app ---------- */
.app-shell { max-width: 480px; min-height: 100vh; margin: 0 auto; background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
.app-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem; padding: .875rem 1rem; background: rgba(255, 255, 255, .95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.app-top h1 { font-size: 1rem; letter-spacing: -.01em; }
.app-top p { font-size: .75rem; color: var(--muted); }
.app-main { padding: 1rem 1rem 6.5rem; }
.scanner { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--r-lg); background: #1c1917; }
.scanner::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .08), transparent 60%); }
.scan-frame { position: absolute; inset: 18%; }
.scan-frame i { position: absolute; width: 34px; height: 34px; border: 3px solid #fff; }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.scan-line { position: absolute; left: 6%; right: 6%; height: 2px; top: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 0 10px rgba(255, 255, 255, .6); animation: scan 2.6s ease-in-out infinite; }
@keyframes scan { 0%, 100% { top: 8%; } 50% { top: 90%; } }
.scan-hint { position: absolute; left: 0; right: 0; bottom: 1rem; text-align: center; color: #e7e5e4; font-size: .8125rem; }
.result { border-left: 4px solid var(--success); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin-top: 1rem; font-size: .875rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink); }
.app-tabbar { position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; padding: .375rem .5rem calc(.375rem + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.app-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: .375rem; color: var(--muted); font-size: .6875rem; font-weight: 500; text-decoration: none; }
.app-tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.app-tabbar .icon { width: 22px; height: 22px; }

/* ---------- Public website ---------- */
.site .header-in { gap: 2.5rem; }
.site-links { display: flex; gap: 1.75rem; }
.site-links a { color: var(--muted); font-weight: 500; text-decoration: none; font-size: .9375rem; }
.site-links a:hover { color: var(--ink); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.s-hero { padding: 4.5rem 0 3.5rem; }
.s-hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 3.5rem; align-items: center; }
.kicker { display: inline-flex; align-items: center; gap: .5rem; height: 30px; padding: 0 .75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .8125rem; font-weight: 500; color: var(--text); }
.s-hero h1 { margin-top: 1.25rem; font-size: clamp(2.25rem, 4.6vw, 3.5rem); line-height: 1.05; letter-spacing: -.04em; }
.lead { margin-top: 1.25rem; font-size: 1.125rem; line-height: 1.6; color: var(--muted); max-width: 32rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn-lg { height: 48px; padding: 0 1.375rem; font-size: .9375rem; border-radius: 12px; }
.proof { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2rem; font-size: .875rem; color: var(--muted); }
.proof span { display: inline-flex; align-items: center; gap: .375rem; }
.hero-media { position: relative; }
.hero-media > img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; border-radius: 20px; }
.float-card { position: absolute; width: 280px; padding: 1rem 1.125rem; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-pop); }
.float-card.a { left: -2rem; bottom: 2rem; }
.float-card.b { right: -1rem; top: 1.5rem; width: 230px; }
.logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 3.5rem; padding: 2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 600; letter-spacing: -.01em; }
.s-sec { padding: 5rem 0; }
.s-title { max-width: 40rem; margin-bottom: 3rem; }
.s-title.center { margin-left: auto; margin-right: auto; text-align: center; }
.s-title h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); letter-spacing: -.03em; line-height: 1.15; }
.s-title p { margin-top: .875rem; font-size: 1.0625rem; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.feature { padding: 1.75rem; }
.feature h3 { margin-top: 1.25rem; font-size: 1.125rem; letter-spacing: -.01em; }
.feature p { margin-top: .5rem; color: var(--muted); font-size: .9375rem; }
.ticks { margin-top: 1.25rem; display: grid; gap: .625rem; font-size: .9375rem; }
.ticks li { display: flex; gap: .625rem; align-items: flex-start; }
.ticks .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--ink); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: s; }
.steps li { counter-increment: s; padding: 1.5rem; border-top: 2px solid var(--ink); }
.steps li::before { content: "0" counter(s); display: block; font: 600 .8125rem var(--mono); color: var(--muted); margin-bottom: 1rem; }
.steps h3 { font-size: 1rem; }
.steps p { margin-top: .375rem; color: var(--muted); font-size: .9375rem; }
.pricing { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 1.75rem; }
.plan.featured { border: 1.5px solid var(--ink); box-shadow: var(--shadow-pop); }
.price { margin-top: 1rem; font-size: 2.5rem; font-weight: 650; letter-spacing: -.04em; color: var(--ink); }
.price small { font-size: .9375rem; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.plan .ticks { margin-bottom: 2rem; }
.plan .btn { margin-top: auto; }
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; cursor: pointer; list-style: none; font-weight: 600; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--muted); transition: transform .2s; }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details p { padding-bottom: 1.25rem; color: var(--muted); }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding: 3rem; border-radius: 20px; background: var(--ink); color: #d6d3d1; }
.cta-band h2 { color: #fff; font-size: 1.875rem; letter-spacing: -.03em; }
.cta-band p { margin-top: .5rem; }
.cta-band .btn { background: #fff; border-color: #fff; color: var(--ink); }
.cta-band :focus-visible { outline-color: #fff; }
.footer { margin-top: 5rem; padding: 3rem 0 2rem; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2rem; }
.footer h3 { font-size: .8125rem; font-weight: 600; color: var(--ink); }
.footer ul { margin-top: .875rem; display: grid; gap: .5rem; }
.footer a { color: var(--muted); text-decoration: none; font-size: .875rem; }
.footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Visitor form ---------- */
.form-page { max-width: 680px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.form-cover { position: relative; overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; aspect-ratio: 21 / 8; background: var(--sunken); }
.form-cover img { width: 100%; height: 100%; object-fit: cover; }
.form-head { padding: 1.5rem 1.5rem 1.25rem; }
.form-head h1 { font-size: 1.5rem; }
.host-line { display: flex; align-items: center; gap: .625rem; margin-top: 1rem; font-size: .875rem; color: var(--muted); }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; padding: 0 1.5rem 1.5rem; }
.stepper li { font-size: .75rem; font-weight: 500; color: var(--muted); }
.stepper li::before { content: ""; display: block; height: 3px; margin-bottom: .5rem; border-radius: 3px; background: var(--line); }
.stepper li[aria-current="step"] { color: var(--ink); font-weight: 600; }
.stepper li[aria-current="step"]::before { background: var(--ink); }
.stepper a { color: inherit; text-decoration: none; }
.f-sec { padding: 1.75rem 1.5rem; border-top: 1px solid var(--line); }
.f-sec-head { display: flex; gap: .875rem; align-items: baseline; margin-bottom: 1.25rem; }
.f-sec-head .n { font: 600 .8125rem var(--mono); color: var(--muted); }
.f-sec-head p { font-size: .875rem; color: var(--muted); margin-top: .125rem; }
.req { color: var(--danger); }
.check { display: flex; gap: .75rem; align-items: flex-start; font-size: .875rem; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.sig-pad { display: block; width: 100%; height: 170px; margin-top: .5rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); touch-action: none; cursor: crosshair; }
.rules { margin-top: .75rem; padding: 1rem 1.125rem; border-radius: var(--r); background: var(--sunken); font-size: .875rem; color: var(--text); }
.rules li { display: flex; gap: .5rem; padding: .25rem 0; }
.rules .icon { width: 15px; height: 15px; margin-top: 3px; color: var(--muted); }

/* ---------- Mockup index ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.hub-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem 1.375rem; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.hub-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-pop); }
.hub-card p { font-size: .875rem; color: var(--muted); margin-top: .25rem; }

@media (max-width: 1080px) {
  .strip.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip.cols-4 > div:nth-child(3) { border-left: 0; }
  .strip.cols-4 > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .s-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .float-card.a { left: 1rem; }
  .float-card.b { right: 1rem; }
  .features, .pricing { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .site-links, .site .hide-sm { display: none; }
  .strip.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .strip.cols-4 > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .steps, .hub-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .float-card { display: none; }
  .cta-band { padding: 2rem; }
  .s-hero { padding-top: 2.5rem; }
}
.layout.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .layout.two { grid-template-columns: minmax(0, 1fr); } }
