:root {
  color-scheme: dark;
  --bg: #020612;
  --bg-2: #071323;
  --panel: rgba(5, 15, 30, 0.78);
  --panel-strong: rgba(7, 18, 36, 0.92);
  --line: rgba(52, 211, 255, 0.22);
  --line-strong: rgba(52, 211, 255, 0.58);
  --cyan: #22d3ee;
  --blue: #38bdf8;
  --violet: #8b5cf6;
  --pink: #f472b6;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --text: #e8f7ff;
  --muted: #8ba5bd;
  --soft: #cdeaff;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  --glow: 0 0 34px rgba(34, 211, 238, 0.18);
  --page-background:
    linear-gradient(128deg, rgba(34, 211, 238, 0.14) 0%, transparent 30% 64%, rgba(244, 114, 182, 0.1) 100%),
    linear-gradient(42deg, transparent 0 38%, rgba(139, 92, 246, 0.08) 56%, transparent 78%),
    linear-gradient(180deg, #020612 0%, #071323 48%, #02040d 100%);
  --grid-line: rgba(148, 163, 184, 0.055);
  --grid-mask: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 82%);
  --ambient-overlay:
    linear-gradient(120deg, transparent 0 18%, rgba(34, 211, 238, 0.075) 20%, transparent 24% 100%),
    linear-gradient(42deg, transparent 0 62%, rgba(244, 114, 182, 0.045) 64%, transparent 68% 100%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
  --panel-bg:
    linear-gradient(145deg, rgba(15, 32, 59, 0.86), rgba(4, 12, 25, 0.8) 58%, rgba(14, 20, 44, 0.74)),
    rgba(5, 15, 30, 0.75);
  --card-bg:
    linear-gradient(145deg, rgba(15, 32, 59, 0.86), rgba(4, 12, 25, 0.8)),
    rgba(5, 15, 30, 0.75);
  --control-bg: rgba(3, 10, 22, 0.72);
  --control-strong-bg: rgba(3, 10, 22, 0.86);
  --field-bg: rgba(1, 6, 16, 0.64);
  --input-bg: rgba(1, 6, 16, 0.92);
  --prompt-bg:
    linear-gradient(180deg, rgba(1, 8, 20, 0.95), rgba(4, 13, 30, 0.92)),
    rgba(1, 6, 16, 0.94);
  --subtle-bg: rgba(2, 8, 18, 0.58);
  --chip-bg: rgba(2, 8, 18, 0.7);
  --chip-text: #dff8ff;
  --badge-bg: rgba(2, 8, 18, 0.62);
  --icon-bg: rgba(3, 10, 22, 0.74);
  --active-bg:
    linear-gradient(135deg, rgba(34, 211, 238, 0.26), rgba(139, 92, 246, 0.2)),
    rgba(3, 10, 22, 0.86);
  --active-border: rgba(34, 211, 238, 0.68);
  --active-shadow: 0 0 32px rgba(34, 211, 238, 0.2);
  --primary-bg:
    linear-gradient(135deg, rgba(34, 211, 238, 0.82), rgba(139, 92, 246, 0.78) 56%, rgba(244, 114, 182, 0.72));
  --primary-text: #f8fdff;
  --stage-bg:
    linear-gradient(128deg, rgba(34, 211, 238, 0.14), transparent 42%, rgba(139, 92, 246, 0.1)),
    linear-gradient(145deg, rgba(2, 8, 18, 0.95), rgba(5, 18, 36, 0.88));
}

body[data-theme="portrait"] {
  color-scheme: light;
  --bg: #f7fbff;
  --bg-2: #e9f4fb;
  --line: rgba(54, 119, 142, 0.24);
  --line-strong: rgba(46, 139, 166, 0.58);
  --cyan: #2f9bb3;
  --blue: #3478c7;
  --violet: #8a73c7;
  --pink: #dd6f9c;
  --green: #16845f;
  --amber: #a66300;
  --red: #c83f66;
  --text: #183246;
  --muted: #5a7184;
  --soft: #314d62;
  --shadow: 0 24px 70px rgba(31, 66, 86, 0.16);
  --glow: 0 0 30px rgba(221, 111, 156, 0.16);
  --page-background:
    linear-gradient(128deg, rgba(98, 194, 210, 0.2) 0%, transparent 34% 66%, rgba(236, 143, 181, 0.18) 100%),
    linear-gradient(42deg, transparent 0 46%, rgba(138, 115, 199, 0.1) 58%, transparent 76%),
    linear-gradient(180deg, #f7fbff 0%, #eef7fb 48%, #f9fbff 100%);
  --grid-line: rgba(76, 108, 132, 0.09);
  --grid-mask: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 82%);
  --ambient-overlay:
    linear-gradient(120deg, transparent 0 20%, rgba(98, 194, 210, 0.12) 22%, transparent 27% 100%),
    linear-gradient(42deg, transparent 0 60%, rgba(236, 143, 181, 0.08) 63%, transparent 68% 100%);
  --panel-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(238, 247, 251, 0.82) 58%, rgba(246, 241, 255, 0.76)),
    rgba(255, 255, 255, 0.75);
  --card-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(238, 247, 251, 0.82)),
    rgba(255, 255, 255, 0.75);
  --control-bg: rgba(255, 255, 255, 0.72);
  --control-strong-bg: rgba(255, 255, 255, 0.9);
  --field-bg: rgba(255, 255, 255, 0.74);
  --input-bg: rgba(255, 255, 255, 0.94);
  --prompt-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 252, 0.92)),
    rgba(255, 255, 255, 0.94);
  --subtle-bg: rgba(255, 255, 255, 0.64);
  --chip-bg: rgba(235, 246, 250, 0.86);
  --chip-text: #254b60;
  --badge-bg: rgba(255, 255, 255, 0.72);
  --icon-bg: rgba(239, 249, 252, 0.86);
  --active-bg:
    linear-gradient(135deg, rgba(98, 194, 210, 0.3), rgba(236, 143, 181, 0.26)),
    rgba(255, 255, 255, 0.88);
  --active-border: rgba(221, 111, 156, 0.58);
  --active-shadow: 0 0 28px rgba(98, 194, 210, 0.18);
  --primary-bg: linear-gradient(135deg, #2f9bb3, #8a73c7 56%, #dd6f9c);
  --primary-text: #ffffff;
  --stage-bg:
    linear-gradient(128deg, rgba(236, 143, 181, 0.16), transparent 46%, rgba(98, 194, 210, 0.14)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(238, 247, 251, 0.88));
}

body[data-theme="seller"] {
  color-scheme: light;
  --bg: #f8faf7;
  --bg-2: #eef6f1;
  --line: rgba(18, 117, 87, 0.22);
  --line-strong: rgba(18, 117, 87, 0.58);
  --cyan: #0f9f8f;
  --blue: #2563eb;
  --violet: #7c3aed;
  --pink: #e85d75;
  --green: #15803d;
  --amber: #c26a00;
  --red: #dc2626;
  --text: #17261f;
  --muted: #5d7067;
  --soft: #2e4b3d;
  --shadow: 0 22px 64px rgba(20, 54, 42, 0.16);
  --glow: 0 0 30px rgba(15, 159, 143, 0.16);
  --page-background:
    linear-gradient(128deg, rgba(15, 159, 143, 0.16) 0%, transparent 34% 66%, rgba(37, 99, 235, 0.12) 100%),
    linear-gradient(42deg, transparent 0 48%, rgba(232, 93, 117, 0.09) 60%, transparent 78%),
    linear-gradient(180deg, #f9fbf8 0%, #eef7f2 46%, #f7faf9 100%);
  --grid-line: rgba(41, 80, 62, 0.08);
  --grid-mask: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 82%);
  --ambient-overlay:
    linear-gradient(120deg, transparent 0 18%, rgba(15, 159, 143, 0.1) 21%, transparent 25% 100%),
    linear-gradient(42deg, transparent 0 62%, rgba(37, 99, 235, 0.07) 64%, transparent 68% 100%);
  --panel-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(239, 248, 242, 0.84) 58%, rgba(238, 244, 255, 0.76)),
    rgba(255, 255, 255, 0.75);
  --card-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(239, 248, 242, 0.84)),
    rgba(255, 255, 255, 0.78);
  --control-bg: rgba(255, 255, 255, 0.74);
  --control-strong-bg: rgba(255, 255, 255, 0.92);
  --field-bg: rgba(255, 255, 255, 0.76);
  --input-bg: rgba(255, 255, 255, 0.95);
  --prompt-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 248, 243, 0.92)),
    rgba(255, 255, 255, 0.94);
  --subtle-bg: rgba(255, 255, 255, 0.66);
  --chip-bg: rgba(232, 246, 240, 0.88);
  --chip-text: #234b3e;
  --badge-bg: rgba(255, 255, 255, 0.76);
  --icon-bg: rgba(235, 248, 242, 0.9);
  --active-bg:
    linear-gradient(135deg, rgba(15, 159, 143, 0.24), rgba(37, 99, 235, 0.18)),
    rgba(255, 255, 255, 0.9);
  --active-border: rgba(15, 159, 143, 0.58);
  --active-shadow: 0 0 28px rgba(15, 159, 143, 0.18);
  --primary-bg: linear-gradient(135deg, #0f9f8f, #2563eb 58%, #e85d75);
  --primary-text: #ffffff;
  --stage-bg:
    linear-gradient(128deg, rgba(15, 159, 143, 0.14), transparent 46%, rgba(37, 99, 235, 0.1)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(239, 248, 242, 0.88));
}

