/* Portal stylesheet. Design language: docs/prototypes/saas-v2/client.html (tokens in ./tokens.css; components below:
   pill buttons, 13px tags, cards told apart from the page by fill (no outline, no shadow), segmented controls, 26px dialogs).
   Outlines were retired on 2026-10-15 (owner decision, tokens.css header): a former 1px outline is now `border-color: transparent`
   so every box keeps its size and corner, and controls are filled with --color-fill instead of being stroked.
   The portal's role tokens (--bg, --text, --accent, …) are aliases of the prototype tokens so that every page that
   shares this sheet (client, admin, native enrollment, auth callback) is re-skinned in place. */
@import url("./tokens.css");

@font-face {
  font-family: "Immacu Sans KR";
  src: url("./assets/fonts/ImmacuSansKR-Variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Geist / Geist Mono (SIL OFL 1.1): the prototype's Latin faces, self-hosted (docs/FONT_LICENSE.md, assets/fonts/PROVENANCE.json). */
@font-face {
  font-family: Geist;
  src: url("./assets/fonts/Geist-Latin.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Roboto (OFL 1.1, Latin subset, pinned in assets/fonts/PROVENANCE.json): only the Google sign-in button label uses it. */
@font-face {
  font-family: Roboto;
  src: url("./assets/fonts/Roboto-Latin.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  src: url("./assets/fonts/GeistMono-Latin.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --font-sans: var(--font-body);
  --bg: var(--color-bg);
  --bg-soft: var(--color-surface);
  --surface: var(--color-surface);
  --surface-raised: var(--color-elevated);
  --surface-muted: var(--color-surface);
  --text: var(--color-text);
  --text-soft: var(--color-neutral-700);
  --text-faint: var(--color-neutral-600);
  --stroke: var(--color-divider);
  --stroke-strong: var(--color-divider-strong);
  --stroke-control: transparent;
  --fill: var(--color-fill);
  --fill-strong: var(--color-fill-strong);
  --accent: var(--color-accent);
  --on-accent: var(--color-on-accent);
  --accent-hover: var(--color-accent-600);
  --accent-soft: var(--color-accent-100);
  --success: var(--color-ok);
  --success-soft: var(--color-ok-100);
  --warning: var(--color-warn);
  --warning-soft: var(--color-warn-100);
  --danger: var(--color-crit);
  --danger-soft: var(--color-crit-100);
  --info: var(--color-info);
  --info-soft: var(--color-info-100);
  --shadow-card: none;
  --shadow-float: var(--shadow-lg);
  --sidebar-width: 244px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -0.006em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .auth-copy {
  word-break: keep-all;
  overflow-wrap: normal;
}

h1, h2 { text-wrap: balance; }

button, input, select, textarea { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

a { color: inherit; }

::selection { background: var(--color-accent-200); color: var(--color-accent-900); }

[hidden] { display: none !important; }

/* Continuous corners on every surface (SPEC §14.1-12). Pills and circles are excluded by their own rules. */
.ui-corner { border-radius: var(--radius-xl); }

@supports (corner-shape: superellipse(2)) {
  .ui-corner, .card, .dialog, .seg, .seg-opt, .field input, .field select, .field textarea { corner-shape: var(--squircle); }
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

/* Brand: accent square + 16px/600 word mark (prototype app bar). */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-large { font-size: 17px; }

.brand-mark {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--accent);
}

@supports (corner-shape: superellipse(2)) { .brand-mark { corner-shape: var(--squircle); } }

.brand-mark::before,
.brand-mark span {
  position: absolute;
  content: "";
  background: var(--on-accent);
  opacity: 0.9;
}

.brand-mark::before { width: 2px; height: 11px; left: 10px; top: 5px; border-radius: 2px; transform: rotate(38deg); }
.brand-mark span { width: 2px; height: 7px; left: 14px; top: 9px; border-radius: 2px; transform: rotate(38deg); opacity: 0.5; }

/* Kicker (prototype .card-kicker): 13px/600, never below 13px (14/13 rule). */
.eyebrow {
  margin: 0 0 6px;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; letter-spacing: -0.021em; line-height: 1.1; }
h1 { margin-bottom: 6px; font-size: clamp(28px, 4vw, 36px); letter-spacing: -0.028em; }
h2 { margin-bottom: 6px; font-size: clamp(19px, 2.2vw, 21px); }
h3 { margin-bottom: 0; font-size: 19px; letter-spacing: -0.02em; line-height: 1.2; }
p { margin-bottom: 1em; }

/* ── Controls: pill buttons (prototype .btn) ───────────────────────── */
.btn,
.button,
.icon-button,
.avatar-button,
.nav-item,
.client-nav-item,
.text-button {
  border: 0;
  cursor: pointer;
}

.btn, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.008em;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.btn:disabled, .button:disabled { cursor: default; opacity: 0.45; }
.btn-primary, .button-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled), .button-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active:not(:disabled), .button-primary:active:not(:disabled) { background: var(--color-accent-700); border-color: var(--color-accent-700); }
.btn-danger, .button-danger { background: var(--danger); border-color: var(--danger); color: #ffffff; }
.btn-danger:hover:not(:disabled), .button-danger:hover:not(:disabled) { filter: brightness(0.92); }
.btn-secondary, .button-secondary { background: var(--fill); border-color: transparent; color: var(--text); }
.btn-secondary:hover:not(:disabled), .button-secondary:hover:not(:disabled) { background: var(--fill-strong); }
.btn-secondary:active:not(:disabled), .button-secondary:active:not(:disabled) { background: color-mix(in srgb, var(--text) 18%, transparent); }
.btn-ghost, .button-ghost { color: var(--accent); }
.btn-ghost:hover:not(:disabled), .button-ghost:hover:not(:disabled) { background: var(--accent-soft); }
.btn-block, .button-block { display: flex; width: 100%; }
.btn-icon { padding: 9px; border-radius: 50%; }
.button-compact { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.button-large { min-height: 44px; padding: 11px 20px; }

/* Circular icon button (prototype .btn-icon). */
.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--fill);
  color: var(--text);
  font-size: 1.05rem;
}
.icon-button:hover:not(:disabled) { background: var(--fill-strong); }

.text-button {
  min-height: 34px;
  padding: 0 4px;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}
.text-button:hover { text-decoration: underline; }

/* Tags (prototype .tag): 13px/600 pills. Semantic tones are portal additions. */
.status-pill,
.count-badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 0;
  border-radius: var(--pill);
  background: var(--color-neutral-200);
  color: var(--color-neutral-800);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
}

.tag-accent, .status-info { background: var(--info-soft); color: var(--info); }
.tag-neutral, .status-neutral { background: var(--color-neutral-200); color: var(--color-neutral-800); }
.tag-outline { background: var(--fill); box-shadow: none; color: var(--text-soft); }
.tag-solid { background: var(--accent); color: var(--on-accent); }
.status-success { background: var(--success-soft); color: var(--success); }
.status-warning { background: var(--warning-soft); color: var(--warning); }
.status-danger { background: var(--danger-soft); color: var(--danger); }
.count-badge { min-width: 28px; }
.mono { font-family: var(--font-mono); font-size: 13px; }
/* Login-window session code (SPEC §15.5 D5): the same 6 symbols as the Mac's indicator bar, set like the prototype's mono IDs. */
.session-code {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: var(--pill);
  background: var(--fill);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
  white-space: nowrap;
}
.session-code-box { display: inline-flex; align-items: center; gap: 8px; }
.session-code-label { color: var(--text-soft); font-size: 13px; }

/* Segmented control (prototype .seg): hidden radio inputs, `:has(input:checked)` marks the active option. */
.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border: 0;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.seg-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: calc(var(--radius-md) - 2px);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease;
}
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt:hover { color: var(--text); }
.seg-opt:has(input:checked) { background: var(--color-selected); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.seg-opt:has(input:focus-visible) { outline: 3px solid var(--color-focus); outline-offset: 1px; }

/* ── Entry ─────────────────────────────────────────────────────────── */
.entry-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--bg);
}

.entry-shell { width: min(780px, calc(100% - 40px)); padding: 72px 0; }
.entry-copy { max-width: 610px; margin-top: clamp(72px, 14vh, 142px); }
.entry-copy p:last-child { max-width: 510px; color: var(--text-soft); font-size: 15px; }
.entry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 44px; }

.entry-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 15px;
  align-items: center;
  min-height: 102px;
  padding: 18px;
  border: 1px solid transparent;
  background: var(--surface);
  text-decoration: none;
  transition: background-color 160ms ease;
}

.entry-card:hover { background: var(--accent-soft); }
.entry-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.entry-card-copy { display: flex; flex-direction: column; gap: 3px; }
.entry-card-copy small { color: var(--text-soft); font-size: 13px; }

/* ── Authentication ───────────────────────────────────────────────── */
.auth-layout { display: grid; grid-template-columns: minmax(420px, 0.9fr) 1.1fr; min-height: 100vh; }
.auth-panel { display: flex; width: min(100%, 540px); min-height: 100vh; margin-inline: auto; padding: 54px clamp(30px, 7vw, 84px); flex-direction: column; justify-content: center; }
.auth-panel > .brand { position: absolute; top: 42px; }
.auth-copy { max-width: 470px; margin-bottom: 34px; }
.auth-copy h1 { max-width: 430px; font-size: clamp(32px, 4vw, 44px); }
.auth-copy p:last-child { max-width: 440px; margin-bottom: 0; color: var(--text-soft); }
.auth-form { display: grid; gap: 17px; }

/* Inputs (prototype .input): 14px, 9px 12px, divider border, 3px accent ring on focus. */
.field { display: grid; gap: 6px; color: var(--text-soft); font-size: 13px; font-weight: 500; }
.field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--fill);
  color: var(--text);
  font-size: 14px;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}
