:root {
  color-scheme: light;
  --page: #f3f5f0;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #edf1e8;
  --surface-strong: #172018;
  --gate-brand-bg: #172018;
  --gate-brand-text: #f3f5f0;
  --text: #162018;
  --text-soft: #536057;
  --text-faint: #79847c;
  --line: #dce3da;
  --line-strong: #c7d1c5;
  --accent: #d9ff45;
  --accent-hover: #cbed35;
  --accent-ink: #192104;
  --green: #23794f;
  --green-soft: #e4f4e9;
  --amber: #a85f09;
  --amber-soft: #fff0d5;
  --red: #b23d34;
  --red-soft: #ffeae7;
  --blue: #386ea8;
  --blue-soft: #e9f2fd;
  --purple: #7058a7;
  --purple-soft: #f0ebfb;
  --shadow: 0 16px 46px rgba(26, 42, 30, 0.09);
  --shadow-small: 0 7px 20px rgba(26, 42, 30, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --sidebar: 248px;
  --topbar: 76px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-synthesis: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f1411;
  --surface: #171d19;
  --surface-raised: #1c241f;
  --surface-soft: #222a24;
  --surface-strong: #edf3ed;
  --gate-brand-bg: #111914;
  --gate-brand-text: #edf3ed;
  --text: #edf3ed;
  --text-soft: #aeb8b0;
  --text-faint: #818d84;
  --line: #2d3730;
  --line-strong: #3c4840;
  --accent: #d7fb4b;
  --accent-hover: #e3ff6e;
  --accent-ink: #172004;
  --green: #70d49a;
  --green-soft: #173528;
  --amber: #efb35a;
  --amber-soft: #3b2a15;
  --red: #ff9188;
  --red-soft: #40201e;
  --blue: #8dbaf0;
  --blue-soft: #1b3048;
  --purple: #c2aaf4;
  --purple-soft: #302743;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
  --shadow-small: 0 8px 26px rgba(0, 0, 0, 0.23);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
    --page: #0f1411;
    --surface: #171d19;
    --surface-raised: #1c241f;
    --surface-soft: #222a24;
    --surface-strong: #edf3ed;
    --gate-brand-bg: #111914;
    --gate-brand-text: #edf3ed;
    --text: #edf3ed;
    --text-soft: #aeb8b0;
    --text-faint: #818d84;
    --line: #2d3730;
    --line-strong: #3c4840;
    --accent: #d7fb4b;
    --accent-hover: #e3ff6e;
    --accent-ink: #172004;
    --green: #70d49a;
    --green-soft: #173528;
    --amber: #efb35a;
    --amber-soft: #3b2a15;
    --red: #ff9188;
    --red-soft: #40201e;
    --blue: #8dbaf0;
    --blue-soft: #1b3048;
    --purple: #c2aaf4;
    --purple-soft: #302743;
    --shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
    --shadow-small: 0 8px 26px rgba(0, 0, 0, 0.23);
  }
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--page); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--page); color: var(--text); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .52; }
a { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 72%, #4f7800); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 5000; top: 8px; left: 8px; padding: 9px 14px; border-radius: var(--radius-sm); background: var(--surface-strong); color: var(--page); transform: translateY(-150%); transition: transform 160ms ease; }
.skip-link:focus { transform: translateY(0); }
.eyebrow { margin: 0 0 7px; color: var(--text-faint); font-size: 11px; font-weight: 800; letter-spacing: .13em; line-height: 1.2; text-transform: uppercase; }
.muted { color: var(--text-soft); }

.brand-mark { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 13px; background: var(--accent); box-shadow: inset 0 -10px 24px rgba(112, 146, 0, .12); color: var(--accent-ink); font-size: 18px; font-weight: 900; }
.brand-mark svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.brand-mark--large { width: 66px; height: 66px; border-radius: 20px; font-size: 26px; }

.boot-view { position: fixed; z-index: 3000; inset: 0; display: grid; place-content: center; justify-items: center; gap: 17px; padding: 24px; background: var(--page); color: var(--text-soft); text-align: center; }
.boot-view p { margin: 0; font-weight: 650; }

.gate-view { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.06fr) minmax(400px, .94fr); }
.gate-brand { display: flex; min-height: 100vh; flex-direction: column; justify-content: center; padding: clamp(44px, 8vw, 118px); background: var(--gate-brand-bg); color: var(--gate-brand-text); }
.gate-brand .eyebrow { margin-top: 34px; color: color-mix(in srgb, var(--gate-brand-text) 56%, transparent); }
.gate-brand h1 { margin: 0; font-size: clamp(42px, 5vw, 68px); letter-spacing: -.055em; line-height: .98; }
.gate-brand > p:not(.eyebrow) { max-width: 560px; margin: 24px 0 0; color: color-mix(in srgb, var(--gate-brand-text) 70%, transparent); font-size: 16px; }
.gate-brand .support-copy { margin-top: auto !important; padding-top: 50px; font-size: 12px !important; }
.gate-panel { position: relative; display: grid; min-height: 100vh; place-items: center; padding: 68px clamp(24px, 7vw, 92px); background: var(--page); }
.gate-panel__body { width: min(100%, 430px); }
.gate-panel h2, .password-card h1 { margin: 0 0 10px; font-size: clamp(27px, 3vw, 36px); letter-spacing: -.035em; }
.gate-panel .muted { margin: 0 0 28px; }
.gate-theme { position: absolute; top: calc(20px + var(--safe-top)); right: calc(20px + var(--safe-right)); }
.fine-print, .field-help { margin: 15px 0 0; color: var(--text-faint); font-size: 12px; }

