/* HANVEXIS v2 shared interface. Charcoal marks actions; neutral gray marks focus. */
:root {
  --bg: oklch(97.5% .009 85);
  --surface: oklch(99.65% .003 85);
  --surface-raised: oklch(99.9% .001 85);
  --fg: #252629;
  --muted: oklch(48% .012 220);
  --soft: oklch(91% .007 85);
  --border: oklch(87.5% .009 85);
  --accent: #252629;
  --accent-hover: #161719;
  --focus: #707174;
  --danger: #8f302d;
  --danger-soft: oklch(96.5% .025 25);
  --success: #385f4a;
  --success-soft: oklch(96% .022 150);
  --warning: #74541e;
  --warning-soft: oklch(96.5% .025 80);
  --font-display: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-body: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --radius: 12px;
  --container: 1120px;
  --gutter: clamp(24px, 4.4vw, 72px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
p { text-wrap: pretty; }
svg { display: block; flex-shrink: 0; }
html, body { max-width: 100%; }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.sidebar :focus-visible { outline-color: var(--bg); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; background: var(--surface); border: 1px solid var(--fg); padding: 12px 18px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 760; letter-spacing: .1em; line-height: 1; }
.monogram { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.eyebrow { font: 11px/1.5 var(--font-mono); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 11px 20px; border: 1px solid var(--border); border-radius: 8px; background: transparent; font-weight: 680; font-size: 13px; line-height: 1.2; transition: background 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease); }
.btn:hover { background: color-mix(in oklch, var(--fg) 5%, var(--surface)); border-color: color-mix(in oklch, var(--fg) 35%, var(--border)); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .58; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn-small { min-height: 38px; padding: 8px 12px; font-size: 11px; gap: 7px; }
.btn-small .icon { width: 15px; height: 15px; }
.icon-btn { min-width: 44px; min-height: 44px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 8px; }
.icon-btn:hover { background: color-mix(in oklch, var(--fg) 6%, transparent); }
.notice { margin: 20px 0; padding: 14px 18px; border: 1px solid var(--border); border-radius: 9px; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.notice-warning { background: var(--warning-soft); border-color: color-mix(in oklch, var(--warning) 24%, var(--border)); color: var(--warning); }
.notice-error { background: var(--danger-soft); border-color: color-mix(in oklch, var(--danger) 24%, var(--border)); color: var(--danger); }
.notice-success { background: var(--success-soft); border-color: color-mix(in oklch, var(--success) 24%, var(--border)); color: var(--success); }
.refresh-action { display: inline-flex; min-height: 32px; align-items: center; margin: 8px 0 0; padding: 5px 10px; border: 1px solid currentColor; border-radius: 5px; background: transparent; color: inherit; font-size: 11px; font-weight: 700; }

/* Public entry */
.entry-shell { display: grid; grid-template-columns: 38% minmax(0, 1fr); min-height: 100svh; }
.entry-identity { background: var(--fg); color: var(--bg); padding: 45px clamp(28px, 4.3vw, 76px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.entry-art { display: grid; place-items: center; padding: 65px 0; }
.entry-art .monogram { width: clamp(150px, 20vw, 300px); height: auto; stroke-width: .85; }
.entry-art .art-frame { width: min(100%, 320px); aspect-ratio: 1; border: 1px solid color-mix(in oklch, var(--bg) 19%, transparent); border-radius: 50%; display: grid; place-items: center; }
.entry-foot { color: color-mix(in oklch, var(--bg) 65%, var(--fg)); font: 10px/1.8 var(--font-mono); letter-spacing: .12em; }
.entry-content { display: flex; flex-direction: column; justify-content: center; padding: 70px clamp(28px, 7vw, 120px); min-width: 0; }
.entry-content .eyebrow { margin-bottom: 26px; }
.entry-content h1 { font-size: clamp(38px, 4.3vw, 68px); font-weight: 620; line-height: 1.22; letter-spacing: -.055em; }
.entry-content .lead { margin-top: 28px; font-size: 16px; line-height: 1.9; color: var(--muted); }
.entry-login { margin-top: 40px; min-width: 182px; align-self: flex-start; justify-content: space-between; }
.entry-helper { max-width: 370px; font-size: 12px; color: var(--muted); margin-top: 20px; }
.entry-bottom { padding-top: 90px; color: var(--muted); font: 10px/1.5 var(--font-mono); letter-spacing: .12em; }

/* Authenticated shell */
.workspace { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100svh; }
.sidebar { background: var(--fg); color: var(--bg); padding: 38px 25px 26px; display: flex; flex-direction: column; min-width: 0; }
.sidebar .brand { font-size: 17px; gap: 10px; }
.sidebar .monogram { width: 29px; height: 29px; }
.sidebar-kicker { margin: 51px 14px 16px; font: 10px/1.5 var(--font-mono); letter-spacing: .14em; color: color-mix(in oklch, var(--bg) 57%, var(--fg)); }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 14px; color: color-mix(in oklch, var(--bg) 72%, var(--fg)); border-radius: 8px; font-size: 14px; }
.side-nav a:hover { background: color-mix(in oklch, var(--bg) 6%, transparent); color: var(--bg); }
.side-nav a[aria-current="page"] { background: color-mix(in oklch, var(--bg) 10%, transparent); color: var(--bg); }
.side-nav .icon { width: 19px; height: 19px; }
.sidebar-bottom { margin-top: auto; padding: 44px 12px 0; }
.sidebar-note { color: color-mix(in oklch, var(--bg) 58%, var(--fg)); font-size: 11px; line-height: 1.9; }
.profile { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 24px; border-top: 1px solid color-mix(in oklch, var(--bg) 14%, transparent); min-width: 0; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid color-mix(in oklch, var(--bg) 28%, transparent); border-radius: 50%; }
.avatar .icon { width: 17px; height: 17px; }
.profile > div { min-width: 0; }
.profile strong { display: block; font-size: 12px; font-weight: 520; overflow-wrap: anywhere; }
.profile small { font-size: 10px; color: color-mix(in oklch, var(--bg) 57%, var(--fg)); }
.main-column { display: flex; flex-direction: column; min-width: 0; }
.workspace-top { min-height: 94px; padding: 22px var(--gutter); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.breadcrumb { display: flex; gap: 12px; font-size: 12px; color: var(--muted); min-width: 0; }
.breadcrumb strong { color: var(--fg); font-weight: 550; }
.logout-link { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 7px 4px; border: 0; background: transparent; }
.logout-link:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.logout-link .icon { width: 16px; height: 16px; }
.logout-link:disabled { opacity: .5; cursor: wait; }
.main-content { width: 100%; max-width: var(--container); margin-inline: auto; padding: 62px var(--gutter) 40px; flex: 1; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 38px; }
.page-heading .eyebrow { margin-bottom: 14px; color: var(--fg); }
.page-heading h1 { font-size: clamp(34px, 3.3vw, 49px); line-height: 1.24; letter-spacing: -.055em; font-weight: 620; }
.page-heading .lead { margin-top: 16px; color: var(--muted); font-size: 14px; }
.heading-action { flex-shrink: 0; margin-bottom: 3px; }
.pagefoot { margin: 0 var(--gutter); padding: 23px 0; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 10px; color: var(--muted); }
.pagefoot .wordmark { font: 10px/1.6 var(--font-mono); letter-spacing: .13em; }

/* Service collection */
.collection-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.category-filters { display: flex; align-items: center; gap: 22px; min-width: 0; }
.category-filters button { position: relative; padding: 12px 0; min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 13px; white-space: nowrap; }
.category-filters button:hover { color: var(--fg); }
.category-filters button[aria-pressed="true"] { color: var(--fg); font-weight: 720; }
.category-filters button[aria-pressed="true"]::after { content: ""; height: 2px; background: var(--accent); position: absolute; bottom: 0; left: 0; right: 0; }
.search-wrap { position: relative; width: 280px; max-width: 100%; }
.search-wrap > .icon { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search { width: 100%; min-height: 44px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 10px 14px 10px 40px; color: var(--fg); font-size: 12px; }
.search::placeholder, textarea::placeholder, input::placeholder { color: color-mix(in oklch, var(--muted) 80%, transparent); }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.service-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 29px 29px 0; min-width: 0; transition: border-color 180ms var(--ease), transform 180ms var(--ease); }
.service-card:hover { border-color: color-mix(in oklch, var(--fg) 40%, var(--border)); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 27px; }
.service-symbol { width: 54px; height: 54px; border: 1px solid var(--border); border-radius: 13px; display: grid; place-items: center; background: var(--bg); }
.service-symbol .icon { width: 28px; height: 28px; stroke-width: 1.3; }
.category-label, .state-pill { font-size: 10px; color: var(--muted); }
.service-card h3 { font-size: clamp(25px, 2.5vw, 30px); font-weight: 620; letter-spacing: -.035em; overflow-wrap: anywhere; line-height: 1.2; }
.service-description { font-size: 14px; margin-top: 9px; color: var(--muted); overflow-wrap: anywhere; }
.service-description:empty { display: none; }
.access-tag { display: inline-flex; align-items: center; gap: 5px; margin-top: 22px; padding: 4px 9px; font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; }
.access-tag .icon { width: 12px; height: 12px; }
.address { font: 11px/1.7 var(--font-mono); color: var(--muted); overflow-wrap: anywhere; margin-top: 23px; padding-bottom: 26px; }
.card-footer { border-top: 1px solid var(--border); min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.health::before { content: ""; width: 5px; height: 5px; border: 1px solid var(--muted); border-radius: 50%; }
.service-link { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 44px; font-size: 12px; font-weight: 680; }
.service-link .icon { width: 16px; height: 16px; }
.service-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.collection-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 25px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.collection-note .icon { width: 14px; height: 14px; margin-top: 2px; }
.loading-state, .empty-state, .error-state { border: 1px dashed var(--border); border-radius: var(--radius); padding: 54px 24px; text-align: center; color: var(--muted); grid-column: 1 / -1; min-width: 0; }
.loading-state { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.loading-mark { width: 22px; height: 22px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 900ms linear infinite; }
.empty-state h3, .error-state h3 { margin-bottom: 8px; color: var(--fg); font-size: 18px; font-weight: 620; }
.empty-state p, .error-state p { font-size: 12px; overflow-wrap: anywhere; }
.empty-state .btn, .error-state .btn { margin: 18px 4px 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Admin registry */
.admin-panel { margin-top: 6px; }
.admin-panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.admin-panel-head h2 { font-size: 21px; letter-spacing: -.025em; font-weight: 650; }
.admin-panel-head p { margin-top: 5px; font-size: 11px; color: var(--muted); }
.admin-registry { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.admin-list { display: flex; flex-direction: column; min-width: 0; }
.registry-head, .admin-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(88px, .42fr) minmax(150px, .65fr); align-items: center; gap: 18px; min-width: 0; }
.registry-head { padding: 11px 16px; background: var(--bg); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.5; }
.admin-row { padding: 17px 16px; border-bottom: 1px solid var(--border); }
.admin-row:last-child { border-bottom: 0; }
.service-state { min-width: 0; }
.service-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.service-identity .service-symbol { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 10px; }
.service-identity .service-symbol .icon { width: 21px; height: 21px; }
.service-meta { min-width: 0; }
.service-meta h3 { font-size: 16px; font-weight: 650; letter-spacing: -.015em; overflow-wrap: anywhere; line-height: 1.35; }
.service-subline { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 3px; color: var(--muted); font-size: 10px; }
.service-subline span + span::before { content: "·"; margin-right: 7px; }
.service-domain { display: block; font: 10px/1.6 var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.service-domain-cell { min-width: 0; }
.service-domain-cell .category-label, .service-meta .service-description { display: block; margin-top: 4px; font-size: 10px; line-height: 1.65; color: var(--muted); overflow-wrap: anywhere; }
.state-pill { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 3px 7px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); background: var(--bg); white-space: nowrap; }
.state-pill::before { content: ""; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; }
.state-pill[data-state="active"] { color: var(--surface); border-color: var(--accent); background: var(--accent); }
.state-pill[data-state="active"]::before { background: currentColor; }
.state-pill[data-state="disabled"] { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 20%, var(--border)); background: var(--danger-soft); }
.service-grants { min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.grant-line { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.grant-line strong { color: var(--fg); font-size: 10px; font-weight: 650; flex: 0 0 auto; }
.grant-line span { overflow-wrap: anywhere; }
.service-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0 8px; flex-wrap: wrap; }
.action-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 2px 0; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--border); }
.action-btn:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
.action-btn .icon { width: 13px; height: 13px; }
.action-btn-danger:hover { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 20%, var(--border)); background: var(--danger-soft); }
.admin-guidance { padding: 21px 0 23px; margin: 0 0 28px; border-block: 1px solid var(--border); }
.setup-path { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; list-style: none; padding: 0; margin: 0; }
.setup-step { display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 9px; min-width: 0; }
.step-no { color: var(--muted); font: 11px/2 var(--font-mono); }
.setup-step strong { display: block; font-size: 13px; font-weight: 650; }
.setup-step p { margin-top: 3px; color: var(--muted); font-size: 11px; }

/* Dialogs and forms */
dialog { padding: 0; margin: auto; color: var(--fg); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: min(860px, calc(100% - 36px)); max-height: calc(100dvh - 36px); overflow-y: auto; box-shadow: 0 26px 80px color-mix(in oklch, var(--fg) 25%, transparent); }
dialog::backdrop { background: color-mix(in oklch, var(--fg) 56%, transparent); backdrop-filter: blur(3px); }
dialog[open] { animation: modal-enter 180ms var(--ease); }
@keyframes modal-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.dialog-head { padding: 27px 30px 18px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.dialog-head h2 { font-size: 24px; font-weight: 630; letter-spacing: -.04em; margin-top: 8px; }
.dialog-head .eyebrow { font-size: 9px; }
.dialog-intro { margin: 0 30px 24px; font-size: 12px; color: var(--muted); }
.dialog-body { padding: 0 30px 28px; display: grid; grid-template-columns: minmax(0, 1fr) 235px; gap: 30px; }
.form-fields { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.field { min-width: 0; }
.field > label, fieldset legend, .state-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 680; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-raised); color: var(--fg); padding: 10px 12px; font-size: 13px; }
.field textarea { min-height: 70px; resize: vertical; line-height: 1.55; }
.field input[readonly] { color: var(--muted); background: var(--bg); font: 10px/1.5 var(--font-mono); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field-help, .form-note, .group-foot { margin-top: 6px; font-size: 10px; line-height: 1.65; color: var(--muted); }
.field-error, .form-error { margin-top: 7px; font-size: 11px; line-height: 1.65; color: var(--danger); overflow-wrap: anywhere; }
.form-error { margin: 2px 0 0; padding: 11px 13px; border-radius: 6px; background: var(--danger-soft); }
.form-error:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-status { min-height: 18px; margin: 0; color: var(--muted); font-size: 11px; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.prefix-field { display: flex; min-width: 0; align-items: stretch; }
.prefix-field input { border-radius: 7px 0 0 7px; text-transform: lowercase; min-width: 0; }
.prefix-suffix { display: flex; align-items: center; max-width: 58%; min-width: 90px; padding: 9px 11px; border: 1px solid var(--border); border-left: 0; border-radius: 0 7px 7px 0; background: var(--bg); color: var(--muted); font: 10px/1.4 var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.advanced { border: 1px solid var(--border); border-radius: 8px; background: color-mix(in oklch, var(--bg) 45%, var(--surface)); }
.advanced summary { min-height: 44px; padding: 11px 13px; cursor: pointer; font-size: 12px; color: var(--muted); }
.advanced-body { padding: 0 13px 14px; }
.state-box { border: 1px solid var(--border); border-radius: 8px; padding: 14px; background: color-mix(in oklch, var(--bg) 38%, var(--surface)); }
.state-options { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.state-options label, .check-line { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; }
.state-options input, .check-line input, input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.activation-check { min-height: 39px; margin-top: 8px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.activation-check:has(input[aria-invalid="true"]) { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.form-guide { padding: 21px 20px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); align-self: start; position: sticky; top: 12px; }
.form-guide .eyebrow { font-size: 9px; margin-bottom: 16px; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 17px; }
.guide-steps li { display: flex; gap: 10px; }
.guide-steps li > span { color: var(--muted); font: 9px/1.6 var(--font-mono); }
.guide-steps strong { display: block; font-size: 11px; font-weight: 680; }
.guide-steps p { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.form-guide .form-note { margin-top: 21px; padding-top: 16px; border-top: 1px solid var(--border); }
.form-guide .form-note strong { display: block; color: var(--fg); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 30px; border-top: 1px solid var(--border); background: var(--bg); }
.dialog-actions .btn { flex: 0 1 auto; }
.dialog-small { width: min(470px, calc(100% - 36px)); }
.dialog-small .dialog-copy { padding: 0 30px 30px; color: var(--muted); font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.dialog-small .form-error { margin: 0 30px 22px; }
.dialog-small .form-error:focus { outline-color: var(--focus); }

/* Tablet */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 204px minmax(0, 1fr); }
  .sidebar { padding-inline: 19px; }
  :root { --gutter: 32px; }
  .collection-tools { gap: 12px; }
  .search-wrap { width: 240px; }
  .page-heading h1 { font-size: 39px; }
  .service-card { padding: 23px 23px 0; }
  .registry-head, .admin-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(82px, .4fr); gap: 12px; }
  .registry-head span:nth-child(4), .registry-head span:nth-child(5) { display: none; }
  .admin-row { grid-template-areas: "identity domain grants state" "actions actions actions actions"; }
  .admin-row > :nth-child(1) { grid-area: identity; }
  .admin-row > :nth-child(2) { grid-area: domain; }
  .admin-row > :nth-child(3) { grid-area: grants; }
  .admin-row > :nth-child(4) { grid-area: state; }
  .admin-row > :nth-child(5) { grid-area: actions; }
  .service-actions { justify-content: flex-start; padding-top: 7px; border-top: 1px solid var(--border); }
}

@media (max-width: 920px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { padding: 22px 32px; flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
  .sidebar-kicker, .sidebar-bottom { display: none; }
  .side-nav { flex-direction: row; gap: 8px; }
  .side-nav a { min-height: 44px; padding: 10px 14px; font-size: 12px; }
  .workspace-top { min-height: 76px; }
  .main-content { padding-top: 40px; max-width: 840px; }
  .page-heading h1 { font-size: 40px; }
  .entry-shell { grid-template-columns: 35% minmax(0, 1fr); }
  .entry-identity { padding: 32px 24px; }
  .entry-identity .brand { font-size: 15px; gap: 8px; }
  .entry-content { padding: 70px 45px; }
  .entry-content h1 { font-size: 44px; }
  .entry-bottom { padding-top: 70px; }
  .dialog-body { grid-template-columns: minmax(0, 1fr) 210px; gap: 22px; }
  .admin-registry { border: 0; border-radius: 0; background: transparent; overflow: visible; }
  .registry-head { display: none; }
  .admin-list { gap: 14px; }
  .admin-row { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: none; gap: 12px; padding: 17px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
  .admin-row > * { grid-area: auto !important; }
  .admin-row > [data-label]::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
  .admin-row > .service-identity::before, .admin-row > .service-actions::before { display: none; }
  .service-identity { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .service-domain-cell, .service-grants { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .service-grants { display: block; }
  .service-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .service-state::before { margin: 0 !important; }
  .service-actions { gap: 0 20px; }
}

@media (max-width: 620px) {
  :root { --gutter: 20px; }
  .entry-shell { display: flex; flex-direction: column; min-height: 100svh; }
  .entry-identity { padding: 26px 23px; min-height: 87px; flex: 0 0 auto; }
  .entry-identity .brand { font-size: 17px; }
  .entry-art, .entry-foot { display: none; }
  .entry-content { padding: 70px 23px 28px; flex: 1; }
  .entry-content h1 { font-size: clamp(38px, 11vw, 49px); }
  .entry-content .lead { font-size: 14px; margin-top: 23px; }
  .entry-content .eyebrow { font-size: 10px; }
  .entry-login { width: 100%; margin-top: 33px; min-height: 52px; }
  .entry-helper { font-size: 11px; }
  .entry-bottom { padding-top: 65px; }
  .sidebar { padding: 20px 20px 17px; gap: 12px; flex-wrap: wrap; }
  .sidebar .brand { font-size: 16px; }
  .side-nav { margin-left: auto; gap: 3px; }
  .side-nav a { padding: 8px 9px; font-size: 11px; gap: 6px; }
  .side-nav a .icon { width: 16px; height: 16px; }
  .workspace-top { padding-block: 11px; min-height: 61px; }
  .breadcrumb { font-size: 10px; gap: 7px; }
  .logout-link { font-size: 10px; gap: 4px; padding-inline: 2px; }
  .main-content { padding-top: 34px; padding-bottom: 34px; }
  .page-heading { margin-bottom: 28px; display: block; }
  .page-heading h1 { font-size: clamp(32px, 9vw, 39px); }
  .page-heading .eyebrow { font-size: 9px; margin-bottom: 14px; }
  .page-heading .lead { font-size: 12px; margin-top: 13px; }
  .heading-action { margin-top: 22px; width: 100%; }
  .collection-tools { flex-direction: column-reverse; align-items: stretch; gap: 10px; margin-bottom: 20px; }
  .category-filters { gap: 19px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 1px; }
  .search-wrap { width: 100%; }
  .search { font-size: 13px; min-height: 46px; }
  .service-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .service-card { padding: 23px 22px 0; }
  .card-top { margin-bottom: 21px; }
  .service-card h3 { font-size: 27px; }
  .service-description { font-size: 13px; }
  .address { font-size: 10px; }
  .card-footer { gap: 8px; }
  .service-link { font-size: 11px; }
  .collection-note { font-size: 10px; }
  .admin-panel-head { align-items: stretch; }
  .admin-panel-head .search-wrap { width: 100%; }
  .admin-row { padding: 17px; }
  .action-btn { min-height: 44px; font-size: 12px; }
  .admin-guidance { padding: 19px 0 20px; margin-bottom: 24px; }
  .setup-path { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .setup-step { grid-template-columns: 23px minmax(0, 1fr); }
  .pagefoot { padding: 20px 0; font-size: 9px; gap: 4px; }
  .loading-state, .empty-state, .error-state { padding: 40px 18px; }
  dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 13px; }
  .dialog-head { padding: 22px 20px 15px; }
  .dialog-head h2 { font-size: 22px; }
  .dialog-intro { margin-inline: 20px; }
  .dialog-body { grid-template-columns: minmax(0, 1fr); padding-inline: 20px; gap: 24px; }
  .form-guide { position: static; }
  .field-pair { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .prefix-suffix { max-width: 48%; min-width: 68px; padding-inline: 8px; font-size: 9px; }
  .dialog-actions { padding: 16px 20px; }
  .dialog-actions .btn { flex: 1 1 0; padding-inline: 10px; white-space: nowrap; font-size: 12px; }
  .dialog-small .dialog-copy { padding-inline: 20px; }
}

@media (min-width: 1680px) {
  :root { --container: 1280px; }
  .service-grid { gap: 28px; }
  .service-card { padding-inline: 36px; }
}

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