:root {
  color-scheme: dark;
  --bg: #08060b;
  --bg-soft: #0d0912;
  --surface: rgba(20, 13, 27, .86);
  --surface-strong: #1b1124;
  --surface-raised: #24152f;
  --line: rgba(215, 173, 255, .16);
  --line-strong: rgba(215, 173, 255, .32);
  --text: #f7f2fb;
  --muted: #a99caf;
  --dim: #756a7b;
  --violet: #9c58db;
  --violet-bright: #c287ff;
  --rose: #c564ad;
  --focus: #d7adff;
  --good: #6de0ad;
  --warn: #efbf6a;
  --bad: #ff7b9b;
  --gradient: linear-gradient(135deg, #7040aa, #9c58db 52%, #c564ad);
  --shadow: 0 24px 70px rgba(0, 0, 0, .42);
  --radius: 22px 8px 22px 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--text); background: radial-gradient(circle at 12% 15%, rgba(112, 64, 170, .13), transparent 28rem), var(--bg); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; padding: 10px 14px; transform: translateY(-150%); border-radius: 8px; background: var(--text); color: var(--bg); }
.skip-link:focus { transform: none; }
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.ambient-one { width: 30vw; height: 30vw; top: -16vw; left: 38vw; background: rgba(156, 88, 219, .17); }
.ambient-two { width: 22vw; height: 22vw; right: -10vw; bottom: 10vh; background: rgba(197, 100, 173, .09); }