body[data-theme="academic"] {
  color-scheme: light;
  --bg: #fbfcff;
  --bg-2: #eef4fb;
  --line: rgba(45, 93, 140, 0.22);
  --line-strong: rgba(45, 93, 140, 0.56);
  --cyan: #278fa8;
  --blue: #315f9f;
  --violet: #6954b7;
  --pink: #b55279;
  --green: #18705f;
  --amber: #946200;
  --red: #b91c1c;
  --text: #152436;
  --muted: #5b6876;
  --soft: #2d4259;
  --shadow: 0 20px 64px rgba(35, 53, 72, 0.14);
  --glow: 0 0 28px rgba(49, 95, 159, 0.14);
  --page-background:
    linear-gradient(128deg, rgba(39, 143, 168, 0.12) 0%, transparent 36% 64%, rgba(105, 84, 183, 0.1) 100%),
    linear-gradient(42deg, transparent 0 46%, rgba(24, 112, 95, 0.08) 60%, transparent 78%),
    linear-gradient(180deg, #fbfcff 0%, #eef4fb 50%, #f8fbff 100%);
  --grid-line: rgba(42, 66, 92, 0.08);
  --grid-mask: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 82%);
  --ambient-overlay:
    linear-gradient(120deg, transparent 0 18%, rgba(49, 95, 159, 0.08) 21%, transparent 25% 100%),
    repeating-linear-gradient(180deg, rgba(21, 36, 54, 0.024) 0 1px, transparent 1px 6px);
  --panel-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(239, 244, 251, 0.86) 58%, rgba(244, 244, 255, 0.78)),
    rgba(255, 255, 255, 0.78);
  --card-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(239, 244, 251, 0.86)),
    rgba(255, 255, 255, 0.78);
  --control-bg: rgba(255, 255, 255, 0.76);
  --control-strong-bg: rgba(255, 255, 255, 0.92);
  --field-bg: rgba(255, 255, 255, 0.78);
  --input-bg: rgba(255, 255, 255, 0.96);
  --prompt-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 245, 251, 0.92)),
    rgba(255, 255, 255, 0.94);
  --subtle-bg: rgba(255, 255, 255, 0.68);
  --chip-bg: rgba(235, 241, 249, 0.9);
  --chip-text: #243b55;
  --badge-bg: rgba(255, 255, 255, 0.78);
  --icon-bg: rgba(235, 241, 249, 0.9);
  --active-bg:
    linear-gradient(135deg, rgba(49, 95, 159, 0.22), rgba(24, 112, 95, 0.14)),
    rgba(255, 255, 255, 0.9);
  --active-border: rgba(49, 95, 159, 0.56);
  --active-shadow: 0 0 28px rgba(49, 95, 159, 0.16);
  --primary-bg: linear-gradient(135deg, #315f9f, #18705f 58%, #6954b7);
  --primary-text: #ffffff;
  --stage-bg:
    linear-gradient(128deg, rgba(49, 95, 159, 0.12), transparent 46%, rgba(24, 112, 95, 0.08)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(239, 244, 251, 0.88));
}

body[data-theme="engineering"] {
  --bg: #061111;
  --bg-2: #09201f;
  --line: rgba(74, 222, 128, 0.22);
  --line-strong: rgba(74, 222, 128, 0.58);
  --cyan: #4ade80;
  --blue: #38bdf8;
  --violet: #a78bfa;
  --pink: #f472b6;
  --green: #22c55e;
  --amber: #fbbf24;
  --red: #fb7185;
  --text: #e9fff3;
  --muted: #8fb4a2;
  --soft: #d7ffe7;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  --glow: 0 0 34px rgba(74, 222, 128, 0.16);
  --page-background:
    linear-gradient(128deg, rgba(74, 222, 128, 0.12) 0%, transparent 34% 66%, rgba(56, 189, 248, 0.1) 100%),
    linear-gradient(42deg, transparent 0 46%, rgba(167, 139, 250, 0.08) 60%, transparent 78%),
    linear-gradient(180deg, #061111 0%, #09201f 48%, #030807 100%);
  --grid-line: rgba(74, 222, 128, 0.07);
  --ambient-overlay:
    linear-gradient(120deg, transparent 0 18%, rgba(74, 222, 128, 0.08) 20%, transparent 24% 100%),
    linear-gradient(42deg, transparent 0 62%, rgba(56, 189, 248, 0.05) 64%, transparent 68% 100%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 4px);
  --panel-bg:
    linear-gradient(145deg, rgba(10, 38, 34, 0.9), rgba(4, 18, 18, 0.82) 58%, rgba(8, 22, 38, 0.76)),
    rgba(5, 22, 20, 0.78);
  --card-bg:
    linear-gradient(145deg, rgba(10, 38, 34, 0.9), rgba(4, 18, 18, 0.82)),
    rgba(5, 22, 20, 0.78);
  --control-bg: rgba(2, 16, 14, 0.76);
  --control-strong-bg: rgba(2, 16, 14, 0.9);
  --field-bg: rgba(2, 16, 14, 0.68);
  --input-bg: rgba(2, 13, 13, 0.94);
  --prompt-bg:
    linear-gradient(180deg, rgba(2, 16, 14, 0.96), rgba(6, 29, 27, 0.92)),
    rgba(2, 13, 13, 0.94);
  --subtle-bg: rgba(2, 16, 14, 0.62);
  --chip-bg: rgba(2, 16, 14, 0.74);
  --chip-text: #dbffe8;
  --badge-bg: rgba(2, 16, 14, 0.66);
  --icon-bg: rgba(2, 16, 14, 0.82);
  --active-bg:
    linear-gradient(135deg, rgba(74, 222, 128, 0.22), rgba(56, 189, 248, 0.18)),
    rgba(2, 16, 14, 0.88);
  --active-border: rgba(74, 222, 128, 0.64);
  --active-shadow: 0 0 32px rgba(74, 222, 128, 0.18);
  --primary-bg: linear-gradient(135deg, #22c55e, #38bdf8 58%, #a78bfa);
  --primary-text: #04100b;
  --stage-bg:
    linear-gradient(128deg, rgba(74, 222, 128, 0.12), transparent 46%, rgba(56, 189, 248, 0.09)),
    linear-gradient(145deg, rgba(2, 13, 13, 0.95), rgba(6, 29, 27, 0.88));
}

body[data-theme="architecture"] {
  color-scheme: light;
  --bg: #fafafa;
  --bg-2: #eeeeec;
  --line: rgba(83, 94, 105, 0.22);
  --line-strong: rgba(83, 94, 105, 0.54);
  --cyan: #2b8c99;
  --blue: #3f6f9b;
  --violet: #7c6fb1;
  --pink: #c05f73;
  --green: #527d58;
  --amber: #a16524;
  --red: #b64242;
  --text: #22282f;
  --muted: #69717a;
  --soft: #3b424a;
  --shadow: 0 24px 70px rgba(38, 42, 47, 0.14);
  --glow: 0 0 28px rgba(63, 111, 155, 0.12);
  --page-background:
    linear-gradient(128deg, rgba(43, 140, 153, 0.1) 0%, transparent 36% 64%, rgba(192, 95, 115, 0.08) 100%),
    linear-gradient(42deg, transparent 0 48%, rgba(161, 101, 36, 0.08) 60%, transparent 78%),
    linear-gradient(180deg, #fbfbfb 0%, #eeeeec 50%, #f8f8f8 100%);
  --grid-line: rgba(34, 40, 47, 0.075);
  --grid-mask: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 82%);
  --ambient-overlay:
    linear-gradient(120deg, transparent 0 18%, rgba(63, 111, 155, 0.07) 20%, transparent 24% 100%),
    repeating-linear-gradient(90deg, rgba(34, 40, 47, 0.018) 0 1px, transparent 1px 7px);
  --panel-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 238, 0.86) 58%, rgba(236, 242, 244, 0.76)),
    rgba(255, 255, 255, 0.78);
  --card-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 238, 0.86)),
    rgba(255, 255, 255, 0.78);
  --control-bg: rgba(255, 255, 255, 0.76);
  --control-strong-bg: rgba(255, 255, 255, 0.92);
  --field-bg: rgba(255, 255, 255, 0.78);
  --input-bg: rgba(255, 255, 255, 0.96);
  --prompt-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 241, 239, 0.92)),
    rgba(255, 255, 255, 0.94);
  --subtle-bg: rgba(255, 255, 255, 0.68);
  --chip-bg: rgba(238, 241, 242, 0.9);
  --chip-text: #303b43;
  --badge-bg: rgba(255, 255, 255, 0.78);
  --icon-bg: rgba(238, 241, 242, 0.92);
  --active-bg:
    linear-gradient(135deg, rgba(43, 140, 153, 0.16), rgba(161, 101, 36, 0.12)),
    rgba(255, 255, 255, 0.9);
  --active-border: rgba(63, 111, 155, 0.54);
  --active-shadow: 0 0 28px rgba(63, 111, 155, 0.12);
  --primary-bg: linear-gradient(135deg, #2b8c99, #3f6f9b 58%, #a16524);
  --primary-text: #ffffff;
  --stage-bg:
    linear-gradient(128deg, rgba(43, 140, 153, 0.1), transparent 46%, rgba(161, 101, 36, 0.08)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 238, 0.88));
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--page-background);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: var(--grid-mask);
}

body::after {
  background: var(--ambient-overlay);
  opacity: 0.55;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell {
  width: min(1680px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 26px;
}

.topbar,
.glass-panel,
.role-card,
.mode-card,
.field,
.metric,
.stat,
.history-item,
.layer-item,
.upload-readout,
.provider-card,
.toggle-field {
  border: 1px solid var(--line);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  min-height: 74px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  z-index: 20;
}

.brand {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.brand strong {
  display: block;
  font-size: 20px;
  letter-spacing: 0;
}

.brand em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
}

.sigil {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 15px;
  position: relative;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.34), transparent 34%),
    var(--primary-bg);
  box-shadow: var(--active-shadow);
}

.status-strip,
.topbar-actions,
.status-row,
.action-dock,
.command-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-strip {
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.status-strip span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-left: 1px solid var(--line);
}

.status-strip b,
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: var(--glow);
}

.topbar-actions {
  justify-content: flex-end;
}

.nav-button {
  appearance: none;
  font: inherit;
}

.navlink,
.btn,
.status {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--control-bg);
  padding: 10px 15px;
  font-size: 13px;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.btn:hover,
.navlink:hover,
.role-card:hover,
.mode-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--glow);
}

.navlink.active,
.btn.primary,
.role-card.active,
.mode-card.active {
  border-color: var(--active-border);
  background: var(--active-bg);
  box-shadow: var(--active-shadow);
}

.btn.primary {
  min-width: 148px;
  background: var(--primary-bg);
  color: var(--primary-text);
}

.btn.small {
  min-height: 32px;
  padding: 7px 11px;
}

.glass-panel {
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--line), transparent 24%, var(--active-border) 68%, transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 36%);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas:
    "hero gateway"
    "roles gateway"
    "flow gateway";
  gap: 16px;
  margin-top: 16px;
}

.hero-console {
  grid-area: hero;
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 18px;
  padding: 28px;
}

