@charset "UTF-8";
/* Tokens copied from the MegaSeek design system (tokens.css); the light block is this tool's extension. */

:root {
  color-scheme: dark;

  --color-bg-sunken: #060807;
  --color-bg: #0a0c0b;
  --color-surface-1: #101413;
  --color-surface-2: #161b1a;
  --color-surface-3: #1e2423;
  --color-scrim: rgb(6 8 7 / 0.72);
  --color-line: #222927;
  --color-line-strong: #39423f;
  --color-line-control: #68736f;
  --color-text: #f1f1ec;
  --color-text-2: #a9afab;
  --color-text-3: #8a928e;
  --color-text-disabled: #555c59;
  --color-accent: #ffd60a;
  --color-accent-dim: #c9a800;
  --color-accent-ink: #0a0c0b;
  --color-accent-text: #ffd60a;
  --color-accent-soft: rgb(255 214 10 / 0.12);
  --color-selection: rgb(255 214 10 / 0.32);
  --focus-color: #ffd60a;
  --color-success: #46d38a;
  --color-success-soft: rgb(70 211 138 / 0.14);
  --color-warn: #ff9f43;
  --color-warn-soft: rgb(255 159 67 / 0.14);
  --color-danger: #ff5c5c;
  --color-danger-soft: rgb(255 92 92 / 0.14);

  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "D2Coding", monospace;
  --fs-h2: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --fs-h3: 1.25rem;
  --fs-body: 0.9375rem;
  --fs-ui: 0.875rem;
  --fs-sm: 0.8125rem;
  --fs-xs: 0.75rem;
  --fs-label: 0.6875rem;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;
  --lh-heading: 1.2;
  --lh-body: 1.65;
  --lh-ui: 1.35;
  --ls-heading: -0.02em;
  --ls-meta: 0.08em;
  --ls-ko: 0.02em;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --page-max: 1280px;
  --page-gutter: clamp(16px, 3vw, 40px);
  --sidebar-w: 248px;
  --measure: 68ch;
  --control-sm: 32px;
  --control-md: 40px;
  --control-lg: 48px;
  --hit-min: 44px;
  --row-h: 52px;
  --row-side: 48px;
  --pad-input: 14px;
  --pad-badge: 6px;
  --badge-h: 20px;
  --icon-size: 16px;
  --icon-size-sm: 12px;
  --check-size: 18px;
  --switch-w: 36px;
  --switch-h: 20px;
  --switch-thumb: 16px;
  --dialog-w: 720px;
  --dialog-w-sm: 480px;
  --login-w: 380px;
  --col-url: 28ch;
  --z-sticky: 100;

  --radius: 0px;
  --rule: 1px solid var(--color-line);
  --rule-strong: 1px solid var(--color-line-strong);
  --rule-control: 1px solid var(--color-line-control);
  --focus-width: 2px;
  --focus-offset: 2px;
  --shadow-pop: 0 16px 40px -8px rgb(0 0 0 / 0.7);

  --dur-instant: 80ms;
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-pulse: 2s;
  --dur-busy: 900ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --color-bg-sunken: #ffffff;
    --color-bg: #f4f4ef;
    --color-surface-1: #fbfbf8;
    --color-surface-2: #ecece6;
    --color-surface-3: #e2e3dc;
    --color-scrim: rgb(10 12 11 / 0.48);
    --color-line: #d9dbd4;
    --color-line-strong: #b9bdb5;
    --color-line-control: #6d7570;
    --color-text: #0a0c0b;
    --color-text-2: #3c433f;
    --color-text-3: #555c59;
    --color-text-disabled: #9aa09c;
    --color-accent-dim: #e0bb00;
    --color-accent-text: #6b5a00;
    --color-accent-soft: rgb(255 214 10 / 0.28);
    --color-selection: rgb(255 214 10 / 0.45);
    --focus-color: #0a0c0b;
    --color-success: #17703f;
    --color-success-soft: rgb(23 112 63 / 0.1);
    --color-warn: #8f4700;
    --color-warn-soft: rgb(255 159 67 / 0.18);
    --color-danger: #b42318;
    --color-danger-soft: rgb(180 35 24 / 0.08);
    --shadow-pop: 0 16px 40px -8px rgb(10 12 11 / 0.25);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--color-line-strong) var(--color-bg);
  scrollbar-width: thin;
  background: var(--color-bg);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font: var(--fw-regular) var(--fs-body)/var(--lh-body) var(--font-sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: var(--fw-bold); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); text-wrap: balance; }
