/* Access Desk · AGB Tech Consulting — iOS-style design system, light and dark */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --fill: rgba(118, 118, 128, .12);
  --fill-strong: rgba(118, 118, 128, .2);
  --pressed: rgba(0, 0, 0, .05);
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #8e8e93;
  --placeholder: #737378;
  --sep: rgba(60, 60, 67, .16);
  --sep-strong: rgba(60, 60, 67, .29);
  --accent: #5856d6;
  --accent-solid: #5856d6;
  --accent-hover: #4b49c4;
  --accent-tint: rgba(88, 86, 214, .12);
  --selected: rgba(88, 86, 214, .12);
  --green: #1b6e30;
  --green-tint: rgba(52, 199, 89, .16);
  --orange: #a05a00;
  --orange-tint: rgba(255, 149, 0, .16);
  --red: #d70015;
  --red-tint: rgba(255, 59, 48, .1);
  --nav: rgba(242, 242, 247, .8);
  --sheet-bg: #f2f2f7;
  --switch-off: #e9e9eb;
  --segment-on: #ffffff;
  --toast: rgba(29, 29, 31, .92);
  --focus: rgba(88, 86, 214, .5);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-sheet: 0 24px 80px rgba(0, 0, 0, .22);
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --hair: 1px;
}
@media (min-resolution: 2dppx) { :root { --hair: .5px; --sep: rgba(60, 60, 67, .29); } }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-raised: #2c2c2e;
    --fill: rgba(118, 118, 128, .24);
    --fill-strong: rgba(118, 118, 128, .36);
    --pressed: rgba(255, 255, 255, .07);
    --label: #f5f5f7;
    --label-2: #aeaeb2;
    --label-3: #8e8e93;
    --placeholder: #8e8e93;
    --sep: rgba(84, 84, 88, .55);
    --sep-strong: rgba(84, 84, 88, .75);
    --accent: #8e8cff;
    --accent-solid: #5e5ce6;
    --accent-hover: #6d6bf0;
    --accent-tint: rgba(125, 122, 255, .18);
    --selected: rgba(125, 122, 255, .2);
    --green: #30d158;
    --green-tint: rgba(48, 209, 88, .18);
    --orange: #ff9f0a;
    --orange-tint: rgba(255, 159, 10, .18);
    --red: #ff6961;
    --red-tint: rgba(255, 69, 58, .16);
    --nav: rgba(0, 0, 0, .72);
    --sheet-bg: #1c1c1e;
    --switch-off: #39393d;
    --segment-on: #636366;
    --toast: rgba(58, 58, 60, .94);
    --focus: rgba(142, 140, 255, .6);
    --shadow-card: none;
  }
  @media (min-resolution: 2dppx) { :root { --sep: rgba(84, 84, 88, .75); } }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
/* iPhone and iPad: follow the system text size (Dynamic Type). */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) { html { font: -apple-system-body; } }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--label);
  font-family: var(--font); font-size: 1rem; line-height: 1.4; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a, button, label, input, textarea { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 10px; }
h1:focus-visible, h1:focus { outline: none; }
::selection { background: var(--accent-tint); }
.visually-hidden, .clipboard-proxy { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.clipboard-proxy { position: fixed !important; top: 0; left: -9999px; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-size: .94em; letter-spacing: 0; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spinner { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; animation: spin .8s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.boot img { width: 56px; height: 56px; border-radius: 13px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; transform: scale(.96); } }
.noscript { max-width: 420px; margin: 20vh auto; padding: 0 24px; text-align: center; color: var(--label-2); }

/* ---------- Motion ---------- */

.enter { animation: enter .42s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Navigation bar ---------- */

.nav {
  position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top);
  background: var(--nav); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--hair); background: var(--sep-strong); opacity: 0; transition: opacity .2s; }
.nav.scrolled::after, .nav.show-title::after { opacity: 1; }
.nav-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); max-width: 1120px; margin: 0 auto; }
.nav-side { display: flex; align-items: center; min-width: 0; }
.nav-left { justify-self: start; }
.nav-right { justify-self: end; gap: 2px; }
.nav-title { font-weight: 600; font-size: 1.0625rem; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s var(--ease); }
.nav.show-title .nav-title { opacity: 1; transform: none; }
.navbtn { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--accent); font-size: 1.0625rem; white-space: nowrap; }
.navbtn .ic { width: 22px; height: 22px; stroke-width: 2; }
.navbtn:active { opacity: .5; }
.navbtn-icon { width: 44px; justify-content: center; padding: 0; }
.navbtn-icon .ic { width: 24px; height: 24px; }
.navbtn-strong { font-weight: 600; }