.hero-copy,
.home-result-preview,
.section-heading,
.role-grid,
.timeline,
.metric-grid,
.creator-board > *,
.admin-console > *,
.preview-rail > *,
.role-rail > * {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  margin: 26px 0 16px;
  max-width: 720px;
  font-size: clamp(36px, 4vw, 64px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 760px;
  color: var(--soft);
  font-size: 16px;
  line-height: 1.85;
  margin: 0 0 22px;
}

.status {
  color: var(--soft);
  font-size: 12px;
  background: var(--control-bg);
}

.home-result-preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 318px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 16px;
  color: #e8f7ff;
  background: #061321;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.04), 0 20px 44px rgba(2, 6, 18, 0.28);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.home-result-preview:hover {
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.08), 0 24px 50px rgba(2, 6, 18, 0.36);
  transform: translateY(-2px);
}

.home-result-preview:focus-visible {
  outline: 3px solid rgba(34, 211, 238, 0.66);
  outline-offset: 4px;
}

.home-result-kicker {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
  color: #b9d8e8;
  font-size: 11px;
  font-weight: 700;
}

.home-result-preview figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  margin: 0;
}

.home-result-media {
  position: relative;
  display: grid;
  height: clamp(220px, 25vw, 318px);
  min-width: 0;
  place-items: center;
  overflow: hidden;
  background: #f7f8fa;
}

.home-result-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 180ms ease;
}

.home-result-preview:hover .home-result-media img {
  transform: scale(1.012);
}

.home-result-version {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(34, 211, 238, 0.52);
  color: #071323;
  background: rgba(232, 247, 255, 0.92);
  font-size: 10px;
  font-weight: 800;
}

.home-result-preview figcaption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 12px;
  border-top: 1px solid rgba(34, 211, 238, 0.18);
}

.home-result-preview figcaption > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.home-result-preview figcaption small {
  color: #8fb0c5;
  font-size: 9px;
}

.home-result-preview figcaption strong {
  overflow: hidden;
  color: #f4fbff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-result-open {
  color: #67e8f9;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.role-matrix { grid-area: roles; padding: 20px; }
.workflow-panel { grid-area: flow; padding: 20px; }
.gateway-panel { grid-area: gateway; padding: 20px; }

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.section-heading.slim {
  margin-top: 18px;
}

.section-heading span {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  color: var(--cyan);
  background: var(--icon-bg);
  font-size: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

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

.legacy-role-grid {
  display: none !important;
}

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

.task-card {
  --task-accent: var(--cyan);
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  color: var(--text);
  background: var(--card-bg);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon desc"
    "badge badge";
  gap: 6px 12px;
  align-content: start;
  position: relative;
  overflow: hidden;
}

.task-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--task-accent);
  opacity: 0.78;
}

.task-card[data-theme="portrait"] { --task-accent: var(--pink); }
.task-card[data-theme="seller"] { --task-accent: var(--green); }
.task-card[data-theme="academic"] { --task-accent: var(--blue); }
.task-card[data-theme="engineering"] { --task-accent: var(--cyan); }
.task-card[data-theme="architecture"] { --task-accent: var(--amber); }

.task-card i {
  grid-area: icon;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--cyan);
  background: var(--icon-bg);
  font-style: normal;
  font-size: 11px;
}

.task-card strong {
  grid-area: title;
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.task-card small {
  grid-area: desc;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-card span {
  grid-area: badge;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--soft);
  background: var(--badge-bg);
  font-size: 12px;
}

.task-card.ready span { color: var(--green); }
.task-card.guarded span,
.task-card.provider-check span,
.task-card.concept-only span { color: var(--amber); }
.task-card.planned span { color: var(--muted); }

/* Home is a task launcher, so keep its hierarchy calmer than the creator surfaces. */
.home-page {
  --home-surface: rgba(9, 18, 31, 0.94);
  --home-surface-soft: rgba(13, 25, 41, 0.88);
  background: #07101c;
}

.home-page::before { opacity: 0.24; }

.home-page::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 32%);
  opacity: 1;
}

.home-page .topbar,
.home-page .glass-panel {
  background: var(--home-surface);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
  backdrop-filter: none;
}

.home-page .glass-panel::before {
  background: linear-gradient(90deg, var(--task-accent, var(--line-strong)), transparent 34%);
  opacity: 0.42;
}

.home-page .home-grid {
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas:
    "hero gateway"
    "roles roles"
    "flow flow";
  gap: 14px;
}

.home-page .hero-console {
  min-height: 372px;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 24px;
  padding: 24px;
}

.home-page .hero-copy h1 {
  max-width: 620px;
  margin: 20px 0 14px;
  font-size: 46px;
  line-height: 1.08;
}

.home-page .hero-copy p {
  max-width: 680px;
  font-size: 15px;
  line-height: 1.72;
}

.home-page .gateway-panel { align-self: stretch; }

.home-page .gateway-panel .metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-page .metric,
.home-page .timeline div {
  border-color: rgba(148, 163, 184, 0.16);
  background: var(--home-surface-soft);
  box-shadow: none;
}

.home-page .role-matrix,
.home-page .workflow-panel,
.home-page .gateway-panel { padding: 18px; }

.home-page .task-center { gap: 8px; }

.home-page .task-card {
  min-height: 116px;
  border-color: rgba(148, 163, 184, 0.16);
  background: var(--home-surface-soft);
  box-shadow: none;
}

.home-page .task-card:hover {
  border-color: var(--task-accent);
  background: rgba(17, 32, 50, 0.96);
}

.home-page .task-card::after { width: 2px; }

.home-page .task-card span {
  padding: 3px 7px;
  background: rgba(2, 8, 18, 0.46);
}

.home-page .workflow-panel .timeline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mobile-flow {
  display: none;
  position: relative;
  z-index: 1;
  gap: 8px;
  margin-bottom: 14px;
}

.mobile-flow button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  color: var(--soft);
  background: var(--control-bg);
  font-size: 12px;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.mobile-flow button.active {
  border-color: var(--active-border);
  color: var(--primary-text);
  background: var(--primary-bg);
  box-shadow: var(--active-shadow);
}

.visibility-rules {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--subtle-bg);
}

.visibility-rules strong,
.visibility-rules small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.visibility-rules small {
  color: var(--muted);
  font-size: 12px;
}

.portrait-workflow {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--subtle-bg);
}

.seller-workflow {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--subtle-bg);
}

.professional-workflow {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--subtle-bg);
}

.reference-boundary-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
  padding: 12px;
}

.reference-transfer-preflight-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(45, 212, 191, .45);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
  padding: 12px;
}

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

.reference-transfer-preflight-grid div,
.reference-transfer-preflight-boundaries {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
  padding: 10px;
}

.reference-transfer-preflight-grid small,
.reference-transfer-preflight-grid strong,
.reference-transfer-preflight-boundaries strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.reference-transfer-preflight-grid small {
  color: var(--muted);
  font-size: 11px;
}

.reference-transfer-preflight-grid strong,
.reference-transfer-preflight-boundaries strong {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.reference-transfer-preflight-boundaries {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.reference-transfer-readiness {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(248, 113, 113, .45);
  border-radius: 10px;
  background: rgba(127, 29, 29, .12);
  padding: 10px;
  min-width: 0;
}

.reference-transfer-readiness-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.reference-transfer-readiness-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.reference-transfer-readiness-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
  padding: 10px;
}

.reference-transfer-readiness small,
.reference-transfer-readiness strong,
.reference-transfer-readiness span,
.reference-transfer-readiness p {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.reference-transfer-readiness small {
  color: var(--muted);
  font-size: 11px;
}

.reference-transfer-readiness strong,
.reference-transfer-readiness span,
.reference-transfer-readiness p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.reference-transfer-readiness[data-reference-transfer-readiness-state="ready"] {
  border-color: rgba(52, 211, 153, .65);
  background: rgba(20, 83, 45, .12);
}

.reference-transfer-preapproval {
  display: grid;
  gap: 10px;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.reference-transfer-preapproval-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.reference-transfer-preapproval-head > div {
  display: grid;
  gap: 3px;
}

.reference-transfer-preapproval-head small,
.reference-transfer-preapproval-head strong,
.reference-transfer-preapproval-head span,
.reference-transfer-preapproval p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.reference-transfer-preapproval-head small {
  color: var(--muted);
  font-size: 10px;
}

.reference-transfer-preapproval-head strong {
  font-size: 13px;
}

.reference-transfer-preapproval-head span,
.reference-transfer-preapproval p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

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

.reference-transfer-preapproval-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  padding: 6px 0;
}

.reference-transfer-preapproval-item span,
.reference-transfer-preapproval-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.35;
}

.reference-transfer-preapproval-item span {
  color: var(--text);
}

.reference-transfer-preapproval-item strong {
  color: var(--red);
  font-weight: 700;
}

.reference-transfer-preapproval[data-reference-transfer-preapproval-state="preapproval_ready"] .reference-transfer-preapproval-item strong,
.reference-transfer-preapproval[data-reference-transfer-preapproval-state="approved_for_execution"] .reference-transfer-preapproval-item strong,
.reference-transfer-preapproval[data-reference-transfer-preapproval-state="execution_verified"] .reference-transfer-preapproval-item strong {
  color: #6ee7b7;
}

.reference-transfer-preflight-panel[data-preflight-state="ready"] {
  border-color: rgba(52, 211, 153, .65);
}

.reference-edit-execution {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.reference-edit-execution > div,
.reference-edit-result-card figcaption {
  display: grid;
  gap: 6px;
}

.reference-edit-execution small,
.reference-edit-result-card figcaption span {
  color: var(--muted);
}

.reference-edit-result {
  margin-top: 12px;
}

.reference-edit-result-card {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
}

.reference-edit-result-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
}

.identity-comparison-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin-top: 16px;
  padding: 16px 0;
  border-block: 1px solid var(--line);
}

.identity-comparison-head,
.identity-comparison-toolbar,
.identity-candidate-actions,
.identity-verdict-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.identity-comparison-head > div:first-child,
.identity-comparison-status,
.identity-candidate-actions > div,
.identity-verdict-control > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.identity-comparison-head small,
.identity-comparison-status span,
.identity-candidate-actions small,
.identity-verdict-control small {
  color: var(--muted);
  font-size: 11px;
}