.field input:hover { background: var(--fill-strong); }
.field input:focus { border-color: transparent; outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field input[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--danger); }
.field input::placeholder { color: var(--color-neutral-500); }
.field select, .field textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--fill);
  color: var(--text);
  font-size: 14px;
}
.field select { height: 40px; padding: 0 12px; }
.field textarea { min-height: 82px; padding: 9px 12px; resize: vertical; }
.field select:focus, .field textarea:focus { border-color: transparent; outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--danger); }
.form-message { min-height: 22px; margin: -2px 0 0; color: var(--danger); font-size: 14px; font-weight: 500; }
.form-message[data-tone="info"] { color: var(--text-soft); }
.form-message[data-tone="warning"] { color: var(--warning); }
.auth-footnote { margin: 24px 0 0; color: var(--text-faint); font-size: 13px; font-weight: 500; }
.provider-list { display: grid; gap: 10px; }
.provider-button { display: grid; grid-template-columns: 34px 1fr 20px; align-items: center; width: 100%; min-height: 56px; padding: 10px 14px; border-radius: var(--radius-lg); text-align: left; white-space: normal; }
.provider-glyph { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid transparent; border-radius: 50%; background: var(--fill); font-weight: 600; }
.provider-button strong, .provider-note { display: block; }
.provider-button strong { font-weight: 600; }
.provider-note { margin-top: 2px; color: var(--text-faint); font-size: 13px; font-weight: 500; }

