/* Reset, type, scrollbars, focus, buttons (native cursor, v4) (locked v3 effect from the landing), fields. */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { font-family: var(--font); font-weight: var(--w-reg); font-size: var(--fs-15); line-height: 1.5; color: var(--c-ink); background: var(--c-bg); -webkit-font-smoothing: antialiased; overflow-x: clip; min-height: 100dvh; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
b, strong { font-weight: var(--w-med); }
h1, h2, h3, h4 { font-weight: var(--w-reg); line-height: 1.15; letter-spacing: var(--ls-tight); text-wrap: balance; }
p { text-wrap: pretty; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--c-tint); color: var(--c-deep); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.mute { color: var(--c-ink-2); } .mute-3 { color: var(--c-ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.noselect { -webkit-user-select: none; user-select: none; }

/* Scrollbars: thin, brand tinted, never arrow buttons */
::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in oklab, var(--c-ink) 18%, transparent); border-radius: var(--r-pill); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in oklab, var(--c-brand) 60%, transparent); background-clip: padding-box; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: color-mix(in oklab, var(--c-ink) 18%, transparent) transparent; } }

/* Focus: 2 px Electric Blue ring (R-UI-11) */
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--r-8); }
.skip { position: fixed; top: var(--sp-12); left: var(--sp-12); z-index: var(--z-cursor); padding: var(--sp-12) var(--sp-16); border-radius: var(--r-12); background: var(--c-ink); color: var(--c-white); transform: translateY(-160%); }
.skip:focus-visible { transform: none; }

/* Icons: duotone sprite (24 grid). .a = 30 % layer, .s = stroke glyph */
.i { display: inline-block; vertical-align: -0.22em; width: var(--ic-20); height: var(--ic-20); flex: none; fill: currentColor; }
.i .a, symbol .a { opacity: 0.3; }
.i .s, symbol .s { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }  /* symbol: styles must match the referenced element (use shadow tree) */
.i--sm { width: var(--ic-16); height: var(--ic-16); } .i--xs { width: var(--ic-14); height: var(--ic-14); } .i--lg { width: var(--ic-24); height: var(--ic-24); } .i--xl { width: var(--ic-32); height: var(--ic-32); }
.i--spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- Buttons (v3 effect, locked by the user): rest Deep Blue, hover #1D4ED8 grows from the pointer,
   label rolls, arrow chip turns white + rotates. No lift. ---------- */
.btn {
  --bg: var(--c-ink); --fg: var(--c-white); --fill: var(--c-brand-2); --fg-h: var(--c-white); --ic-bg: var(--c-brand); --ic-fg: var(--c-white); --ic-bg-h: var(--c-white); --ic-fg-h: var(--c-brand-2);
  position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-12);
  min-height: 48px; padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-20); border-radius: var(--r-pill); background: var(--bg); color: var(--fg);
  font-size: var(--fs-15); font-weight: var(--w-med); white-space: nowrap; letter-spacing: -0.005em;
  box-shadow: none;
  transition: color 420ms var(--ease-out), transform 240ms var(--ease-out), box-shadow 420ms var(--ease-out), opacity 200ms;
}
.btn::before { content: ""; position: absolute; left: var(--mx, 50%); top: var(--my, 50%); width: 260%; aspect-ratio: 1; border-radius: 50%; background: var(--fill); transform: translate(-50%, -50%) scale(0); transition: transform 620ms var(--ease-expo); z-index: -1; }
.btn:hover::before, .btn:focus-visible::before { transform: translate(-50%, -50%) scale(1); }
.btn:hover, .btn:focus-visible { color: var(--fg-h); box-shadow: none; }
.btn:active { transform: scale(0.97); }
.btn__l { display: inline-grid; overflow: hidden; line-height: 1.3; }
.btn__l > span { grid-area: 1 / 1; transition: transform 560ms var(--ease-expo); }
.btn__l > span + span { transform: translateY(110%); }
.btn:hover .btn__l > span:first-child, .btn:focus-visible .btn__l > span:first-child { transform: translateY(-110%); }
.btn:hover .btn__l > span + span, .btn:focus-visible .btn__l > span + span { transform: none; }
.btn__i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ic-bg); color: var(--ic-fg); flex: none; transition: transform 560ms var(--ease-expo), background 420ms, color 420ms; }
.btn__i .i { width: var(--ic-14); height: var(--ic-14); }
.btn:hover .btn__i, .btn:focus-visible .btn__i { transform: rotate(45deg); background: var(--ic-bg-h); color: var(--ic-fg-h); }
.btn--plain { padding: var(--sp-4) var(--sp-22); }
.btn--line { --bg: var(--c-white); --fg: var(--c-ink); --fill: var(--c-ink); --fg-h: var(--c-white); --ic-bg: var(--c-brand); box-shadow: inset 0 0 0 1px var(--c-line-2); }
.btn--white { --bg: var(--c-white); --fg: var(--c-ink); --fill: var(--c-lav-hi); --fg-h: var(--c-ink); --ic-bg: var(--c-brand); --ic-bg-h: var(--c-ink); --ic-fg-h: var(--c-white); box-shadow: var(--sh-1); }
.btn--sm { min-height: 40px; font-size: var(--fs-14); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-16); gap: var(--sp-10); }
.btn--sm .btn__i { width: 34px; height: 34px; }
.btn--sm.btn--plain { padding: var(--sp-3) var(--sp-16); }
.btn--block { width: 100%; justify-content: space-between; }
.btn--block.btn--plain { justify-content: center; }
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"] .btn__i .i { animation: spin 0.8s linear infinite; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; box-shadow: none; }