.identity-comparison-head h3,
.identity-comparison-status output,
.identity-candidate-actions strong,
.identity-verdict-control output {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.identity-comparison-head h3 {
  font-size: 18px;
}

.identity-comparison-status {
  text-align: right;
}

.identity-comparison-status output {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}

.identity-comparison-boundary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: var(--subtle-bg);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
}

.identity-comparison-boundary strong,
.identity-comparison-boundary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.identity-segmented-control,
.identity-zoom-control,
.identity-verdict-actions {
  display: grid;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.identity-segmented-control {
  grid-template-columns: repeat(3, minmax(72px, 1fr));
}

.identity-zoom-control {
  grid-template-columns: 40px 58px 40px minmax(96px, auto);
}

.identity-segmented-control button,
.identity-zoom-control button,
.identity-verdict-actions button,
.identity-candidate-actions button,
.identity-import-control {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--control-bg);
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
}

.identity-import-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}

.identity-segmented-control button[aria-pressed="true"],
.identity-verdict-actions button[aria-pressed="true"] {
  border-color: var(--active-border);
  background: var(--active-bg);
  box-shadow: inset 0 0 0 1px var(--active-border);
}

.identity-zoom-control output {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 40px;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.identity-readiness-output {
  min-width: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

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

.identity-comparison-panel[data-identity-mode="reference"] .identity-comparison-stages,
.identity-comparison-panel[data-identity-mode="candidate"] .identity-comparison-stages {
  grid-template-columns: minmax(0, 1fr);
}

.identity-comparison-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle-bg);
}

.identity-comparison-stage figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.identity-comparison-stage figcaption strong,
.identity-comparison-stage figcaption span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.identity-comparison-stage figcaption strong {
  font-size: 13px;
}

.identity-comparison-stage figcaption span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.identity-image-viewport {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--stage-bg);
  scrollbar-gutter: stable;
}

.identity-image-viewport:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.identity-image-viewport[data-pan-enabled="true"] {
  cursor: grab;
  touch-action: none;
}

.identity-image-viewport[data-pan-dragging="true"] {
  cursor: grabbing;
}

.identity-image-viewport img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform-origin: center center;
}

.identity-image-viewport img:not([src]) {
  display: none;
}

.identity-image-viewport img[src] + .identity-image-empty {
  display: none;
}

.identity-image-empty {
  max-width: 22ch;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.identity-review-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 12px;
  min-width: 0;
}

.identity-candidate-actions,
.identity-review-record,
.identity-verdict-control {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle-bg);
}

.identity-candidate-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.identity-candidate-actions > div {
  flex: 1 1 180px;
}

.identity-candidate-actions button:disabled {
  opacity: .52;
  cursor: not-allowed;
}

[data-identity-candidate-input]:disabled + .identity-import-control {
  opacity: .52;
  pointer-events: none;
  cursor: not-allowed;
}

.identity-review-record {
  display: grid;
  gap: 0;
}

.identity-review-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-bottom: 7px;
}

.identity-review-summary strong,
.identity-review-summary output {
  min-width: 0;
  overflow-wrap: anywhere;
}

.identity-review-summary strong {
  color: var(--text);
  font-size: 12px;
}

.identity-review-summary output {
  color: var(--cyan);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.identity-review-group {
  min-width: 0;
  margin: 0;
  padding: 8px 0 9px;
  border: 0;
  border-top: 1px solid var(--line);
}

.identity-review-group legend {
  width: 100%;
  margin-bottom: 6px;
  padding: 0;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.identity-review-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.identity-review-options label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 36px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--control-bg);
  font-size: 11px;
  line-height: 1.25;
  cursor: pointer;
}

.identity-review-options label span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.identity-review-options input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.identity-review-options input[value="pending"] {
  accent-color: var(--muted);
}

.identity-review-options input[value="match"] {
  accent-color: var(--green);
}

.identity-review-options input[value="mismatch"] {
  accent-color: var(--red);
}

.identity-review-options input[value="unable"] {
  accent-color: var(--amber);
}

.identity-review-options label:has(input[value="pending"]:checked) {
  border-color: var(--muted);
  color: var(--text);
  background: var(--control-bg);
}

.identity-review-options label:has(input[value="match"]:checked) {
  border-color: var(--green);
  color: var(--text);
  background: color-mix(in srgb, var(--green) 14%, var(--control-bg));
}

.identity-review-options label:has(input[value="mismatch"]:checked) {
  border-color: var(--red);
  color: var(--text);
  background: color-mix(in srgb, var(--red) 15%, var(--control-bg));
}

.identity-review-options label:has(input[value="unable"]:checked) {
  border-color: var(--amber);
  color: var(--text);
  background: color-mix(in srgb, var(--amber) 14%, var(--control-bg));
}

.identity-review-options label:has(input:focus-visible) {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.identity-review-options label:has(input:disabled) {
  opacity: .5;
  cursor: not-allowed;
}

.identity-verdict-control {
  display: grid;
  grid-template-columns: minmax(110px, .45fr) minmax(180px, 1fr) minmax(160px, .75fr);
}

.identity-verdict-control > div:first-child output {
  font-size: 16px;
  font-weight: 800;
}

.identity-review-details {
  min-width: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.identity-validation-output {
  min-height: 20px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

@media (max-width: 759px) {
  .identity-comparison-panel {
    gap: 12px;
    padding-block: 14px;
    scroll-margin-top: 76px;
  }

  .identity-comparison-head,
  .identity-comparison-toolbar,
  .identity-comparison-boundary,
  .identity-candidate-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .identity-comparison-status,
  .identity-comparison-stage figcaption span {
    text-align: left;
  }

  .identity-segmented-control,
  .identity-zoom-control,
  .identity-review-grid,
  .identity-verdict-control {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .identity-segmented-control {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .identity-zoom-control {
    grid-template-columns: 40px minmax(52px, 1fr) 40px minmax(94px, 1.3fr);
  }

  .identity-comparison-stages,
  .identity-comparison-panel[data-identity-mode="reference"] .identity-comparison-stages,
  .identity-comparison-panel[data-identity-mode="candidate"] .identity-comparison-stages {
    grid-template-columns: minmax(0, 1fr);
  }

  .identity-image-viewport {
    aspect-ratio: 4 / 3;
  }

  .identity-candidate-actions > div {
    flex-basis: auto;
  }

  .identity-import-control,
  .identity-candidate-actions button {
    width: 100%;
  }

  .identity-review-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .identity-review-summary output {
    text-align: left;
  }

  .identity-review-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .identity-review-options label {
    min-height: 44px;
    padding: 8px;
  }

  .identity-review-group,
  .identity-review-options label,
  .identity-review-options input {
    scroll-margin-top: 76px;
  }

  .identity-validation-output {
    min-height: 18px;
    text-align: left;
  }
}

.exploded-3d-workbench {
  margin-top: 14px;
  border: 1px solid rgba(56, 189, 248, .42);
  border-radius: 8px;
  overflow: hidden;
  background: #101827;
  color: #e5eef9;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
}

.exploded-3d-head,
.exploded-3d-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #182235;
}

.exploded-3d-head label,
.exploded-3d-head strong,
.exploded-3d-head span {
  display: block;
}

.exploded-3d-head label,
.exploded-3d-head span,
.exploded-3d-boundary {
  color: #9fb0c5;
  font-size: 12px;
}

.exploded-3d-head strong {
  margin-top: 3px;
  font-size: 16px;
}

.exploded-3d-stage {
  width: 100%;
  height: clamp(360px, 48vw, 560px);
  min-height: 360px;
  background: #101827;
  touch-action: none;
}

.exploded-3d-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.exploded-3d-stage canvas:active {
  cursor: grabbing;
}

.exploded-distance-control {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-width: min(430px, 62%);
  font-size: 12px;
}

.exploded-distance-control input {
  width: 100%;
  accent-color: #38bdf8;
}

.exploded-distance-control output {
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
}

.exploded-3d-actions {
  display: flex;
  gap: 8px;
}

.exploded-3d-actions .btn {
  border-color: #3a4a62;
  background: #26344a;
  color: #e5eef9;
}

.exploded-3d-legend {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: #243044;
}

.exploded-3d-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 9px 10px;
  background: #182235;
  color: #cad6e4;
  font-size: 11px;
}

.exploded-3d-legend i {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 2px;
  background: var(--part-color);
}

.exploded-3d-boundary {
  display: block;
  padding: 10px 14px 12px;
  background: #182235;
}

.reference-boundary-panel[data-boundary-blocked="true"] {
  border-color: rgba(248, 113, 113, .45);
}

.reference-boundary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.reference-boundary-grid div,
.reference-boundary-reason,
.reference-identity-contract div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--control-bg);
  padding: 10px;
  min-width: 0;
}

.reference-identity-contract {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.reference-boundary-grid small,
.reference-boundary-grid strong,
.reference-boundary-reason,
.reference-identity-contract small,
.reference-identity-contract strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.reference-boundary-grid small,
.reference-identity-contract small {
  color: var(--muted);
  font-size: 11px;
}

.reference-boundary-grid strong,
.reference-boundary-reason,
.reference-identity-contract strong {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.professional-workflow [data-pro-workflow-id] {
  display: grid;
  gap: 4px;
  min-height: 74px;
  text-align: left;
}

.professional-workflow [data-pro-workflow-id] strong,
.professional-workflow [data-pro-workflow-id] small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.professional-workflow [data-pro-workflow-id].active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.workflow-mode-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.workflow-mode-selector [data-pro-workflow-id] {
  display: grid;
  gap: 4px;
  min-height: 72px;
  text-align: left;
  align-content: start;
  padding: 10px;
}

.workflow-mode-selector [data-pro-workflow-id] strong,
.workflow-mode-selector [data-pro-workflow-id] small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workflow-mode-selector [data-pro-workflow-id] strong {
  line-height: 1.25;
}

.workflow-mode-selector [data-pro-workflow-id] small {
  line-height: 1.35;
}

.workflow-mode-selector [data-pro-workflow-id].active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.workflow-mode-boundary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.research-chart-panel,
.research-mechanism-panel,
.research-experiment-panel,
.research-abstract-panel,
.seller-plan-panel,
.theme-batch-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--subtle-bg);
}

.research-chart-panel[hidden],
.research-mechanism-panel[hidden],
.research-experiment-panel[hidden],
.research-abstract-panel[hidden],
.seller-plan-panel[hidden],
.theme-batch-panel[hidden] {
  display: none;
}

.creation-context {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
}

.creation-context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.creation-context-grid > div {
  min-width: 0;
}

.creation-context-grid dt {
  color: var(--muted);
  font-size: 11px;
}

.creation-context-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.creation-plan {
  margin: -6px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
}

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

.creation-plan-head span {
  font-size: 12px;
  font-weight: 700;
}

.creation-plan-head code {
  color: var(--muted);
  font-size: 10px;
}

.creation-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.creation-plan-grid > div {
  min-width: 0;
}

.creation-plan-grid dt {
  color: var(--muted);
  font-size: 11px;
}

.creation-plan-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.creation-plan-provenance {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.creation-plan-provenance span {
  display: inline-flex;
  min-width: 0;
  gap: 5px;
}

.creation-plan-provenance b {
  color: var(--ink);
  font-weight: 600;
}

.creation-plan-provenance em {
  overflow-wrap: anywhere;
  font-style: normal;
}

.creation-plan-details {
  margin-top: 7px;
}

.creation-plan-details summary {
  width: fit-content;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.creation-plan-details summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.creation-plan-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.creation-plan-detail-grid section {
  min-width: 0;
}

.creation-plan-detail-grid h4 {
  margin: 0 0 5px;
  font-size: 11px;
}

.creation-plan-detail-grid ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 11px;
}

.creation-plan-detail-grid li {
  overflow-wrap: anywhere;
}

.research-chart-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.research-chart-head label {
  margin-bottom: 4px;
}

.research-chart-head strong,
.research-chart-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.research-chart-head span {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.research-chart-panel textarea {
  min-height: 118px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.research-chart-controls {
  display: grid;
  grid-template-columns: minmax(90px, 0.35fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.research-chart-controls label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.research-chart-controls select {
  width: 100%;
}

.research-chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mechanism-editor-toolbar,
.experiment-editor-toolbar,
.abstract-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
}

.mechanism-editor-toolbar > span,
.experiment-editor-toolbar > span,
.abstract-editor-toolbar > span {
  color: var(--muted);
  font-size: 12px;
}

.mechanism-nudge-controls {
  display: grid;
  grid-template-columns: repeat(4, 36px);
  gap: 6px;
}

.mechanism-nudge-controls .icon-btn {
  width: 36px;
  height: 36px;
}

.experiment-nudge-controls {
  display: grid;
  grid-template-columns: minmax(64px, auto) 36px 36px minmax(64px, auto);
  gap: 6px;
}

.experiment-nudge-controls .btn,
.experiment-nudge-controls .icon-btn {
  min-height: 36px;
}

.abstract-nudge-controls {
  display: grid;
  grid-template-columns: repeat(4, 36px);
  gap: 6px;
}

.abstract-nudge-controls .icon-btn {
  width: 36px;
  height: 36px;
}

.experiment-nudge-controls .icon-btn {
  width: 36px;
  height: 36px;
}

[data-research-mechanism-svg] [data-mechanism-node] {
  cursor: grab;
  outline: none;
  touch-action: none;
}

[data-research-mechanism-svg] [data-mechanism-node]:active {
  cursor: grabbing;
}

[data-research-mechanism-svg] [data-mechanism-node].is-selected rect,
[data-research-mechanism-svg] [data-mechanism-node]:focus rect {
  stroke: #f59e0b;
  stroke-width: 4;
}

[data-research-experiment-svg] [data-experiment-step] {
  cursor: grab;
  outline: none;
  touch-action: none;
}

[data-research-experiment-svg] [data-experiment-step]:active {
  cursor: grabbing;
}

[data-research-experiment-svg] [data-experiment-step].is-selected > rect:first-of-type,
[data-research-experiment-svg] [data-experiment-step]:focus > rect:first-of-type {
  stroke: #f59e0b;
  stroke-width: 4;
}

[data-research-abstract-svg] [data-abstract-panel] {
  cursor: grab;
  outline: none;
  touch-action: none;
}

[data-research-abstract-svg] [data-abstract-panel]:active {
  cursor: grabbing;
}

[data-research-abstract-svg] [data-abstract-panel].is-selected > rect:first-of-type,
[data-research-abstract-svg] [data-abstract-panel]:focus > rect:first-of-type {
  stroke: #f59e0b;
  stroke-width: 4;
}

.research-chart-result {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  padding: 10px;
  overflow: auto;
}

.research-chart-result > span {
  color: var(--muted);
  font-size: 12px;
}

.research-chart-svg {
  min-width: 560px;
}

.research-chart-svg svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.seller-plan-summary {
  display: grid;
  gap: 10px;
}

.seller-plan-summary strong,
.seller-plan-summary small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.seller-plan-summary small {
  color: var(--muted);
}

.theme-batch-summary {
  display: grid;
  gap: 12px;
}

.theme-batch-meta {
  display: grid;
  gap: 4px;
}

.theme-batch-meta strong,
.theme-batch-meta small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.theme-batch-meta small {
  color: var(--muted);
}

.theme-batch-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.theme-batch-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
}

.theme-batch-card span,
.theme-batch-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.theme-batch-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workflow-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.consistency-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.consistency-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--chip-text);
  background: var(--chip-bg);
  font-size: 12px;
}

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

.preset-grid button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--chip-text);
  background: var(--chip-bg);
  padding: 8px;
  font-size: 12px;
  text-align: left;
}