.auth-aside {
  position: relative;
  display: grid;
  min-height: calc(100vh - 24px);
  margin: 12px;
  place-items: center;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.auth-signal { position: relative; width: min(42vw, 430px); aspect-ratio: 1; border: 1px solid transparent; background: var(--fill); }
.signal-core, .signal-orbit { position: absolute; border-radius: 50%; }
.signal-core { inset: calc(50% - 36px); background: var(--accent); }
.signal-core::after { position: absolute; inset: 18px; border: 2px solid var(--on-accent); border-radius: 50%; content: ""; }
.signal-orbit { border: 1px solid var(--stroke); }
.signal-orbit::after { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); content: ""; }
.signal-orbit-a { inset: 16%; }
.signal-orbit-a::after { top: 19%; right: 7%; }
.signal-orbit-b { inset: 30%; }
.signal-orbit-b::after { bottom: 4%; left: 26%; }

/* Device illustration on the sign-in page: flat tinted panels, no gradients (prototype .stripe). */
.device-scene { position: relative; width: min(46vw, 560px); height: 380px; }
.device-screen { position: absolute; inset: 30px 30px 90px; padding: 11px; border: 1px solid transparent; background: #0b0b0c; }
.device-content { display: flex; height: 100%; padding: 26px; flex-direction: column; gap: 14px; border-radius: 12px; background: var(--color-bg); }
.device-content span { height: 14px; border-radius: 7px; background: var(--color-neutral-200); }
.device-content span:first-child { width: 42%; height: 38px; margin-top: auto; border-radius: var(--pill); background: var(--accent); }
.device-content span:nth-child(2) { width: 68%; }
.device-content span:nth-child(3) { width: 48%; margin-bottom: auto; }
.device-base { position: absolute; right: 0; bottom: 66px; left: 0; height: 18px; border-radius: 4px 4px 18px 18px; background: var(--color-neutral-300); }
.connection-line { position: absolute; right: 22%; bottom: 22px; width: 54%; height: 2px; background: var(--accent); opacity: 0.6; }

/* ── Admin shell ──────────────────────────────────────────────────── */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; padding: 28px 18px 20px; border-right: 1px solid transparent; background: var(--surface-muted); flex-direction: column; }
.sidebar .brand { padding: 2px 10px; }
.side-nav { display: grid; gap: 4px; margin-top: 48px; }
.nav-item { display: flex; min-height: 40px; padding: 0 12px; align-items: center; gap: 12px; border-radius: var(--radius-sm); background: transparent; color: var(--text-soft); text-align: left; font-size: 14px; font-weight: 500; }
.nav-item > span:first-child { width: 22px; color: var(--text-faint); font-size: 15px; text-align: center; }
.nav-item:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
.nav-item.is-active { background: var(--color-selected); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.nav-item.is-active > span:first-child { color: var(--accent); }
.sidebar-foot { margin-top: auto; }
.identity-line { padding: 10px 12px 0; overflow: hidden; color: var(--text-faint); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.app-frame { min-width: 0; }
.topbar { display: flex; min-height: 84px; padding: 20px clamp(24px, 4vw, 56px); align-items: center; justify-content: space-between; border-bottom: 1px solid transparent; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.topbar h1 { margin: 0; font-size: 24px; }
.topbar .eyebrow { margin-bottom: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.operation-indicator { display: inline-flex; min-height: 32px; padding: 0 12px; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: var(--pill); background: var(--surface); color: var(--text-soft); font-size: 13px; font-weight: 500; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--info); }
.mobile-menu, .mobile-nav { display: none; }
.system-banner { display: flex; margin: 20px clamp(24px, 4vw, 56px) 0; padding: 14px 16px; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid transparent; background: var(--warning-soft); color: var(--warning); }
.system-banner strong { font-size: 14px; }
.system-banner p { margin: 3px 0 0; font-size: 13px; }
.main-content { width: min(1480px, 100%); padding: 34px clamp(24px, 4vw, 56px) 70px; }
.page-section { display: grid; gap: 22px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.section-heading h2 { margin: 0; }
.section-heading > p, .section-heading > div > p:last-child { margin: 0; color: var(--text-soft); font-size: 13px; }
.section-heading.compact { margin-bottom: 14px; align-items: center; }
.section-heading.compact h2 { font-size: 21px; }
.freshness-copy { text-align: right; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-height: 142px; padding: 18px; border: 1px solid transparent; background: var(--surface); }
.metric-label { color: var(--text-soft); font-size: 13px; font-weight: 600; }
.metric-value { display: block; margin-top: 24px; font-size: clamp(26px, 2.8vw, 34px); font-weight: 600; letter-spacing: -0.028em; line-height: 1; }
.metric-note { display: block; margin-top: 9px; color: var(--text-faint); font-size: 13px; font-weight: 500; }
.content-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 14px; }

/* Card (prototype .card): card fill, no outline (transparent 1px keeps the box size), radius-xl, 18px padding, no shadow. */
.surface, .card { min-width: 0; padding: 18px; border: 1px solid transparent; border-radius: var(--radius-xl); background: var(--surface); box-shadow: none; }
.card { display: flex; flex-direction: column; gap: 12px; }
.card-kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-faint); }
.card-title { font-family: var(--font-heading); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.card-body { color: var(--text-soft); font-size: 14px; }
.card-meta { color: var(--text-faint); font-size: 13px; }
.hr { border: 0; border-top: 1px solid var(--stroke); margin: 0; }
.stripe { background: color-mix(in srgb, var(--text) 4%, transparent); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-copy { margin: -2px 0 18px; color: var(--text-soft); font-size: 14px; }
.management-form { display: grid; gap: 16px; }
.management-form > .button { justify-self: start; }
.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.role-form { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--stroke); }
.role-assignment-row { align-items: start; }
.role-chips { display: flex; margin-top: 9px; gap: 6px; flex-wrap: wrap; }
.role-chip { padding: 3px 9px; border: 0; border-radius: var(--pill); background: var(--color-neutral-200); color: var(--color-neutral-800); font-size: 13px; font-weight: 600; }
.surface-header { display: flex; min-height: 42px; margin-bottom: 16px; align-items: flex-start; justify-content: space-between; gap: 18px; }
.surface-header .eyebrow { margin-bottom: 4px; }
.state-list { display: grid; gap: 1px; }
.state-row { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; min-height: 56px; padding: 12px 0; border-top: 1px solid var(--stroke); }
.state-row:first-child { border-top: 0; }
.state-row-main { min-width: 0; }
.state-row strong { display: block; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.state-row small { display: block; margin-top: 3px; color: var(--text-faint); font-size: 13px; font-weight: 500; }
.state-symbol { display: inline-flex; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: var(--text-faint); }
.state-symbol.success { background: var(--success); }
.state-symbol.warning { background: var(--warning); }
.state-symbol.danger { background: var(--danger); }
.empty-inline { padding: 18px 0; color: var(--text-faint); font-size: 14px; }
.empty-block { padding: 46px 18px; color: var(--text-faint); text-align: center; font-size: 14px; }
.empty-state { max-width: 520px; margin: 20px auto; padding: 48px 24px; text-align: center; }
.empty-state h3 { margin: 14px 0 8px; }
.empty-state p { margin: 0; color: var(--text-soft); font-size: 14px; }
.empty-symbol { display: grid; width: 54px; height: 54px; margin: auto; place-items: center; border-radius: 18px; background: var(--fill); color: var(--text-soft); font-size: 1.4rem; }

/* Table (prototype .table): 14px rows, 13px/500 header. */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table, .table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .table thead th { padding: 9px 12px; border-bottom: 1px solid var(--stroke); color: var(--text-faint); font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; }
.data-table td, .table tbody td { padding: 12px; border-bottom: 1px solid color-mix(in srgb, var(--stroke) 60%, transparent); color: var(--text-soft); vertical-align: middle; }
.data-table tr:last-child td, .table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td, .table tbody tr:hover td { background: color-mix(in srgb, var(--text) 3%, transparent); }
.data-table td:first-child { color: var(--text); font-weight: 600; }
.data-table .status-pill { min-height: 24px; }

/* Read-only capacity projections keep unlike pool dimensions separate. */
.capacity-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--stroke); }
.capacity-section > h3 { margin: 0 0 12px; }
.capacity-scope, .capacity-source-note { margin: 8px 0; color: var(--text-soft); font-size: 13px; line-height: 1.6; }
.capacity-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0 0; }
.capacity-inputs > div { min-width: 0; padding-left: 14px; border-left: 2px solid var(--stroke); }
.capacity-inputs dt { color: var(--text-soft); font-size: 13px; }
.capacity-inputs dd { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.capacity-inputs .capacity-input-reason { color: var(--text-soft); font-size: 13px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
.capacity-pools { display: grid; gap: 16px; margin-top: 24px; }
.capacity-pool { min-width: 0; padding: 18px; border: 1px solid transparent; border-radius: var(--radius-md); background: var(--fill); }
.capacity-pool-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.capacity-pool-header h4 { margin: 4px 0 0; overflow-wrap: anywhere; }
.capacity-table-wrap { margin-top: 14px; }
.capacity-table caption { padding: 0 12px 10px; color: var(--text-soft); font-size: 13px; text-align: left; }
.capacity-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table tbody th[scope="row"] { color: var(--text); font-size: 14px; letter-spacing: normal; text-transform: none; }
.capacity-source-cell span, .capacity-source-cell small { display: block; }
.capacity-source-cell small { margin-top: 5px; font-size: 13px; }
.capacity-reasons { margin: 12px 0 0; padding-left: 20px; color: var(--text-soft); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.capacity-history { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--stroke); }
.capacity-history summary { min-height: 32px; color: var(--text); cursor: pointer; font-size: 14px; font-weight: 600; }
.capacity-history > p { color: var(--text-soft); font-size: 13px; line-height: 1.6; }
@media (max-width: 620px) {
  .capacity-inputs { grid-template-columns: 1fr; }
  .capacity-pool { padding: 14px; }
  .capacity-pool-header { flex-direction: column; }
}

.skeleton-card { position: relative; min-height: 180px; overflow: hidden; background: var(--surface); }
.skeleton-card::after { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--text) 5%, transparent) 45%, transparent 70%); animation: shimmer 1.6s infinite; content: ""; transform: translateX(-100%); }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Client screens live in client.css (prototype port). */

