:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #eef6f4;
  --text: #142026;
  --muted: #64737b;
  --line: #d9e2e1;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --warn: #b45309;
  --bad: #b91c1c;
  --ok: #15803d;
  --shadow: 0 10px 28px rgba(20, 32, 38, .08);
}

/* Final light theme: warm white surfaces with restrained sunny accents. */
:root {
  --bg: #fffdf8;
  --panel: #ffffff;
  --panel-soft: #fffaf0;
  --text: #24313a;
  --muted: #71808a;
  --line: #eee6d8;
  --accent: #d97706;
  --accent-2: #b45309;
  --accent-soft: #fff4d6;
  --warn: #c26a05;
  --bad: #c2413b;
  --ok: #16866a;
  --shadow: 0 10px 28px rgba(123, 84, 18, .07);
}

body { background: var(--bg); color: var(--text); }
body:not(.has-workspace) .topbar,
body:not(.has-workspace) .status-strip { display: none; }
body:not(.has-workspace) .app-shell { width: 100%; max-width: 100%; padding: 12px; }
.product-sidebar { border-color: #f2eadb; background: #fff; }
.product-brand { border-color: #f3ecdf; }
.brand-mark { color: #a45b05; background: #ffefb8; box-shadow: none; }
.admin-mark { color: #087a64; background: #dff7ee; }
.product-brand small, .sidebar-label, .sidebar-status small, .sidebar-user small, .toolbar-eyebrow, .last-sync { color: #a18f78; }
.product-nav-item { color: #74818a; }
.product-nav-item:hover { color: #87520c; background: #fffaf0; }
.product-nav-item.active, .admin-product-nav .product-nav-item.active { color: #a45b05; background: #fff4d6; }
.admin-product-nav .product-nav-item.active { color: #087a64; background: #eaf9f4; }
.sidebar-status { border-color: #f1e8d8; background: #fffaf1; }
.avatar { color: #a45b05; background: #ffefb8; }
.admin-avatar { color: #087a64; background: #dff7ee; }
.workspace-main { background: transparent; }
.workspace-toolbar h2 { color: #28343c; }
.user-hero { border-color: #f0dfb8; border-left: 4px solid #f2b84b; background: #fffefb; box-shadow: var(--shadow); }
.hero-copy p, .user-metric span, .user-metric em, .balance-chip span { color: var(--muted); }
.balance-chip, .balance-card { border-color: #f0dfb8; background: #fffaf0; }
.balance-chip strong, .balance-card strong, .user-metric.accent strong { color: #b45f05; }
.user-metric, .panel, .admin-section { border-color: var(--line); background: #fff; box-shadow: var(--shadow); }
.user-metric.accent { border-color: #f0dfb8; background: #fffaf0; }
.scan-panel { border-top-color: #f2b84b; }
.section-kicker { color: #b45f05; }
.step-badge { border-color: #f0dfb8; color: #a45b05; background: #fffaf0; }
.primary-action, button:not(.secondary):not(.auth-tab):not(.text-button), .link-button:not(.secondary) { color: #fff; background: #e39a19; box-shadow: 0 6px 14px rgba(227, 154, 25, .18); }
.primary-action:hover, button:not(.secondary):not(.auth-tab):not(.text-button):hover, .link-button:not(.secondary):hover { background: #c97908; }
button.secondary, .link-button.secondary { border-color: #eadfce; color: #596770; background: #fff; }
button.secondary:hover, .link-button.secondary:hover { border-color: #f0c66a; color: #a45b05; background: #fffaf0; }
input, select, textarea { border-color: #eadfce; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: #e5a12b; box-shadow: 0 0 0 3px rgba(229, 161, 43, .14); }
.notice { border-color: #f1dfb6; background: #fffaf0; color: #865914; }
.notice.error { border-color: #f1c8c5; background: #fff7f6; color: #a13d38; }
.notice.ok { border-color: #b9e7d7; background: #f2fcf8; color: #14725d; }
.task-workspace .item, .admin-table-wrap, .admin-stat, .sub-panel { border-color: var(--line); background: #fff; }
.task-list-card.completed { border-left-color: #70c9a9; }
.task-list-card.running { border-left-color: #f0b84b; }
.task-list-card.queued { border-left-color: #e7a22b; }
.task-list-card.failed { border-left-color: #e49a94; }
.pill.completed { color: #14725d; background: #e9f8f1; }
.pill.running { color: #90600f; background: #fff4d6; }
.pill.queued { color: #95600c; background: #fff7df; }
.pill.failed { color: #a13d38; background: #fff0ee; }
.phase-line { color: #9a7c48; }
.admin-table th { color: #9a8e7d; background: #fffaf1; }
.admin-table td { border-color: #f2ebdf; }
.task-filters, .viewer-filters { border-color: var(--line); background: #fffaf2; }
.viewer-modal { border-color: #efdfbd; background: #fffdf8; }
.viewer-modal .modal-head, .viewer-modal .viewer-stats, .viewer-modal .viewer-filters { background: #fff; }
.viewer-player { border-color: #eee2d0; background: #fff; }
.viewer-player > summary:hover { background: #fffaf0; }
.viewer-summary-cell b, .viewer-queue-title { color: #976010; }
.viewer-profile-strip > div, .viewer-queue { border-color: #eee2d0; background: #fffdf9; }
.viewer-section-title { color: #7b551c; }
.viewer-loading { border-color: #edce8b; color: #936116; background: #fffaf0; }
.shield-highlight.active { border-color: #a9dfc8; background: #effbf6; }
.shield-highlight.active strong { color: #16866a; }
.shield-highlight.inactive { border-color: #efd0b2; background: #fff8ee; }
.shield-highlight.inactive strong { color: #9b6418; }
.result-card.soft { border-color: #eee2d0; background: #fffaf2; }
.result-card.soft .result-title { color: #8c641f; }
.status-dot { background: #16866a; box-shadow: 0 0 0 4px #dff7ee; }

.auth-shell { width: min(820px, calc(100vw - 32px)); min-height: 500px; margin: 28px auto; border-color: #f0dfb8; border-radius: 10px; box-shadow: 0 22px 60px rgba(123, 84, 18, .1); }
.auth-intro, .admin-auth-intro { color: #26343c; background: #fff8df; }
.auth-intro .product-brand { border-color: #f0dfb8; }
.auth-intro .product-brand strong { color: #60461c; }
.auth-intro .product-brand small { color: #aa8b53; }
.auth-intro .brand-mark { color: #a45b05; background: #ffefb8; }
.auth-intro-copy .toolbar-eyebrow { color: #a9884d; }
.auth-intro-copy h2 { color: #4b371c; }
.auth-intro-copy h2 em { color: #c27b16; }
.auth-intro-copy p, .auth-intro-foot { color: #90784f; }
.admin-auth-intro { background: #eaf9f4; }
.auth-forms { background: #fff; }
.auth-tabs { border-color: #eee4d5; }
.auth-tab, .auth-tab:hover { color: #a7957a; background: transparent; }
.auth-tab.active { color: #a45b05; background: transparent; }
.auth-tab.active::after { background: #e39a19; }
.auth-form-block h2 { color: #29363e; }
.purchase-guide { border-color: #f0dfb8; color: #887454; background: #fffaf0; }
.purchase-guide strong { color: #a45b05; }
.auth-switch-hint, .item-meta { color: #9b8e7e; }
.text-button { color: #a45b05; }

@media (max-width: 700px) {
  body:not(.has-workspace) .app-shell { padding: 8px; }
  .auth-shell { width: calc(100vw - 16px); margin: 8px auto; border-radius: 10px; }
  .auth-intro { min-height: 154px; padding: 16px; }
  .auth-intro-copy { margin-top: 22px; }
  .auth-intro-copy h2 { margin: 0; font-size: 25px; }
  .auth-intro-copy p { margin-top: 6px; font-size: 12px; }
  .auth-intro-foot { padding-top: 16px; font-size: 10px; }
  .auth-forms { padding: 22px 18px 24px; }
  .auth-form-block h2 { font-size: 21px; }
  .auth-tabs { margin-bottom: 20px; }
  .auth-form-block input { min-height: 44px; }
  .workspace-main { padding: 15px 10px 28px; }
  .user-hero { padding: 17px; }
  .panel, .admin-section { box-shadow: 0 5px 18px rgba(123, 84, 18, .05); }
  .admin-content .admin-section { padding: 15px; }
  .admin-table-wrap { overflow-x: auto; }
  .viewer-modal { border-radius: 10px; }
}

/* Customer shell final pass: white surfaces, soft color accents, no dashboard sidebar. */
:root {
  --bg: #fbfdff;
  --panel: #ffffff;
  --panel-soft: #f1fbf8;
  --text: #203344;
  --muted: #718596;
  --line: #e5edf2;
  --accent: #119b87;
  --accent-2: #e58a3d;
  --accent-soft: #e9faf5;
  --warn: #e99a37;
  --bad: #e57373;
  --ok: #159b79;
  --shadow: 0 12px 34px rgba(31, 72, 86, .08);
}
body, body.has-workspace { background: #fbfdff; color: var(--text); }
.user-workspace-shell .product-sidebar { display: none; }
.user-workspace-shell .workspace-main { margin-left: 0; width: 100%; padding: 24px clamp(14px, 4vw, 56px) 60px; }
.user-toolbar { align-items: center; margin-bottom: 20px; }
.user-brand-line { display: flex; align-items: center; gap: 18px; min-width: 0; }
.user-toolbar .product-brand { height: auto; padding: 0 18px 0 0; border: 0; }
.user-toolbar .product-brand small { color: #8da1af; }
.user-toolbar .toolbar-eyebrow { color: #91a3b0; }
.user-toolbar h2 { font-size: 22px; }
.service-status-chip, .auth-service-status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: #237c70; font-size: 12px; font-weight: 800; }
.service-status-chip i, .auth-service-status i { width: 8px; height: 8px; border-radius: 50%; background: #39bd8e; box-shadow: 0 0 0 4px #e2f8ef; }
.service-status-chip.offline, .auth-service-status.offline { color: #bb6b62; }
.service-status-chip.offline i, .auth-service-status.offline i { background: #e57373; box-shadow: 0 0 0 4px #ffebeb; }
.user-hero { border-color: #d8efe9; border-left: 4px solid #8bd8c7; background: #fff; box-shadow: var(--shadow); }
.user-metric, .panel, .admin-section { border-color: var(--line); background: #fff; box-shadow: var(--shadow); }
.user-metric:nth-child(1) { border-color: #c9eee4; background: #f1fcf8; }
.user-metric:nth-child(2) { border-color: #d7eafb; background: #f4faff; }
.user-metric:nth-child(3) { border-color: #f7e3bf; background: #fffaf1; }
.user-metric:nth-child(4) { border-color: #f3dbe5; background: #fff7fa; }
.user-metric:nth-child(1) strong { color: #108e7c; }
.user-metric:nth-child(2) strong { color: #4d8cc2; }
.user-metric:nth-child(3) strong { color: #c98223; }
.user-metric:nth-child(4) strong { color: #c26683; }
.scan-panel { border-top-color: #ffc36d; }
.account-panel { border-top: 3px solid #8fd9ca; }
.task-workspace { border-top: 3px solid #a9c9eb; }
.section-kicker { color: #168f82; }
.step-badge { border-color: #c9eee4; color: #138c7b; background: #effbf8; }
.balance-chip, .balance-card { border-color: #f2dfb1; background: #fffaf0; }
.balance-chip strong, .balance-card strong { color: #d5811c; }
.service-note { border-color: #d8eee9; background: #f6fcfb; }
.primary-action, button:not(.secondary):not(.auth-tab):not(.text-button), .link-button:not(.secondary) { color: #fff; background: #f0a13c; box-shadow: 0 7px 16px rgba(240, 161, 60, .2); }
.primary-action:hover, button:not(.secondary):not(.auth-tab):not(.text-button):hover, .link-button:not(.secondary):hover { background: #df8930; }
button.secondary, .link-button.secondary { border-color: #dfe9ef; color: #557080; background: #fff; }
button.secondary:hover, .link-button.secondary:hover { border-color: #a9dcd1; color: #128c7b; background: #f3fcfa; }
input, select, textarea { border-color: #dce8ef; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: #71cdbd; box-shadow: 0 0 0 3px rgba(113, 205, 189, .16); }
.task-filters, .viewer-filters { border-color: #e1ebf0; background: #f7fbfd; }
.pill.completed { color: #158e75; background: #e8faf3; }
.pill.running { color: #4b87b8; background: #edf7ff; }
.pill.queued { color: #b8751a; background: #fff5df; }
.pill.failed { color: #bd625d; background: #fff0f0; }

.auth-shell, .auth-shell.auth-simple-shell, .auth-shell.admin-auth-shell { display: block; width: min(520px, calc(100vw - 28px)); min-height: 0; margin: clamp(28px, 8vh, 72px) auto; border: 1px solid #e2ebf0; border-radius: 22px; background: #fff; box-shadow: 0 20px 60px rgba(53, 91, 105, .1); overflow: hidden; }
.auth-shell .auth-intro { display: none; }
.auth-forms, .auth-shell .auth-forms { min-height: 0; padding: 30px clamp(22px, 6vw, 48px) 36px; background: #fff; }
.auth-simple-forms { max-width: none; }
.auth-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 30px; }
.auth-brand-row .product-brand { height: auto; padding: 0; border: 0; }
.auth-brand-row .product-brand small { color: #8da1af; }
.auth-brand-row .brand-mark { color: #b76b1e; background: #fff0c9; box-shadow: none; }
.auth-brand-row .admin-mark { color: #148b78; background: #dff7ef; }
.auth-tabs { gap: 26px; margin-bottom: 28px; border-bottom-color: #e7edf1; }
.auth-tab, .auth-tab:hover { color: #9aabb7; }
.auth-tab.active { color: #d5811c; }
.auth-tab.active::after { background: #f0a13c; }
.auth-form-block h2 { color: #253a4a; font-size: 25px; }
.auth-form-block .item-meta { color: #8194a1; }
.purchase-guide { border-color: #f3dfb4; color: #937248; background: #fffaf0; }
.purchase-guide strong, .text-button { color: #d5811c; }

.viewer-backdrop { padding: 12px; background: rgba(35, 57, 68, .24); backdrop-filter: blur(2px); }
.viewer-modal { width: min(1120px, 100%); max-height: min(94dvh, 980px); padding: 20px; border: 1px solid #dfebef; border-radius: 22px; background: #fff; box-shadow: 0 24px 80px rgba(34, 67, 81, .2); }
.viewer-modal .modal-head { align-items: center; padding-bottom: 14px; border-bottom: 1px solid #edf2f4; }
.viewer-modal .modal-head h2 { color: #263e4e; }
.viewer-stats { gap: 10px; margin: 14px 0; }
.viewer-stats .admin-stat { border-radius: 13px; border-color: #e5edf2; background: #fbfdff; }
.viewer-stats .admin-stat:nth-child(1) { background: #f2fbff; border-color: #d6ebf7; }
.viewer-stats .admin-stat:nth-child(2) { background: #f0fcf7; border-color: #d0eee1; }
.viewer-stats .admin-stat:nth-child(3) { background: #fff9ee; border-color: #f2e2bd; }
.viewer-stats .admin-stat:nth-child(4) { background: #fff4f7; border-color: #f0dce5; }
.viewer-filters { padding: 12px; border-radius: 14px; background: #f8fbfd; }
.viewer-player { border-color: #e1ebef; border-radius: 14px; box-shadow: 0 5px 16px rgba(41, 78, 92, .05); }
.viewer-player > summary { min-height: 64px; padding: 13px 15px; }
.viewer-player > summary::before { border-color: #b9d8e0; color: #168f82; background: #f4fbfb; }
.viewer-player-body { padding: 0 15px 17px; border-top-color: #edf2f4; }
.viewer-profile-strip { gap: 9px; padding: 14px 0; }
.viewer-profile-strip > div { border-color: #e2edf0; border-radius: 11px; background: #fbfdff; }
.viewer-profile-strip > div:nth-child(1) { background: #f5fbff; }
.viewer-profile-strip > div:nth-child(2) { background: #f2fcf8; }
.viewer-profile-strip > div:nth-child(3) { background: #fffaf1; }
.viewer-profile-strip > div:nth-child(4) { background: #fff6f8; }
.viewer-section-title { margin-top: 16px; color: #168f82; }
.viewer-queue { border-color: #d9eae8; border-radius: 12px; background: #f7fcfb; }
.viewer-queue-title { color: #168f82; }
.viewer-loading { border-color: #a9dcd1; color: #168f82; background: #f2fcfa; }
.shield-highlight.active { border-color: #b8e7d5; background: #effbf6; }
.shield-highlight.inactive { border-color: #f0d0d0; background: #fff7f7; }

@media (max-width: 760px) {
  .user-workspace-shell .workspace-main { padding: 14px 12px 34px; }
  .user-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .user-brand-line { justify-content: space-between; }
  .user-brand-line > div:last-child { display: none; }
  .user-toolbar .toolbar-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .service-status-chip { margin-right: auto; }
  .user-hero { align-items: flex-start; flex-direction: column; padding: 18px; }
  .hero-actions { width: 100%; }
  .balance-chip { width: 100%; }
  .viewer-modal { width: 100%; max-height: calc(100dvh - 18px); padding: 13px; border-radius: 17px; }
  .viewer-modal .modal-head { align-items: flex-start; }
  .viewer-modal .modal-head h2 { font-size: 17px; }
  .viewer-stats { gap: 7px; }
  .viewer-stats .admin-stat { padding: 10px; }
  .viewer-filters { gap: 7px; padding: 9px; }
  .viewer-player > summary { min-height: 58px; padding: 11px 12px; }
  .viewer-player-body { padding: 0 12px 14px; }
  .viewer-profile-strip { gap: 7px; }
  .viewer-profile-strip > div { padding: 8px; }
}
@media (max-width: 520px) {
  .auth-shell, .auth-shell.auth-simple-shell, .auth-shell.admin-auth-shell { width: calc(100vw - 20px); margin: 10px auto; border-radius: 17px; }
  .auth-forms, .auth-shell .auth-forms { padding: 22px 17px 26px; }
  .auth-brand-row { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 24px; }
  .auth-tabs { margin-bottom: 23px; }
  .auth-form-block h2 { font-size: 22px; }
  .auth-form-block input { min-height: 45px; }
}

/* Public mobile-first surface. Keep the customer flow bright and single-column. */
:root {
  --bg: #fbfdff;
  --panel: #ffffff;
  --panel-soft: #f1fbf8;
  --text: #203344;
  --muted: #718596;
  --line: #e5edf2;
  --accent: #119b87;
  --accent-2: #e58a3d;
  --accent-soft: #e9faf5;
  --warn: #e99a37;
  --bad: #e57373;
  --ok: #159b79;
  --shadow: 0 12px 34px rgba(31, 72, 86, .08);
}

body { background: #fbfdff; color: var(--text); }
body.has-workspace { background: #fbfdff; }
.workspace-main { margin-left: 0; padding: 24px clamp(14px, 4vw, 56px) 60px; }
.user-workspace-shell .product-sidebar { display: none; }
.user-workspace-shell .workspace-main { width: 100%; }
.user-toolbar { align-items: center; margin-bottom: 20px; }
.user-brand-line { display: flex; align-items: center; gap: 18px; min-width: 0; }
.user-toolbar .product-brand { height: auto; padding: 0 18px 0 0; border: 0; }
.user-toolbar .product-brand small { color: #8da1af; }
.user-toolbar .toolbar-eyebrow { color: #91a3b0; }
.user-toolbar h2 { font-size: 22px; }
.service-status-chip,
.auth-service-status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: #237c70; font-size: 12px; font-weight: 800; }
.service-status-chip i,
.auth-service-status i { width: 8px; height: 8px; border-radius: 50%; background: #39bd8e; box-shadow: 0 0 0 4px #e2f8ef; }
.service-status-chip.offline, .auth-service-status.offline { color: #bb6b62; }
.service-status-chip.offline i, .auth-service-status.offline i { background: #e57373; box-shadow: 0 0 0 4px #ffebeb; }
.user-hero { border-color: #d8efe9; border-left: 4px solid #8bd8c7; background: #ffffff; box-shadow: var(--shadow); }
.user-metric, .panel, .admin-section { border-color: var(--line); background: #fff; box-shadow: var(--shadow); }
.user-metric:nth-child(1) { border-color: #c9eee4; background: #f1fcf8; }
.user-metric:nth-child(2) { border-color: #d7eafb; background: #f4faff; }
.user-metric:nth-child(3) { border-color: #f7e3bf; background: #fffaf1; }
.user-metric:nth-child(4) { border-color: #f3dbe5; background: #fff7fa; }
.user-metric strong { color: #2e485a; }
.user-metric:nth-child(1) strong { color: #108e7c; }
.user-metric:nth-child(2) strong { color: #4d8cc2; }
.user-metric:nth-child(3) strong { color: #c98223; }
.user-metric:nth-child(4) strong { color: #c26683; }
.scan-panel { border-top-color: #ffc36d; }
.account-panel { border-top: 3px solid #8fd9ca; }
.task-workspace { border-top: 3px solid #a9c9eb; }
.section-kicker { color: #168f82; }
.step-badge { border-color: #c9eee4; color: #138c7b; background: #effbf8; }
.balance-chip, .balance-card { border-color: #f2dfb1; background: #fffaf0; }
.balance-chip strong, .balance-card strong { color: #d5811c; }
.service-note { border-color: #d8eee9; background: #f6fcfb; }
.primary-action,
button:not(.secondary):not(.auth-tab):not(.text-button),
.link-button:not(.secondary) { color: #fff; background: #f0a13c; box-shadow: 0 7px 16px rgba(240, 161, 60, .2); }
.primary-action:hover,
button:not(.secondary):not(.auth-tab):not(.text-button):hover,
.link-button:not(.secondary):hover { background: #df8930; }
button.secondary, .link-button.secondary { border-color: #dfe9ef; color: #557080; background: #fff; }
button.secondary:hover, .link-button.secondary:hover { border-color: #a9dcd1; color: #128c7b; background: #f3fcfa; }
input, select, textarea { border-color: #dce8ef; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: #71cdbd; box-shadow: 0 0 0 3px rgba(113, 205, 189, .16); }
.task-filters, .viewer-filters { border-color: #e1ebf0; background: #f7fbfd; }
.task-list-card.completed { border-left-color: #77d1b6; }
.task-list-card.running { border-left-color: #8ebbe3; }
.task-list-card.queued { border-left-color: #f3bd64; }
.task-list-card.failed { border-left-color: #e99a9a; }
.pill.completed { color: #158e75; background: #e8faf3; }
.pill.running { color: #4b87b8; background: #edf7ff; }
.pill.queued { color: #b8751a; background: #fff5df; }
.pill.failed { color: #bd625d; background: #fff0f0; }

/* Login and registration are one focused form, with no decorative split panel. */
.auth-shell,
.auth-shell.auth-simple-shell,
.auth-shell.admin-auth-shell { display: block; width: min(520px, calc(100vw - 28px)); min-height: 0; margin: clamp(28px, 8vh, 72px) auto; border: 1px solid #e2ebf0; border-radius: 22px; background: #fff; box-shadow: 0 20px 60px rgba(53, 91, 105, .1); overflow: hidden; }
.auth-shell .auth-intro { display: none; }
.auth-forms,
.auth-shell .auth-forms { min-height: 0; padding: 30px clamp(22px, 6vw, 48px) 36px; background: #fff; }
.auth-simple-forms { max-width: none; }
.auth-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 30px; }
.auth-brand-row .product-brand { height: auto; padding: 0; border: 0; }
.auth-brand-row .product-brand small { color: #8da1af; }
.auth-brand-row .brand-mark { color: #b76b1e; background: #fff0c9; box-shadow: none; }
.auth-brand-row .admin-mark { color: #148b78; background: #dff7ef; }
.auth-tabs { gap: 26px; margin-bottom: 28px; border-bottom-color: #e7edf1; }
.auth-tab, .auth-tab:hover { color: #9aabb7; }
.auth-tab.active { color: #d5811c; }
.auth-tab.active::after { background: #f0a13c; }
.auth-form-block h2 { color: #253a4a; font-size: 25px; }
.auth-form-block .item-meta { color: #8194a1; }
.purchase-guide { border-color: #f3dfb4; color: #937248; background: #fffaf0; }
.purchase-guide strong, .text-button { color: #d5811c; }
.auth-service-status { font-size: 11px; }

/* Online results: readable cards on desktop, stacked details on phones. */
.viewer-backdrop { padding: 12px; background: rgba(35, 57, 68, .24); backdrop-filter: blur(2px); }
.viewer-modal { width: min(1120px, 100%); max-height: min(94dvh, 980px); padding: 20px; border: 1px solid #dfebef; border-radius: 22px; background: #fff; box-shadow: 0 24px 80px rgba(34, 67, 81, .2); }
.viewer-modal .modal-head { align-items: center; padding-bottom: 14px; border-bottom: 1px solid #edf2f4; }
.viewer-modal .modal-head h2 { color: #263e4e; }
.viewer-stats { gap: 10px; margin: 14px 0; }
.viewer-stats .admin-stat { border-radius: 13px; border-color: #e5edf2; background: #fbfdff; }
.viewer-stats .admin-stat:nth-child(1) { background: #f2fbff; border-color: #d6ebf7; }
.viewer-stats .admin-stat:nth-child(2) { background: #f0fcf7; border-color: #d0eee1; }
.viewer-stats .admin-stat:nth-child(3) { background: #fff9ee; border-color: #f2e2bd; }
.viewer-stats .admin-stat:nth-child(4) { background: #fff4f7; border-color: #f0dce5; }
.viewer-filters { padding: 12px; border-radius: 14px; background: #f8fbfd; }
.viewer-player { border-color: #e1ebef; border-radius: 14px; box-shadow: 0 5px 16px rgba(41, 78, 92, .05); }
.viewer-player > summary { min-height: 64px; padding: 13px 15px; }
.viewer-player > summary::before { border-color: #b9d8e0; color: #168f82; background: #f4fbfb; }
.viewer-player-body { padding: 0 15px 17px; border-top-color: #edf2f4; }
.viewer-profile-strip { gap: 9px; padding: 14px 0; }
.viewer-profile-strip > div { border-color: #e2edf0; border-radius: 11px; background: #fbfdff; }
.viewer-profile-strip > div:nth-child(1) { background: #f5fbff; }
.viewer-profile-strip > div:nth-child(2) { background: #f2fcf8; }
.viewer-profile-strip > div:nth-child(3) { background: #fffaf1; }
.viewer-profile-strip > div:nth-child(4) { background: #fff6f8; }
.viewer-section-title { margin-top: 16px; color: #168f82; }
.viewer-queue { border-color: #d9eae8; border-radius: 12px; background: #f7fcfb; }
.viewer-queue-title { color: #168f82; }
.viewer-loading { border-color: #a9dcd1; color: #168f82; background: #f2fcfa; }
.shield-highlight.active { border-color: #b8e7d5; background: #effbf6; }
.shield-highlight.inactive { border-color: #f0d0d0; background: #fff7f7; }

@media (max-width: 760px) {
  .workspace-main { padding: 14px 12px 34px; }
  .user-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .user-brand-line { justify-content: space-between; }
  .user-brand-line > div:last-child { display: none; }
  .user-toolbar .toolbar-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .service-status-chip { margin-right: auto; }
  .user-hero { align-items: flex-start; flex-direction: column; padding: 18px; }
  .hero-actions { width: 100%; }
  .balance-chip { width: 100%; }
  .viewer-modal { width: 100%; max-height: calc(100dvh - 18px); padding: 13px; border-radius: 17px; }
  .viewer-modal .modal-head { align-items: flex-start; }
  .viewer-modal .modal-head h2 { font-size: 17px; }
  .viewer-stats { gap: 7px; }
  .viewer-stats .admin-stat { padding: 10px; }
  .viewer-filters { gap: 7px; padding: 9px; }
  .viewer-player > summary { min-height: 58px; padding: 11px 12px; }
  .viewer-player-body { padding: 0 12px 14px; }
  .viewer-profile-strip { gap: 7px; }
  .viewer-profile-strip > div { padding: 8px; }
}

@media (max-width: 520px) {
  .auth-shell,
  .auth-shell.auth-simple-shell,
  .auth-shell.admin-auth-shell { width: calc(100vw - 20px); margin: 10px auto; border-radius: 17px; }
  .auth-forms, .auth-shell .auth-forms { padding: 22px 17px 26px; }
  .auth-brand-row { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 24px; }
  .auth-tabs { margin-bottom: 23px; }
  .auth-form-block h2 { font-size: 22px; }
  .auth-form-block input { min-height: 45px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f8fbfa 0, #f1f5f4 260px, var(--bg) 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

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

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 14px;
}

.brand-block { min-width: 0; }

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

h1, h2, h3, p { margin: 0; letter-spacing: 0; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

.badge {
  flex: 0 0 auto;
  min-width: 88px;
  border-radius: 999px;
  padding: 8px 14px;
  color: white;
  background: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}
.badge.online { background: var(--accent); }
.badge.busy { background: var(--warn); }
.badge.offline { background: var(--bad); }

.announcement-trigger {
  min-width: 70px;
  padding-inline: 12px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  box-shadow: 0 6px 18px rgba(20, 32, 38, .05);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  word-break: break-word;
  line-height: 1.35;
}

.notice {
  margin: 10px 0;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 10px 12px;
  line-height: 1.5;
}
.notice.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.notice.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
  min-width: 0;
}

.scan-panel {
  border-color: #b7d8d4;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.stack { display: grid; gap: 10px; }
.wide { grid-column: 1 / -1; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.warn-text {
  color: var(--warn);
}

.check-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid #cde2df;
  border-radius: 8px;
  background: #f7fcfb;
  padding: 10px 11px;
  color: var(--text);
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.check-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.check-row strong {
  font-size: 14px;
  line-height: 1.35;
}

.check-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.5;
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid #cde2df;
  border-radius: 8px;
  background: #f7fcfb;
  padding: 10px 11px;
  color: var(--text);
}

.mode-choice input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.mode-choice span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mode-choice strong {
  font-size: 14px;
  line-height: 1.35;
}

.mode-choice em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.5;
}

input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

input:disabled {
  color: #8a979d;
  background: #f3f6f6;
  border-color: #e2e8e7;
  cursor: not-allowed;
}

.disabled-field {
  color: #9aa7ad;
}

.disabled-field input {
  opacity: .82;
}

textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.settings-block {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 2px;
}

.settings-block h3 {
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button, .link-button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.1;
}

button.secondary, .link-button.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

button.warn { background: var(--bad); }
button:disabled { opacity: .55; cursor: wait; }

.purchase-actions {
  display: grid;
  gap: 8px;
}

.purchase-actions.after-form {
  margin-top: 10px;
}

.purchase-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  background: var(--accent-2);
  text-align: center;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  white-space: nowrap;
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}
.tab.active {
  background: var(--accent);
  color: #fff;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  overflow: hidden;
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.item-title {
  font-weight: 900;
  word-break: break-word;
}

.item-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 6px;
  word-break: break-word;
}
.phase-line {
  color: var(--accent);
  font-weight: 800;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #e7eeed;
  overflow: hidden;
  margin-top: 10px;
}

.progress > div {
  height: 100%;
  border-radius: inherit;
  background: var(--accent-2);
  transition: width .7s ease;
}

.progress.completed > div { background: var(--ok); }
.progress.failed > div { background: var(--bad); }
.progress.queued > div { background: var(--warn); }

.progress-events {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.progress-event {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.progress-event span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  flex: 0 0 auto;
}

.progress-event strong {
  font-weight: 700;
}

.progress-event.warn span { background: var(--warn); }
.progress-event.ok span { background: var(--ok); }

.result-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.result-card.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.result-card.bad {
  border-color: #fecaca;
  background: #fef2f2;
}
.result-card.soft {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.result-title {
  font-weight: 900;
  margin-bottom: 8px;
}
.result-card.ok .result-title { color: var(--ok); }
.result-card.bad .result-title { color: var(--bad); }
.result-card.soft .result-title { color: var(--accent-2); }
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.result-grid div {
  min-width: 0;
}
.result-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.result-grid strong {
  display: block;
  margin-top: 2px;
  word-break: break-word;
}
.result-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #bbf7d0;
}
.result-section {
  min-width: 0;
}
.result-section.wide {
  grid-column: span 3;
}
.result-section-title {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.result-lines {
  display: grid;
  gap: 6px;
}
.result-line {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #dcfce7;
  border-left: 3px solid var(--ok);
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.result-note {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
  word-break: break-word;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--panel-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.pill.running { color: var(--accent-2); background: #eff6ff; }
.pill.completed { color: var(--ok); background: #f0fdf4; }
.pill.failed { color: var(--bad); background: #fef2f2; }
.pill.queued { color: var(--warn); background: #fffbeb; }

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.downloads a {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-2);
  background: #fff;
  padding: 8px 9px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}
.download-note {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  padding: 0 4px;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 32, 38, .42);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  max-height: min(76vh, 680px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(20, 32, 38, .22);
  padding: 16px;
}

.admin-task-modal {
  width: min(980px, 100%);
  max-height: min(86vh, 820px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-close {
  width: auto;
  flex: 0 0 auto;
}

.announcement-body {
  color: var(--text);
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}

.announcement-contact {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 10px 12px;
  line-height: 1.6;
  word-break: break-word;
}

.announcement-contact strong {
  color: #1d4ed8;
}

.admin-layout {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
}

.admin-sidebar-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-nav-item {
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.admin-nav-item.active {
  background: var(--accent);
  color: #fff;
}

.admin-logout {
  margin-top: 4px;
}

.admin-content,
.admin-section {
  min-width: 0;
}

.admin-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.admin-stat,
.sub-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-stat {
  padding: 12px;
}

.admin-stat span,
.admin-stat em,
.cell-muted {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.admin-stat strong {
  display: block;
  margin: 4px 0 3px;
  font-size: 18px;
  line-height: 1.25;
  word-break: break-word;
}

.sub-panel {
  padding: 12px;
}

.admin-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.45;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbfa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.admin-table code {
  display: inline-block;
  max-width: 260px;
  border: 1px solid #e2e8e7;
  border-radius: 6px;
  background: #f8faf9;
  padding: 3px 5px;
  color: var(--text);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  word-break: break-all;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions button {
  width: auto;
  padding: 7px 8px;
  font-size: 12px;
}

.admin-task-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-task-detail-body {
  display: grid;
  gap: 10px;
}

.admin-task-detail-head h3 {
  margin: 0;
  font-size: 16px;
}

.admin-task-detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.code-output {
  margin-top: 10px;
  min-height: 140px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

@media (max-width: 760px) {
  .app-shell { padding: 10px 10px 28px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
  }
  h1 { font-size: 22px; }
  .badge { width: 100%; }
  .announcement-trigger { width: 100%; }
  .status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }
  .metric { padding: 9px; }
  .metric strong { font-size: 14px; }
  .grid, .form-grid, .mode-row { grid-template-columns: 1fr; }
  .panel { padding: 12px; box-shadow: none; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  input, select, textarea { min-height: 42px; }
  .item-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .item-title { font-size: 14px; line-height: 1.45; }
  .pill { align-self: start; }
  button, .link-button { width: 100%; text-align: center; }
  .actions button, .actions .link-button { flex: 1 1 140px; }
  .downloads {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .downloads a { text-align: center; }
  .download-note { justify-content: center; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-detail-grid { grid-template-columns: 1fr; }
  .result-section.wide { grid-column: span 1; }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    box-shadow: none;
  }
  .admin-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .admin-nav-item {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: center;
  }
  .admin-section {
    padding: 12px;
    box-shadow: none;
  }
  .admin-section-head {
    display: grid;
    gap: 10px;
  }
  .admin-stats,
  .admin-two-col {
    grid-template-columns: 1fr;
  }
  .admin-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .admin-table {
    min-width: 0;
    display: block;
  }
  .admin-table thead {
    display: none;
  }
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }
  .admin-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    margin-bottom: 10px;
    overflow: hidden;
  }
  .admin-table td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding: 9px;
  }
  .admin-table td:last-child {
    border-bottom: 0;
  }
  .admin-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }
  .table-actions button {
    width: auto;
    flex: 1 1 86px;
  }
  .modal-backdrop { padding: 10px; place-items: end center; }
  .modal-card {
    max-height: 86vh;
    padding: 14px;
  }
}

@media (max-width: 420px) {
  h1 { font-size: 20px; }
  .top-actions { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: 1fr; }
  .item-head { grid-template-columns: 1fr; }
  .pill { width: max-content; max-width: 100%; }
  .downloads { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .result-line { padding: 7px 8px; }
}

.task-filters,
.viewer-filters {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.viewer-filters {
  grid-template-columns: minmax(180px, 2fr) repeat(6, minmax(100px, 1fr)) auto;
}

.task-filters label,
.viewer-filters label {
  min-width: 0;
}

.task-filters button,
.viewer-filters button {
  white-space: nowrap;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.pagination-actions {
  display: flex;
  gap: 8px;
}

.pagination-actions button {
  width: auto;
  padding: 8px 10px;
}

.viewer-backdrop { z-index: 60; }
.viewer-modal {
  width: min(1180px, 100%);
  max-height: min(92vh, 960px);
}

.viewer-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.viewer-stats .admin-stat { padding: 10px; }
.viewer-stats .admin-stat strong { font-size: 17px; }

.viewer-list {
  display: grid;
  gap: 8px;
}

.viewer-player {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.viewer-player > summary {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(5, minmax(80px, 1fr));
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.viewer-player > summary::-webkit-details-marker { display: none; }
.viewer-player > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-weight: 900;
}

.viewer-player[open] > summary::before { content: "−"; }
.viewer-player-main { display: grid; gap: 3px; min-width: 0; }
.viewer-player-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-summary-cell { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.viewer-player-body { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.viewer-section-title { margin: 13px 0 8px; color: var(--text); font-weight: 900; }
.viewer-queues { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.viewer-queue { border: 1px solid #cde2df; border-radius: 8px; background: #f8fcfb; padding: 9px; }
.viewer-queue-title { margin-bottom: 7px; color: var(--accent); font-weight: 900; }
.viewer-queue .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.compact-empty { padding: 10px; }

@media (max-width: 900px) {
  .viewer-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .viewer-filters label:first-of-type,
  .viewer-filters label:nth-of-type(2) { grid-column: span 2; }
  .viewer-filters button { grid-column: span 1; }
  .viewer-player > summary { grid-template-columns: minmax(160px, 2fr) repeat(3, minmax(70px, 1fr)); }
  .viewer-player > summary .pill { grid-column: span 1; }
  .viewer-queues { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .task-filters,
  .viewer-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-filters label:first-of-type,
  .viewer-filters label:first-of-type { grid-column: 1 / -1; }
  .task-filters button,
  .viewer-filters button { width: 100%; }
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination-actions { width: 100%; }
  .pagination-actions button { flex: 1; }
  .viewer-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer-player > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .viewer-player > summary .viewer-summary-cell { display: none; }
  .viewer-player > summary .pill { display: inline-flex; justify-self: end; }
  .viewer-player-body .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Product surfaces: quiet white cards with visible structure and depth. */
.app-shell { width: min(1280px, 100%); padding: 20px 22px 42px; }
.topbar { padding: 16px 4px 18px; }
.topbar h1 { font-size: 28px; letter-spacing: .01em; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; top: 76px; height: 1px; background: var(--line); }
.topbar { position: relative; }
.status-strip { margin: 2px 0 18px; }
.metric { min-height: 76px; padding: 14px 16px; border-color: #d6e2e0; box-shadow: 0 8px 24px rgba(20,32,38,.06); }
.panel, .admin-section { border-color: #d4dfde; border-radius: 10px; box-shadow: 0 14px 34px rgba(20,32,38,.07); }
.panel-head { margin-bottom: 14px; }
.user-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 4px 0 14px; padding: 22px 24px; border: 1px solid #d0dfdd; border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(20,32,38,.07); }
.hero-copy { min-width: 0; }
.hero-copy h2 { margin: 4px 0 6px; font-size: 25px; }
.hero-copy p { color: var(--muted); line-height: 1.55; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.balance-chip { min-width: 126px; padding: 10px 14px; border: 1px solid #b9d9d4; border-radius: 8px; background: #f3fbf9; }
.balance-chip span, .balance-chip strong { display: block; }
.balance-chip span { color: var(--muted); font-size: 12px; }
.balance-chip strong { margin-top: 2px; color: var(--accent); font-size: 25px; line-height: 1.1; }
.user-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.user-metric { min-width: 0; padding: 15px 16px; border: 1px solid #d4dfde; border-radius: 10px; background: #fff; box-shadow: 0 8px 22px rgba(20,32,38,.05); }
.user-metric span, .user-metric em { display: block; color: var(--muted); font-size: 12px; font-style: normal; }
.user-metric strong { display: block; margin: 5px 0 2px; font-size: 23px; }
.user-metric.accent { border-color: #9fd1c8; background: linear-gradient(135deg, #f6fffd, #fff); }
.user-metric.accent strong { color: var(--accent); }
.user-workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 14px; margin-bottom: 14px; }
.scan-workspace { border-top: 3px solid var(--accent); }
.section-kicker { color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.step-badge { display: inline-flex; align-items: center; border: 1px solid #b8d9d4; border-radius: 999px; padding: 5px 9px; color: var(--accent); background: #f5fcfb; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.primary-action { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding-inline: 16px; font-size: 15px; }
.primary-action b { font-size: 22px; font-weight: 500; }
.balance-card { display: grid; gap: 3px; margin: 4px 0 14px; padding: 16px; border: 1px solid #d5e7e3; border-radius: 8px; background: #f7fcfb; }
.balance-card span, .balance-card em { color: var(--muted); font-size: 12px; font-style: normal; }
.balance-card strong { color: var(--accent); font-size: 30px; line-height: 1.1; }
.service-note { display: flex; gap: 9px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.service-note strong { font-size: 13px; }
.service-note p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.status-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px #dcfce7; flex: 0 0 auto; }
.task-workspace { padding-top: 18px; }
.task-workspace .section-kicker { margin-bottom: -4px; }
.task-workspace .item { box-shadow: 0 5px 14px rgba(20,32,38,.035); }
.admin-layout { grid-template-columns: 206px minmax(0, 1fr); gap: 16px; }
.admin-sidebar { top: 20px; padding: 14px; border-radius: 10px; box-shadow: 0 12px 30px rgba(20,32,38,.07); }
.admin-sidebar-title { padding: 2px 4px 6px; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.admin-nav-item { padding: 11px 12px; border-radius: 7px; }
.admin-nav-item.active { box-shadow: 0 6px 14px rgba(15,118,110,.18); }
.admin-section { padding: 18px; }
.admin-stat { padding: 14px; border-color: #d4dfde; box-shadow: 0 6px 16px rgba(20,32,38,.035); }
.admin-table-wrap { border-color: #d4dfde; box-shadow: 0 8px 20px rgba(20,32,38,.035); }
.admin-table th { background: #f5faf9; }
.task-filters, .viewer-filters { border-color: #d4dfde; background: #f7faf9; }
.pagination { flex-wrap: wrap; padding-top: 4px; }
.pagination-summary { display: grid; gap: 2px; }
.pagination-summary strong { color: var(--text); font-size: 13px; }
.page-jump { display: flex; align-items: end; gap: 6px; }
.page-jump label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.page-jump input { width: 66px; min-height: 36px; padding: 7px 8px; }
.page-jump button { min-height: 36px; padding: 8px 11px; }
.pagination-actions { margin-left: auto; }
.viewer-modal { border-radius: 12px; }
.viewer-player { border-color: #d4dfde; box-shadow: 0 6px 16px rgba(20,32,38,.035); }
.viewer-player > summary { padding: 13px 14px; }
.viewer-summary-cell b { display: block; margin-bottom: 2px; color: var(--text); font-size: 11px; font-weight: 800; }
.viewer-player-body { padding: 0 14px 15px; }
.viewer-profile-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.viewer-profile-strip > div { min-width: 0; padding: 9px 10px; border: 1px solid #dce7e5; border-radius: 7px; background: #fbfdfd; }
.viewer-profile-strip span { display: block; color: var(--muted); font-size: 11px; }
.viewer-profile-strip strong { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.viewer-profile-strip em { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-style: normal; }
.shield-highlight.active { border-color: #b8e3c5; background: #f2fcf5; }
.shield-highlight.active strong { color: var(--ok); }
.shield-highlight.inactive { border-color: #f2c4c4; background: #fff7f7; }
.shield-highlight.inactive strong { color: var(--bad); }
.viewer-section-title { display: flex; align-items: center; justify-content: space-between; }
.viewer-queue { border-color: #cbdeda; background: #f8fcfb; }
.viewer-queue-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.viewer-queue-title .pill { padding: 3px 7px; font-size: 11px; }
.viewer-list.is-loading { opacity: .72; }
.viewer-loading { margin-top: 8px; padding: 8px 10px; border: 1px dashed #b9d9d4; border-radius: 7px; color: var(--accent); background: #f7fcfb; font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .user-workspace { grid-template-columns: 1fr; }
  .viewer-profile-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .app-shell { padding: 12px 10px 28px; }
  .topbar h1 { font-size: 23px; }
  .user-hero { align-items: stretch; flex-direction: column; padding: 17px; }
  .hero-actions { justify-content: space-between; }
  .user-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-metric { padding: 12px; }
  .pagination { display: grid; grid-template-columns: 1fr; }
  .pagination-actions { margin-left: 0; }
  .page-jump { justify-content: space-between; }
  .page-jump label { flex: 1; }
  .page-jump input { flex: 1; }
  .viewer-profile-strip { grid-template-columns: 1fr 1fr; }
}

/* Workspace shell inspired by the supplied white SaaS dashboard reference. */
:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-soft: #f5f7ff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #635bff;
  --accent-2: #4f46e5;
  --accent-soft: #f0efff;
  --warn: #d97706;
  --bad: #dc2626;
  --ok: #16a34a;
  --shadow: 0 1px 3px rgba(15, 23, 42, .04), 0 1px 2px rgba(15, 23, 42, .06);
}

body { background: var(--bg); color: var(--text); font-size: 14px; }
body.has-workspace .app-shell { width: 100%; max-width: none; margin: 0; padding: 0; }
body.has-workspace .topbar,
body.has-workspace .status-strip { display: none; }
body.has-workspace #notice { position: fixed; top: 18px; right: 24px; z-index: 100; width: min(420px, calc(100vw - 48px)); margin: 0; box-shadow: 0 12px 30px rgba(15,23,42,.12); }

.workspace-shell { min-height: 100vh; }
.product-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; width: 256px; padding: 22px 16px 16px; border-right: 1px solid #eef0f3; background: #fff; }
.product-brand { display: flex; align-items: center; gap: 11px; height: 48px; padding: 0 10px 18px; border-bottom: 1px solid #f1f2f4; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #7c73ff, #554ce9); box-shadow: 0 6px 14px rgba(99,91,255,.25); font-weight: 900; }
.admin-mark { background: linear-gradient(135deg, #3b82f6, #4f46e5); }
.product-brand strong, .product-brand small { display: block; }
.product-brand strong { font-size: 15px; letter-spacing: .01em; }
.product-brand small { margin-top: 2px; color: #9ca3af; font-size: 10px; letter-spacing: .04em; }
.sidebar-label { margin: 25px 10px 9px; color: #9ca3af; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.product-nav { display: grid; gap: 4px; }
.product-nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; width: 100%; padding: 0 11px; border: 0; border-radius: 9px; color: #6b7280; background: transparent; text-decoration: none; font-size: 13px; font-weight: 700; text-align: left; transition: background .16s ease, color .16s ease; }
.product-nav-item:hover { color: #374151; background: #f8f8ff; }
.product-nav-item.active { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.nav-icon { display: inline-grid; place-items: center; width: 22px; color: currentColor; font-size: 17px; font-weight: 500; }
.sidebar-spacer { flex: 1 1 auto; }
.sidebar-status { display: flex; align-items: center; gap: 9px; margin: 12px 6px; padding: 11px 10px; border: 1px solid #eef0f3; border-radius: 10px; background: #fafbfc; }
.sidebar-status strong, .sidebar-status small { display: block; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status small { margin-top: 2px; color: #9ca3af; font-size: 10px; }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 12px 7px 3px; border-top: 1px solid #f1f2f4; }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sidebar-user small { margin-top: 2px; color: #9ca3af; font-size: 10px; }
.avatar, .admin-avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: #111827; font-size: 12px; font-weight: 800; }
.admin-avatar { background: var(--accent); }
.icon-button { margin-left: auto; padding: 4px; border: 0; color: #9ca3af; background: transparent; font-size: 18px; }
.sidebar-logout { display: flex; align-items: center; gap: 11px; width: 100%; margin-top: 12px; padding: 11px; border: 0; border-radius: 9px; color: #6b7280; background: transparent; font-size: 13px; font-weight: 700; text-align: left; }
.sidebar-logout:hover { color: var(--bad); background: #fff5f5; }
.workspace-main { min-width: 0; min-height: 100vh; margin-left: 256px; padding: 30px 42px 60px; }
.workspace-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; max-width: 1320px; margin: 0 auto 25px; }
.toolbar-eyebrow { display: block; margin-bottom: 5px; color: #9ca3af; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workspace-toolbar h2 { font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.toolbar-actions { display: flex; align-items: center; gap: 12px; }
.last-sync { color: #9ca3af; font-size: 12px; }
.workspace-main > *:not(.workspace-toolbar) { max-width: 1320px; margin-left: auto; margin-right: auto; }
.user-hero { margin: 0 0 16px; padding: 26px 28px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.hero-copy h2 { font-size: 26px; letter-spacing: -.02em; }
.hero-copy p { color: #6b7280; }
.balance-chip { border-color: #e5e7eb; background: #fafbff; }
.balance-chip strong { color: var(--accent); }
.user-metrics { gap: 12px; margin-bottom: 16px; }
.user-metric { border-color: var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.user-metric.accent { border-color: #dddafe; background: #fbfaff; }
.user-metric.accent strong { color: var(--accent); }
.user-workspace { gap: 16px; margin-bottom: 16px; }
.panel, .admin-section { border-color: var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.scan-panel { border-top: 3px solid var(--accent); border-color: var(--line); }
.section-kicker { color: var(--accent); letter-spacing: .12em; }
.step-badge { border-color: #dddafe; color: var(--accent); background: var(--accent-soft); }
.scan-workspace .panel-head h2, .account-panel .panel-head h2, .task-workspace .panel-head h2 { font-size: 18px; }
.primary-action { border-radius: 9px; background: linear-gradient(90deg, #6d63ff, #554ce9); box-shadow: 0 8px 16px rgba(99,91,255,.18); }
.primary-action:hover { background: linear-gradient(90deg, #5d54ed, #4941d5); }
.balance-card { border-color: #e8e6ff; background: #fafaff; }
.balance-card strong { color: var(--accent); }
.task-workspace { padding: 22px 24px; }
.task-workspace .item { border-color: var(--line); border-radius: 12px; box-shadow: none; }
.task-filters, .viewer-filters { border-color: var(--line); border-radius: 12px; background: #fafbfc; }
input, select, textarea { border-color: #e5e7eb; border-radius: 9px; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,91,255,.1); }
button, .link-button { border-radius: 9px; background: var(--accent); box-shadow: none; }
button:hover, .link-button:hover { background: var(--accent-2); }
button.secondary, .link-button.secondary { border-color: #e5e7eb; color: #4b5563; background: #fff; }
button.secondary:hover, .link-button.secondary:hover { border-color: #d8d5ff; color: var(--accent); background: #fafaff; }
.pill { border-radius: 999px; }
.admin-content .admin-section { box-shadow: var(--shadow); }
.admin-section { padding: 24px; }
.admin-section-head { align-items: center; }
.admin-section-head h2 { font-size: 18px; }
.admin-section-head p { color: #9ca3af; }
.admin-stats { gap: 12px; }
.admin-stat { border-color: var(--line); border-radius: 12px; box-shadow: none; }
.admin-stat strong { color: #111827; }
.admin-table-wrap { border-color: var(--line); border-radius: 12px; box-shadow: none; }
.admin-table th { background: #fafbfc; color: #9ca3af; }
.admin-table td { border-color: #f0f1f3; }
.admin-nav { display: contents; }
.admin-product-nav .product-nav-item { width: 100%; }
.admin-product-nav .product-nav-item.active { color: var(--accent); background: var(--accent-soft); }
.admin-layout { display: block; }
.admin-sidebar { display: none; }
.pagination { margin-top: 16px; }
.page-jump input { border-radius: 8px; }
.viewer-modal { border-radius: 16px; }
.auth-shell { display: grid; grid-template-columns: minmax(300px, .95fr) minmax(380px, 1.05fr); width: min(980px, calc(100vw - 48px)); min-height: 620px; margin: 40px auto; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 20px 55px rgba(15,23,42,.08); }
.auth-intro { display: flex; flex-direction: column; min-width: 0; padding: 28px; color: #fff; background: linear-gradient(145deg, #25225c, #554ce9 70%, #7068ff); }
.auth-intro .product-brand { padding: 0 0 18px; border-bottom-color: rgba(255,255,255,.16); }
.auth-intro .product-brand strong { color: #fff; }
.auth-intro .product-brand small { color: rgba(255,255,255,.62); }
.auth-intro .brand-mark { color: #554ce9; background: #fff; box-shadow: none; }
.auth-intro-copy { margin-top: auto; }
.auth-intro-copy .toolbar-eyebrow { color: rgba(255,255,255,.65); }
.auth-intro-copy h2 { margin: 10px 0 14px; font-size: 37px; line-height: 1.15; letter-spacing: -.04em; }
.auth-intro-copy h2 em { color: #c9c6ff; font-style: normal; }
.auth-intro-copy p { max-width: 290px; color: rgba(255,255,255,.72); line-height: 1.7; }
.auth-intro-foot { margin-top: auto; padding-top: 28px; color: rgba(255,255,255,.58); font-size: 11px; }
.auth-forms { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 46px 54px; }
.auth-form-block h2 { margin: 7px 0 6px; font-size: 26px; letter-spacing: -.025em; }
.auth-form-block h3 { margin-bottom: 8px; font-size: 18px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 30px 0 24px; color: #9ca3af; font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: #eef0f3; }
.register-block { padding-top: 0; }
.single-auth-form { justify-content: center; }
.admin-auth-intro { background: linear-gradient(145deg, #172554, #2563eb 75%, #4f46e5); }

@media (max-width: 900px) {
  body.has-workspace .app-shell { padding: 0; }
  .product-sidebar { position: static; width: 100%; min-height: auto; padding: 13px 14px 10px; border-right: 0; border-bottom: 1px solid #eef0f3; }
  .product-brand { height: 42px; padding-bottom: 10px; }
  .sidebar-label, .sidebar-spacer, .sidebar-status, .sidebar-user, .sidebar-logout { display: none; }
  .product-nav { display: flex; gap: 5px; margin-top: 10px; overflow-x: auto; }
  .product-nav-item { width: auto; flex: 0 0 auto; min-height: 36px; padding: 0 11px; white-space: nowrap; }
  .workspace-main { margin-left: 0; padding: 24px 18px 42px; }
  .workspace-toolbar { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .toolbar-actions { width: 100%; justify-content: space-between; }
  .auth-shell { grid-template-columns: 1fr; width: min(560px, calc(100vw - 32px)); margin: 20px auto; }
  .auth-intro { min-height: 280px; }
  .auth-intro-copy { margin-top: 38px; }
  .auth-intro-copy h2 { font-size: 30px; }
  .auth-forms { padding: 34px 28px; }
}

@media (max-width: 640px) {
  .workspace-main { padding: 20px 12px 32px; }
  .workspace-toolbar h2 { font-size: 21px; }
  .user-hero { padding: 20px; border-radius: 14px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .balance-chip { width: 100%; }
  .user-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-workspace { gap: 12px; }
  .panel, .admin-section { border-radius: 13px; }
  .admin-section { padding: 16px; }
  .toolbar-actions button { width: auto; }
  .auth-shell { width: calc(100vw - 20px); margin: 10px auto; border-radius: 15px; }
  .auth-intro { min-height: 250px; padding: 20px; }
  .auth-forms { padding: 28px 20px; }
}

/* Light mobile-first refinement. */
:root {
  --accent: #334155;
  --accent-2: #1f2937;
  --accent-soft: #f1f5f9;
  --panel-soft: #f8fafc;
}
body { background: #f8fafc; }
.brand-mark { color: #334155; background: #e2e8f0; box-shadow: none; }
.admin-mark { color: #334155; background: #e2e8f0; }
.product-nav-item.active, .admin-product-nav .product-nav-item.active { color: #334155; background: #eef2f7; }
.primary-action, .auth-forms button[type="submit"] { background: #334155; box-shadow: none; }
.primary-action:hover, .auth-forms button[type="submit"]:hover { background: #1f2937; }
.step-badge, .balance-card { border-color: #e2e8f0; color: #475569; background: #f8fafc; }
.balance-card strong, .balance-chip strong, .user-metric.accent strong { color: #334155; }
.user-metric.accent { border-color: #e2e8f0; background: #fff; }
.section-kicker { color: #64748b; }
.auth-shell { grid-template-columns: 1fr minmax(400px, .95fr); min-height: 560px; border-radius: 16px; }
.auth-intro, .admin-auth-intro { color: #1f2937; background: #f8fafc; }
.auth-intro .product-brand { border-bottom-color: #e5e7eb; }
.auth-intro .product-brand strong { color: #1f2937; }
.auth-intro .product-brand small { color: #94a3b8; }
.auth-intro .brand-mark { color: #334155; background: #e2e8f0; }
.auth-intro-copy .toolbar-eyebrow { color: #94a3b8; }
.auth-intro-copy h2 { color: #1f2937; }
.auth-intro-copy h2 em { color: #64748b; }
.auth-intro-copy p { color: #64748b; }
.auth-intro-foot { color: #94a3b8; }
.auth-forms { padding: 42px 48px; }
.auth-simple-forms { max-width: 480px; width: 100%; justify-self: center; }
.auth-tabs { display: flex; gap: 20px; margin-bottom: 28px; border-bottom: 1px solid #e5e7eb; }
.auth-tab { position: relative; min-width: 58px; padding: 0 0 12px; border: 0; border-radius: 0; color: #94a3b8; background: transparent; font-size: 16px; font-weight: 800; }
.auth-tab:hover { color: #334155; background: transparent; }
.auth-tab.active { color: #334155; background: transparent; }
.auth-tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: #334155; }
.auth-form-block h2 { font-size: 24px; }
.auth-form-block .item-meta { margin-bottom: 18px; }
.purchase-guide { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 18px; padding: 11px 12px; border: 1px solid #e5e7eb; border-radius: 9px; color: #64748b; background: #fafbfc; text-decoration: none; font-size: 12px; }
.purchase-guide strong { color: #334155; font-size: 12px; }
.auth-switch-hint { margin-top: 20px; color: #94a3b8; font-size: 12px; text-align: center; }
.text-button { width: auto; padding: 0; border: 0; color: #334155; background: transparent; font-size: 12px; font-weight: 800; }
.text-button:hover { background: transparent; text-decoration: underline; }
.task-workspace .item { background: #fff; }
.task-list-card { border-left-width: 3px; }
.task-list-card.completed { border-left-color: #86efac; }
.task-list-card.running { border-left-color: #94a3b8; }
.task-list-card.queued { border-left-color: #fbbf24; }
.task-list-card.failed { border-left-color: #fca5a5; }
.item-title { font-size: 14px; }
.item-meta { color: #94a3b8; }
.phase-line { color: #64748b; }
.viewer-modal { background: #f8fafc; }
.viewer-modal .modal-head, .viewer-modal .viewer-stats, .viewer-modal .viewer-filters { background: #fff; }
.viewer-player { border-radius: 12px; border-color: #e5e7eb; }
.viewer-player > summary { gap: 10px; padding: 13px 14px; }
.viewer-player-main strong { color: #1f2937; font-size: 14px; }
.viewer-mobile-meta { display: none; color: #64748b; font-size: 11px; }
.viewer-summary-cell b { color: #64748b; }
.viewer-profile-strip > div { border-color: #e5e7eb; background: #fff; }
.viewer-queue { border-color: #e5e7eb; background: #fff; }
.viewer-queue-title { color: #475569; }
.pill.running { color: #475569; background: #f1f5f9; }
.result-card.soft { border-color: #e5e7eb; background: #f8fafc; }
.result-card.soft .result-title { color: #475569; }
.notice { border-color: #e5e7eb; background: #f8fafc; color: #475569; }
.notice.error { border-color: #fecaca; background: #fff7f7; color: #991b1b; }

@media (max-width: 700px) {
  .user-workspace-shell .product-sidebar { padding: 10px 13px 8px; background: #fff; }
  .user-workspace-shell .product-brand { height: 36px; padding: 0 2px 8px; border-bottom: 0; }
  .user-workspace-shell .product-brand small { display: none; }
  .user-workspace-shell .product-brand strong { font-size: 14px; }
  .user-workspace-shell .brand-mark { width: 28px; height: 28px; border-radius: 7px; }
  .user-workspace-shell .product-nav { display: none; }
  .workspace-main { padding: 15px 12px 30px; }
  .workspace-toolbar { margin-bottom: 14px; }
  .workspace-toolbar h2 { font-size: 20px; }
  .toolbar-eyebrow { margin-bottom: 2px; font-size: 10px; }
  .last-sync { display: none; }
  .user-hero { margin-bottom: 10px; padding: 18px; border-radius: 12px; }
  .hero-copy .eyebrow { display: none; }
  .hero-copy h2 { font-size: 21px; }
  .hero-copy p { margin-top: 5px; font-size: 12px; }
  .hero-actions { margin-top: 13px; gap: 8px; }
  .hero-actions .secondary { width: 100%; }
  .user-metrics { gap: 8px; margin-bottom: 10px; }
  .user-metric { padding: 11px 12px; border-radius: 10px; }
  .user-metric strong { font-size: 19px; }
  .user-workspace { gap: 10px; margin-bottom: 10px; }
  .panel, .admin-section { border-radius: 12px; }
  .scan-workspace, .account-panel, .task-workspace { padding: 15px; }
  .scan-workspace .panel-head { margin-top: 5px; }
  .scan-workspace .panel-head h2 { font-size: 17px; }
  .form-grid { gap: 8px; }
  .mode-choice { padding: 9px; }
  .check-row em { font-size: 11px; }
  .task-workspace .panel-head { gap: 8px; }
  .task-workspace .panel-head .secondary { width: auto; padding: 8px 10px; }
  .task-filters { grid-template-columns: 1fr 1fr; padding: 9px; }
  .task-filters label:first-of-type { grid-column: 1 / -1; }
  .task-filters button { grid-column: 1 / -1; }
  .item { padding: 11px; }
  .item-head { gap: 7px; }
  .downloads { display: grid; grid-template-columns: 1fr; }
  .downloads button { width: 100%; }
  .auth-shell { display: block; width: calc(100vw - 24px); min-height: 0; margin: 12px auto; border-radius: 14px; }
  .auth-intro { min-height: 0; padding: 18px; }
  .auth-intro-copy { margin-top: 26px; }
  .auth-intro-copy h2 { margin: 6px 0 7px; font-size: 27px; }
  .auth-intro-copy p { font-size: 12px; }
  .auth-intro-foot { padding-top: 20px; }
  .auth-forms { padding: 23px 18px 25px; }
  .auth-tabs { margin-bottom: 22px; }
  .auth-form-block h2 { font-size: 21px; }
  .auth-form-block .item-meta { margin-bottom: 14px; }
  .auth-form-block label { font-size: 12px; }
  .auth-form-block input { min-height: 44px; }
  .purchase-guide { align-items: flex-start; flex-direction: column; gap: 5px; }
  .viewer-modal { width: 100%; max-height: 94vh; padding: 13px; }
  .viewer-modal .modal-head { gap: 8px; }
  .viewer-modal .modal-head h2 { font-size: 16px; }
  .viewer-stats { gap: 7px; }
  .viewer-stats .admin-stat { padding: 9px; }
  .viewer-filters { grid-template-columns: 1fr 1fr; padding: 9px; }
  .viewer-filters label:first-of-type { grid-column: 1 / -1; }
  .viewer-filters button { grid-column: 1 / -1; }
  .viewer-player > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .viewer-player > summary .viewer-summary-cell { display: none; }
  .viewer-mobile-meta { display: block; margin-top: 3px; }
  .viewer-player-body { padding: 0 11px 12px; }
  .viewer-profile-strip { grid-template-columns: 1fr 1fr; gap: 6px; }
  .viewer-profile-strip > div { padding: 8px; }
}

/* Bright white finish applied after the legacy theme rules. */
:root {
  --bg: #fffdf8;
  --panel: #ffffff;
  --panel-soft: #fffaf0;
  --text: #24313a;
  --muted: #71808a;
  --line: #eee6d8;
  --accent: #d97706;
  --accent-2: #b45309;
  --accent-soft: #fff4d6;
  --warn: #c26a05;
  --bad: #c2413b;
  --ok: #16866a;
  --shadow: 0 10px 28px rgba(123, 84, 18, .07);
}
body { background: var(--bg); color: var(--text); }
body:not(.has-workspace) .topbar, body:not(.has-workspace) .status-strip { display: none; }
body:not(.has-workspace) .app-shell { width: 100%; max-width: 100%; padding: 12px; }
.product-sidebar { border-color: #f2eadb; background: #fff; }
.product-brand { border-color: #f3ecdf; }
.brand-mark { color: #a45b05; background: #ffefb8; box-shadow: none; }
.admin-mark { color: #087a64; background: #dff7ee; }
.product-brand small, .sidebar-label, .sidebar-status small, .sidebar-user small, .toolbar-eyebrow, .last-sync { color: #a18f78; }
.product-nav-item { color: #74818a; }
.product-nav-item:hover { color: #87520c; background: #fffaf0; }
.product-nav-item.active { color: #a45b05; background: #fff4d6; }
.admin-product-nav .product-nav-item.active { color: #087a64; background: #eaf9f4; }
.sidebar-status { border-color: #f1e8d8; background: #fffaf1; }
.avatar { color: #a45b05; background: #ffefb8; }
.admin-avatar { color: #087a64; background: #dff7ee; }
.workspace-main { background: transparent; }
.workspace-toolbar h2 { color: #28343c; }
.user-hero { border-color: #f0dfb8; border-left: 4px solid #f2b84b; background: #fffefb; box-shadow: var(--shadow); }
.hero-copy p, .user-metric span, .user-metric em, .balance-chip span { color: var(--muted); }
.balance-chip, .balance-card { border-color: #f0dfb8; background: #fffaf0; }
.balance-chip strong, .balance-card strong, .user-metric.accent strong { color: #b45f05; }
.user-metric, .panel, .admin-section { border-color: var(--line); background: #fff; box-shadow: var(--shadow); }
.user-metric.accent { border-color: #f0dfb8; background: #fffaf0; }
.scan-panel { border-top-color: #f2b84b; }
.section-kicker { color: #b45f05; }
.step-badge { border-color: #f0dfb8; color: #a45b05; background: #fffaf0; }
.primary-action, button:not(.secondary):not(.auth-tab):not(.text-button), .link-button:not(.secondary) { color: #fff; background: #e39a19; box-shadow: 0 6px 14px rgba(227, 154, 25, .18); }
.primary-action:hover, button:not(.secondary):not(.auth-tab):not(.text-button):hover, .link-button:not(.secondary):hover { background: #c97908; }
button.secondary, .link-button.secondary { border-color: #eadfce; color: #596770; background: #fff; }
button.secondary:hover, .link-button.secondary:hover { border-color: #f0c66a; color: #a45b05; background: #fffaf0; }
input, select, textarea { border-color: #eadfce; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: #e5a12b; box-shadow: 0 0 0 3px rgba(229, 161, 43, .14); }
.notice { border-color: #f1dfb6; background: #fffaf0; color: #865914; }
.notice.error { border-color: #f1c8c5; background: #fff7f6; color: #a13d38; }
.notice.ok { border-color: #b9e7d7; background: #f2fcf8; color: #14725d; }
.task-workspace .item, .admin-table-wrap, .admin-stat, .sub-panel { border-color: var(--line); background: #fff; }
.task-list-card.completed { border-left-color: #70c9a9; }
.task-list-card.running { border-left-color: #f0b84b; }
.task-list-card.queued { border-left-color: #e7a22b; }
.task-list-card.failed { border-left-color: #e49a94; }
.pill.completed { color: #14725d; background: #e9f8f1; }
.pill.running { color: #90600f; background: #fff4d6; }
.pill.queued { color: #95600c; background: #fff7df; }
.pill.failed { color: #a13d38; background: #fff0ee; }
.phase-line { color: #9a7c48; }
.admin-table th { color: #9a8e7d; background: #fffaf1; }
.admin-table td { border-color: #f2ebdf; }
.task-filters, .viewer-filters { border-color: var(--line); background: #fffaf2; }
.viewer-modal { border-color: #efdfbd; background: #fffdf8; }
.viewer-modal .modal-head, .viewer-modal .viewer-stats, .viewer-modal .viewer-filters { background: #fff; }
.viewer-player { border-color: #eee2d0; background: #fff; }
.viewer-player > summary:hover { background: #fffaf0; }
.viewer-summary-cell b, .viewer-queue-title { color: #976010; }
.viewer-profile-strip > div, .viewer-queue { border-color: #eee2d0; background: #fffdf9; }
.viewer-section-title { color: #7b551c; }
.viewer-loading { border-color: #edce8b; color: #936116; background: #fffaf0; }
.shield-highlight.active { border-color: #a9dfc8; background: #effbf6; }
.shield-highlight.active strong { color: #16866a; }
.shield-highlight.inactive { border-color: #efd0b2; background: #fff8ee; }
.shield-highlight.inactive strong { color: #9b6418; }
.result-card.soft { border-color: #eee2d0; background: #fffaf2; }
.result-card.soft .result-title { color: #8c641f; }
.status-dot { background: #16866a; box-shadow: 0 0 0 4px #dff7ee; }
.auth-shell { width: min(820px, calc(100vw - 32px)); min-height: 500px; margin: 28px auto; border-color: #f0dfb8; border-radius: 10px; box-shadow: 0 22px 60px rgba(123, 84, 18, .1); }
.auth-intro, .admin-auth-intro { color: #26343c; background: #fff8df; }
.auth-intro .product-brand { border-color: #f0dfb8; }
.auth-intro .product-brand strong { color: #60461c; }
.auth-intro .product-brand small { color: #aa8b53; }
.auth-intro .brand-mark { color: #a45b05; background: #ffefb8; }
.auth-intro-copy h2 { color: #4b371c; }
.auth-intro-copy h2 em { color: #c27b16; }
.auth-intro-copy p, .auth-intro-foot { color: #90784f; }
.admin-auth-intro { background: #eaf9f4; }
.auth-forms { background: #fff; }
.auth-tabs { border-color: #eee4d5; }
.auth-tab, .auth-tab:hover { color: #a7957a; background: transparent; }
.auth-tab.active { color: #a45b05; background: transparent; }
.auth-tab.active::after { background: #e39a19; }
.auth-form-block h2 { color: #29363e; }
.purchase-guide { border-color: #f0dfb8; color: #887454; background: #fffaf0; }
.purchase-guide strong { color: #a45b05; }
.auth-switch-hint, .item-meta { color: #9b8e7e; }
.text-button { color: #a45b05; }
@media (max-width: 700px) {
  body:not(.has-workspace) .app-shell { padding: 8px; }
  .auth-shell { width: calc(100vw - 16px); margin: 8px auto; border-radius: 10px; }
  .auth-intro { min-height: 154px; padding: 16px; }
  .auth-intro-copy { margin-top: 22px; }
  .auth-intro-copy h2 { margin: 0; font-size: 25px; }
  .auth-intro-copy p { margin-top: 6px; font-size: 12px; }
  .auth-intro-foot { padding-top: 16px; font-size: 10px; }
  .auth-forms { padding: 22px 18px 24px; }
  .auth-form-block h2 { font-size: 21px; }
  .auth-tabs { margin-bottom: 20px; }
  .auth-form-block input { min-height: 44px; }
  .workspace-main { padding: 15px 10px 28px; }
  .user-hero { padding: 17px; }
  .panel, .admin-section { box-shadow: 0 5px 18px rgba(123, 84, 18, .05); }
  .admin-content .admin-section { padding: 15px; }
  .admin-table-wrap { overflow-x: auto; }
  .viewer-modal { border-radius: 10px; }
}