a { color: inherit; text-underline-offset: 0.24em; text-decoration-thickness: 1px; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
code { font-family: var(--font-mono); font-size: 1em; }
[hidden] { display: none !important; }
::selection { background: var(--color-selection); color: var(--color-text); }
:focus-visible { outline: var(--focus-width) solid var(--focus-color); outline-offset: var(--focus-offset); }
[tabindex="-1"]:focus { outline: none; }
::placeholder { color: var(--color-text-3); opacity: 1; }
input { caret-color: var(--color-accent-text); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon {
  width: var(--icon-size); height: var(--icon-size); flex-shrink: 0;
  stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none;
}
.mono { font-family: var(--font-mono); }
.t-2 { color: var(--color-text-2); }
.t-3 { color: var(--color-text-3); }

/* ---------- Login ---------- */
.login { display: grid; place-items: center; min-height: 100dvh; padding: var(--space-6) var(--page-gutter); }
.login__card {
  display: grid; gap: var(--space-5); width: min(var(--login-w), 100%);
  padding: var(--space-8) var(--space-6); background: var(--color-surface-1); border: var(--rule);
}
.login__title { font-size: var(--fs-h3); }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; }
.side {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand logout" "nav nav";
  align-items: center; column-gap: var(--space-3);
  padding-inline: var(--page-gutter);
  background: var(--color-bg); border-bottom: var(--rule);
}
.side__brand { grid-area: brand; font-size: var(--fs-ui); font-weight: var(--fw-bold); line-height: var(--lh-ui); white-space: nowrap; }
.side__logout { grid-area: logout; display: grid; justify-items: end; padding-block: var(--space-1); }
.btn-hint { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-1) var(--space-3); }
.side__nav { grid-area: nav; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-inline: calc(var(--page-gutter) * -1); border-top: var(--rule); }
.side__link {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--hit-min); padding-inline: var(--space-2);
  font-size: var(--fs-ui); font-weight: var(--fw-medium); color: var(--color-text-2); text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.side__link .icon { display: none; }
.side__link:hover { color: var(--color-text); background: var(--color-surface-2); }
.side__link[aria-current="page"] { color: var(--color-accent-text); background: var(--color-accent-soft); }
.side__text { display: grid; }
.side__hint {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.view { display: grid; gap: var(--space-6); align-content: start; max-width: var(--page-max); padding: var(--space-6) var(--page-gutter) var(--space-12); }

@media (width >= 900px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .side {
    height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "brand" "nav" "." "logout";
    align-items: start; row-gap: var(--space-6);
    padding: var(--space-6) var(--space-4); border-bottom: 0; border-right: var(--rule);
  }
  .side__brand { padding-inline: var(--space-3); }
  .side__logout { justify-self: start; justify-items: start; }
  .side__nav { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); margin: 0; border: 0; }
  .side__link { justify-content: flex-start; gap: var(--space-3); min-height: var(--row-side); padding: var(--space-2) var(--space-3); }
  .side__link .icon { display: block; }
  .side__hint { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: var(--fs-xs); font-weight: var(--fw-regular); line-height: var(--lh-ui); color: var(--color-text-3); }
  .view { padding: var(--space-10) var(--space-10) var(--space-12); }
}