.brand { display: inline-flex; align-items: center; gap: 9px; padding: 0 8px; min-height: 44px; color: var(--label); text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.wordmark { font-size: .8125rem; letter-spacing: .08em; white-space: nowrap; font-weight: 400; color: var(--label); }
.wordmark b { font-weight: 700; }
.brand-name { font-weight: 600; font-size: 1.0625rem; letter-spacing: -.01em; }

.secure-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; margin: 6px 8px; padding: 0 11px 0 9px; border: 0; border-radius: 999px; background: var(--green-tint); color: var(--green); font-size: .8125rem; font-weight: 600; }
.secure-pill .ic { width: 15px; height: 15px; stroke-width: 2.1; }
.secure-pill:active { opacity: .6; }

/* ---------- Page layouts ---------- */

.screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page { width: 100%; margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); flex: 1; }
.page-narrow { max-width: 560px; }
@media (min-width: 700px) { .page { padding-top: 40px; padding-bottom: 48px; } }

.title { font-family: var(--display); font-size: 1.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -.022em; text-wrap: balance; }
.large-title { font-family: var(--display); font-size: 2.125rem; line-height: 1.12; font-weight: 700; letter-spacing: -.024em; text-wrap: balance; overflow-wrap: anywhere; }
.lead { margin-top: 8px; color: var(--label-2); font-size: 1rem; line-height: 1.42; text-wrap: pretty; }
.eyebrow { margin-bottom: 6px; color: var(--accent); font-size: .8125rem; font-weight: 600; letter-spacing: .01em; overflow-wrap: anywhere; }
.fine { color: var(--label-2); font-size: .8125rem; line-height: 1.4; }