.password-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.password-card { width: min(100%, 520px); padding: clamp(24px, 5vw, 44px); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.password-card .brand-mark { margin-bottom: 24px; }
.password-card .muted { margin: 0 0 26px; }
.password-card .text-button { display: block; margin: 16px auto 0; }

.field { display: grid; gap: 7px; margin: 17px 0 0; }
.field > span { font-size: 13px; font-weight: 760; }
.field input, .field select, .field textarea, .compact-field input, .compact-field select { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .compact-field input:focus, .compact-field select:focus { border-color: color-mix(in srgb, var(--green) 62%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-check { display: flex; align-items: flex-start; gap: 9px; margin: 18px 0 0; }
.field-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green); }
.form-message { min-height: 22px; margin: 13px 0 0; color: var(--red); font-size: 13px; }

.button { min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; font-weight: 760; transition: background 150ms ease, border-color 150ms ease, transform 150ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button--primary { background: var(--accent); color: var(--accent-ink); }
.button--primary:hover:not(:disabled) { background: var(--accent-hover); }
.button--secondary { border-color: var(--line-strong); background: var(--surface-strong); color: var(--page); }
.button--quiet { border-color: var(--line); background: var(--surface); }
.button--danger { border-color: color-mix(in srgb, var(--red) 30%, var(--line)); background: var(--red-soft); color: var(--red); }
.button--full { width: 100%; margin-top: 22px; }
.text-button { padding: 5px; background: transparent; color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; }
.icon-button, .theme-button { display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-soft); }

.studio-shell { min-height: 100vh; }
.studio-sidebar { position: fixed; z-index: 120; inset: 0 auto 0 0; display: flex; width: var(--sidebar); flex-direction: column; padding: calc(21px + var(--safe-top)) 14px calc(19px + var(--safe-bottom)); border-right: 1px solid var(--line); background: var(--surface); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 21px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 15px; }
.sidebar-brand span { color: var(--text-faint); font-size: 11px; }
.studio-nav { display: grid; min-height: 0; align-content: start; gap: 3px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.nav-section-label { margin: 14px 11px 4px; color: var(--text-faint); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.nav-button { position: relative; display: flex; width: 100%; min-height: 43px; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; background: transparent; color: var(--text-soft); text-align: left; }
.nav-button--link { text-decoration: none; }
.nav-button:hover { background: var(--surface-soft); color: var(--text); }
.nav-button.is-active { background: var(--surface-soft); color: var(--text); font-weight: 780; }
.nav-button.is-active::before { position: absolute; top: 10px; bottom: 10px; left: -5px; width: 3px; border-radius: 9px; background: var(--accent); content: ""; }
.nav-icon { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; color: var(--text-faint); }
.nav-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.nav-label--mobile { display: none; }
.mobile-more-button { display: none; }
.nav-count { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--red-soft); color: var(--red); font-size: 11px; font-weight: 800; }
.sidebar-note { display: grid; gap: 5px; margin-top: auto; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.sidebar-note strong { font-size: 12px; }
.sidebar-note span { color: var(--text-faint); font-size: 10px; line-height: 1.45; }

.studio-workspace { min-height: 100vh; margin-left: var(--sidebar); }
.studio-topbar { position: sticky; z-index: 100; top: 0; display: flex; min-height: var(--topbar); align-items: center; gap: 20px; padding: calc(11px + var(--safe-top)) calc(26px + var(--safe-right)) 11px 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--page) 91%, transparent); backdrop-filter: blur(16px); }
.studio-topbar h1 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.studio-topbar .eyebrow { margin-bottom: 3px; }
.scope-control { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.scope-control label { color: var(--text-faint); font-size: 11px; font-weight: 750; }
.scope-control select { min-height: 39px; padding: 7px 30px 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 8px; }
.icon-button svg, .theme-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; margin-right: 3px; color: var(--text-faint); font-size: 12px; }
.connection-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 13%, transparent); }
.connection-state.is-error i { background: var(--red); }
.account-button { display: flex; min-height: 44px; align-items: center; gap: 9px; padding: 5px 9px 5px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; }
.account-avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: var(--surface-soft); color: var(--green); font-weight: 850; }
.account-button strong, .account-button small { display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button small { color: var(--text-faint); font-size: 10px; }
.account-menu { position: absolute; z-index: 150; top: calc(100% + 8px); right: 0; width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow-small); }
.account-menu a, .account-menu button { display: block; width: 100%; padding: 9px 10px; border-radius: 8px; background: transparent; text-align: left; text-decoration: none; }
.account-menu a:hover, .account-menu button:hover { background: var(--surface-soft); }