/* ---------- Page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.page-head__text { display: grid; gap: var(--space-2); min-width: 0; flex: 1 1 24rem; }
.page-head h1 { font-size: var(--fs-h2); }
.page-help { font-size: var(--fs-ui); line-height: var(--lh-body); color: var(--color-text-2); max-width: var(--measure); }

/* ---------- Buttons (MegaSeek 3.2) ---------- */
.btn {
  --btn-bg: transparent; --btn-fg: var(--color-text); --btn-bd: transparent;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--control-md); padding-inline: var(--space-4);
  font: var(--fw-bold) var(--fs-ui)/var(--lh-ui) var(--font-sans); white-space: nowrap; text-decoration: none;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-bd); border-radius: var(--radius);
  user-select: none;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out), transform var(--dur-instant) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--sm { height: var(--control-sm); padding-inline: var(--space-3); }
.btn--block { width: 100%; }
.btn--primary { --btn-bg: var(--color-accent); --btn-fg: var(--color-accent-ink); --btn-bd: var(--color-accent); }
.btn--primary:hover { --btn-bg: var(--color-text); --btn-fg: var(--color-bg); --btn-bd: var(--color-text); }
.btn--primary:active { --btn-bg: var(--color-accent-dim); --btn-bd: var(--color-accent-dim); --btn-fg: var(--color-accent-ink); }
.btn--secondary { --btn-bd: var(--color-line-control); }
.btn--secondary:hover { --btn-bg: var(--color-text); --btn-fg: var(--color-bg); --btn-bd: var(--color-text); }
.btn--ghost { --btn-fg: var(--color-text-2); }
.btn--ghost:hover { --btn-fg: var(--color-text); --btn-bg: var(--color-surface-2); }
.btn--ghost-danger { --btn-fg: var(--color-danger); }
.btn--ghost-danger:hover { --btn-bg: var(--color-danger-soft); }
.btn--danger { --btn-bg: var(--color-danger); --btn-fg: var(--color-bg); --btn-bd: var(--color-danger); }
.btn--danger:hover { --btn-bg: var(--color-text); --btn-fg: var(--color-bg); --btn-bd: var(--color-text); }
.btn:disabled, .btn[aria-disabled="true"] {
  --btn-bg: var(--color-surface-3); --btn-fg: var(--color-text-disabled); --btn-bd: var(--color-line);
  cursor: not-allowed; transform: none;
}
.btn--ghost:disabled { --btn-bg: transparent; --btn-bd: transparent; }
.btn:has(.btn__busy) { display: inline-grid; grid-auto-flow: column; place-items: center; }
.btn--block:has(.btn__busy) { display: grid; }
.btn__label { display: inline-flex; align-items: center; gap: var(--space-2); }
.btn__label, .btn__busy { grid-area: 1 / 1; }
.btn__busy { display: inline-flex; align-items: center; justify-content: center; visibility: hidden; }
.btn.is-loading { cursor: progress; }
.btn--primary.is-loading { --btn-bg: var(--color-accent-dim); --btn-bd: var(--color-accent-dim); --btn-fg: var(--color-accent-ink); }
.btn.is-loading .btn__label { visibility: hidden; }
.btn.is-loading .btn__busy { visibility: visible; }
.busy-dots { display: inline-flex; gap: var(--space-1); }
.busy-dots i { width: var(--space-1); height: var(--space-1); background: currentColor; opacity: 0.25; animation: busy var(--dur-busy) steps(1) infinite; }
.busy-dots i:nth-child(2) { animation-delay: calc(var(--dur-busy) / 3); }
.busy-dots i:nth-child(3) { animation-delay: calc(var(--dur-busy) / 3 * 2); }
.link { color: var(--color-text); font-weight: var(--fw-medium); text-decoration: underline; text-decoration-color: var(--color-line-control); text-underline-offset: 0.3em; }
.link:hover { text-decoration-color: var(--color-accent-text); }