.hero { text-align: center; padding: 18px 8px 28px; }
.hero .lead { max-width: 30em; margin-left: auto; margin-right: auto; }
.seal { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 22px; display: grid; place-items: center; color: #fff; }
.seal .ic { width: 40px; height: 40px; stroke-width: 1.8; }
.seal-indigo { background: linear-gradient(160deg, #8a88ff 0%, #5856d6 55%, #4644c2 100%); box-shadow: 0 12px 32px rgba(88, 86, 214, .32), inset 0 1px 0 rgba(255, 255, 255, .3); }
.seal-gray { background: linear-gradient(160deg, #a1a1a6, #6e6e73); box-shadow: 0 10px 26px rgba(0, 0, 0, .14); }
.seal-red { background: linear-gradient(160deg, #ff6b62, #d70015); box-shadow: 0 10px 26px rgba(215, 0, 21, .25); }
.seal-glow { position: relative; }
@keyframes halo { 0% { opacity: .9; transform: scale(.92); } 70%, 100% { opacity: 0; transform: scale(1.12); } }

.step-head { display: flex; gap: 16px; align-items: flex-start; padding: 8px 4px 24px; }
.step-head .title { font-size: 1.625rem; }
.progress { display: flex; gap: 6px; margin: 4px 4px 22px; }
.progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--fill-strong); transition: background .3s; }
.progress i.done { background: var(--accent-solid); opacity: .55; }
.progress i.now { background: var(--accent-solid); }

.status-page { text-align: center; padding-top: 32px; }
.status-page .lead { max-width: 28em; margin: 10px auto 26px; }
.status-page .group { text-align: left; }
.stack-actions { display: grid; gap: 12px; margin-top: 8px; }
.quiet-link { justify-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--label-2); font-size: .875rem; text-decoration: none; }
.quiet-link:hover { color: var(--accent); }
.loading { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 50vh; color: var(--label-2); }
.loading .spinner { width: 28px; height: 28px; }

.foot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); color: var(--label-2); font-size: .75rem; }
.foot .ic { width: 13px; height: 13px; stroke-width: 2; }
.foot .wordmark { color: inherit; font-size: .6875rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px;
  border: 0; border-radius: 999px; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: transform .18s var(--ease), background-color .2s, opacity .2s;
}
.btn .ic { width: 20px; height: 20px; stroke-width: 2; }
.btn:active { transform: scale(.97); }
.btn[disabled] { cursor: default; }
.btn[aria-busy="true"] { cursor: progress; opacity: .92; }
.btn-primary { background: var(--accent-solid); color: #fff; box-shadow: 0 1px 2px rgba(88, 86, 214, .25); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-tinted { background: var(--accent-tint); color: var(--accent); }
.btn-tinted:hover { background: var(--selected); background: color-mix(in srgb, var(--accent-tint) 70%, var(--accent) 12%); }
.btn-gray { background: var(--fill); color: var(--label); }
.btn-gray:hover { background: var(--fill-strong); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: .9375rem; gap: 6px; }
.btn-small .ic { width: 17px; height: 17px; }
.btn-block { display: flex; width: 100%; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--accent); font-size: 1rem; }
.link-btn .ic { width: 18px; height: 18px; stroke-width: 2.1; }
.link-btn.center { display: flex; margin: 4px auto 0; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--accent); text-decoration: none; }
.icon-btn:hover { background: var(--accent-tint); }
.icon-btn:active { opacity: .55; }
.icon-btn .ic { width: 21px; height: 21px; }

.dock { margin-top: 28px; }
.dock-note { margin: 12px 8px 0; text-align: center; color: var(--label-2); font-size: .8125rem; line-height: 1.4; text-wrap: balance; }
@media (max-width: 699px) {
  .dock-sticky { position: sticky; bottom: 0; z-index: 5; margin: 20px calc(-1 * max(16px, env(safe-area-inset-left))) 0; padding: 18px max(16px, env(safe-area-inset-left)) calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 72%, transparent); background: linear-gradient(to top, var(--bg) 72%, color-mix(in srgb, var(--bg) 0%, transparent)); }
}

/* ---------- Grouped lists (iOS inset grouped) ---------- */