.native-steps { display: grid; margin: 18px 0 0; padding-left: 22px; gap: 6px; color: var(--text-soft); font-size: 14px; text-align: left; }

/* ── Dialogs (prototype .dialog-backdrop / .dialog) ─────────────── */
.dialog-backdrop { position: fixed; z-index: 160; inset: 0; display: grid; padding: 32px; place-items: center; overflow-y: auto; background: rgba(0, 0, 0, 0.32); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dialog-backdrop[hidden] { display: none; }
.enrollment-panel, .dialog { display: flex; width: min(640px, 100%); max-height: calc(100vh - 64px); padding: 26px; flex-direction: column; gap: 14px; overflow-y: auto; border: 0; border-radius: var(--radius-2xl); background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-dialog); }
.enrollment-panel:focus, .dialog:focus { outline: none; }
.enrollment-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.enrollment-panel-header h2, .dialog-title { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.021em; }
.enrollment-lead { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; }
.enrollment-security-copy, .dialog-body { max-width: 590px; margin: 0; color: var(--text-soft); font-size: 14px; line-height: 1.55; }
.enrollment-facts { display: grid; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.enrollment-facts > div { min-width: 0; padding: 12px 14px; border: 1px solid transparent; border-radius: var(--radius-md); background: var(--fill); }
.enrollment-facts dt { color: var(--text-faint); font-size: 13px; font-weight: 500; }
.enrollment-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; color: var(--text); font-size: 14px; font-weight: 600; }
.enrollment-steps { display: grid; margin: 0; padding-left: 22px; gap: 8px; color: var(--text-soft); font-size: 14px; }
.enrollment-steps li { padding-left: 4px; }
.enrollment-availability { padding: 13px 16px; border: 1px solid transparent; border-radius: var(--radius-md); background: var(--fill); }
.enrollment-availability strong { font-size: 14px; font-weight: 600; }
.enrollment-availability p { margin: 4px 0 0; color: var(--text-soft); font-size: 13px; }
.enrollment-panel-actions, .dialog-actions { display: flex; margin-top: 4px; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(440px, calc(100vw - 48px)); padding: 12px 16px; border: 1px solid transparent; border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-lg); color: var(--text); font-size: 14px; font-weight: 500; }