/* Quiet buttons for toolbars, rows and secondary actions (one shape, three tones) */
.b { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8); min-height: 40px; padding: 0 var(--sp-14); border-radius: var(--r-12); font-size: var(--fs-14); font-weight: var(--w-med); white-space: nowrap; background: var(--c-white); color: var(--c-ink); box-shadow: inset 0 0 0 1px var(--c-line-2); transition: background 180ms, box-shadow 180ms, color 180ms, transform 180ms; }
.b:hover { background: var(--c-hover); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-brand) 34%, transparent); }
.b:active { transform: scale(0.98); }
.b .i { width: var(--ic-18); height: var(--ic-18); color: var(--c-brand); }
.b--sm { min-height: 34px; padding: 0 var(--sp-12); font-size: var(--fs-13); border-radius: 10px; }
.b--sm .i { width: var(--ic-16); height: var(--ic-16); }
.b--ink { background: var(--c-ink); color: var(--c-white); box-shadow: none; }
.b--ink:hover { background: var(--c-brand-2); box-shadow: none; }
.b--ink .i { color: var(--c-tint); }
.b--ghost { background: transparent; box-shadow: none; }
.b--ghost:hover { background: var(--c-bg-2); box-shadow: none; }
.b--danger { color: var(--c-err); }
.b--danger .i { color: var(--c-err); }
.b--danger:hover { background: var(--st-err-bg); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-err) 30%, transparent); }
.b--ok { color: var(--c-ok); } .b--ok .i { color: var(--c-ok); }
.b--ok:hover { background: var(--st-ok-bg); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-ok) 30%, transparent); }
.b:disabled, .b[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.b[aria-busy="true"] { pointer-events: none; opacity: 0.7; }
.ib { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--c-ink); transition: background 180ms, color 180ms; flex: none; position: relative; }
.ib:hover { background: var(--c-bg-2); }
.ib .i { width: var(--ic-20); height: var(--ic-20); }
.ib--sm { width: 32px; height: 32px; } .ib--sm .i { width: var(--ic-16); height: var(--ic-16); }
.ib--line { background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-line); }
.ib--line:hover { background: var(--c-hover); }
.tlink { color: var(--c-brand-ink); font-weight: var(--w-med); display: inline-flex; align-items: center; gap: var(--sp-4); border-radius: 6px; }
.tlink:hover { text-decoration: underline; text-underline-offset: 3px; }
.tlink .i { width: var(--ic-14); height: var(--ic-14); }