.safety-note,
.upload-readout small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.upload-readout {
  display: grid;
  gap: 4px;
}

.upload-error {
  color: var(--red);
}

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

.role-group-label {
  grid-column: 1 / -1;
  padding: 4px 2px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.role-card.task-entry {
  min-height: 70px;
}

.role-library-map {
  margin: -2px 0 12px;
  padding-left: 10px;
  border-left: 2px solid var(--cyan);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.role-card {
  appearance: none;
  width: 100%;
  min-height: 74px;
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text);
  text-align: left;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon desc";
  gap: 4px 12px;
}

.role-card:focus-visible,
.btn:focus-visible,
.navlink:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.role-card i {
  grid-area: icon;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-style: normal;
  font-size: 11px;
  background: var(--icon-bg);
}

.role-card strong {
  grid-area: title;
  min-width: 0;
  font-size: 14px;
}

.role-card small,
.metric small,
.stat small,
.history-item small,
.layer-item small,
.quality-card small,
.rail-note small,
.mode-card small,
.table small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.role-card small {
  grid-area: desc;
}

.role-card.free-entry {
  border-color: var(--active-border);
  background: var(--active-bg);
}

.role-card.free-entry i {
  color: var(--primary-text);
  border-color: var(--active-border);
  background: var(--primary-bg);
  box-shadow: var(--active-shadow);
}

.empty-state.inline {
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: var(--field-bg);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.timeline div,
.metric,
.stat {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 14px;
  background: var(--subtle-bg);
}

.timeline strong,
.metric strong,
.stat strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 20px;
}

.timeline small {
  color: var(--muted);
}

.metric-grid {
  display: grid;
  gap: 12px;
}

.creator-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 350px;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.role-rail,
.creator-board,
.preview-rail,
.admin-console {
  padding: 18px;
}

.creator-board {
  min-width: 0;
}

.rail-note,
.quality-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
  padding: 14px;
}

.rail-note strong,
.quality-card strong {
  display: block;
  margin-bottom: 8px;
}

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

.compact-mode {
  margin-bottom: 0;
}

.mode-card {
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text);
  text-align: left;
}

.mode-card span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.layout-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
}

.layout-mode-bar > div:first-child {
  min-width: 0;
}

.layout-mode-bar strong,
.layout-mode-bar small {
  display: block;
}

.layout-mode-bar strong {
  color: var(--text);
  font-size: 13px;
}

.layout-mode-bar small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.layout-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--control-bg);
}

.layout-mode-switch button {
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.layout-mode-switch button:hover,
.layout-mode-switch button.active {
  border-color: var(--active-border);
  color: var(--text);
  background: var(--active-bg);
}

.layout-mode-switch button strong {
  font-size: 12px;
}

.layout-mode-switch button small {
  margin-top: 2px;
  color: inherit;
  font-size: 10px;
}

body[data-ui-mode="simple"] .advanced-compose,
body[data-ui-mode="simple"] .creation-context,
body[data-ui-mode="simple"] .creation-plan {
  display: none;
}

.creator-priority {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.advanced-compose {
  display: grid;
  grid-template-columns: minmax(180px, 0.78fr) minmax(260px, 1.18fr) minmax(180px, 0.64fr);
  gap: 14px;
  margin-top: 14px;
}

.professional-review-panel {
  position: relative;
  margin-top: 18px;
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
}

.professional-review-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
  content: "";
}

.professional-review-panel[hidden] {
  display: none;
}

.professional-review-head,
.professional-review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.professional-review-head {
  align-items: flex-start;
  padding: 20px 20px 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--control-strong-bg);
}

.professional-review-head label,
.professional-review-head strong,
.professional-review-title strong,
.professional-review-title small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.professional-review-head label {
  margin-bottom: 5px;
  color: var(--green);
  font-weight: 700;
}

.professional-review-head strong {
  font-size: 18px;
  line-height: 1.35;
}

.professional-review-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.professional-review-badges span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  color: var(--soft);
  background: var(--control-bg);
  font-size: 11px;
  font-weight: 700;
}

.professional-review-badges [data-state="ai"],
.professional-review-badges [data-state="confirmed"] {
  border-color: color-mix(in srgb, var(--green) 68%, transparent);
  color: var(--green);
}

.professional-review-badges [data-state="blocked"],
.professional-review-badges [data-state="fallback"] {
  border-color: color-mix(in srgb, var(--amber) 68%, transparent);
  color: var(--amber);
}

.professional-review-status {
  margin: 0;
  padding: 11px 20px 11px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.professional-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
}

.professional-review-section {
  min-width: 0;
  padding: 18px 20px;
}

.professional-review-grid > .professional-review-section:first-child {
  padding-left: 22px;
}

.professional-review-grid > .professional-review-section + .professional-review-section {
  border-left: 1px solid var(--line);
}

.professional-review-title strong {
  font-size: 13px;
  line-height: 1.4;
}

.professional-review-title small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.professional-field-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0 16px;
  margin-top: 10px;
}