.group { margin: 0 0 30px; }
.group-header { margin: 0 16px 7px; color: var(--label-2); font-size: .8125rem; font-weight: 400; text-transform: uppercase; letter-spacing: .03em; }
.group-body { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.group-footer { margin: 8px 16px 0; color: var(--label-2); font-size: .8125rem; line-height: 1.4; text-wrap: pretty; }
.group-tight { margin-bottom: 24px; }

.row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 16px; border: 0; background: var(--surface); color: var(--label); text-align: left; font-size: 1rem; }
.row:not(:last-child)::after { content: ""; position: absolute; z-index: 1; right: 0; bottom: 0; left: var(--inset, 16px); height: var(--hair); background: var(--sep); pointer-events: none; }
.row:has(> .tile:first-child) { --inset: 58px; }
.row-button { cursor: pointer; transition: background-color .15s; }
.row-button:hover { background: var(--pressed); background: color-mix(in srgb, var(--surface) 94%, var(--label) 6%); }
.row-button:active { background: var(--fill); background: color-mix(in srgb, var(--surface) 88%, var(--label) 12%); }
.row-button:focus-visible { outline-offset: -3px; border-radius: 0; }
.row-text { flex: 1; min-width: 0; }
.row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { margin-top: 2px; color: var(--label-2); font-size: .875rem; line-height: 1.35; }
.info-row { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.info-row .row-title { white-space: normal; font-weight: 500; }
.info-row .tile { margin-top: 1px; }
.info-row:not(:has(.row-sub)) { align-items: center; }
.info-row:not(:has(.row-sub)) .tile { margin-top: 0; }
.row-icon { color: var(--accent); width: 21px; height: 21px; }
.chev { width: 13px; height: 13px; color: var(--label-3); stroke-width: 2.6; }
.action-row .row-title { color: var(--accent); }
.action-row.destructive .row-title, .action-row.destructive .row-icon { color: var(--red); }
.kv { justify-content: space-between; }
.kv-k { color: var(--label); }
.kv-v { color: var(--label-2); text-align: right; }

.tile { width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center; border-radius: 7.5px; color: #fff; }
.tile .ic { width: 19px; height: 19px; stroke-width: 2; }
.tile-lg { width: 52px; height: 52px; border-radius: 13px; }
.tile-lg .ic { width: 30px; height: 30px; stroke-width: 1.9; }
.tile { background: var(--accent-tint); color: var(--accent); }
.tone-red { background: var(--red-tint); color: var(--red); }

/* ---------- Form fields inside groups ---------- */

.field { position: relative; display: block; padding: 9px 16px 10px; background: var(--surface); }
.field:not(:last-child)::after { content: ""; position: absolute; z-index: 2; right: 0; bottom: 0; left: 16px; height: var(--hair); background: var(--sep); pointer-events: none; }
.field-label { display: block; margin-bottom: 1px; color: var(--label-2); font-size: .8125rem; font-weight: 500; transition: color .15s; }
.field input, .field textarea {
  display: block; width: 100%; min-height: 30px; margin: 0; padding: 2px 0; border: 0; border-radius: 0; outline: 0;
  background: transparent; color: var(--label); font-size: 1rem; -webkit-appearance: none; appearance: none;
}
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); opacity: 1; }
.field textarea { resize: vertical; min-height: 76px; line-height: 1.4; }
.field:not(.field-control):focus-within { box-shadow: inset 0 0 0 2px var(--focus); z-index: 1; }
/* Round the focus ring with the group's corners, so it has an even width all the way round. */
.group-body > .field:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.group-body > .field:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.field:not(.field-control):focus-within .field-label { color: var(--accent); }
.field.invalid .field-label { color: var(--red); }
.field.invalid { box-shadow: inset 0 0 0 2px var(--red); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--red) 55%, transparent); }
.field-secret input { padding-right: 44px; }
.field-secret input[type="password"]:not(:placeholder-shown) { letter-spacing: .08em; }
.field .reveal { position: absolute; right: 4px; bottom: 3px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--label-3); }
.field .reveal:hover { color: var(--accent); }
.field .reveal .ic { width: 21px; height: 21px; }
.field.nested { padding-left: 58px; }
.field.nested::after { left: 58px; }
.field-control { padding-top: 12px; padding-bottom: 12px; }
.field-control .field-label { margin-bottom: 8px; }
.form-error { margin: -14px 16px 18px; color: var(--red); font-size: .875rem; font-weight: 500; line-height: 1.35; }
.form-error:empty { display: none; }
.note-group .field { padding-top: 12px; }
.client-form > .link-btn { margin: -18px 0 8px; padding-left: 16px; }