.studio-main { width: min(100%, 1520px); margin: 0 auto; padding: 28px clamp(18px, 3vw, 42px) calc(56px + var(--safe-bottom)); }
.page-loading { display: grid; min-height: 45vh; place-content: center; justify-items: center; gap: 12px; color: var(--text-faint); }
.spinner { width: 25px; height: 25px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading h2 { margin: 0 0 5px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.045em; line-height: 1.08; }
.page-heading p:last-child { max-width: 720px; margin: 0; color: var(--text-soft); }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 20px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line)); border-radius: var(--radius-md); background: var(--blue-soft); color: var(--text-soft); }
.notice strong { display: block; color: var(--text); }
.notice p { margin: 2px 0 0; }
.notice--warning { border-color: color-mix(in srgb, var(--amber) 30%, var(--line)); background: var(--amber-soft); }
.notice-symbol { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: var(--surface); color: var(--blue); font-weight: 900; }
.one-time-url > div { min-width: 0; flex: 1; }
.one-time-url code { display: block; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); overflow-wrap: anywhere; user-select: all; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.metric-card, .panel, .profile-card, .album-card, .work-card, .channel-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-small); }
.metric-card { min-height: 150px; padding: 18px; }
.metric-card__head { display: flex; justify-content: space-between; gap: 12px; color: var(--text-soft); font-size: 12px; }
.metric-card__value { display: block; margin-top: 13px; font-size: clamp(30px, 4vw, 45px); letter-spacing: -.055em; line-height: 1; }
.metric-card__foot { display: block; margin-top: 12px; color: var(--text-faint); font-size: 11px; }
.metric-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--green); }
.metric-dot.is-purple { background: var(--purple); }
.metric-dot.is-amber { background: var(--amber); }
.metric-dot.is-red { background: var(--red); }