@media (max-width: 980px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-panel { width: min(560px, 100%); padding-inline: 32px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .entry-shell { width: min(100% - 30px, 560px); padding: 38px 0; }
  .entry-copy { margin-top: 86px; }
  .entry-grid { grid-template-columns: 1fr; margin-top: 32px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { min-height: 72px; padding: 14px 16px; }
  .topbar .mobile-menu { display: inline-grid; margin-right: 12px; }
  .topbar > div:first-of-type { margin-right: auto; }
  .operation-indicator { display: none; }
  .mobile-nav { display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 12px; border-bottom: 1px solid transparent; background: var(--surface-muted); }
  .mobile-nav button { min-height: 40px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-soft); font-size: 13px; font-weight: 600; }
  .main-content { padding: 24px 16px 60px; }
  .system-banner { margin: 14px 16px 0; align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-heading, .section-heading.compact { align-items: flex-start; flex-direction: column; gap: 8px; }
  .freshness-copy { text-align: left; }
  .surface, .card { padding: 16px; }
  .enrollment-facts { grid-template-columns: 1fr; }
  .form-columns { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .button { min-height: 42px; white-space: normal; }
  .button-compact { min-height: 36px; }
  .seg { max-width: 100%; overflow-x: auto; }
  .mobile-connect-bar {
    position: fixed; z-index: 40; right: 0; bottom: 0; left: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 0;
    background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  }
  .auth-panel > .brand { top: 28px; }
  .auth-panel { padding: 96px 20px 42px; justify-content: flex-start; }
  .auth-copy { margin-top: 24px; }
  .metric-grid { grid-template-columns: 1fr; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 20px; }
  .dialog-backdrop { padding: 10px; place-items: end center; }
  .enrollment-panel, .dialog { width: 100%; max-height: calc(100dvh - 20px); padding: 18px; }
  .enrollment-panel-actions, .dialog-actions { align-items: stretch; flex-direction: column; }
  .enrollment-panel-actions .button, .dialog-actions .button { width: 100%; }
}

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

@media (forced-colors: active) {
  .state-symbol, .activity-dot { forced-color-adjust: none; border: 1px solid CanvasText; }
  .status-pill, .tag, .count-badge, .enrollment-panel, .dialog, .enrollment-facts > div, .journey-step, .mobile-connect-bar, .display-option { border: 1px solid CanvasText; }
  .journey-step.is-current, .display-option.is-selected { outline: 2px solid Highlight; }
}

/* Sign-in provider buttons (js/provider-buttons.js). Colours, type and logo sizes follow the Google Identity
   "Sign in with Google" branding guidelines and Apple's Human Interface Guidelines for Sign in with Apple; both
   buttons share one height and shape so neither is less prominent. Dark pages switch Google to its dark theme and
   Apple to its white style. */
.provider-option { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.provider-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid transparent;
  /* Pill, like the portal's own buttons: Google's guidelines offer a pill shape and Apple's allow any corner radius. */
  border-radius: var(--pill);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.provider-button::after { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity 120ms ease; pointer-events: none; }
.provider-button:hover:not(:disabled)::after { opacity: 0.08; }
.provider-button:active:not(:disabled)::after { opacity: 0.12; }
.provider-button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.provider-button:disabled { cursor: not-allowed; }
.provider-button-content { display: inline-flex; align-items: center; min-width: 0; }
.provider-button-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-logo { display: block; flex: none; }
.provider-note { color: var(--color-neutral-600); font-size: 13px; line-height: 1.4; }

.provider-button-google { background: #ffffff; border-color: #747775; color: #1f1f1f; font: 500 14px/20px Roboto, "Immacu Sans KR", Arial, sans-serif; letter-spacing: 0.25px; }
.provider-button-google .provider-button-content { gap: 10px; }
.provider-logo-google { width: 20px; height: 20px; }
.provider-button-google:disabled { background: rgba(255, 255, 255, 0.38); border-color: rgba(31, 31, 31, 0.12); color: rgba(31, 31, 31, 0.38); }

.provider-button-apple { background: #000000; color: #ffffff; font: 500 15px/20px -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Immacu Sans KR", Arial, sans-serif; }
.provider-button-apple .provider-button-content { gap: 6px; }
.provider-logo-apple { width: 15px; height: 19px; margin-top: -2px; }
.provider-button-apple:disabled { opacity: 0.38; }
.provider-button:disabled .provider-logo { opacity: 0.38; }
.provider-button-apple:disabled .provider-logo { opacity: 1; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .provider-button-google { background: #131314; border-color: #8e918f; color: #e3e3e3; }
  :root:not([data-theme="light"]) .provider-button-google:disabled { background: rgba(19, 19, 20, 0.38); border-color: rgba(142, 145, 143, 0.12); color: rgba(227, 227, 227, 0.38); }
  :root:not([data-theme="light"]) .provider-button-apple { background: #ffffff; color: #000000; }
}
:root[data-theme="dark"] .provider-button-google { background: #131314; border-color: #8e918f; color: #e3e3e3; }
:root[data-theme="dark"] .provider-button-google:disabled { background: rgba(19, 19, 20, 0.38); border-color: rgba(142, 145, 143, 0.12); color: rgba(227, 227, 227, 0.38); }
:root[data-theme="dark"] .provider-button-apple { background: #ffffff; color: #000000; }