.professional-field-state {
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.professional-field-state span,
.professional-field-state strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.professional-field-state span {
  color: var(--muted);
  font-size: 11px;
}

.professional-field-state strong {
  margin-top: 4px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
}

.professional-field-state[data-state="missing"] strong {
  color: var(--amber);
}

.professional-question-list {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.professional-question {
  margin: 0;
  padding: 0;
}

.professional-question span {
  display: block;
  margin-bottom: 5px;
  color: var(--soft);
  line-height: 1.45;
}

.professional-question[data-state="unanswered"] span {
  color: var(--amber);
}

.professional-question-list + .btn {
  margin-top: 10px;
}

.provider-ready-section {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1.55fr);
  gap: 20px;
  align-items: start;
  border-top: 1px solid var(--line);
  background: var(--subtle-bg);
}

.provider-ready-projection {
  min-width: 0;
  margin: 0;
}

.provider-ready-projection pre {
  margin: 0;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--soft);
  background: var(--input-bg);
  font: 11px/1.55 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.professional-review-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.professional-review-actions {
  justify-content: flex-start;
  padding: 16px 20px 16px 22px;
  border-top: 1px solid var(--line);
  background: var(--control-strong-bg);
}

.professional-review-actions .btn {
  min-width: 220px;
}

.professional-review-actions small {
  max-width: 560px;
  margin-left: auto;
  color: var(--muted);
  line-height: 1.5;
  text-align: right;
}

.control-section,
.prompt-workbench {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.field {
  border-radius: var(--radius-sm);
  padding: 12px;
}

label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 12px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--line);
}

textarea {
  min-height: 128px;
  line-height: 1.65;
  resize: vertical;
}

.primary-compose textarea[data-prompt] {
  min-height: 214px;
  font-size: 16px;
  background: var(--prompt-bg);
}

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

.starter-chips button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--chip-text);
  background: var(--chip-bg);
  font-size: 12px;
}

.starter-chips button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--glow);
}

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

.provider-pipeline-status > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subtle-bg);
  padding: 10px 11px;
}

.provider-pipeline-status span,
.provider-pipeline-status strong,
.provider-pipeline-status small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.provider-pipeline-status span {
  color: var(--muted);
  font-size: 11px;
}

.provider-pipeline-status strong {
  margin-top: 4px;
  color: var(--soft);
  font-size: 13px;
}

.provider-pipeline-status small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.provider-pipeline-status [data-state="running"] {
  border-color: var(--line-strong);
}

.provider-pipeline-status [data-state="ready"] {
  border-color: color-mix(in srgb, var(--green) 64%, transparent);
}

.provider-pipeline-status [data-state="ready"] strong {
  color: var(--green);
}

.provider-pipeline-status [data-state="fallback"] strong,
.provider-pipeline-status [data-state="blocked"] strong {
  color: var(--amber);
}

.provider-pipeline-status [data-state="failed"] strong {
  color: var(--red);
}

.enhanced-output { min-height: 220px; }
.negative-output { min-height: 92px; color: var(--red); }

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

.role-fields {
  display: grid;
  gap: 10px;
}

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

.theme-choice {
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--control-bg);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-template-areas:
    "swatch label"
    "swatch note";
  gap: 2px 8px;
  align-items: center;
  padding: 8px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.theme-choice:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--glow);
}

.theme-choice.active {
  border-color: var(--active-border);
  background: var(--active-bg);
  box-shadow: var(--active-shadow);
}

.theme-choice strong,
.theme-choice small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.theme-choice strong {
  grid-area: label;
  font-size: 12px;
  line-height: 1.25;
}

.theme-choice small {
  grid-area: note;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.theme-swatch {
  grid-area: swatch;
  width: 18px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--violet), var(--pink));
}

.theme-swatch[data-theme-swatch="portrait"] {
  background: linear-gradient(180deg, #2f9bb3, #8a73c7, #dd6f9c);
}

.theme-swatch[data-theme-swatch="seller"] {
  background: linear-gradient(180deg, #0f9f8f, #2563eb, #e85d75);
}

.theme-swatch[data-theme-swatch="academic"] {
  background: linear-gradient(180deg, #315f9f, #18705f, #6954b7);
}

.theme-swatch[data-theme-swatch="engineering"] {
  background: linear-gradient(180deg, #22c55e, #38bdf8, #a78bfa);
}

.theme-swatch[data-theme-swatch="architecture"] {
  background: linear-gradient(180deg, #2b8c99, #3f6f9b, #a16524);
}

.theme-summary {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--subtle-bg);
}

.theme-summary strong,
.theme-summary small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.theme-summary small {
  color: var(--muted);
  font-size: 12px;
}

.field-mini {
  min-width: 0;
}

.prompt-director-panel {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.intent-readout,
.refinement-actions {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
  padding: 12px;
}

.intent-readout strong,
.intent-readout small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.intent-readout small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.refinement-actions {
  min-height: 58px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.refinement-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--chip-text);
  background: var(--chip-bg);
  padding: 8px 11px;
  font-size: 12px;
}

.refinement-chip.active {
  border-color: var(--active-border);
  color: var(--primary-text);
  background: var(--primary-bg);
  box-shadow: var(--active-shadow);
}

.upload-readout {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--muted);
  font-size: 13px;
}

.command-bar {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--subtle-bg);
  justify-content: flex-start;
}

.priority-actions {
  margin-top: 0;
}

.message-line {
  min-height: 22px;
  margin-top: 10px;
  color: var(--amber);
  font-size: 13px;
}

.message-line[data-variant="ok"] {
  color: var(--green);
}

.message-line[data-variant="error"] {
  color: var(--red);
}

.preview-rail {
  min-width: 0;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.preview-rail::-webkit-scrollbar,
.preview-rail .quality-card::-webkit-scrollbar {
  width: 8px;
}

.preview-rail::-webkit-scrollbar-track,
.preview-rail .quality-card::-webkit-scrollbar-track {
  background: rgba(2, 8, 18, 0.28);
  border-radius: 999px;
}

.preview-rail::-webkit-scrollbar-thumb,
.preview-rail .quality-card::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  border-radius: 999px;
}

.preview-rail .quality-card {
  max-height: min(44vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

@media (min-width: 1280px) {
  .creator-grid > .preview-rail {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .creator-grid > .preview-rail .quality-card {
    max-height: none;
    overflow-y: visible;
    scrollbar-gutter: auto;
  }
}

/* Desktop workbench: keep the three workflow columns in one viewport while
   allowing each work surface to scroll without moving the other columns. */
@media (min-width: 1361px) {
  .creator-grid {
    height: calc(100dvh - 126px);
    min-height: 0;
    align-items: stretch;
  }

  .creator-grid > .role-rail,
  .creator-grid > .creator-board,
  .creator-grid > .preview-rail {
    min-height: 0;
  }

  .creator-grid > .role-rail {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .creator-grid > .creator-board {
    height: 100%;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .creator-grid > .preview-rail {
    height: 100%;
    max-height: none;
  }

  .creator-grid > .creator-board > .section-heading:first-child {
    position: sticky;
    z-index: 6;
    top: -18px;
    margin: -18px -18px 16px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-bg);
    backdrop-filter: blur(14px);
  }
}

.result-frame {
  min-height: 310px;
  display: grid;
  gap: 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--stage-bg);
  overflow: hidden;
  padding: 12px;
}

.result-frame img {
  width: min(100%, 520px);
  max-height: 52vh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42);
}

.generated-result-card {
  width: min(100%, 560px);
  margin: 0;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.generated-result-link {
  display: grid;
  justify-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: zoom-in;
}

.result-inspector {
  width: min(1120px, calc(100vw - 32px));
  height: min(860px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(122, 156, 184, 0.34);
  border-radius: 8px;
  color: var(--text);
  background: #071321;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
  overflow: hidden;
}

.result-inspector:not([open]) {
  display: none;
}

.result-inspector::backdrop {
  background: rgba(0, 5, 12, 0.82);
}

.result-inspector-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.result-inspector-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(122, 156, 184, 0.24);
  background: #0a1a2b;
}

.result-inspector-header > div:first-child {
  min-width: 0;
}

.result-inspector-header strong,
.result-inspector-header small {
  display: block;
  overflow-wrap: anywhere;
}

.result-inspector-header strong {
  font-size: 16px;
}

.result-inspector-header small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.result-inspector-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.result-inspector-toolbar button,
.result-inspector-toolbar a,
.result-inspector-toolbar output {
  min-height: 36px;
  border: 1px solid rgba(122, 156, 184, 0.3);
  border-radius: 7px;
  color: var(--text);
  background: #06101d;
  font: inherit;
  font-size: 12px;
}

.result-inspector-toolbar button,
.result-inspector-toolbar a {
  display: inline-grid;
  place-items: center;
  padding: 7px 10px;
  cursor: pointer;
  text-decoration: none;
}

.result-inspector-toolbar button[aria-label="缩小"],
.result-inspector-toolbar button[aria-label="放大"],
.result-inspector-close {
  width: 36px;
  padding: 0;
  font-size: 18px;
}

.result-inspector-toolbar output {
  display: inline-grid;
  place-items: center;
  width: 54px;
  padding: 0 6px;
  color: #b8ccdc;
}

.result-inspector-toolbar button:hover,
.result-inspector-toolbar a:hover,
.result-inspector-toolbar button:focus-visible,
.result-inspector-toolbar a:focus-visible {
  border-color: rgba(34, 211, 238, 0.72);
  outline: none;
}

.result-inspector-stage {
  --result-inspector-zoom: 1;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  background: #020811;
  overflow: auto;
}

.result-inspector-stage img {
  display: block;
  height: auto;
  border: 1px solid rgba(122, 156, 184, 0.24);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

.result-inspector-stage[data-fit="true"] {
  display: grid;
  place-items: center;
}

.result-inspector-stage[data-fit="true"] img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
}

.result-inspector-stage[data-fit="false"] img {
  width: calc(var(--result-inspector-zoom) * 100%);
  max-width: none;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .result-inspector {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }

  .result-inspector-header {
    align-items: flex-start;
    padding: 10px;
  }

  .result-inspector-header > div:first-child {
    display: none;
  }

  .result-inspector-toolbar {
    flex: 1;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .result-inspector-toolbar a {
    flex: 1;
    min-width: 86px;
  }

  .result-inspector-close {
    margin-left: auto;
  }

  .result-inspector-stage {
    padding: 10px;
  }
}

.generated-result-card figcaption {
  width: 100%;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.generated-result-card figcaption strong,
.generated-result-card figcaption span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.generated-result-caption-main,
.provider-state-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.provider-state-row small {
  flex: 1 1 150px;
}

.provider-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  max-width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.provider-state-badge.is-real {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
}

.provider-state-badge.is-fallback,
.provider-state-badge.is-mock {
  border-color: rgba(245, 158, 11, 0.46);
  background: rgba(245, 158, 11, 0.14);
  color: var(--amber);
}

.provider-state-badge.is-unknown {
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.generation-progress {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), transparent 52%, rgba(139, 92, 246, 0.12)),
    var(--subtle-bg);
  padding: 12px;
}

.generation-progress[hidden] {
  display: none !important;
}

.progress-meta {
  display: grid;
  gap: 4px;
}

.progress-meta strong,
.progress-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.progress-meta span {
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink));
  box-shadow: var(--glow);
  transition: width 220ms ease;
}

.generation-progress[data-state="running"] .progress-track span {
  animation: progress-pulse 1.1s ease-in-out infinite;
}

.generation-progress[data-state="failed"] .progress-track span,
.generation-progress[data-state="blocked"] .progress-track span {
  background: linear-gradient(90deg, var(--amber), var(--red));
}

.generation-progress[data-state="done"] .progress-track span {
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.progress-steps li {
  min-height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  background: var(--control-bg);
}

.progress-steps li.active,
.progress-steps li.done {
  border-color: var(--active-border);
  color: var(--text);
  background: var(--active-bg);
}

@keyframes progress-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.28);
  }
}

.version-strip,
.export-panel,
.asset-library-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
  padding: 12px;
}

.version-strip {
  min-height: 58px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.version-chip {
  flex: 0 0 108px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--control-bg);
  padding: 8px;
  text-align: left;
}

.version-chip.active {
  border-color: var(--active-border);
  background: var(--active-bg);
  box-shadow: var(--active-shadow);
}

.version-chip strong,
.version-chip small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.version-chip small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.export-panel {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.export-panel strong,
.export-panel small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.export-panel small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.asset-library-panel {
  display: grid;
  gap: 12px;
}

.asset-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.asset-library-head strong,
.asset-library-head small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.asset-library-head small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.asset-library-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.asset-library-filters span {
  color: var(--muted);
  font-size: 11px;
}

.asset-library-filters select {
  width: 100%;
  min-width: 0;
}

.asset-library-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.asset-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--control-bg);
  padding: 10px;
}