/* ---------- Fields (MegaSeek 3.3) ---------- */
.field { display: grid; gap: var(--space-2); min-width: 0; align-content: start; }
.field__label { font: var(--fw-medium) var(--fs-sm)/var(--lh-ui) var(--font-sans); color: var(--color-text); }
.field__msg { font-size: var(--fs-xs); line-height: var(--lh-ui); color: var(--color-text-3); }
.input {
  width: 100%; min-width: 0; height: var(--control-md); padding-inline: var(--pad-input);
  background: var(--color-bg-sunken); color: var(--color-text); border: var(--rule-control); border-radius: var(--radius);
  font: var(--fw-regular) var(--fs-ui)/var(--lh-ui) var(--font-sans);
  transition: border-color var(--dur-fast) var(--ease-out);
  appearance: none;
}
.input--mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.input:hover { border-color: var(--color-text-3); }
.input:focus { border-color: var(--color-accent); outline: var(--focus-width) solid var(--focus-color); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--color-danger); }
.input:disabled { background: var(--color-surface-1); border: var(--rule); color: var(--color-text-disabled); cursor: not-allowed; }
.select { position: relative; display: flex; }
.select .input { padding-right: calc(var(--pad-input) + var(--icon-size) + var(--space-2)); cursor: pointer; }
.select option { background: var(--color-surface-2); color: var(--color-text); }
.select::after {
  content: ""; position: absolute; right: var(--pad-input); top: 50%; width: var(--space-2); height: var(--space-2);
  border-right: 1.5px solid var(--color-text-2); border-bottom: 1.5px solid var(--color-text-2);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.field-row { display: grid; gap: var(--space-5); }
@media (width >= 600px) { .field-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-error { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-3); font-size: var(--fs-sm); line-height: var(--lh-ui); color: var(--color-danger); background: var(--color-danger-soft); }
.form-error .icon { margin-top: 1px; }
.form-error--info { color: var(--color-text-2); background: var(--color-surface-2); }

.check { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--control-md); font-size: var(--fs-ui); line-height: var(--lh-ui); cursor: pointer; min-width: 0; }
.check input {
  appearance: none; margin: 0; flex-shrink: 0; display: inline-grid; place-content: center;
  width: var(--check-size); height: var(--check-size); background: var(--color-bg-sunken); border: var(--rule-control);
  cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.check input:hover { border-color: var(--color-text-3); }
.check input:checked { background: var(--color-accent); border-color: var(--color-accent); }
.check input:checked::before {
  content: ""; width: var(--icon-size-sm); height: var(--icon-size-sm); background: var(--color-accent-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.2l2.6 2.6L10 3.4' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.2l2.6 2.6L10 3.4' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.check input:disabled { border-color: var(--color-line); background: var(--color-surface-1); cursor: not-allowed; }
.check:has(input:disabled) { color: var(--color-text-disabled); cursor: not-allowed; }
.check__text { display: grid; gap: var(--space-1); justify-items: start; min-width: 0; }
.check__sub { font-size: var(--fs-xs); color: var(--color-text-3); }

/* ---------- Switch ---------- */
.switch {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-sm);
  padding: 0; border: 0; background: none; color: var(--color-text-2); font-size: var(--fs-sm); white-space: nowrap;
}
.switch__track {
  position: relative; display: inline-block; flex-shrink: 0; width: var(--switch-w); height: var(--switch-h);
  background: var(--color-bg-sunken); border: var(--rule-control);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.switch__thumb {
  position: absolute; top: 1px; left: 1px; width: var(--switch-thumb); height: var(--switch-thumb);
  background: var(--color-text-2); transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.switch[aria-checked="true"] { color: var(--color-text); }
.switch[aria-checked="true"] .switch__track { background: var(--color-accent); border-color: var(--color-accent); }
.switch[aria-checked="true"] .switch__thumb { background: var(--color-accent-ink); transform: translateX(calc(var(--switch-w) - var(--switch-thumb) - var(--space-1))); }
.switch:hover .switch__track { border-color: var(--color-text-3); }
.switch:disabled { cursor: progress; opacity: 0.6; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  height: var(--badge-h); padding: 0 var(--pad-badge);
  font: var(--fw-medium) var(--fs-xs)/1 var(--font-sans); letter-spacing: var(--ls-ko); white-space: nowrap;
  color: var(--color-text-2); background: var(--color-surface-2);
}
.badge .icon { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.badge--success { background: var(--color-success-soft); color: var(--color-success); }
.badge--warn { background: var(--color-warn-soft); color: var(--color-warn); }

/* ---------- Notice ---------- */
.notice {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  font-size: var(--fs-ui); line-height: var(--lh-ui); background: var(--color-warn-soft); color: var(--color-text);
}
.notice > .icon { color: var(--color-warn); margin-top: 1px; }
.notice--danger { background: var(--color-danger-soft); }
.notice--danger > .icon { color: var(--color-danger); }
.notice__body { flex: 1 1 auto; min-width: 0; }
.notice .btn { margin: calc(var(--space-2) * -1) calc(var(--space-2) * -1) calc(var(--space-2) * -1) 0; }

/* ---------- Table (MegaSeek 3.8) ---------- */
.list { display: grid; gap: var(--space-3); }
.list__help { font-size: var(--fs-xs); line-height: var(--lh-ui); color: var(--color-text-3); }
.table-wrap { border: var(--rule); overflow-x: auto; background: var(--color-surface-1); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); line-height: var(--lh-ui); }
.table th {
  height: var(--control-md); padding: 0 var(--space-4);
  text-align: left; white-space: nowrap; font: var(--fw-medium) var(--fs-xs)/1 var(--font-sans); letter-spacing: var(--ls-ko);
  color: var(--color-text-3); background: var(--color-surface-2); border-bottom: var(--rule-strong);
}
.table td { height: var(--row-h); padding: var(--space-2) var(--space-4); border-bottom: var(--rule); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--color-surface-2); }
.table tbody tr.is-broken { background: var(--color-warn-soft); }
.table .t-name { font-weight: var(--fw-bold); }
.table .t-mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.table .t-url { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--color-text-2); max-width: var(--col-url); }
.table .t-num { text-align: right; font-family: var(--font-mono); font-size: var(--fs-sm); white-space: nowrap; }
.table th.t-num { text-align: right; }
.table .t-act { text-align: right; width: 1%; white-space: nowrap; }
.table .t-models { color: var(--color-text-2); min-width: 14ch; }
.cell-stack { display: grid; gap: var(--space-1); justify-items: start; }
.cell-note { font-size: var(--fs-xs); color: var(--color-text-2); }
.row-actions { display: inline-flex; gap: var(--space-1); justify-content: flex-end; }
.table__state td { height: auto; padding: var(--space-10) var(--space-4); text-align: center; }
.state { display: grid; gap: var(--space-3); justify-items: center; max-width: 44ch; margin-inline: auto; font-size: var(--fs-ui); color: var(--color-text-2); }
.state__title { font-weight: var(--fw-bold); color: var(--color-text); }
.state--error .state__title { color: var(--color-danger); }
.skel { display: block; height: var(--space-3); background: var(--color-surface-3); width: var(--w, 60%); animation: skel var(--dur-pulse) var(--ease-in-out) infinite; }
.table__skel td { height: var(--row-h); }

@media (width < 600px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: var(--space-3) var(--space-4); border-bottom: var(--rule); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
    height: auto; min-height: var(--control-md); padding: var(--space-1) 0; border: 0; text-align: right;
  }
  .table--stack td::before { content: attr(data-label); flex-shrink: 0; font-size: var(--fs-xs); color: var(--color-text-3); text-align: left; }
  .table--stack td.t-name { font-size: var(--fs-body); }
  .table--stack td.t-name::before { content: none; }
  .table--stack td.t-act { width: 100%; padding-top: var(--space-2); }
  .table--stack td.t-act::before { content: none; }
  .table--stack .row-actions { width: 100%; }
  .table--stack .cell-stack { justify-items: end; }
  .table--stack .t-url { max-width: none; }
  .table--stack tr.table__state, .table--stack tr.table__skel { padding: 0; }
  .table--stack .table__state td { display: block; text-align: center; padding: var(--space-8) var(--space-4); }
  .table--stack .table__skel td { padding: var(--space-3) 0; }
}

/* ---------- Dialog ---------- */
.dlg {
  width: min(var(--dialog-w), 100% - var(--space-8)); max-width: none; max-height: min(88dvh, 960px);
  padding: 0; color: var(--color-text); background: var(--color-surface-1); border: var(--rule-strong); box-shadow: var(--shadow-pop);
}
.dlg--sm { width: min(var(--dialog-w-sm), 100% - var(--space-8)); }
.dlg[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.dlg::backdrop { background: var(--color-scrim); }
.dlg__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-4) var(--space-6); border-bottom: var(--rule); }
.dlg__head h2 { font-size: var(--fs-h3); min-width: 0; }
.dlg__body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: var(--space-6); align-content: start; padding: var(--space-6); }
.dlg__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: var(--rule); background: var(--color-surface-2); }
.dlg__foot-hint { display: grid; gap: var(--space-1); flex: 1 1 16rem; font-size: var(--fs-xs); line-height: var(--lh-ui); color: var(--color-text-3); }
.dlg__actions { display: flex; gap: var(--space-2); margin-left: auto; }
.dlg__body > fieldset { display: grid; gap: var(--space-6); margin: 0; padding: 0; border: 0; min-width: 0; }
@media (width < 600px) {
  .dlg, .dlg--sm { width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; }
  .dlg__head { padding-left: var(--space-4); }
  .dlg__body { padding: var(--space-5) var(--space-4); }
  .dlg__foot { padding: var(--space-3) var(--space-4); }
  .dlg__actions { width: 100%; }
  .dlg__actions .btn { flex: 1 1 0; }
}