.segmented { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; border-radius: 10px; background: var(--fill); }
.segment { position: relative; display: grid; place-items: center; min-height: 34px; padding: 4px 8px; border-radius: 8px; color: var(--label); font-size: .875rem; font-weight: 500; text-align: center; cursor: pointer; transition: background-color .2s, box-shadow .2s; }
.segment input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segment:has(input:checked) { background: var(--segment-on); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }
.segment:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 15px; border: 1px solid var(--sep-strong); border-radius: 999px; background: transparent; color: var(--label); font-size: .9375rem; transition: background-color .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { border-color: transparent; background: var(--accent-solid); color: #fff; font-weight: 600; }

.check-row { cursor: pointer; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-row .row-text { flex: 1; display: grid; }
.check-row .row-sub { font-size: .8125rem; }

.check { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--label-3); border-radius: 50%; color: transparent; transition: background-color .15s, border-color .15s; }
.check .ic { width: 15px; height: 15px; stroke-width: 3; }
.check-row:has(input:checked) .check { border-color: var(--accent-solid); background: var(--accent-solid); color: #fff; }
.check-row:has(input:focus-visible) { box-shadow: inset 0 0 0 3px var(--focus); }

.switch { position: relative; width: 51px; height: 31px; flex: none; padding: 0; border: 0; border-radius: 999px; background: var(--switch-off); transition: background-color .25s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); transition: transform .3s var(--ease); }
.switch[aria-checked="true"] { background: #34c759; }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* ---------- Unlock ---------- */

.screen-unlock { justify-content: center; }
.unlock { display: flex; flex-direction: column; justify-content: center; text-align: center; padding-top: max(40px, 8vh); max-width: 420px; }
.app-mark { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 17px; box-shadow: 0 12px 30px rgba(88, 86, 214, .3); }
.unlock .lead { margin: 8px auto 28px; max-width: 22em; }
.unlock .group { text-align: left; margin-bottom: 18px; }
.unlock .form-error { margin: 14px 8px 0; text-align: center; }
.lock-reason { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin: -10px auto 22px; padding: 6px 12px; border-radius: 999px; background: var(--fill); color: var(--label-2); font-size: .8125rem; font-weight: 500; }
.lock-reason .ic { width: 14px; height: 14px; stroke-width: 2.1; }
.passkey-block { display: grid; gap: 4px; }

/* ---------- Owner workspace ---------- */

.topbar { display: none; }
.pane-nav .nav-inner { max-width: none; }
.pane-body { padding: 0 max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); }
.pane-head { padding: 4px max(20px, env(safe-area-inset-left)) 10px; }
.search { position: relative; display: flex; align-items: center; margin: 0 max(16px, env(safe-area-inset-right)) 18px max(16px, env(safe-area-inset-left)); }
.search .ic { position: absolute; left: 10px; width: 17px; height: 17px; color: var(--label-2); stroke-width: 2.2; pointer-events: none; }
.search-input { width: 100%; height: 38px; padding: 0 12px 0 34px; border: 0; border-radius: 11px; background: var(--fill); color: var(--label); font-size: 1rem; -webkit-appearance: none; appearance: none; }
.search-input::placeholder { color: var(--label-2); }
.search-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.workspace[data-view="list"] .pane-detail { display: none; }
.workspace[data-view="detail"] .pane-list { display: none; }

.req { min-height: 66px; padding-top: 11px; padding-bottom: 11px; }
.req .tile { align-self: flex-start; margin-top: 3px; }
.row-line { display: flex; align-items: baseline; gap: 8px; }
.row-line .row-title { flex: 1; font-weight: 600; }
.row-time { flex: none; color: var(--label-2); font-size: .8125rem; }
.req .row-sub { display: flex; min-width: 0; white-space: nowrap; }
.row-services { margin-left: .3em; overflow: hidden; text-overflow: ellipsis; }
.status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; flex: none; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-ready { color: var(--green); }
.status-wait { color: var(--orange); }
.req.selected { background: var(--selected); }
.req.selected .chev { color: var(--accent); }

.offer { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; padding: 12px 8px 12px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); }
.offer-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.offer-text strong { font-weight: 600; font-size: .9375rem; }
.offer-text span { color: var(--label-2); font-size: .8125rem; line-height: 1.3; }
.offer-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--label-3); }
.offer-close .ic { width: 16px; height: 16px; stroke-width: 2.4; }

.empty, .placeholder { display: grid; justify-items: center; gap: 8px; padding: 48px 20px 40px; text-align: center; }
.empty p, .placeholder p { max-width: 24em; color: var(--label-2); font-size: .9375rem; text-wrap: balance; }
.empty h2, .placeholder h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.015em; }
.empty .btn, .placeholder .btn { margin-top: 12px; }
.empty-art { width: 64px; height: 64px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 18px; background: var(--fill); color: var(--label-2); }
.empty-art .ic { width: 32px; height: 32px; stroke-width: 1.6; }
.empty-search { padding: 28px 20px; }
.list-loading { display: grid; place-items: center; min-height: 160px; color: var(--label-2); }
.list-loading .spinner { width: 26px; height: 26px; }
.security-group { margin-top: 8px; }

.detail { max-width: 680px; margin: 0 auto; }
.detail-head { display: flex; flex-direction: column; gap: 14px; padding: 6px 4px 26px; }
.detail-sub { margin-top: 6px; color: var(--label-2); }
.status-line { margin-top: 10px; color: var(--label-2); font-size: .875rem; }
.status-line .status { font-weight: 600; }