.panel { padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 17px; }
.panel-head p { margin: 3px 0 0; color: var(--text-faint); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 15px; }
.compact-field { min-width: 160px; flex: 0 1 250px; }
.compact-field--search { flex-grow: 1; }
.compact-field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.profile-grid, .album-grid, .work-grid, .channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.profile-card, .album-card, .work-card, .channel-card { overflow: hidden; }
.profile-card__cover { height: 7px; background: var(--accent); }
.profile-card.is-rsm .profile-card__cover { background: var(--surface-strong); }
.profile-card__body, .album-card, .channel-card { padding: 18px; }
.profile-identity { display: flex; align-items: center; gap: 13px; }
.profile-photo { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-soft); color: var(--text-faint); font-size: 20px; font-weight: 850; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-identity h3, .album-card h3, .channel-card h3 { margin: 0; font-size: 16px; }
.profile-identity p, .album-card p, .channel-card p { margin: 2px 0 0; color: var(--text-faint); font-size: 12px; }
.profile-summary { min-height: 45px; margin: 15px 0; color: var(--text-soft); font-size: 13px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 999px; background: var(--surface-soft); color: var(--text-soft); font-size: 11px; font-weight: 720; }
.pill.is-active, .pill.is-running { background: var(--green-soft); color: var(--green); }
.pill.is-hidden, .pill.is-disabled, .pill.is-closed { background: var(--red-soft); color: var(--red); }
.pill.is-rsm { background: var(--purple-soft); color: var(--purple); }
.pill.is-new, .pill.is-review { background: var(--amber-soft); color: var(--amber); }
.card-actions { display: flex; align-items: center; gap: 8px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.card-actions .button { min-height: 36px; padding: 7px 11px; font-size: 12px; }

.album-link { display: block; max-width: 100%; overflow: hidden; color: var(--blue); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.work-card__image { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-soft); }
.work-card__image img { width: 100%; height: 100%; object-fit: cover; }
.work-card__image span { display: grid; height: 100%; place-items: center; color: var(--text-faint); font-weight: 800; }
.work-card__body { padding: 15px; }
.work-card__body h3 { margin: 0; font-size: 15px; }
.work-card__body p { margin: 4px 0 0; color: var(--text-faint); font-size: 12px; }

.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
table { width: 100%; min-width: 760px; border-collapse: collapse; background: var(--surface); }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--surface-soft); color: var(--text-faint); font-size: 11px; letter-spacing: .035em; white-space: nowrap; }
td { color: var(--text-soft); font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
.table-primary strong, .table-primary span { display: block; }
.table-primary strong { color: var(--text); font-size: 13px; }
.table-primary span { margin-top: 2px; color: var(--text-faint); font-size: 11px; }
.table-actions { white-space: nowrap; }
.table-actions .button { min-height: 34px; padding: 6px 10px; font-size: 11px; }
.empty-state { grid-column: 1 / -1; margin: 0; padding: 48px 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--text-faint); text-align: center; }

.complaint-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr); gap: 16px; }
.complaint-list { display: grid; align-content: start; gap: 8px; }
.complaint-item { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; }
.complaint-item:hover, .complaint-item.is-active { border-color: var(--line-strong); box-shadow: var(--shadow-small); }
.complaint-item__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.complaint-item__copy { display: -webkit-box; overflow: hidden; color: var(--text-soft); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.complaint-item__meta { display: flex; flex-wrap: wrap; gap: 8px 13px; color: var(--text-faint); font-size: 11px; }
.detail-card { min-height: 360px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.detail-card h3 { margin: 0; }
.detail-copy { margin: 18px 0; padding: 15px; border-radius: 12px; background: var(--surface-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-grid div { padding: 11px; border: 1px solid var(--line); border-radius: 10px; }
.detail-grid span, .detail-grid strong { display: block; }
.detail-grid span { color: var(--text-faint); font-size: 10px; }
.detail-grid strong { margin-top: 3px; font-size: 12px; }

.bar-list { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(160px, 2fr) auto; align-items: center; gap: 12px; }
.bar-label strong, .bar-label span { display: block; }
.bar-label span { color: var(--text-faint); font-size: 10px; }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.bar-fill { display: block; width: var(--bar-width, 0%); height: 100%; border-radius: inherit; background: var(--accent); }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 820; }

.channel-purpose { margin-top: 13px; padding: 10px; border-radius: 10px; background: var(--surface-soft); color: var(--text-soft); font-size: 12px; }
.account-anchor { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 17px; border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--line)); border-radius: var(--radius-md); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.account-anchor strong, .account-anchor span { display: block; }
.account-anchor span { color: var(--text-soft); font-size: 12px; }

.studio-dialog { width: min(720px, calc(100% - 28px)); max-height: min(86vh, 880px); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface-raised); color: var(--text); box-shadow: 0 28px 90px rgba(0, 0, 0, .25); }
.studio-dialog::backdrop { background: rgba(6, 12, 8, .58); backdrop-filter: blur(3px); }
.dialog-frame { display: grid; max-height: inherit; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 21px; }
.dialog-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 22px; }
.dialog-message { margin: 0; padding: 0 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.check-option { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.check-option input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--green); }
.check-option strong, .check-option span { display: block; }
.check-option span { color: var(--text-faint); font-size: 10px; }
.png-preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 11px; background: var(--surface-soft); }
.png-preview__media { display: grid; width: 78px; height: 62px; flex: 0 0 auto; place-items: center; overflow: hidden; border-radius: 9px; background: var(--surface); color: var(--text-faint); font-size: 9px; text-align: center; }
.png-preview__media img { width: 100%; height: 100%; object-fit: cover; }
.png-preview > span { color: var(--text-faint); font-size: 11px; }