.asset-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.asset-card strong,
.asset-card small,
.asset-card p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.asset-card strong {
  display: block;
  font-size: 13px;
}

.asset-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.asset-card p {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
  box-shadow: none;
}

.holo-preview {
  position: relative;
  min-height: 260px;
  width: 100%;
  display: grid;
  justify-items: center;
  place-content: center;
  gap: 10px;
  overflow: hidden;
}

.holo-preview strong,
.holo-preview span {
  position: relative;
  z-index: 1;
}

.holo-preview span {
  color: var(--muted);
  font-size: 13px;
}

.holo-grid,
.holo-orbit {
  position: absolute;
  pointer-events: none;
}

.holo-grid {
  inset: 12%;
  border-radius: 18px;
  opacity: 0.42;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: radial-gradient(circle, #000 0 56%, transparent 82%);
}

.holo-orbit {
  width: 188px;
  height: 188px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  box-shadow: var(--glow);
}

.holo-orbit::before,
.holo-orbit::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: inherit;
  border: 1px solid var(--violet);
}

.holo-orbit::after {
  inset: 54px;
  border-color: var(--pink);
}

.check-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 0;
}

.check-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--chip-text);
  background: var(--chip-bg);
  font-size: 12px;
}

.layer-list,
.history-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.layer-item,
.history-item {
  border-radius: 12px;
  padding: 10px;
  background: var(--subtle-bg);
}

.layer-item strong,
.history-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.history-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 420px;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

/* Admin is an operational surface: keep hierarchy quiet and reserve color for state. */
.admin-page {
  --admin-surface: rgba(7, 17, 31, 0.96);
  --admin-surface-strong: rgba(9, 23, 40, 0.98);
  --admin-surface-muted: rgba(5, 13, 25, 0.9);
  --admin-line: rgba(122, 156, 184, 0.2);
  --admin-line-strong: rgba(34, 211, 238, 0.55);
  --admin-shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
  --page-background:
    linear-gradient(180deg, #07111f 0%, #030914 72%, #020711 100%);
  --ambient-overlay: none;
  --grid-line: rgba(122, 156, 184, 0.035);
}

.admin-page .topbar {
  border-color: var(--admin-line);
  background: var(--admin-surface-strong);
  box-shadow: var(--admin-shadow);
  backdrop-filter: none;
}

.admin-page .glass-panel {
  border-color: var(--admin-line);
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow);
  backdrop-filter: none;
}

.admin-page .glass-panel::before {
  opacity: 0;
}

.admin-page .admin-console {
  border-color: rgba(122, 156, 184, 0.28);
  background: var(--admin-surface-strong);
}

.admin-page .role-rail,
.admin-page .preview-rail {
  background: var(--admin-surface-muted);
}

.admin-page .section-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-page .section-heading span {
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 7px;
  background: rgba(5, 18, 32, 0.95);
}

.admin-page .role-card {
  border-color: var(--admin-line);
  background: rgba(4, 12, 24, 0.86);
  box-shadow: none;
  backdrop-filter: none;
}

.admin-page .role-card:hover {
  transform: none;
  border-color: rgba(122, 156, 184, 0.4);
  box-shadow: none;
}

.admin-page .role-card.active {
  border-color: var(--admin-line-strong);
  background: rgba(8, 31, 47, 0.94);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.admin-page .admin-module-summary,
.admin-page .admin-module-card,
.admin-page .field,
.admin-page .toggle-field,
.admin-page .provider-card,
.admin-page .stat,
.admin-page .history-item,
.admin-page .table-shell {
  border-color: var(--admin-line);
  background: rgba(3, 11, 22, 0.72);
  box-shadow: none;
  backdrop-filter: none;
}

.admin-page .table th {
  background: rgba(10, 24, 39, 0.84);
  color: #a9bed0;
}

.admin-page .table tbody tr:hover {
  background: rgba(34, 211, 238, 0.045);
}

.admin-page .admin-mobile-modules {
  border-color: var(--admin-line);
  background: rgba(4, 12, 24, 0.98);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}

.admin-page .admin-mobile-modules button.active {
  border-color: var(--admin-line-strong);
  color: #e8f7ff;
  background: rgba(8, 42, 58, 0.98);
  box-shadow: inset 0 -2px 0 var(--cyan);
}

.admin-mobile-modules { display: none; }

.admin-login-panel {
  grid-column: 1 / -1;
  width: min(520px, 100%);
  margin: 8vh auto 0;
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--subtle-bg);
}

.provider-card-list {
  display: none;
  gap: 12px;
}

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

.compact-table .table {
  min-width: 0;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.table td strong,
.table td small {
  display: block;
}

.attempt-chain {
  margin-top: 4px;
  max-width: 420px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.fallback-badge {
  display: inline-block;
  margin-left: 6px;
  border: 1px solid rgba(34, 211, 238, 0.36);
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.status-text.healthy,
.status-text.ready {
  color: var(--green);
}

.status-text.unconfigured {
  color: var(--amber);
}

.provider-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 160px;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.admin-toolbar.inside {
  grid-template-columns: 150px 220px minmax(220px, 1fr) auto;
  margin: 0;
}

.admin-toolbar.inside.logs-toolbar {
  grid-template-columns: minmax(120px, 150px) minmax(160px, 1fr) minmax(160px, 1fr) minmax(96px, auto);
}

.admin-toolbar.inside.logs-toolbar [data-refresh-logs] {
  min-width: 96px;
  white-space: nowrap;
}

.compact-field {
  padding: 10px;
}

.provider-form-heading {
  grid-column: 1 / -1;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
  padding: 12px 14px;
}

.flat-heading {
  grid-column: auto;
  margin-bottom: 12px;
  box-shadow: none;
}

.provider-form-heading strong,
.provider-form-heading small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.provider-form-heading small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.toggle-field {
  min-height: 48px;
  border-radius: var(--radius-sm);
  padding: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--soft);
  font-size: 13px;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}

.provider-capability-options {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.provider-capability-options small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.capability-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--muted);
}

.capability-tags span.enabled {
  border-color: rgba(34, 211, 238, .45);
  color: var(--cyan);
}

.capability-tags span.disabled {
  border-color: rgba(148, 163, 184, .22);
}

.provider-card {
  border-radius: var(--radius-sm);
  padding: 14px;
}

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

.provider-card-head strong,
.provider-card-head small {
  display: block;
}

.provider-card dl {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.provider-card dl div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}

.provider-card dt {
  color: var(--muted);
  font-size: 12px;
}

.provider-card dd {
  min-width: 0;
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.provider-card .btn {
  margin-right: 8px;
  margin-top: 4px;
}

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

.btn.danger {
  border-color: rgba(251, 113, 133, 0.42);
  color: var(--red);
}

.btn.danger:hover {
  border-color: var(--red);
  box-shadow: 0 0 22px rgba(251, 113, 133, 0.16);
}

.admin-module-panel {
  margin-top: 14px;
}

.admin-module-summary,
.admin-module-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
  padding: 14px;
}

.admin-module-summary strong,
.admin-module-summary small,
.admin-module-card strong,
.admin-module-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-module-summary small,
.admin-module-card small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.admin-module-card.wide {
  grid-column: 1 / -1;
}

.admin-module-grid.split-grid {
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
}

.admin-module-grid.quota-admin-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 1500px) {
  .admin-module-grid.quota-admin-grid {
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  }
}

.admin-settings-form {
  display: grid;
  gap: 14px;
}

.checkbox-grid,
.route-grid,
.alias-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.checkbox-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-toggle {
  min-height: 40px;
  box-shadow: none;
}

.alias-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.alias-row span {
  color: var(--muted);
}

.template-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 520px;
  overflow: auto;
}

.template-admin-row {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(2, 6, 23, 0.42);
  color: var(--text);
}

.template-admin-row.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.2) inset;
}

.template-editor {
  display: grid;
  gap: 12px;
}