.link-row { padding: 6px; }
.link-box { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--fill); color: var(--label); text-align: left; cursor: copy; }
.link-box .ic { margin-top: 1px; width: 18px; height: 18px; color: var(--label-2); }
.link-text { font-family: var(--mono); font-size: .8125rem; line-height: 1.45; word-break: break-all; color: var(--label); }
.link-box:hover { background: var(--fill-strong); }

.item-group .item-head { min-height: 52px; }
.item-head .row-title { font-weight: 600; font-size: 1.0625rem; }
.value-row { align-items: center; padding-top: 9px; padding-bottom: 9px; padding-right: 6px; }
.value-label { color: var(--label-2); font-size: .8125rem; }
.value { margin-top: 2px; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.value.multiline { white-space: pre-wrap; }
.secret-value { font-family: var(--mono); letter-spacing: .12em; }
.secret-value.revealed { letter-spacing: .02em; }
.ch-num { color: #0a63d6; }
.ch-sym { color: #c13515; }
.ch-space { color: var(--label-3); }
@media (prefers-color-scheme: dark) { .ch-num { color: #64b5ff; } .ch-sym { color: #ff8a65; } }
.value-actions { display: flex; flex: none; align-items: center; }

/* ---------- Sheets and alerts ---------- */

dialog { max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--label); overflow: visible; }
dialog::backdrop { background: rgba(0, 0, 0, .38); animation: fade .3s ease both; }
dialog.closing::backdrop { animation: fade-out .18s ease both; }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.sheet { position: fixed; inset: auto 0 0 0; width: 100%; }
.sheet-card { display: flex; flex-direction: column; width: 100%; max-height: calc(100dvh - max(24px, env(safe-area-inset-top))); border-radius: 14px 14px 0 0; background: var(--sheet-bg); box-shadow: var(--shadow-sheet); animation: sheet-up .5s var(--ease) both; overflow: hidden; }
.sheet.closing .sheet-card { animation: sheet-down .2s ease-in both; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
.sheet-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 56px; padding: 0 8px; flex: none; }
.sheet-nav h2 { font-size: 1.0625rem; font-weight: 600; text-align: center; }
.sheet-nav > :last-child { justify-self: end; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.sheet-body .form-error { margin-top: -18px; }
.sheet-actions { margin-top: 8px; }
.sheet-compact .sheet-body { padding-top: 4px; }
.sheet-compact .info-row .row-title { font-weight: 600; }
.ready { display: grid; gap: 16px; padding-top: 4px; }
.ready .lead { margin: 0 auto; max-width: 22em; color: var(--label); }
.ready-actions { display: grid; gap: 10px; }

.alert { position: fixed; inset: auto 0 0 0; width: 100%; padding: 0 8px calc(8px + env(safe-area-inset-bottom)); }
.alert-card, .alert-cancel { width: 100%; border-radius: 14px; background: var(--surface-raised); background: color-mix(in srgb, var(--surface-raised) 97%, transparent); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); }
.alert .cancel-inline { display: none; }
.alert-centered .cancel-inline { display: block; }
.alert-card { overflow: hidden; animation: sheet-up .45s var(--ease) both; }
.alert-text { padding: 16px 20px 14px; text-align: center; }
.alert-text h2 { font-size: .9375rem; font-weight: 600; color: var(--label); }
.alert-text p { margin-top: 5px; color: var(--label-2); font-size: .8125rem; line-height: 1.38; }
.alert-actions { display: grid; }
.alert-btn { position: relative; min-height: 56px; border: 0; background: none; color: var(--accent); font-size: 1.1875rem; }
.alert-btn::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: var(--hair); background: var(--sep-strong); }
.alert-btn:active { background: var(--pressed); }
.alert-btn.destructive { color: var(--red); }
.alert-cancel { margin-top: 8px; font-weight: 600; animation: sheet-up .5s var(--ease) both; }
.alert-cancel::before { display: none; }
.alert.closing .alert-card, .alert.closing .alert-cancel { animation: sheet-down .2s ease-in both; }
.alert-btn:focus-visible { outline-offset: -3px; border-radius: 14px; }
.alert-centered { inset: 0; display: grid; place-content: center; width: 100%; height: 100%; padding: 24px; }
.alert-centered .alert-card { width: min(300px, calc(100vw - 48px)); animation: pop-in .3s var(--ease) both; }
.alert-centered .cancel-inline { font-weight: 600; }
.alert-actions.pair .cancel-inline { font-weight: 400; }

/* ---------- Success mark ---------- */

.success-seal { width: 84px; height: 84px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: var(--green-tint); color: var(--green); }
.success-seal.small { width: 72px; height: 72px; margin-bottom: 0; }
.success-mark { width: 60px; height: 60px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.success-ring { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .7s var(--ease) .1s forwards; }
.success-tick { stroke-width: 2.2; stroke-dasharray: 16; stroke-dashoffset: 16; animation: draw .45s var(--ease) .55s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Toast ---------- */

.toast {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; z-index: 100; display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 32px); padding: 11px 18px 11px 14px; border-radius: 999px; background: var(--toast); color: #fff;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  font-size: .9375rem; font-weight: 600; transform: translate(-50%, calc(-100% - 30px)); opacity: 0; pointer-events: none;
  transition: transform .45s var(--ease), opacity .3s;
}
.toast .ic { width: 19px; height: 19px; stroke-width: 2.2; color: #7cf09a; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Wider screens ---------- */

@media (min-width: 700px) {
  .title { font-size: 2rem; }
  .step-head .title { font-size: 1.75rem; }
  .hero { padding-top: 8px; }
  .sheet { inset: 0; display: grid; place-items: center; width: 100%; height: 100%; padding: 24px; }
  .sheet-card { width: min(540px, 100%); max-height: min(760px, calc(100dvh - 48px)); border-radius: var(--radius-lg); animation: pop-in .38s var(--ease) both; }
  .sheet.closing .sheet-card { animation: pop-out .18s ease-in both; }
  .sheet-body { padding: 8px 24px 24px; }
  @keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(8px); } }
  @keyframes pop-out { to { opacity: 0; transform: scale(.97); } }
  .alert { inset: 0; display: grid; place-content: center; width: 100%; height: 100%; padding: 24px; }
  .alert-card { width: 300px; animation: pop-in .3s var(--ease) both; }
  .alert .alert-cancel { display: none; }
  .alert .cancel-inline { display: block; }
  .alert-actions.pair { grid-template-columns: 1fr 1fr; }
  .alert-actions.pair .alert-btn + .alert-btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: var(--hair); background: var(--sep-strong); }
  .alert.closing .alert-card { animation: pop-out .15s ease-in both; }
  .alert-btn { min-height: 46px; font-size: 1.0625rem; }
  .alert-btn.destructive { font-weight: 600; }
}

@media (min-width: 900px) {
  .workspace { display: grid; grid-template-rows: auto 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
  .topbar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; padding: 0 20px 0 16px; background: var(--nav); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
  .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--hair); background: var(--sep-strong); }
  .topbar-actions { display: flex; gap: 8px; }
  .panes { display: grid; grid-template-columns: minmax(330px, 390px) 1fr; min-height: 0; }
  .pane { min-height: 0; display: flex; flex-direction: column; }
  .pane-nav { display: none; }
  .pane-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .workspace[data-view] .pane-list, .workspace[data-view] .pane-detail { display: flex; }
  .pane-list { position: relative; }
  .pane-list::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: var(--hair); background: var(--sep-strong); }
  .pane-list .pane-head { padding: 22px 20px 12px; }
  .pane-list .large-title { font-size: 1.75rem; }
  .pane-list .search { margin: 0 16px 18px; }
  .pane-list .pane-body { padding: 0 16px 28px; }
  .pane-detail .pane-body { padding: 36px 40px 48px; }
  .detail-head { flex-direction: row; align-items: flex-start; gap: 18px; padding-top: 0; }
  .detail-head .tile-lg { width: 60px; height: 60px; border-radius: 15px; }
  .detail-head .large-title { font-size: 2rem; }
  .placeholder { min-height: 60vh; align-content: center; }
}

@media (min-width: 1280px) {
  .panes { grid-template-columns: 420px 1fr; }
}

@media print {
  .nav, .topbar, .toast, .value-actions, .foot { display: none !important; }
}