/* ---------- Model picker ---------- */
.picker { display: grid; gap: var(--space-3); }
.picker__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.picker__title { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.picker__count { font-size: var(--fs-xs); color: var(--color-text-3); }
.picker__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.picker__tools .input { flex: 1 1 12rem; }
@media (width < 600px) { .picker__tools .input { flex-basis: 100%; } }
.picker__list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  gap: 0 var(--space-4); padding: var(--space-2) var(--space-4); background: var(--color-bg-sunken); border: var(--rule);
}
.picker__list .check { padding-block: var(--space-1); }
.picker__model { font-family: var(--font-mono); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.picker__empty { padding: var(--space-6) var(--space-4); font-size: var(--fs-ui); color: var(--color-text-2); background: var(--color-bg-sunken); border: var(--rule); }
.load-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.load-row .field__msg { flex: 1 1 16rem; }

/* ---------- Secret ---------- */
.secret { display: flex; align-items: stretch; min-width: 0; border: var(--rule-control); background: var(--color-bg-sunken); }
.secret code { flex: 1 1 auto; min-width: 0; padding: var(--space-3) var(--pad-input); font-size: var(--fs-sm); line-height: var(--lh-ui); word-break: break-all; user-select: all; }
.secret .btn { height: auto; min-height: var(--control-md); border-width: 0 0 0 1px; border-left: var(--rule-control); }

/* ---------- Touch targets under 900px ---------- */
@media (width < 900px) {
  .btn, .btn--sm { min-height: var(--hit-min); }
  .input { height: var(--hit-min); }
  .check, .switch { min-height: var(--hit-min); }
  :is(button, select, label.check) { min-width: var(--hit-min); }
}

@keyframes busy { 0%, 33% { opacity: 1; } 34%, 100% { opacity: 0.25; } }
@keyframes skel { 50% { opacity: 0.5; } }

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