.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; letter-spacing: .13em; }
.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 13px; letter-spacing: .22em; }
.brand small { font-size: 8px; color: #c8a5e8; letter-spacing: .18em; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 8px); grid-template-rows: repeat(2, 8px); gap: 3px; width: 31px; height: 31px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 10px 3px 10px 3px; background: var(--gradient); box-shadow: 0 0 30px rgba(156, 88, 219, .28); }
.brand-mark i { border-radius: 2px; background: white; opacity: .94; }
.eyebrow { margin: 0 0 10px; color: #c9a2ef; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.muted { color: var(--muted); }

.auth-shell { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(360px, .6fr); min-height: 100vh; padding: clamp(24px, 5vw, 72px); gap: clamp(40px, 8vw, 120px); align-items: center; }
.auth-story { min-height: min(760px, 86vh); display: flex; flex-direction: column; justify-content: space-between; padding: clamp(8px, 2vw, 24px); }
.story-copy { max-width: 760px; margin: auto 0; }
.story-copy h1 { max-width: 700px; margin: 0; font-size: clamp(46px, 6.2vw, 92px); line-height: .94; letter-spacing: -.065em; }
.story-copy > p:last-child { max-width: 650px; margin: 28px 0 0; color: #b9acbf; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.65; }
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.story-grid article { min-height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: 18px 5px 18px 5px; background: linear-gradient(150deg, rgba(27, 17, 36, .9), rgba(13, 9, 18, .5)); }
.story-grid span { display: block; color: var(--violet-bright); font: 700 10px ui-monospace, monospace; letter-spacing: .18em; }
.story-grid strong { display: block; margin-top: 28px; font-size: 14px; }
.story-grid p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-card { padding: clamp(28px, 4vw, 48px); border: 1px solid var(--line-strong); border-radius: 32px 9px 32px 9px; background: linear-gradient(145deg, rgba(27, 17, 36, .96), rgba(13, 9, 18, .92)); box-shadow: var(--shadow); }
.auth-card h2 { margin: 0; font-size: 30px; letter-spacing: -.035em; }
.auth-card .muted { margin: 10px 0 28px; font-size: 14px; line-height: 1.55; }
.auth-foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.auth-foot a { color: #cfb0ed; text-decoration: none; }

.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: #d8cdda; font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 11px 4px 11px 4px; background: rgba(8, 6, 11, .72); color: var(--text); padding: 12px 13px; transition: border-color .18s, box-shadow .18s; }
textarea { resize: vertical; min-height: 90px; }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus, textarea:focus, select:focus { border-color: var(--violet-bright); outline: none; box-shadow: 0 0 0 3px rgba(156, 88, 219, .15); }
fieldset { margin: 20px 0 0; padding: 0; border: 0; }
legend { font-size: 12px; font-weight: 800; }
.field-help { margin: 5px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-error { margin: 14px 0 0; padding: 11px 12px; border: 1px solid rgba(255,123,155,.3); border-radius: 10px 3px 10px 3px; background: rgba(255,123,155,.08); color: #ffb4c6; font-size: 12px; }
.text-button { padding: 0; margin-bottom: 24px; border: 0; background: none; color: #ceb0ed; cursor: pointer; }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 11px 4px 11px 4px; padding: 9px 15px; font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .16s, border-color .16s, background .16s, opacity .16s; text-decoration: none; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.primary { background: var(--gradient); color: white; box-shadow: 0 10px 28px rgba(112,64,170,.22); }
.button.secondary { border-color: var(--line-strong); background: var(--surface-raised); }
.button.ghost { border-color: var(--line); background: transparent; color: #d6c7dc; }
.button.danger { border-color: rgba(255,123,155,.25); background: rgba(255,123,155,.08); color: #ff9db5; }
.button.small { min-height: 32px; padding: 6px 10px; font-size: 10px; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 11px 4px 11px 4px; background: var(--surface); cursor: pointer; }

.portal-shell { min-height: 100vh; display: grid; grid-template: 68px 1fr / 248px 1fr; }
.topbar { position: sticky; top: 0; z-index: 30; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(8,6,11,.85); backdrop-filter: blur(22px); }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 12px; }
.connection-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.connection-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); }
.connection-pill.offline i { background: var(--bad); box-shadow: none; }
.account-button { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border: 1px solid transparent; border-radius: 13px 5px 13px 5px; background: transparent; cursor: pointer; }
.account-button:hover { border-color: var(--line); background: var(--surface); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 11px 4px 11px 4px; background: var(--gradient); font-size: 12px; font-weight: 900; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-copy { min-width: 130px; display: grid; gap: 2px; text-align: left; }
.account-copy strong { font-size: 11px; }
.account-copy small { color: var(--muted); font-size: 9px; }
.account-menu { position: absolute; top: 54px; right: 0; z-index: 40; width: 180px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 14px 5px 14px 5px; background: #171020; box-shadow: var(--shadow); }
.account-menu a, .account-menu button { width: 100%; display: block; padding: 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 11px; text-align: left; text-decoration: none; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: rgba(156,88,219,.12); }

.sidebar { position: sticky; top: 68px; height: calc(100vh - 68px); display: flex; flex-direction: column; padding: 18px 14px; border-right: 1px solid var(--line); background: rgba(10,7,14,.72); }
.sidebar nav { display: grid; gap: 3px; }
.nav-label { margin: 15px 10px 7px; color: var(--dim); font-size: 8px; font-weight: 900; letter-spacing: .2em; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 11px; border: 1px solid transparent; border-radius: 12px 4px 12px 4px; color: #aa9daf; font-size: 12px; font-weight: 700; text-decoration: none; }
.sidebar nav a > span { width: 20px; color: #bc8fe8; font-size: 16px; text-align: center; }
.sidebar nav a b { min-width: 22px; margin-left: auto; padding: 3px 6px; border-radius: 999px; background: rgba(156,88,219,.12); color: #cba4ef; font-size: 9px; text-align: center; }
.sidebar nav a:hover { color: var(--text); background: rgba(156,88,219,.07); }
.sidebar nav a.active { border-color: rgba(156,88,219,.22); background: linear-gradient(90deg, rgba(112,64,170,.18), rgba(156,88,219,.05)); color: white; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 14px 10px; border-top: 1px solid var(--line); }
.sidebar-foot p { display: grid; gap: 4px; margin: 0; font-size: 10px; }
.sidebar-foot p span { color: var(--dim); font-size: 8px; }
.version-pill { padding: 4px 6px; border: 1px solid rgba(109,224,173,.2); border-radius: 999px; color: var(--good); font-size: 7px; font-weight: 900; letter-spacing: .1em; }

.workspace { min-width: 0; padding: clamp(24px, 4vw, 56px); }
.page { max-width: 1420px; margin: 0 auto; animation: enter .28s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.05em; }
.page-head p:last-child { max-width: 660px; margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notice { max-width: 1420px; margin: 0 auto 18px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 13px 5px 13px 5px; background: rgba(156,88,219,.1); color: #e7d4f8; font-size: 12px; }
.notice.error { border-color: rgba(255,123,155,.3); background: rgba(255,123,155,.08); color: #ffb4c6; }
.notice.success { border-color: rgba(109,224,173,.25); background: rgba(109,224,173,.07); color: #a8f0d0; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.metric { min-height: 116px; padding: 20px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.metric strong { display: block; margin-top: 19px; font-size: 27px; letter-spacing: -.04em; }
.metric small { display: block; margin-top: 5px; color: var(--dim); font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(20,13,27,.92), rgba(13,9,18,.76)); box-shadow: 0 16px 50px rgba(0,0,0,.18); overflow: hidden; }
.panel-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 14px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }
.stack { display: grid; gap: 14px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.status-badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-badge.approved, .status-badge.active { border-color: rgba(109,224,173,.25); color: var(--good); }
.status-badge.pending, .status-badge.draft { border-color: rgba(239,191,106,.25); color: var(--warn); }
.status-badge.rejected, .status-badge.revoked, .status-badge.expired { border-color: rgba(255,123,155,.25); color: var(--bad); }

.onboarding-list { display: grid; }
.onboarding-step { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; min-height: 70px; border-bottom: 1px solid var(--line); }
.onboarding-step:last-child { border: 0; }
.step-number { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px 3px 9px 3px; color: var(--violet-bright); font: 800 10px ui-monospace, monospace; }
.onboarding-step.done .step-number { border-color: rgba(109,224,173,.25); background: rgba(109,224,173,.08); color: var(--good); }
.onboarding-step strong { display: block; font-size: 11px; }
.onboarding-step p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.activity-empty, .empty-state { display: grid; place-items: center; min-height: 260px; padding: 28px; text-align: center; }
.empty-state.compact { min-height: 150px; }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 15px; border: 1px solid var(--line-strong); border-radius: 17px 5px 17px 5px; background: rgba(156,88,219,.07); color: var(--violet-bright); font-size: 24px; }
.empty-state h3 { margin: 0; font-size: 15px; }
.empty-state p { max-width: 420px; margin: 7px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.55; }

.runner-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 16px; }
.runner-list { display: grid; }
.runner-list-item { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; min-height: 66px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.runner-list-item:last-child { border-bottom: 0; }
.runner-list-item:hover, .runner-list-item.active { background: rgba(156,88,219,.08); }
.runner-glyph { width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 11px 4px 11px 4px; background: var(--surface-raised); color: var(--violet-bright); font-size: 14px; font-weight: 900; }
.runner-glyph img { width: 100%; height: 100%; object-fit: cover; }
.runner-list-item strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.runner-list-item small { display: block; margin-top: 4px; color: var(--dim); font-size: 8px; }
.runner-detail-hero { display: flex; align-items: center; gap: 15px; padding: 20px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, rgba(112,64,170,.14), transparent); }
.runner-detail-hero .runner-glyph { width: 52px; height: 52px; border-radius: 16px 5px 16px 5px; font-size: 18px; }
.runner-detail-hero h2 { margin: 0 0 6px; font-size: 20px; }
.detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uid { color: var(--dim); font: 9px ui-monospace, monospace; }
.detail-tabs { display: flex; gap: 4px; padding: 10px 18px 0; border-bottom: 1px solid var(--line); }
.detail-tabs button { padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 10px; font-weight: 800; cursor: pointer; }
.detail-tabs button.active { border-color: var(--violet-bright); color: white; }
.detail-content { padding: 20px; }

.scope-picker { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; max-height: 250px; overflow: auto; padding: 2px; scrollbar-width: thin; }
.scope-option { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px 3px 10px 3px; background: rgba(8,6,11,.35); cursor: pointer; }
.scope-option:hover { border-color: var(--line-strong); }
.scope-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--violet); }
.scope-option span { overflow: hidden; font: 9px ui-monospace, monospace; text-overflow: ellipsis; }
.scope-cloud { display: flex; gap: 6px; flex-wrap: wrap; }
.scope-chip { padding: 5px 7px; border: 1px solid var(--line); border-radius: 999px; background: rgba(156,88,219,.06); color: #cfb2ea; font: 8px ui-monospace, monospace; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 8px; letter-spacing: .14em; text-align: left; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); color: #d9cedd; font-size: 10px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table strong { display: block; color: var(--text); font-size: 11px; }
.data-table small { display: block; margin-top: 3px; color: var(--dim); }
.table-wrap { overflow-x: auto; }
.date-copy { color: var(--muted); white-space: nowrap; }

.profile-status { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 16px 5px 16px 5px; background: rgba(156,88,219,.06); }
.profile-status-orb { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: radial-gradient(circle, rgba(156,88,219,.32), rgba(112,64,170,.05)); color: var(--violet-bright); font-size: 20px; }
.profile-status h3 { margin: 0 0 5px; }
.profile-status p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.key-compose { display: grid; grid-template-columns: 1.1fr .7fr 1.5fr auto; align-items: end; gap: 10px; }
.select-runner { min-width: 180px; }
.secret-reveal { display: flex; gap: 8px; margin: 18px 0; padding: 10px; border: 1px solid var(--line-strong); border-radius: 12px 4px 12px 4px; background: #08060b; }
.secret-reveal code { flex: 1; align-self: center; overflow-wrap: anywhere; color: #e2c5ff; font-size: 11px; }
.confirm-check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.confirm-check input { width: 15px; }

.ability-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px 5px 14px 5px; background: rgba(8,6,11,.35); }
.ability-card-head { display: flex; justify-content: space-between; gap: 12px; }
.ability-card h3 { margin: 0; font-size: 13px; }
.ability-card p { margin: 6px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.operation-builder { padding: 14px; border: 1px solid var(--line); border-radius: 12px 4px 12px 4px; background: rgba(8,6,11,.38); }
.operation-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.operation-head strong { font-size: 10px; }
.field-row { display: grid; grid-template-columns: 1fr .7fr auto auto; align-items: end; gap: 8px; margin-top: 8px; }
.field-row label { font-size: 9px; }
.check-field { display: flex; align-items: center; min-height: 39px; }
.check-field input { width: 14px; }

.endpoint-card { padding: 17px; border: 1px solid var(--line); border-radius: 14px 5px 14px 5px; background: rgba(8,6,11,.38); }
.endpoint-line { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.method { padding: 4px 6px; border-radius: 4px; background: rgba(156,88,219,.16); color: var(--violet-bright); font: 900 8px ui-monospace,monospace; }
.endpoint-line code { color: #e4d7e8; font-size: 10px; overflow-wrap: anywhere; }
.endpoint-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.code-block { position: relative; padding: 16px; border: 1px solid var(--line); border-radius: 13px 4px 13px 4px; background: #070509; overflow: auto; }
.code-block code { color: #d9bee9; font: 10px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.security-list { display: grid; gap: 0; }
.security-item { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.security-item:last-child { border: 0; }
.security-item > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px 3px 8px 3px; background: rgba(109,224,173,.08); color: var(--good); font-size: 10px; }
.security-item strong { display: block; font-size: 11px; }
.security-item p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.modal { width: min(720px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 1px solid var(--line-strong); border-radius: 24px 8px 24px 8px; background: #140d1b; color: var(--text); box-shadow: 0 30px 100px #000; overflow: auto; }
.modal::backdrop { background: rgba(5,3,8,.74); backdrop-filter: blur(8px); }
.modal form, .secret-modal { padding: 24px; }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.modal-head h2 { margin: 0; font-size: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.secret-modal { width: min(570px, calc(100vw - 30px)); }

.mobile-only { display: none; }

@media (max-width: 1000px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: auto; gap: 60px; }
  .auth-card { max-width: 620px; width: 100%; justify-self: center; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dashboard-grid, .runner-layout { grid-template-columns: 1fr; }
  .runner-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .runner-list-item:nth-child(odd) { border-right: 1px solid var(--line); }
  .key-compose { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  body { overflow-x: clip; }
  .auth-shell { width: 100%; min-width: 0; padding: 22px; align-content: start; }
  .auth-shell > *, .auth-story, .story-copy { min-width: 0; max-width: 100%; }
  .auth-story { width: 100%; gap: 44px; }
  .story-copy h1 { width: 100%; max-width: calc(100vw - 44px); font-size: clamp(38px, 11.5vw, 44px); overflow-wrap: normal; }
  .story-grid { grid-template-columns: 1fr; }
  .story-grid article { min-height: auto; }
  .story-grid strong { margin-top: 15px; }
  .auth-card { padding: 25px 20px; }
  .auth-foot { flex-direction: column; gap: 6px; }
  .portal-shell { grid-template: 60px 1fr / 1fr; }
  .topbar { padding: 0 12px; }
  .brand.compact small, .account-copy, .connection-pill { display: none; }
  .mobile-only { display: inline-grid; }
  .sidebar { position: fixed; inset: 60px auto 0 0; z-index: 25; width: min(285px, 86vw); height: calc(100vh - 60px); transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .workspace { grid-row: 2; padding: 22px 14px 90px; }
  .page-head { align-items: start; flex-direction: column; }
  .page-head h1 { font-size: 34px; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric { min-height: 100px; padding: 15px; }
  .metric strong { margin-top: 13px; font-size: 22px; }
  .split, .three-col, .form-grid, .scope-picker, .key-compose { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .runner-list { grid-template-columns: 1fr; }
  .runner-list-item:nth-child(odd) { border-right: 0; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .detail-tabs { overflow-x: auto; }
  .table-wrap { margin: 0; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table tr { padding: 11px 14px; border-bottom: 1px solid var(--line); }
  .data-table td { display: flex; justify-content: space-between; gap: 15px; padding: 5px 0; border: 0; text-align: right; }
  .data-table td::before { content: attr(data-label); color: var(--dim); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
  .modal form, .secret-modal { padding: 20px; }
}

@media (max-width: 500px) {
  .story-copy { width: min(100%, 320px); }
  .story-copy h1 { max-width: 320px; font-size: 40px; }
  .story-copy > p:last-child { max-width: 320px; font-size: 15px; }
}

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