.toast-region { position: fixed; z-index: 6000; right: calc(18px + var(--safe-right)); bottom: calc(18px + var(--safe-bottom)); display: grid; width: min(370px, calc(100% - 32px)); gap: 9px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow); pointer-events: auto; }
.toast strong, .toast p { display: block; margin: 0; }
.toast p { margin-top: 3px; color: var(--text-soft); font-size: 12px; }
.toast.is-error { border-color: color-mix(in srgb, var(--red) 36%, var(--line)); }
.toast button { background: transparent; color: var(--text-faint); }

.mobile-nav-dialog { width: min(520px, calc(100% - 24px)); max-height: min(78vh, 720px); margin: auto 12px 0 auto; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px 22px 0 0; background: var(--surface-raised); color: var(--text); }
.mobile-nav-dialog::backdrop, .badge-wizard-dialog::backdrop { background: rgba(6, 12, 8, .58); backdrop-filter: blur(3px); }
.mobile-nav-sheet { max-height: inherit; overflow-y: auto; padding: 0 16px calc(18px + var(--safe-bottom)); }
.mobile-nav-sheet > header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 0 12px; border-bottom: 1px solid var(--line); background: var(--surface-raised); }
.mobile-nav-sheet h2 { margin: 0; font-size: 20px; }
.mobile-nav-sheet nav { display: grid; gap: 4px; padding-top: 9px; }
.mobile-nav-group { margin: 12px 10px 4px; color: var(--text-faint); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.mobile-nav-sheet .nav-button { display: flex !important; min-height: 46px; }
.mobile-nav-sheet .nav-label--full { display: inline; }
.mobile-nav-sheet .nav-label--mobile { display: none; }

.badge-wizard-dialog { width: min(940px, calc(100% - 28px)); max-height: min(90vh, 920px); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface-raised); color: var(--text); box-shadow: 0 28px 90px rgba(0, 0, 0, .28); }
.badge-wizard-frame { display: grid; max-height: inherit; grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
.wizard-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--line); list-style: none; }
.wizard-steps li { min-width: 0; padding: 7px 6px; border-radius: 8px; color: var(--text-faint); font-size: 10px; text-align: center; }
.wizard-steps li.is-current { background: var(--surface-soft); color: var(--text); font-weight: 800; }
.wizard-steps li.is-complete { color: var(--green); }
.badge-wizard-body { min-height: 390px; overflow-y: auto; padding: 20px; }
.wizard-identity { display: flex; align-items: center; gap: 13px; margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.wizard-identity strong, .wizard-identity span { display: block; }
.wizard-identity span { color: var(--text-faint); font-size: 11px; }
.wizard-portrait-preview { display: grid; width: 136px; aspect-ratio: 3 / 4; place-items: center; overflow: hidden; margin-top: 12px; border: 1px dashed var(--line-strong); border-radius: 13px; background: var(--surface-soft); color: var(--text-faint); font-size: 11px; text-align: center; }
.wizard-portrait-preview img { width: 100%; height: 100%; object-fit: cover; }
.badge-preview { width: min(100%, 430px); margin: 18px auto; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: #f9fce9; box-shadow: var(--shadow-small); color: #162018; }
.badge-preview.is-rsm { background: #f1eef8; }
.badge-preview header, .badge-preview footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; }
.badge-preview header { background: var(--accent); }
.badge-preview.is-rsm header { background: #27242f; color: #fff; }
.badge-preview header span, .badge-preview footer { font-size: 10px; }
.badge-preview__body { display: grid; grid-template-columns: 102px minmax(0, 1fr); align-items: center; gap: 17px; min-height: 154px; padding: 16px; }
.badge-preview__portrait { width: 102px; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 12px; background: rgba(255, 255, 255, .75); }
.badge-preview__portrait img { width: 100%; height: 100%; object-fit: cover; }
.badge-preview__body h3 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.badge-preview__body p { margin: 4px 0; color: #526056; }
.badge-preview footer { border-top: 1px solid rgba(0, 0, 0, .1); }
.channel-comparison, .pending-capabilities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.pending-capabilities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.channel-comparison > div, .pending-capabilities > div { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.channel-comparison span, .channel-comparison strong, .pending-capabilities span, .pending-capabilities strong { display: block; }
.channel-comparison span, .pending-capabilities span { color: var(--text-faint); font-size: 10px; }
.wizard-checks { display: grid; gap: 8px; margin: 15px 0 0; padding: 0; list-style: none; }
.wizard-checks li { padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.wizard-checks li.is-pass { border-color: color-mix(in srgb, var(--green) 30%, var(--line)); background: var(--green-soft); }
.wizard-checks li.is-pending { border-color: color-mix(in srgb, var(--amber) 30%, var(--line)); background: var(--amber-soft); }
.wizard-checks strong, .wizard-checks span { display: block; }
.wizard-checks span { margin-top: 2px; color: var(--text-soft); font-size: 11px; }
.wizard-record-list, .wizard-consent-grid, .wizard-asset-flow { display: grid; gap: 10px; margin-top: 14px; }
.wizard-record, .wizard-consent, .wizard-asset { display: grid; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.wizard-record { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.wizard-record > .button { grid-column: 1 / -1; justify-self: start; }
.wizard-record strong, .wizard-record span, .wizard-asset strong, .wizard-asset span { display: block; }
.wizard-record span, .wizard-asset span { color: var(--text-faint); font-size: 11px; }
.wizard-consent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wizard-consent.is-granted { border-color: color-mix(in srgb, var(--green) 30%, var(--line)); background: var(--green-soft); }
.wizard-form-section { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.wizard-form-section h3 { margin: 0 0 12px; font-size: 15px; }
.wizard-check-row { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.wizard-check-row .field-check { flex: 1 1 180px; }
.wizard-asset-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wizard-asset.is-active { border-color: color-mix(in srgb, var(--green) 30%, var(--line)); background: var(--green-soft); }
.one-time-credential { display: grid; gap: 9px; margin-top: 15px; padding: 15px; border: 1px solid color-mix(in srgb, var(--amber) 42%, var(--line)); border-radius: 14px; background: var(--amber-soft); }
.one-time-credential strong, .one-time-credential p { margin: 0; }
.one-time-credential p { color: var(--text-soft); font-size: 12px; }
.one-time-credential code { display: block; max-width: 100%; padding: 10px; overflow-wrap: anywhere; border-radius: 9px; background: var(--surface); color: var(--text); font-size: 11px; user-select: all; }
.one-time-credential .button { justify-self: start; text-decoration: none; }
.wizard-qr-image { width: min(100%, 260px); aspect-ratio: 1; padding: 10px; border-radius: 12px; background: #fff; }
.wizard-print-link { display: inline-flex; align-items: center; justify-content: center; margin-top: 12px; text-decoration: none; }
.badge-preview__portrait > span { display: grid; height: 100%; place-items: center; padding: 8px; color: #526056; font-size: 10px; text-align: center; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-grid, .album-grid, .work-grid, .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar: 72px; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-brand > div:last-child, .nav-label, .nav-section-label, .sidebar-note { display: none; }
  .nav-button { justify-content: center; padding-inline: 8px; }
  .nav-button.is-active::before { left: -7px; }
  .nav-count { position: absolute; top: 1px; right: 4px; }
  .nav-button::after { position: absolute; z-index: 300; top: 50%; left: calc(100% + 10px); display: none; width: max-content; max-width: 210px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); box-shadow: var(--shadow-small); color: var(--text); content: attr(data-tooltip); font-size: 11px; transform: translateY(-50%); }
  .nav-button:hover::after, .nav-button:focus-visible::after { display: block; }
  .complaint-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --topbar: 66px; }
  .gate-view { display: block; }
  .gate-brand { display: none; }
  .gate-panel { min-height: 100vh; padding: 70px 22px 42px; }
  .studio-shell { padding-bottom: calc(66px + var(--safe-bottom)); }
  .studio-sidebar { inset: auto 0 0; width: auto; height: calc(62px + var(--safe-bottom)); padding: 5px max(5px, var(--safe-right)) var(--safe-bottom) max(5px, var(--safe-left)); border-top: 1px solid var(--line); border-right: 0; }
  .sidebar-brand, .sidebar-note { display: none; }
  .studio-nav { display: flex; height: 100%; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .studio-nav::-webkit-scrollbar { display: none; }
  .studio-nav .nav-section-label, .studio-nav .nav-button:not(.is-mobile-primary) { display: none; }
  .nav-button { min-width: 62px; min-height: 52px; flex: 1 0 62px; flex-direction: column; justify-content: center; gap: 0; padding: 3px; border-radius: 9px; font-size: 9px; line-height: 1.1; text-align: center; }
  .nav-button::after { display: none !important; }
  .studio-nav .nav-label--full { display: none; }
  .studio-nav .nav-label--mobile { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-more-button { display: flex; }
  .nav-button.is-active::before { inset: auto 24% -1px; width: auto; height: 3px; }
  .nav-icon { width: 21px; height: 21px; font-size: 12px; }
  .nav-count { top: 0; right: 8px; }
  .studio-workspace { margin-left: 0; }
  .studio-topbar { min-height: var(--topbar); flex-wrap: wrap; padding: calc(8px + var(--safe-top)) max(12px, var(--safe-right)) 8px max(14px, var(--safe-left)); }
  .studio-topbar > div:first-child { min-width: 0; }
  .studio-topbar h1 { max-width: 42vw; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .studio-topbar .eyebrow, .connection-state, #refreshStudio, .account-button > span:nth-child(2), .account-button > span:last-child { display: none; }
  .scope-control { order: 3; width: 100%; margin: 0; }
  .scope-control label { flex: 0 0 auto; }
  .scope-control select { min-height: 38px; flex: 1; }
  .account-button { min-width: 40px; padding: 4px; border-radius: 10px; }
  .account-avatar { width: 30px; height: 30px; }
  .studio-main { padding: 20px max(12px, var(--safe-right)) calc(24px + var(--safe-bottom)) max(12px, var(--safe-left)); }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 17px; }
  .page-heading h2 { font-size: 28px; }
  .heading-actions { width: 100%; justify-content: flex-start; }
  .heading-actions .button { flex: 1 1 auto; }
  .profile-grid, .album-grid, .work-grid, .channel-grid { grid-template-columns: 1fr; }
  .field-row, .detail-grid, .check-list { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: minmax(90px, 1fr) auto; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .studio-dialog { width: 100%; max-width: none; max-height: calc(100vh - var(--safe-top)); margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .wizard-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .badge-wizard-dialog { width: 100%; max-width: none; max-height: calc(100vh - var(--safe-top)); margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .badge-wizard-body { min-height: 0; padding: 15px; }
  .pending-capabilities { grid-template-columns: 1fr; }
  .wizard-consent-grid { grid-template-columns: 1fr; }
  .wizard-asset-flow { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  body, input, select, textarea { font-size: 16px; }
  body { font-size: 14px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 128px; }
  .account-anchor { align-items: flex-start; flex-direction: column; }
  .toolbar .compact-field { min-width: 100%; flex-basis: 100%; }
  .dialog-head, .dialog-body, .dialog-actions { padding-right: 15px; padding-left: 15px; }
  .toast-region { right: 12px; bottom: calc(74px + var(--safe-bottom)); width: calc(100% - 24px); }
  .wizard-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 10px; }
  .badge-preview__body { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .badge-preview__portrait { width: 80px; }
  .badge-preview__body h3 { font-size: 20px; }
  .channel-comparison { grid-template-columns: 1fr; }
  .wizard-record { grid-template-columns: 1fr; }
}