/* ---------- Fields ---------- */
.f { display: grid; gap: var(--sp-6); min-width: 0; align-content: start; }
.f__l { font-size: var(--fs-13); font-weight: var(--w-med); color: var(--c-ink-2); display: flex; justify-content: space-between; gap: var(--sp-8); }
.f__l small { font-weight: var(--w-reg); color: var(--c-ink-3); }
.f__h { font-size: var(--fs-12); color: var(--c-ink-3); }
.f__e { font-size: var(--fs-12); color: var(--c-err); display: none; align-items: center; gap: var(--sp-6); }
.f__e .i { width: var(--ic-14); height: var(--ic-14); }
.f.is-err .f__e { display: flex; }
.f.is-err .in { box-shadow: inset 0 0 0 1.5px var(--c-err); }
.in { width: 100%; min-height: 46px; padding: var(--sp-10) var(--sp-14); border: 0; border-radius: 14px; background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-line-2); font-size: var(--fs-15); transition: box-shadow 160ms; appearance: none; -webkit-appearance: none; }
.in::placeholder { color: color-mix(in oklab, var(--c-ink) 42%, var(--c-white)); }
.in:hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-ink) 26%, transparent); }
.in:focus { box-shadow: inset 0 0 0 1.5px var(--c-brand), 0 0 0 4px var(--c-brand-14); }
.in[readonly], .in:disabled { background: var(--c-bg); color: var(--c-ink-2); }
textarea.in { min-height: 112px; resize: vertical; line-height: 1.5; }
select.in { padding-right: var(--sp-40); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2310172b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.in--sm { min-height: 38px; padding: var(--sp-6) var(--sp-12); font-size: var(--fs-14); border-radius: 12px; }
.inw { position: relative; display: flex; align-items: center; }
.inw > .i { position: absolute; left: var(--sp-14); color: var(--c-ink-3); pointer-events: none; width: var(--ic-18); height: var(--ic-18); }
.inw > .in { padding-left: var(--sp-42); }
.inw__pre { position: absolute; left: var(--sp-14); color: var(--c-ink-3); font-size: var(--fs-15); pointer-events: none; }
.inw__pre + .in { padding-left: var(--sp-28); }
.inw__suf { position: absolute; right: var(--sp-8); }
.form { display: grid; gap: var(--sp-18); }
.form__row { display: grid; gap: var(--sp-16); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form__act { display: flex; flex-wrap: wrap; gap: var(--sp-10); align-items: center; justify-content: flex-end; padding-top: var(--sp-4); }

/* Checkbox / radio / switch */
.chk { display: flex; gap: var(--sp-12); align-items: flex-start; font-size: var(--fs-14); line-height: 1.45; cursor: pointer; }
.chk input { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin-top: var(--sp-1); border-radius: 6px; background: var(--c-white); box-shadow: inset 0 0 0 1.5px var(--c-line-2); display: grid; place-items: center; transition: background 160ms, box-shadow 160ms; }
.chk input[type=radio] { border-radius: 50%; }
.chk input:checked { background: var(--c-ink); box-shadow: none; }
.chk input:checked::after { content: ""; width: 10px; height: 6px; border: solid var(--c-white); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.chk input[type=radio]:checked::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--c-white); transform: none; }
.chk input:focus-visible { box-shadow: var(--focus-ring); }
.sw { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw i { position: absolute; inset: 0; border-radius: 99px; background: color-mix(in oklab, var(--c-ink) 16%, var(--c-white)); transition: background 220ms; }
.sw i::after { content: ""; position: absolute; top: var(--sp-3); left: var(--sp-3); width: 18px; height: 18px; border-radius: 50%; background: var(--c-white); box-shadow: none; transition: transform 320ms var(--ease-liquid); }
.sw input:checked + i { background: var(--c-brand); }
.sw input:checked + i::after { transform: translateX(18px); }
.sw input:focus-visible + i { box-shadow: var(--focus-ring); }
.sw input:disabled + i { opacity: 0.5; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; } }