.template-editor-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.v1-user-panel {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--subtle-bg);
}

.v1-account-shell,
.v1-auth-form,
.v1-password-form,
.v1-drawer {
  display: grid;
  gap: 12px;
}

.v1-account-shell {
  grid-template-columns: minmax(0, 1fr);
}

.v1-account-summary {
  display: grid;
  gap: 5px;
}

.v1-account-summary strong,
.v1-section-title strong {
  color: var(--text);
  font-size: 16px;
}

.v1-account-summary small,
.v1-section-title small {
  color: var(--muted);
  line-height: 1.55;
}

.v1-auth-form {
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
  align-items: end;
}

.v1-auth-form input,
.v1-password-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

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

.v1-drawer {
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(2, 8, 18, 0.38);
}

.v1-section-title {
  display: grid;
  gap: 4px;
}

.v1-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.v1-work-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--control-bg);
}

.v1-work-card strong,
.v1-work-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.v1-work-card strong {
  color: var(--text);
  line-height: 1.35;
}

.v1-work-card small {
  color: var(--muted);
  line-height: 1.45;
}

.v1-work-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  text-decoration: none;
}

.v1-work-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.v1-work-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

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

.stat strong {
  font-size: 22px;
}

.ops-readiness {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
}

.ops-readiness__summary {
  display: grid;
  gap: 4px;
}

.ops-readiness__summary strong {
  font-size: 18px;
}

.ops-readiness__summary small {
  color: var(--muted);
}

.ops-readiness__list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ops-readiness__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--control-strong-bg);
  color: var(--text);
}

.ops-readiness__item span,
.ops-readiness__item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ops-readiness__item strong {
  flex: 0 1 auto;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.runtime-freshness {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
}

.runtime-freshness__summary {
  display: grid;
  gap: 4px;
}

.runtime-freshness__summary strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.runtime-freshness__summary small,
.runtime-freshness__meta,
.runtime-freshness__fingerprint {
  color: var(--muted);
}

.runtime-freshness__meta,
.runtime-freshness__fingerprint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
}

.runtime-freshness__fingerprint span {
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

@media (max-width: 1360px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .status-strip {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
  }

  .hero-console {
    grid-template-columns: 1fr;
  }

  .creator-grid,
  .admin-grid {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .preview-rail {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }
}

@media (max-width: 1080px) {
  .home-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "roles"
      "flow"
      "gateway";
  }

  .home-page .home-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "hero"
      "roles"
      "flow"
      "gateway";
  }

  .home-page .hero-console { grid-template-columns: 1fr; }

  .role-grid.compact,
  .task-center,
  .timeline,
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creator-grid,
  .admin-grid,
  .creator-priority,
  .advanced-compose,
  .professional-review-grid,
  .prompt-director-panel,
  .provider-form,
  .admin-toolbar,
  .admin-toolbar.inside,
  .admin-module-grid.split-grid,
  .alias-row {
    grid-template-columns: 1fr;
  }

  .professional-review-grid > .professional-review-section:first-child,
  .professional-review-grid > .professional-review-section + .professional-review-section {
    border-left: 0;
  }

  .professional-review-grid > .professional-review-section + .professional-review-section {
    border-top: 1px solid var(--line);
  }

  .role-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 10px;
  }

  .professional-review-head,
  .professional-review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .layout-mode-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .layout-mode-switch {
    width: 100%;
  }

  .layout-mode-switch button {
    text-align: center;
  }

  .professional-review-head {
    padding: 17px 16px 13px 19px;
  }

  .professional-review-status {
    padding: 10px 16px 10px 19px;
  }

  .professional-review-section,
  .professional-review-grid > .professional-review-section:first-child,
  .professional-review-grid > .professional-review-section + .professional-review-section {
    padding: 16px 16px 16px 19px;
  }

  .provider-ready-section {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .professional-review-badges {
    justify-content: flex-start;
  }

  .professional-field-list {
    grid-template-columns: 1fr;
  }

  .professional-review-actions .btn {
    min-width: 0;
    width: 100%;
  }

  .professional-review-actions small {
    max-width: none;
    margin-left: 0;
    text-align: left;
  }

  .professional-review-actions {
    padding: 15px 16px 16px 19px;
  }

  .exploded-3d-stage {
    height: 360px;
    min-height: 360px;
  }

  .exploded-3d-head,
  .exploded-3d-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .exploded-distance-control {
    min-width: 0;
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr) 42px;
  }

  .exploded-3d-actions .btn {
    flex: 1 1 0;
  }

  .exploded-3d-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .topbar-actions,
  .status-strip {
    justify-content: flex-start;
  }

  nav.topbar-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  nav.topbar-actions .navlink {
    min-width: 0;
    padding-inline: 5px;
    font-size: 11px;
    white-space: nowrap;
  }

  .navlink,
  .btn {
    min-height: 44px;
    padding: 10px 12px;
  }

  .hero-console,
  .role-matrix,
  .workflow-panel,
  .gateway-panel,
  .role-rail,
  .creator-board,
  .preview-rail,
  .admin-console {
    padding: 14px;
  }

  .hero-copy h1 {
    margin-top: 18px;
    font-size: 34px;
  }

  .home-page .hero-console {
    min-height: auto;
    padding: 16px;
  }

  .home-page .hero-copy h1 {
    margin-top: 16px;
    font-size: 32px;
  }

  .home-page .hero-copy p {
    font-size: 14px;
    line-height: 1.68;
  }

  .home-page .status {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 10px;
  }

  .home-page .home-result-preview { min-height: 0; }

  .home-page .home-result-media { height: 220px; }

  .home-page .home-result-preview figcaption {
    gap: 8px;
    min-height: 62px;
    padding: 9px 10px;
  }

  .home-page .home-result-open { font-size: 10px; }

  .home-page .role-matrix,
  .home-page .workflow-panel,
  .home-page .gateway-panel { padding: 14px; }

  .home-page .gateway-panel .metric-grid { grid-template-columns: 1fr; }

  .home-page .task-card { min-height: 106px; }

  .home-page .workflow-panel .timeline { grid-template-columns: 1fr; }

  .role-grid.compact,
  .task-center,
  .role-list,
  .mode-grid,
  .v1-auth-form,
  .v1-work-grid,
  .timeline,
  .form-grid,
  .admin-module-grid,
  .checkbox-grid,
  .route-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .mobile-flow {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    order: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-bg);
    box-shadow: 0 8px 24px var(--shadow);
  }

  [data-mobile-step-target],
  [data-reference-transfer-preflight-panel] { scroll-margin-top: 76px; }

  .command-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-bar .btn {
    width: 100%;
  }

  .export-panel {
    grid-template-columns: 1fr;
  }

  .export-actions {
    justify-content: stretch;
  }

  .export-actions .btn {
    flex: 1 1 72px;
  }

  .research-chart-head {
    grid-template-columns: 1fr;
  }

  .creation-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creation-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creation-plan-provenance {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .creation-plan-detail-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .research-chart-controls {
    grid-template-columns: 1fr;
  }

  .mechanism-editor-toolbar,
  .experiment-editor-toolbar,
  .abstract-editor-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mechanism-nudge-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mechanism-nudge-controls .icon-btn {
    width: 100%;
  }

  .experiment-nudge-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .experiment-nudge-controls .btn,
  .experiment-nudge-controls .icon-btn {
    width: 100%;
    min-width: 0;
  }

  .abstract-nudge-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .abstract-nudge-controls .icon-btn {
    width: 100%;
  }

  .reference-boundary-grid,
  .reference-identity-contract {
    grid-template-columns: 1fr;
  }

  .reference-transfer-preflight-grid,
  .reference-transfer-preflight-boundaries,
  .reference-transfer-readiness-grid {
    grid-template-columns: 1fr;
  }

  .reference-transfer-readiness-head {
    display: grid;
  }

  .reference-transfer-preapproval-head,
  .reference-transfer-preapproval-item {
    align-items: start;
  }

  .reference-transfer-preapproval-head {
    display: grid;
  }

  .reference-transfer-preapproval-list {
    grid-template-columns: 1fr;
  }

  .reference-edit-execution {
    align-items: stretch;
    flex-direction: column;
  }

  .reference-edit-result-card {
    grid-template-columns: 1fr;
  }

  .research-chart-head span {
    max-width: none;
    text-align: left;
  }

  .research-chart-svg {
    min-width: 0;
  }

  .creator-board {
    order: 2;
  }

  .preview-rail {
    order: 3;
  }

  .preview-rail .quality-card {
    max-height: 340px;
  }

  .role-rail {
    order: 1;
  }

  .role-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .admin-toolbar.inside.logs-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-mobile-modules {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    order: 0;
    position: static;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-bg);
    box-shadow: 0 8px 24px var(--shadow);
  }

  .admin-mobile-modules button {
    min-width: 0;
    min-height: 38px;
    padding: 7px 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--soft);
    background: var(--control-bg);
    font-size: 12px;
  }

  .admin-mobile-modules button.active {
    border-color: var(--active-border);
    color: var(--primary-text);
    background: var(--primary-bg);
  }

  .admin-toolbar.inside.logs-toolbar [data-refresh-logs] {
    width: 100%;
  }

  .table-shell {
    display: none;
  }

  [data-quota-form] .compact-table {
    display: block;
    overflow: visible;
  }

  [data-quota-form] .compact-table .table,
  [data-quota-form] .compact-table tbody,
  [data-quota-form] .compact-table tr,
  [data-quota-form] .compact-table td {
    display: block;
    width: 100%;
  }

  [data-quota-form] .compact-table thead {
    display: none;
  }

  [data-quota-form] .compact-table tr {
    padding: 10px;
    border-bottom: 1px solid var(--line);
  }

  [data-quota-form] .compact-table tr:last-child {
    border-bottom: 0;
  }

  [data-quota-form] .compact-table td {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border: 0;
  }

  [data-quota-form] .compact-table td::before {
    content: attr(data-role-cell);
    color: var(--muted);
    font-size: 12px;
  }

  [data-quota-form] .compact-table input:not([type="checkbox"]),
  [data-quota-form] .compact-table button {
    width: 100%;
    min-width: 0;
  }

  .provider-card-list {
    display: grid;
  }
}

@media (max-width: 430px) {
  .command-bar {
    grid-template-columns: 1fr;
  }

  .brand strong {
    font-size: 18px;
  }
}
