:root {
  color-scheme: light;
  --bg: #101114;
  --bg-rail: #181b20;
  --surface: #fbfcfd;
  --surface-soft: #f0f4f6;
  --surface-strong: #e1e9ed;
  --text: #151922;
  --muted: #65717f;
  --line: #d7e0e6;
  --accent: #00b894;
  --accent-dark: #007b68;
  --coral: #ff5f57;
  --gold: #f6b84b;
  --blue: #2f78ff;
  --ink: #111820;
  --chrome: #15181d;
  --chrome-soft: #20252b;
  --shadow: 0 22px 60px rgba(5, 8, 12, 0.24);
  --inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.12), transparent 28%),
    linear-gradient(315deg, rgba(255, 95, 87, 0.1), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 52px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 52px),
    linear-gradient(180deg, #101114, #17191d 48%, #101114);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  box-sizing: border-box;
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 38%, rgba(0, 184, 148, 0.08) 38% 39%, transparent 39% 100%),
    linear-gradient(300deg, transparent 0 64%, rgba(246, 184, 75, 0.08) 64% 65%, transparent 65% 100%);
}

.access-lock {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(255, 95, 87, 0.13), transparent 36%),
    rgba(10, 13, 17, 0.78);
  backdrop-filter: blur(16px);
}

.access-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.access-panel h2 {
  color: var(--ink);
  font-size: 24px;
}

.access-panel p,
.access-panel small {
  color: var(--muted);
  line-height: 1.6;
}

.access-panel small {
  min-height: 20px;
  color: #b33a31;
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(90deg, rgba(21, 24, 29, 0.96), rgba(32, 37, 43, 0.9)),
    linear-gradient(90deg, rgba(0, 184, 148, 0.18), transparent);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

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

.brand > div {
  min-width: 0;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 36%),
    conic-gradient(from 210deg, var(--accent), var(--blue), var(--coral), var(--gold), var(--accent));
  box-shadow:
    0 0 28px rgba(0, 184, 148, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(17, 24, 32, 0.72);
  border-radius: 4px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.2);
}

h1 {
  max-width: 100%;
  color: #f8fbfd;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand p {
  margin-top: 4px;
  color: #aeb8c4;
  font-size: 13px;
}

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

.example-select {
  height: 40px;
  min-width: 86px;
  padding: 0 32px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: #f6fbff;
  font-size: 13px;
  font-weight: 800;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.example-select option {
  color: #151922;
  background: #ffffff;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #f6fbff;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 184, 148, 0.7);
  background: rgba(0, 184, 148, 0.16);
}

.workspace {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 20px 24px 28px;
  display: grid;
  grid-template-columns: minmax(360px, 500px) minmax(0, 1fr);
  gap: 18px;
  flex: 1;
}

.workspace > * {
  min-width: 0;
  max-width: 100%;
}

.input-panel,
.output-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(251, 252, 253, 0.96);
  box-shadow: var(--shadow), var(--inner-shadow);
}

.input-panel {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 112px);
  padding: 18px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #94a3ad transparent;
}

.input-panel::before,
.output-panel::before {
  content: "";
  display: block;
  height: 3px;
  margin: -1px -1px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--coral), var(--gold));
}

.output-panel {
  min-height: 780px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 249, 0.98)),
    var(--surface);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title h2 {
  color: var(--ink);
  font-size: 18px;
}

.status-dot {
  min-width: 68px;
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 184, 148, 0.25);
  border-radius: 999px;
  background: #e8fbf6;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

form {
  width: 100%;
  display: grid;
  gap: 14px;
}

label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #2f3742;
  font-size: 13px;
  font-weight: 900;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid #d5dfe6;
  border-radius: var(--radius);
  outline: none;
  background: #ffffff;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(18, 24, 32, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.58;
}

select {
  appearance: auto;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow:
    0 0 0 3px rgba(0, 184, 148, 0.14),
    inset 0 1px 0 rgba(18, 24, 32, 0.04);
}

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

.form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(21, 28, 36, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.045), rgba(47, 120, 255, 0.035)),
    #f8fbfc;
}

.form-section .subsection-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section .subsection-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.12);
}

.input-panel .form-section label,
.input-panel .form-section .subsection-label {
  color: #17212b;
}

.input-panel .form-section label {
  padding: 10px;
  border: 1px solid rgba(15, 23, 32, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.input-panel .form-section label > input,
.input-panel .form-section label > textarea,
.input-panel .form-section label > select {
  margin-top: 2px;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: #6a7684;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.perspective-group,
.framework-section {
  display: grid;
  gap: 10px;
}

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

.model-selector-section {
  gap: 10px;
}

.evidence-source-field {
  display: grid;
  gap: 7px;
}

.evidence-source-field small {
  color: #61717c;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

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

.model-select-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.model-select-field > span {
  color: #26333f;
  font-size: 12px;
  font-weight: 900;
}

.model-select-field select {
  width: 100%;
}

.model-select-field small {
  min-height: 17px;
  color: #60717d;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.model-select-field small.ready {
  color: #117565;
}

.model-select-field small.missing {
  color: #a6501d;
}

.subsection-label {
  color: #2f3742;
  font-size: 13px;
  font-weight: 900;
}

.auto-framework-note {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid rgba(0, 184, 148, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.1), rgba(47, 120, 255, 0.06)),
    #f6fffc;
}

.auto-framework-note strong {
  color: #143f38;
  font-size: 14px;
}

.auto-framework-note span {
  color: #5f6d79;
  font-size: 12px;
  line-height: 1.55;
}

.perspective-card,
.render-mode-card {
  position: relative;
  min-width: 0;
  padding: 12px 12px 12px 38px;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background: #f7fafb;
  color: var(--text);
  text-align: left;
  box-shadow: inset 3px 0 0 rgba(101, 113, 127, 0.18);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.perspective-card:hover,
.render-mode-card:hover {
  transform: translateY(-1px);
  border-color: #aebdc8;
  background: #ffffff;
}

.perspective-card span,
.render-mode-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.perspective-card.active,
.render-mode-card:has(input:checked) {
  border-color: rgba(0, 184, 148, 0.64);
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.1), rgba(47, 120, 255, 0.05)),
    #ffffff;
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 10px 24px rgba(0, 184, 148, 0.1);
}

.perspective-card input,
.render-mode-card input {
  position: absolute;
  top: 15px;
  left: 12px;
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  accent-color: var(--accent);
}

.primary-action,
.secondary-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius);
  font-weight: 900;
  line-height: 1.2;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.primary-action {
  margin-top: 4px;
  border: 0;
  background:
    linear-gradient(135deg, #111820 0%, #14342f 38%, #00a98a 100%);
  color: #ffffff;
  box-shadow:
    0 16px 32px rgba(0, 184, 148, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.primary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 18px 36px rgba(0, 184, 148, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-action {
  padding: 0 14px;
  border: 1px solid #cad6de;
  background: #ffffff;
  color: var(--ink);
}

.secondary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(0, 184, 148, 0.52);
  background: #f7fffc;
}

.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.tabs {
  display: flex;
  border-bottom: 1px solid rgba(17, 24, 32, 0.14);
  background:
    linear-gradient(90deg, #15181d, #20252b),
    var(--chrome);
}

.tab {
  height: 50px;
  min-width: 102px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  background: transparent;
  color: #aeb8c4;
  font-weight: 900;
}

.tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.tab.active {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(0, 184, 148, 0.24), rgba(0, 184, 148, 0.04));
  box-shadow: inset 0 -3px 0 var(--accent);
}

.progress-strip {
  display: grid;
  grid-template-columns: repeat(9, minmax(78px, 1fr));
  gap: 8px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #dbe3e8;
  background:
    linear-gradient(90deg, rgba(0, 184, 148, 0.05), transparent 38%, rgba(255, 95, 87, 0.05)),
    #f7fafb;
  overflow-x: auto;
}

.progress-strip span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #d7e0e6;
  border-radius: 999px;
  background: #ffffff;
  color: #637080;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.progress-strip span.active,
.progress-strip span.done {
  border-color: rgba(0, 184, 148, 0.46);
  background: #e8fbf6;
  color: var(--accent-dark);
}

.progress-strip span.done::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.result-view {
  display: none;
  min-height: 0;
  flex: 1;
}

.result-view.active {
  display: block;
}

.empty-state {
  min-height: 560px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  background:
    repeating-linear-gradient(90deg, rgba(17, 24, 32, 0.035) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(0deg, rgba(17, 24, 32, 0.03) 0 1px, transparent 1px 32px);
}

.empty-state h2 {
  color: var(--ink);
  font-size: 24px;
}

.empty-state p {
  max-width: 520px;
  font-size: 14px;
  line-height: 1.65;
}

.empty-mark {
  width: 88px;
  height: 88px;
  border: 1px solid rgba(0, 184, 148, 0.34);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 45%, rgba(0, 184, 148, 0.72) 46% 48%, transparent 49%),
    linear-gradient(0deg, transparent 45%, rgba(47, 120, 255, 0.58) 46% 48%, transparent 49%),
    linear-gradient(135deg, rgba(0, 184, 148, 0.12), rgba(255, 255, 255, 0.9));
  box-shadow: 0 18px 38px rgba(0, 184, 148, 0.13);
}

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

.branch-desk {
  padding: 18px;
}

.branch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(0, 184, 148, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.09), rgba(47, 120, 255, 0.05)),
    #ffffff;
}

.branch-head h2 {
  color: var(--ink);
  font-size: 20px;
}

.inline-action {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 0 16px;
}

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

.branch-card,
.overview-card,
.concept-card,
.verdict,
.review-item,
.prompt-card {
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 28px rgba(17, 24, 32, 0.06);
}

.branch-card {
  min-width: 0;
  padding: 16px;
}

.branch-source {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(124, 92, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.branch-source strong {
  color: var(--ink);
  font-size: 13px;
}

.branch-source.is-ai {
  border-color: rgba(0, 184, 148, 0.3);
  background: linear-gradient(135deg, rgba(0, 184, 148, 0.12), rgba(255, 255, 255, 0.76));
}

.branch-source.is-warning {
  border-color: rgba(255, 177, 66, 0.42);
  background: linear-gradient(135deg, rgba(255, 177, 66, 0.16), rgba(255, 255, 255, 0.78));
}

.branch-source.is-template {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(248, 250, 252, 0.78);
}

.branch-card.wide,
.overview-card.wide {
  grid-column: 1 / -1;
}

.branch-card h3,
.overview-card h3 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 16px;
}

.charter-card {
  border-color: rgba(0, 184, 148, 0.28);
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.08), rgba(47, 120, 255, 0.04)),
    #ffffff;
}

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

.charter-card-head strong {
  max-width: 42%;
  color: var(--accent-dark);
  font-size: 15px;
  text-align: right;
}

.brief-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.brief-list div {
  display: grid;
  gap: 6px;
}

.brief-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.brief-list dd {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.brief-list span,
.flow-chain span,
.tag-row span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #dce5ea;
  border-radius: 999px;
  background: #f7fafb;
  color: #424c59;
  font-size: 12px;
  font-weight: 900;
}

.flow-chain,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.framework-preview article {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.08), transparent 45%),
    #ffffff;
  box-shadow: inset 3px 0 0 rgba(0, 184, 148, 0.62);
}

.framework-preview strong {
  color: var(--ink);
}

.framework-preview span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.framework-preview p,
.framework-preview small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.flow-overview-card,
.gate-overview-card {
  background:
    linear-gradient(135deg, rgba(47, 120, 255, 0.07), rgba(0, 184, 148, 0.05)),
    rgba(255, 255, 255, 0.96);
}

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

.flow-stage-card,
.gate-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(17, 24, 32, 0.05);
}

.flow-stage-top,
.gate-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.flow-stage-top span,
.gate-head span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: #101820;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
}

.flow-stage-top strong,
.gate-head strong {
  min-width: 0;
  color: var(--ink);
  line-height: 1.35;
}

.flow-stage-card p,
.gate-card p {
  color: #526170;
  font-size: 13px;
  line-height: 1.58;
}

.flow-stage-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.flow-stage-card dl div {
  display: grid;
  gap: 3px;
  padding-left: 9px;
  border-left: 2px solid rgba(0, 184, 148, 0.38);
}

.flow-stage-card dt {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 950;
}

.flow-stage-card dd {
  margin: 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.52;
}

.compact-tags span {
  min-height: 24px;
  font-size: 11px;
}

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

.gate-card {
  align-content: start;
}

.gate-card small {
  color: var(--muted);
  line-height: 1.5;
}

.gate-choice {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid rgba(0, 184, 148, 0.28);
  border-radius: 8px;
  background: #eefbf7;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

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

.evidence-list article {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 0 0 0 12px;
  border-left: 3px solid rgba(0, 184, 148, 0.5);
}

.evidence-list span,
.trace-card span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.evidence-list strong,
.trace-card strong {
  color: var(--ink);
  line-height: 1.45;
}

.evidence-list p,
.evidence-list small,
.trace-card p,
.trace-card small {
  color: var(--muted);
  line-height: 1.55;
}

.evidence-list small,
.trace-card small {
  font-size: 12px;
}

.framework-visual-section {
  min-width: 0;
  padding: 4px 0;
}

.framework-visual-section.wide {
  grid-column: 1 / -1;
}

.framework-visual-section h3,
.framework-report-section h2 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 18px;
}

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

.framework-visual-grid.report-grid {
  margin-top: 12px;
}

.framework-image-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 34px rgba(17, 24, 32, 0.08);
}

.framework-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 760;
  object-fit: contain;
  background: #f7fafb;
  border-bottom: 1px solid #dce5ea;
}

.framework-image-card div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  padding: 12px;
}

.framework-image-card span,
.framework-download {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.framework-image-card strong,
.framework-image-card p {
  min-width: 0;
  grid-column: 1 / -1;
}

.framework-image-card p {
  color: var(--muted);
  line-height: 1.55;
}

.framework-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d7e0e6;
  border-radius: 8px;
  background: #ffffff;
  text-decoration: none;
}

.framework-report-section {
  margin-top: 28px;
}

.framework-image-card.large {
  box-shadow: 0 12px 26px rgba(17, 24, 32, 0.06);
}

.report-inline-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}

.report-inline-visual {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(17, 24, 32, 0.07);
}

.report-inline-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #f7fafb;
  border-bottom: 1px solid #dce5ea;
}

.report-inline-visual div {
  display: grid;
  gap: 5px;
  padding: 11px 12px 12px;
}

.report-inline-visual span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.report-inline-visual strong {
  color: var(--ink);
  line-height: 1.45;
}

.report-inline-visual p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.branch-node {
  min-width: 0;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #f8fbfc);
  box-shadow: 0 14px 32px rgba(17, 24, 32, 0.07);
}

.branch-node legend {
  display: grid;
  gap: 4px;
  padding: 0 6px;
}

.branch-node legend span,
.eyebrow {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.branch-node legend strong {
  color: var(--ink);
  font-size: 15px;
}

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

.branch-option {
  position: relative;
  min-height: 132px;
  padding: 13px 13px 13px 40px;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background: #ffffff;
  font-weight: 800;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.branch-option:hover {
  transform: translateY(-1px);
  border-color: #aab9c4;
}

.branch-option input {
  position: absolute;
  top: 15px;
  left: 14px;
  width: 15px;
  height: 15px;
  min-height: 15px;
  padding: 0;
  accent-color: var(--accent);
}

.branch-option strong {
  color: var(--ink);
  font-size: 14px;
}

.branch-option span,
.branch-option small {
  color: var(--muted);
  line-height: 1.55;
}

.branch-option small {
  font-size: 12px;
}

.branch-option.selected {
  border-color: rgba(0, 184, 148, 0.62);
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.1), rgba(47, 120, 255, 0.05)),
    #ffffff;
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 12px 26px rgba(0, 184, 148, 0.1);
}

.overview-card {
  min-height: 148px;
  padding: 16px;
}

.overview-card p,
.overview-card li,
.report-body li,
.review-item p {
  color: #414c58;
  line-height: 1.65;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 9px;
}

.mast-card {
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.11), rgba(255, 255, 255, 0.92) 42%),
    #ffffff;
}

.mast-card h3 {
  color: var(--ink);
  font-size: 23px;
}

.structured-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.structured-list li {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f5;
}

.structured-list li:last-child {
  border-bottom: 0;
}

.structured-list span {
  color: var(--muted);
}

.structured-list.compact {
  gap: 4px;
}

.structured-list.compact li {
  padding: 6px 0;
}

.tag-row {
  margin-top: 12px;
}

.metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

.metric-strip span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(16, 24, 32, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #22303c;
  font-size: 12px;
  font-weight: 800;
}

.metric-strip strong {
  margin-right: 2px;
  font-size: 22px;
  line-height: 1;
}

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

.spec-grid span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #edf2f5;
  border-radius: 8px;
  background: #ffffff;
  color: #414c58;
  line-height: 1.55;
}

.spec-grid strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.vertical-map-grid span {
  border-color: rgba(0, 90, 190, 0.18);
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.08), rgba(124, 92, 255, 0.06)),
    #ffffff;
}

.vertical-map-grid small {
  color: #64748b;
  font-weight: 700;
  line-height: 1.45;
}

.material-check-card {
  border-color: rgba(0, 168, 143, 0.2);
  background:
    linear-gradient(135deg, rgba(0, 168, 143, 0.08), rgba(255, 255, 255, 0.92)),
    #ffffff;
}

.structure-columns,
.validation-grid,
.render-binding-grid {
  display: grid;
  gap: 12px;
}

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

.structure-columns article,
.validation-card,
.render-binding-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(17, 24, 32, 0.05);
}

.structure-columns article strong,
.validation-card strong,
.render-binding-card strong {
  color: var(--ink);
  line-height: 1.42;
}

.structure-columns article span {
  display: grid;
  gap: 3px;
  padding: 8px 0 0;
  border-top: 1px solid #eef3f5;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.structure-columns article small,
.validation-card small,
.render-binding-card small,
.render-card small,
.prompt-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.validation-grid,
.render-binding-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.validation-card span,
.render-binding-card span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
}

.validation-card p,
.render-binding-card p {
  color: #414c58;
  line-height: 1.55;
}

.agent-plan-grid,
.checkpoint-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

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

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

.agent-card,
.checkpoint-card {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(47, 120, 255, 0.06), rgba(255, 255, 255, 0.94)),
    #ffffff;
  box-shadow: 0 10px 22px rgba(17, 24, 32, 0.05);
}

.checkpoint-card {
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.07), rgba(255, 255, 255, 0.94)),
    #ffffff;
}

.agent-card span,
.checkpoint-card span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
}

.agent-card strong,
.checkpoint-card strong {
  color: var(--ink);
  line-height: 1.42;
}

.agent-card p,
.checkpoint-card p {
  color: #414c58;
  line-height: 1.55;
}

.agent-card small,
.checkpoint-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.concept-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.concept-card span,
.render-card span,
.prompt-card span,
.review-item span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.concept-card p,
.render-card p,
.prompt-card p {
  color: #414c58;
  line-height: 1.6;
}

.concept-card small {
  color: var(--muted);
  font-weight: 900;
}

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

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

.trace-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 0 0 0 12px;
  border-left: 3px solid rgba(47, 120, 255, 0.42);
}

.verdict {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.verdict span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.verdict strong {
  color: var(--ink);
  line-height: 1.45;
}

.verdict small {
  color: var(--muted);
  line-height: 1.55;
}

.verdict-high {
  border-color: rgba(0, 184, 148, 0.42);
  box-shadow: inset 3px 0 0 var(--accent);
}

.verdict-medium {
  border-color: rgba(47, 120, 255, 0.36);
  box-shadow: inset 3px 0 0 var(--blue);
}

.soft-warning {
  margin-top: 12px;
  color: #8a5a00 !important;
}

.generation-task-card {
  display: grid;
  gap: 12px;
}

.task-progress-meter {
  height: 12px;
  overflow: hidden;
  border: 1px solid #d7e0e6;
  border-radius: 999px;
  background: #edf3f6;
}

.task-progress-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2f7cff, #ffb24a);
  transition: width 240ms ease;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #dce5ea;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.task-actions {
  display: flex;
  justify-content: flex-end;
}

.task-actions .danger-action {
  min-height: 36px;
  border-color: rgba(229, 90, 90, 0.32);
  color: #b83434;
}

.hidden {
  display: none;
}

.report-actions,
.render-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-bottom: 1px solid #dbe3e8;
  background: #f7fafb;
}

.report-body {
  max-width: 980px;
  padding: 24px 28px 36px;
}

.report-body h1 {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 28px;
}

.report-body h2 {
  margin: 24px 0 10px;
  color: var(--ink);
  font-size: 18px;
}

.report-body h3 {
  margin: 18px 0 8px;
  color: #202b36;
  font-size: 15px;
  font-weight: 900;
}

.report-body h4 {
  margin: 14px 0 6px 14px;
  color: #40505d;
  font-size: 14px;
  font-weight: 850;
}

.report-body p,
.report-body blockquote {
  margin: 0 0 14px;
  color: #414c58;
  line-height: 1.82;
}

.report-body p,
.report-body li,
.report-body blockquote {
  max-width: 86ch;
}

.report-body blockquote {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: #effcf8;
}

.report-body ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.report-body li + li {
  margin-top: 7px;
}

.report-body .report-grouped-points {
  padding: 12px 14px;
  border-left: 3px solid rgba(0, 184, 148, 0.42);
  background: rgba(247, 250, 251, 0.92);
}

.editable-report-paragraph {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  max-width: 980px;
  margin: 0 0 14px;
  padding: 8px 8px 8px 0;
  border-radius: 8px;
}

.editable-report-paragraph:hover,
.editable-report-paragraph:focus-within {
  background: rgba(0, 184, 148, 0.055);
}

.editable-report-paragraph p {
  margin: 0;
}

.paragraph-rewrite-button {
  min-width: 74px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(0, 184, 148, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: #007b68;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  opacity: 0.18;
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.editable-report-paragraph:hover .paragraph-rewrite-button,
.paragraph-rewrite-button:focus-visible {
  opacity: 1;
}

.paragraph-rewrite-button:hover {
  transform: translateY(-1px);
  background: #effcf8;
}

.rewrite-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 18, 24, 0.48);
  backdrop-filter: blur(10px);
}

.rewrite-dialog.hidden {
  display: none;
}

.rewrite-panel {
  width: min(760px, 100%);
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(17, 24, 32, 0.24);
}

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

.rewrite-head h2 {
  margin-top: 3px;
  color: var(--ink);
  font-size: 20px;
}

.rewrite-panel label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.rewrite-panel textarea {
  width: 100%;
  resize: vertical;
  padding: 12px;
  border: 1px solid #d7e0e6;
  border-radius: 8px;
  background: #f7fafb;
  color: var(--ink);
  font: inherit;
  line-height: 1.62;
}

.rewrite-panel textarea:focus {
  outline: 2px solid rgba(0, 184, 148, 0.24);
  border-color: rgba(0, 184, 148, 0.58);
  background: #ffffff;
}

.rewrite-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.render-workspace {
  padding: 18px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 28px),
    linear-gradient(135deg, #171b20, #23282f);
}

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

.render-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.22);
}

.render-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background: #ffffff;
}

.render-card div,
.prompt-card {
  display: grid;
  gap: 6px;
}

.render-plan-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.prompt-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.render-prompt-review {
  display: grid;
  gap: 12px;
}

.render-prompt-review .section-heading {
  display: grid;
  gap: 4px;
  padding: 4px 2px;
}

.render-prompt-review .section-heading h3 {
  color: var(--ink);
  font-size: 18px;
}

.render-prompt-card {
  gap: 10px;
  border-color: rgba(164, 183, 218, 0.38);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(242, 247, 255, 0.42)),
    rgba(255, 255, 255, 0.42);
}

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

.prompt-card-head div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.prompt-card-head strong {
  color: var(--ink);
  font-size: 15px;
}

.prompt-card-head .secondary-action {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
}

.render-prompt-input {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  padding: 12px;
  border: 1px solid rgba(145, 160, 224, 0.36);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  color: #1c273a;
  font: 12px/1.62 "Microsoft YaHei", "PingFang SC", sans-serif;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.render-prompt-input:focus {
  border-color: rgba(145, 160, 224, 0.72);
  box-shadow:
    0 0 0 3px rgba(145, 160, 224, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.review-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.review-column {
  display: grid;
  align-content: start;
  gap: 12px;
}

.review-column h2 {
  color: var(--ink);
  font-size: 17px;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-item {
  display: grid;
  gap: 7px;
  padding: 14px;
}

.review-column textarea {
  min-height: 190px;
}

.history-shell {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.09), rgba(47, 120, 255, 0.05)),
    #ffffff;
}

.history-head h2 {
  color: var(--ink);
  font-size: 18px;
}

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

.history-card,
.history-empty {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(17, 24, 32, 0.06);
}

.history-card.active {
  border-color: rgba(0, 184, 148, 0.52);
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 14px 28px rgba(0, 184, 148, 0.08);
}

.history-card > span,
.history-card p,
.history-empty p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.history-card strong,
.history-empty strong {
  color: var(--ink);
  line-height: 1.45;
}

.history-meta,
.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-meta span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #dce5ea;
  border-radius: 999px;
  background: #f7fafb;
  color: #424c59;
  font-size: 12px;
  font-weight: 900;
}

.history-actions {
  margin-top: 4px;
}

.history-actions .secondary-action {
  min-height: 34px;
  padding: 0 11px;
}

.danger-action {
  color: #9f2331;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  min-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 184, 148, 0.2), transparent 52%),
    var(--ink);
  color: #ffffff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(24px);
  transition: opacity 160ms ease, transform 160ms ease;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
  }

  .flow-stage-grid,
  .gate-grid,
  .agent-plan-grid,
  .checkpoint-grid,
  .validation-grid,
  .render-binding-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .topbar {
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  h1 {
    font-size: 17px;
    white-space: normal;
  }

  .brand p {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toolbar {
    display: none;
  }

  .workspace {
    width: 100%;
    padding: 10px;
    gap: 12px;
  }

  .input-panel,
  .output-panel {
    width: 100%;
  }

  .input-panel {
    padding: 14px 12px;
  }

  .status-dot {
    display: none;
  }

  .field-grid,
  .render-mode-group,
  .overview-grid,
  .review-shell,
  .verdict-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    min-width: 86px;
    flex: 1 0 auto;
  }

  .progress-strip {
    grid-template-columns: repeat(9, minmax(76px, 1fr));
    padding: 12px;
  }

  .branch-head {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-action {
    width: 100%;
  }

  .branch-summary,
  .branch-options,
  .evidence-list,
  .framework-preview,
  .framework-visual-grid,
  .flow-stage-grid,
  .gate-grid,
  .agent-plan-grid,
  .checkpoint-grid,
  .structure-columns,
  .validation-grid,
  .render-binding-grid,
  .trace-grid,
  .concept-grid,
  .spec-grid,
  .report-inline-visuals,
  .render-gallery,
  .history-list {
    grid-template-columns: 1fr;
  }

  .branch-card.wide,
  .overview-card.wide {
    grid-column: auto;
  }

  .report-body {
    padding: 20px 16px 28px;
  }
}

@media (max-width: 520px) {
  .topbar {
    position: relative;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .empty-state {
    min-height: 430px;
    padding: 24px 16px;
  }

  .branch-desk,
  .overview-grid,
  .review-shell,
  .render-workspace {
    padding: 12px;
  }
}

:root {
  --void: #08090d;
  --void-2: #11151b;
  --panel-deep: #151a22;
  --panel-mid: #1f2630;
  --paper: #f8fbfd;
  --neon: #00f0b5;
  --flare: #ff4f8b;
  --signal: #ffd166;
  --violet: #7c5cff;
  --glass-line: rgba(255, 255, 255, 0.16);
}

body {
  background:
    linear-gradient(117deg, transparent 0 16%, rgba(0, 240, 181, 0.11) 16% 17%, transparent 17% 100%),
    linear-gradient(294deg, transparent 0 57%, rgba(255, 79, 139, 0.1) 57% 58%, transparent 58% 100%),
    linear-gradient(162deg, transparent 0 24%, rgba(124, 92, 255, 0.14) 24% 25%, transparent 25% 100%),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, var(--void), #151821 46%, #0b0d12);
}

.app-shell::before {
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(0, 240, 181, 0.14) 12% 12.4%, transparent 12.4% 100%),
    linear-gradient(90deg, transparent 0 78%, rgba(255, 209, 102, 0.12) 78% 78.5%, transparent 78.5% 100%),
    repeating-linear-gradient(0deg, transparent 0 42px, rgba(255, 255, 255, 0.025) 42px 43px);
}

.topbar {
  min-height: 76px;
  padding: 14px 26px 14px 20px;
  background:
    linear-gradient(112deg, rgba(8, 9, 13, 0.98) 0 62%, rgba(0, 240, 181, 0.2) 62% 63%, rgba(28, 34, 44, 0.95) 63% 100%),
    var(--void);
  border-bottom: 1px solid rgba(0, 240, 181, 0.28);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon), var(--flare), transparent);
}

.brand-mark {
  width: 52px;
  height: 42px;
  flex-basis: 52px;
  border-radius: 6px;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.34), transparent 28%),
    linear-gradient(135deg, var(--neon), var(--violet) 48%, var(--flare));
}

.brand-mark::after {
  inset: 8px 13px;
  border-color: rgba(8, 9, 13, 0.85);
  border-radius: 2px;
}

h1 {
  font-size: 21px;
}

.brand p {
  color: #9fe8d5;
}

.icon-button {
  border-color: rgba(0, 240, 181, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(0, 240, 181, 0.18), rgba(124, 92, 255, 0.1)),
    rgba(255, 255, 255, 0.06);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.workspace {
  width: min(1680px, 100%);
  grid-template-columns: minmax(370px, 485px) minmax(0, 1fr);
  gap: 20px;
  padding: 20px 24px 30px;
}

.input-panel,
.output-panel {
  position: relative;
  border-color: rgba(0, 240, 181, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 28%),
    linear-gradient(180deg, rgba(21, 26, 34, 0.98), rgba(12, 15, 21, 0.98));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.input-panel {
  padding: 18px;
}

.input-panel::before,
.output-panel::before {
  height: 4px;
  margin: -1px -1px 16px;
  background: linear-gradient(90deg, var(--neon), var(--violet), var(--flare), var(--signal));
}

.input-panel::after {
  content: "";
  position: absolute;
  top: 64px;
  right: -1px;
  bottom: 18px;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--neon), var(--flare), transparent);
  opacity: 0.78;
}

.output-panel {
  background:
    linear-gradient(135deg, rgba(0, 240, 181, 0.08), transparent 26%),
    linear-gradient(315deg, rgba(255, 79, 139, 0.08), transparent 32%),
    var(--panel-deep);
}

.section-title h2,
.input-panel label,
.input-panel .subsection-label {
  color: #eef8fb;
}

.status-dot {
  min-width: 76px;
  border-color: rgba(0, 240, 181, 0.46);
  background: rgba(0, 240, 181, 0.13);
  color: #9fffe5;
  box-shadow: 0 0 20px rgba(0, 240, 181, 0.16);
}

input,
textarea,
select {
  border-color: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(236, 244, 247, 0.96));
  color: #111820;
}

.input-panel input,
.input-panel textarea,
.input-panel select {
  box-shadow:
    0 0 0 1px rgba(0, 240, 181, 0.06),
    inset 4px 0 0 rgba(0, 240, 181, 0.18);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--neon);
  box-shadow:
    0 0 0 3px rgba(0, 240, 181, 0.17),
    0 0 22px rgba(0, 240, 181, 0.12),
    inset 4px 0 0 rgba(0, 240, 181, 0.28);
}

.perspective-card,
.render-mode-card,
.auto-framework-note {
  border-color: rgba(0, 240, 181, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(0, 240, 181, 0.12), rgba(124, 92, 255, 0.08)),
    rgba(255, 255, 255, 0.06);
  color: #f4fbff;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  box-shadow: inset 3px 0 0 rgba(0, 240, 181, 0.38);
}

.perspective-card span,
.render-mode-card span,
.auto-framework-note span {
  color: #a9bac7;
}

.auto-framework-note strong {
  color: #dffff7;
}

.perspective-card.active,
.render-mode-card:has(input:checked) {
  border-color: rgba(0, 240, 181, 0.72);
  background:
    linear-gradient(135deg, rgba(0, 240, 181, 0.22), rgba(255, 79, 139, 0.08)),
    rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 3px 0 0 var(--neon),
    0 14px 28px rgba(0, 240, 181, 0.14);
}

.primary-action {
  border: 1px solid rgba(0, 240, 181, 0.56);
  border-radius: 6px;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  background:
    linear-gradient(90deg, rgba(0, 240, 181, 0.55) 0 7px, transparent 7px 100%),
    linear-gradient(135deg, #101820, #172630 58%, #10231f);
  color: #f7fffc;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.62);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.24),
    0 0 22px rgba(0, 240, 181, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.primary-action svg {
  color: #f7fffc;
}

.primary-action:hover:not(:disabled) {
  border-color: rgba(0, 240, 181, 0.76);
  background:
    linear-gradient(90deg, rgba(0, 240, 181, 0.68) 0 7px, transparent 7px 100%),
    linear-gradient(135deg, #121d26, #1b3038 58%, #123028);
  color: #ffffff;
}

.secondary-action {
  border-color: rgba(0, 240, 181, 0.3);
  border-radius: 6px;
  background: #ffffff;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.tabs {
  margin: 0 14px;
  border: 1px solid rgba(0, 240, 181, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 240, 181, 0.12), transparent 30%, rgba(255, 79, 139, 0.1)),
    #0f1319;
}

.tab {
  height: 48px;
  min-width: 112px;
  color: #9fb0be;
}

.tab.active {
  color: #07110f;
  background:
    linear-gradient(135deg, var(--neon), #b3ffe7);
  box-shadow: none;
}

.progress-strip {
  margin: 12px 14px 0;
  padding: 12px;
  border: 1px solid rgba(0, 240, 181, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(0, 240, 181, 0.08), rgba(124, 92, 255, 0.06), rgba(255, 79, 139, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.progress-strip span {
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #afbbc8;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.progress-strip span.active,
.progress-strip span.done {
  border-color: rgba(0, 240, 181, 0.58);
  background: rgba(0, 240, 181, 0.18);
  color: #cffff2;
}

.result-view {
  margin: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}

.empty-state {
  background:
    linear-gradient(135deg, rgba(0, 240, 181, 0.12), transparent 28%),
    linear-gradient(315deg, rgba(255, 79, 139, 0.1), transparent 34%),
    repeating-linear-gradient(90deg, rgba(17, 24, 32, 0.055) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(17, 24, 32, 0.045) 0 1px, transparent 1px 34px),
    #f8fbfd;
}

.empty-mark {
  width: 104px;
  height: 82px;
  border-radius: 6px;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  background:
    linear-gradient(90deg, transparent 44%, rgba(0, 240, 181, 0.82) 45% 48%, transparent 49%),
    linear-gradient(0deg, transparent 42%, rgba(255, 79, 139, 0.62) 43% 46%, transparent 47%),
    linear-gradient(135deg, rgba(0, 240, 181, 0.18), rgba(124, 92, 255, 0.14), rgba(255, 255, 255, 0.9));
}

.branch-head,
.branch-card,
.overview-card,
.concept-card,
.verdict,
.review-item,
.prompt-card,
.framework-preview article,
.branch-node,
.branch-option,
.render-card {
  border-radius: 6px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.branch-head {
  background:
    linear-gradient(90deg, rgba(8, 9, 13, 0.96) 0 12px, rgba(0, 240, 181, 0.2) 12px 15px, rgba(255, 255, 255, 0.96) 15px 100%);
}

.branch-head h2 {
  color: #101820;
}

.branch-card,
.overview-card,
.concept-card,
.verdict,
.review-item,
.prompt-card,
.branch-node {
  background:
    linear-gradient(135deg, rgba(0, 240, 181, 0.08), transparent 36%),
    #ffffff;
}

.mast-card {
  background:
    linear-gradient(90deg, #10151c 0 14px, rgba(0, 240, 181, 0.22) 14px 18px, #ffffff 18px 100%);
}

.mast-card .eyebrow {
  color: var(--accent-dark);
}

.mast-card h3 {
  color: #101820;
}

.framework-preview article {
  border-color: rgba(0, 240, 181, 0.28);
  background:
    linear-gradient(90deg, rgba(15, 19, 25, 0.96) 0 10px, rgba(0, 240, 181, 0.2) 10px 13px, #ffffff 13px 100%);
  box-shadow:
    inset 3px 0 0 var(--neon),
    0 12px 24px rgba(17, 24, 32, 0.08);
}

.framework-preview strong {
  color: var(--ink);
}

.framework-preview span {
  color: var(--accent-dark);
}

.branch-option {
  background:
    linear-gradient(135deg, rgba(0, 240, 181, 0.06), transparent 46%),
    #ffffff;
}

.branch-option.selected {
  border-color: rgba(0, 240, 181, 0.72);
  background:
    linear-gradient(115deg, rgba(0, 240, 181, 0.16), rgba(124, 92, 255, 0.08)),
    #ffffff;
  box-shadow:
    inset 4px 0 0 var(--neon),
    0 14px 30px rgba(0, 240, 181, 0.13);
}

.report-actions,
.render-actions {
  background:
    linear-gradient(90deg, rgba(0, 240, 181, 0.08), transparent 42%, rgba(255, 79, 139, 0.06)),
    #ffffff;
}

.report-body {
  background:
    linear-gradient(90deg, rgba(0, 240, 181, 0.05), transparent 22%),
    #ffffff;
}

.report-body h1 {
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(0, 240, 181, 0.24);
}

.render-workspace {
  background:
    linear-gradient(120deg, rgba(0, 240, 181, 0.1), transparent 30%),
    linear-gradient(300deg, rgba(255, 79, 139, 0.1), transparent 36%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.065) 0 1px, transparent 1px 30px),
    #121820;
}

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

.model-result-grid.wide {
  grid-column: 1 / -1;
}

.model-result-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(17, 24, 32, 0.07);
}

.model-result-head {
  display: grid;
  gap: 4px;
}

.model-result-head span,
.model-result-card small {
  color: var(--accent-dark);
  font-size: 12px;
}

.model-result-head strong {
  color: var(--ink);
  font-size: 16px;
}

.model-result-card p,
.model-result-card small {
  line-height: 1.65;
}

.model-findings {
  display: grid;
  gap: 6px;
}

.model-findings span {
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: var(--surface-soft);
  color: var(--text);
  line-height: 1.68;
}

.history-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.render-plan-list:empty {
  display: none;
}

@media (max-width: 760px) {
  .model-result-grid {
    grid-template-columns: 1fr;
  }
}

.toast {
  border-radius: 6px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  background:
    linear-gradient(100deg, #0b0f14 0 34%, rgba(0, 240, 181, 0.32) 34% 35%, #111820 35% 100%);
}

@media (max-width: 1180px) {
  .input-panel {
    position: relative;
    top: auto;
  }
}

@media (max-width: 780px) {
  .topbar {
    min-height: 68px;
    padding: 12px;
  }

  .workspace {
    padding: 10px;
    grid-template-columns: 1fr;
  }

  .input-panel,
  .output-panel {
    clip-path: none;
  }

  .tabs {
    margin: 0 10px;
  }

  .progress-strip {
    margin: 10px 10px 0;
  }

  .result-view {
    margin: 10px;
  }

  .branch-head {
    background:
      linear-gradient(135deg, rgba(0, 240, 181, 0.12), rgba(124, 92, 255, 0.08)),
      #ffffff;
  }

  .branch-head .eyebrow {
    color: var(--accent-dark);
  }

  .branch-card,
  .overview-card,
  .concept-card,
  .verdict,
  .review-item,
    .prompt-card,
    .framework-image-card,
    .framework-preview article,
    .branch-node,
    .branch-option,
    .render-card {
    clip-path: none;
  }

  .framework-preview article {
    background:
      linear-gradient(135deg, rgba(0, 240, 181, 0.08), transparent 42%),
      #ffffff;
  }

  .framework-preview strong {
    color: var(--ink);
  }
}

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

.framework-mode-card {
  position: relative;
  min-width: 0;
  padding: 12px 12px 12px 38px;
  border: 1px solid rgba(0, 240, 181, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(0, 240, 181, 0.1), rgba(124, 92, 255, 0.07)),
    rgba(255, 255, 255, 0.06);
  color: #f4fbff;
  text-align: left;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  box-shadow: inset 3px 0 0 rgba(0, 240, 181, 0.28);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.framework-mode-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 240, 181, 0.48);
}

.framework-mode-card.active,
.framework-mode-card:has(input:checked) {
  border-color: rgba(0, 240, 181, 0.72);
  background:
    linear-gradient(135deg, rgba(0, 240, 181, 0.22), rgba(255, 79, 139, 0.08)),
    rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 3px 0 0 var(--neon),
    0 14px 28px rgba(0, 240, 181, 0.14);
}

.framework-mode-card input {
  position: absolute;
  top: 15px;
  left: 12px;
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  accent-color: var(--neon);
}

.framework-mode-card strong {
  display: block;
  color: #eafffa;
  font-size: 13px;
}

.framework-mode-card span {
  display: block;
  margin-top: 3px;
  color: #a9bac7;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.framework-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 158px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(0, 240, 181, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 181, 0.48) transparent;
}

.framework-picker.inactive {
  opacity: 0.58;
}

.framework-picker label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid rgba(169, 186, 199, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #eef7fb;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.framework-picker label:has(input:checked) {
  border-color: rgba(0, 240, 181, 0.72);
  background: rgba(0, 240, 181, 0.14);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 240, 181, 0.08);
}

.framework-picker input {
  width: 13px;
  height: 13px;
  min-height: 13px;
  margin: 0;
  accent-color: var(--neon);
}

.branch-muted {
  margin: -4px 0 12px;
  color: #72808b;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 780px) {
  .model-selector-grid,
  .framework-mode-group {
    grid-template-columns: 1fr;
  }

  .framework-picker {
    max-height: 190px;
  }
}

/* Keep the workbench ergonomic: equal-height panes and an always reachable submit button. */
@media (min-width: 781px) {
  .workspace {
    flex: 0 0 auto;
    height: clamp(620px, calc(100vh - 126px), 860px);
    align-items: stretch;
    grid-template-rows: minmax(0, 1fr);
  }

  .input-panel,
  .output-panel {
    height: 100%;
    min-height: 0;
  }

  .input-panel {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .section-title {
    flex: 0 0 auto;
  }

  .input-panel form {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 181, 0.48) transparent;
  }

  .input-panel .primary-action[type="submit"] {
    position: sticky;
    bottom: 0;
    z-index: 6;
    width: 100%;
    flex: 0 0 auto;
    margin-top: 12px;
  }

  .output-panel {
    overflow: hidden;
  }

  .output-panel .result-view.active {
    min-height: 0;
    overflow: auto;
  }
}

@media (min-width: 781px) and (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  }

  .input-panel {
    position: sticky;
    top: 88px;
    max-height: none;
  }
}

@media (max-width: 780px) {
  .input-panel,
  .output-panel {
    height: calc(100vh - 92px);
    min-height: 560px;
  }

  .input-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .input-panel form {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 181, 0.48) transparent;
  }

  .input-panel .primary-action[type="submit"] {
    position: sticky;
    bottom: 0;
    z-index: 6;
    width: 100%;
    margin-top: 12px;
  }

  .output-panel .result-view.active {
    min-height: 0;
    overflow: auto;
  }
}

/* Glass-bubble UI iteration: soft translucent product-design workbench. */
:root {
  --bg: #edf3fb;
  --bg-rail: rgba(242, 247, 253, 0.72);
  --surface: rgba(255, 255, 255, 0.68);
  --surface-soft: rgba(248, 251, 255, 0.58);
  --surface-strong: rgba(255, 255, 255, 0.84);
  --text: #172033;
  --muted: #6f7a8b;
  --line: rgba(120, 142, 170, 0.22);
  --accent: #7997c8;
  --accent-dark: #516f9f;
  --coral: #c98b9c;
  --gold: #d6b783;
  --blue: #8fb3dc;
  --ink: #111a2c;
  --chrome: rgba(255, 255, 255, 0.56);
  --chrome-soft: rgba(255, 255, 255, 0.42);
  --shadow: 0 26px 70px rgba(92, 112, 145, 0.22);
  --inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --radius: 22px;
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(100, 122, 154, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.72);
}

html {
  background: #edf3fb;
}

body {
  background:
    linear-gradient(130deg, rgba(246, 222, 232, 0.88) 0%, rgba(236, 243, 252, 0.82) 38%, rgba(211, 226, 244, 0.9) 100%),
    #edf3fb;
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

.app-shell {
  position: relative;
  isolation: isolate;
}

.app-shell::before {
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.72), transparent 42%),
    url("./assets/glass-bubbles-bg.png") right 56px top 46px / min(50vw, 700px) auto no-repeat;
  opacity: 0.86;
  filter: saturate(0.9) contrast(0.96);
}

.app-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), transparent 42%),
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.72) 0 9%, transparent 23%),
    radial-gradient(circle at 88% 26%, rgba(191, 212, 238, 0.36) 0 13%, transparent 30%),
    radial-gradient(circle at 72% 86%, rgba(246, 220, 231, 0.48) 0 11%, transparent 29%);
}

.topbar {
  top: 14px;
  width: min(1500px, calc(100% - 36px));
  margin: 0 auto;
  padding: 12px 14px 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 18px 52px rgba(105, 125, 154, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(24px) saturate(1.15);
}

.brand {
  gap: 12px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.9);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(215, 228, 244, 0.32)),
    rgba(255, 255, 255, 0.42);
  box-shadow: inset 7px 7px 18px rgba(255, 255, 255, 0.86), inset -8px -8px 16px rgba(117, 139, 170, 0.12), 0 10px 24px rgba(93, 118, 150, 0.14);
}

.brand-mark::after {
  inset: 9px;
  border: 1px solid rgba(82, 102, 132, 0.28);
  border-radius: 7px;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.8);
}

h1 {
  color: #182033;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0;
}

.brand p {
  margin-top: 2px;
  color: rgba(56, 70, 94, 0.68);
  font-size: 12px;
  font-weight: 500;
}

.toolbar {
  gap: 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  color: #2d3a50;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(93, 118, 150, 0.1);
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 151, 196, 0.46);
  background: rgba(255, 255, 255, 0.72);
  color: #172033;
}

.workspace {
  width: min(1520px, 100%);
  padding: 34px 28px 32px;
  grid-template-columns: minmax(390px, 520px) minmax(0, 1fr);
  gap: 22px;
}

.input-panel,
.output-panel,
.access-panel,
.rewrite-panel {
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(247, 251, 255, 0.48)),
    rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow), var(--inner-shadow);
  backdrop-filter: blur(24px) saturate(1.1);
}

.input-panel {
  padding: 22px;
  scrollbar-color: rgba(121, 151, 200, 0.52) transparent;
}

.input-panel::before,
.output-panel::before {
  display: none;
}

.output-panel {
  padding: 0;
  overflow: hidden;
}

.section-title {
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(116, 137, 170, 0.14);
}

.section-title h2 {
  color: #182033;
  font-size: 30px;
  font-weight: 520;
  line-height: 1.08;
}

.status-dot,
.eyebrow,
.brief-list span,
.flow-chain span,
.tag-row span,
.compact-tags span,
.metric-strip span,
.framework-picker label {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  color: rgba(38, 54, 78, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

form {
  gap: 16px;
}

label {
  color: #23304a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

input,
textarea,
select {
  min-height: 44px;
  border: 1px solid rgba(105, 127, 160, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  color: #1a2437;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

textarea {
  line-height: 1.62;
}

input::placeholder,
textarea::placeholder {
  color: rgba(73, 87, 113, 0.42);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(112, 146, 198, 0.62);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 4px rgba(133, 166, 211, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.field-grid {
  gap: 12px;
}

.form-section,
.model-selector-section,
.framework-section,
.auto-framework-note {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 14px 34px rgba(94, 116, 146, 0.08);
}

.form-section {
  padding: 16px;
}

.form-section .subsection-label,
.subsection-label {
  color: #182033;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
}

.form-section .subsection-label::before {
  background: linear-gradient(180deg, rgba(118, 150, 196, 0.7), rgba(204, 153, 172, 0.68));
  box-shadow: 0 0 18px rgba(143, 177, 219, 0.26);
}

.input-panel .form-section label {
  color: #2f3d57;
}

.field-hint,
.model-select-field small,
.auto-framework-note span,
.perspective-card span,
.render-mode-card span,
.framework-mode-card span {
  color: rgba(70, 84, 110, 0.68);
  font-weight: 560;
}

.model-selector-grid {
  gap: 12px;
}

.model-select-field,
.perspective-card,
.render-mode-card,
.framework-mode-card,
.branch-option,
.branch-node,
.branch-card,
.overview-card,
.concept-card,
.verdict,
.review-item,
.prompt-card,
.flow-overview-card,
.gate-overview-card,
.flow-stage-card,
.gate-card,
.evidence-list article,
.trace-card,
.framework-image-card,
.report-inline-visual,
.material-check-card,
.render-card,
.history-card,
.history-empty {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(247, 251, 255, 0.34)),
    rgba(255, 255, 255, 0.36);
  color: #1c273a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 16px 38px rgba(90, 112, 145, 0.08);
}

.perspective-card:hover,
.render-mode-card:hover,
.framework-mode-card:hover,
.branch-option:hover,
.history-card:hover {
  transform: translateY(-1px);
  border-color: rgba(126, 157, 202, 0.5);
  background: rgba(255, 255, 255, 0.64);
}

.perspective-card.active,
.render-mode-card:has(input:checked),
.framework-mode-card.active,
.framework-mode-card:has(input:checked),
.branch-option.selected,
.history-card.active {
  border-color: rgba(108, 142, 194, 0.56);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(226, 238, 252, 0.52)),
    rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 42px rgba(105, 132, 176, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.perspective-card strong,
.render-mode-card strong,
.framework-mode-card strong,
.branch-option strong,
.overview-card h3,
.branch-card h3,
.flow-stage-top strong,
.gate-head strong,
.history-card strong,
.history-empty strong {
  color: #182033;
  font-weight: 720;
}

.framework-preview article {
  position: relative;
  padding: 15px 16px 15px 24px;
  overflow: hidden;
  border-color: rgba(164, 183, 218, 0.38);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(242, 247, 255, 0.38)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 14px 30px rgba(92, 112, 148, 0.08);
}

.framework-preview article::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 13px;
  bottom: 13px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(137, 156, 224, 0.62), rgba(218, 156, 216, 0.42));
}

.framework-preview article strong,
.framework-preview article span,
.framework-preview article p,
.framework-preview article small {
  position: relative;
  z-index: 1;
}

.primary-action,
.secondary-action,
.inline-action,
.framework-download {
  min-height: 44px;
  border-radius: 999px;
  letter-spacing: 0;
}

.primary-action {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(135deg, rgba(116, 145, 195, 0.96), rgba(161, 132, 168, 0.86)),
    #7893c5;
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(105, 132, 176, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.36);
  font-weight: 760;
}

.primary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 22px 52px rgba(105, 132, 176, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.secondary-action,
.framework-download,
.paragraph-rewrite-button {
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.48);
  color: #29374f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(94, 116, 146, 0.08);
}

.secondary-action:hover:not(:disabled),
.framework-download:hover,
.paragraph-rewrite-button:hover {
  border-color: rgba(112, 146, 198, 0.44);
  background: rgba(255, 255, 255, 0.72);
  color: #172033;
}

.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.48;
  filter: saturate(0.7);
}

.tabs {
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 0;
  background: transparent;
}

.tab {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(38, 51, 76, 0.62);
  font-weight: 680;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.42);
  color: #182033;
}

.tab.active {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.66);
  color: #182033;
  box-shadow: 0 12px 28px rgba(101, 126, 160, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.progress-strip {
  margin: 0 16px 12px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.34);
}

.progress-strip span {
  color: rgba(63, 77, 103, 0.62);
}

.progress-strip span.active,
.progress-strip span.done {
  color: #1b2a44;
}

.progress-strip span.done::after {
  background: rgba(121, 151, 200, 0.72);
}

.result-view {
  padding: 18px 20px 22px;
}

.empty-state {
  min-height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 28px;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.18)),
    url("./assets/glass-bubbles-bg.png") right 10% center / min(54%, 520px) auto no-repeat;
  color: #182033;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.empty-state h2 {
  max-width: 560px;
  color: #ffffff;
  color: #182033;
  font-size: clamp(34px, 5vw, 70px);
  font-weight: 430;
  line-height: 1.02;
}

.empty-state p {
  max-width: 470px;
  color: rgba(39, 52, 78, 0.68);
  font-size: 15px;
  line-height: 1.75;
}

.empty-mark {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.18) 34%, rgba(138, 165, 205, 0.22) 70%),
    rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: inset 10px 12px 28px rgba(255, 255, 255, 0.72), inset -14px -14px 28px rgba(91, 116, 148, 0.18), 0 18px 42px rgba(91, 116, 148, 0.18);
}

.overview-grid,
.flow-stage-grid,
.gate-grid,
.framework-visual-grid,
.spec-grid,
.validation-grid,
.render-binding-grid {
  gap: 14px;
}

.branch-head,
.history-head,
.rewrite-head {
  border-bottom: 1px solid rgba(116, 137, 170, 0.14);
}

.branch-head h2,
.history-head h2,
.rewrite-head h2 {
  color: #182033;
  font-weight: 560;
}

.report-actions,
.render-actions {
  gap: 10px;
  margin-bottom: 14px;
}

.report-body {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.56);
  color: #1f2b40;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 18px 46px rgba(94, 116, 146, 0.08);
}

.report-body h1 {
  color: #182033;
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 470;
  letter-spacing: 0;
}

.report-body h2 {
  color: #182033;
  font-size: 24px;
  font-weight: 580;
}

.report-body h3 {
  color: #23304a;
  font-size: 18px;
  font-weight: 720;
}

.report-body h4 {
  color: #46536b;
}

.report-body p,
.report-body li,
.report-body blockquote {
  color: rgba(31, 43, 64, 0.78);
  line-height: 1.86;
}

.report-body blockquote {
  border-left-color: rgba(121, 151, 200, 0.62);
  background: rgba(235, 243, 252, 0.52);
}

.render-gallery,
.render-plan-list,
.history-list {
  scrollbar-color: rgba(121, 151, 200, 0.52) transparent;
}

.render-card img,
.framework-image-card img,
.report-inline-visual img {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.render-card small,
.render-card span,
.render-card p,
.overview-card p,
.overview-card li,
.review-item p,
.flow-stage-card p,
.gate-card p,
.evidence-list p,
.evidence-list small,
.trace-card p,
.trace-card small,
.framework-image-card p,
.report-inline-visual p,
.history-card p,
.history-empty p {
  color: rgba(56, 70, 94, 0.68);
}

.framework-picker {
  border-color: rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.3);
  scrollbar-color: rgba(121, 151, 200, 0.52) transparent;
}

.framework-picker label:has(input:checked) {
  border-color: rgba(108, 142, 194, 0.58);
  background: rgba(228, 239, 252, 0.72);
  color: #182033;
  box-shadow: 0 0 0 3px rgba(128, 158, 205, 0.12);
}

.framework-picker input,
.framework-mode-card input,
.perspective-card input,
.render-mode-card input {
  accent-color: #7693c5;
}

.access-lock,
.rewrite-dialog {
  background:
    linear-gradient(135deg, rgba(232, 240, 250, 0.68), rgba(246, 223, 232, 0.58)),
    rgba(236, 243, 252, 0.68);
  backdrop-filter: blur(18px);
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: #182033;
  box-shadow: 0 18px 44px rgba(90, 112, 145, 0.18);
}

@media (min-width: 781px) {
  .workspace {
    height: clamp(660px, calc(100vh - 124px), 900px);
  }

  .input-panel {
    top: 92px;
  }

  .input-panel form {
    scrollbar-color: rgba(121, 151, 200, 0.52) transparent;
  }

  .input-panel .primary-action[type="submit"] {
    background:
      linear-gradient(135deg, rgba(108, 137, 188, 0.98), rgba(161, 132, 168, 0.9)),
      #7893c5;
  }
}

@media (max-width: 1180px) {
  .app-shell::before {
    background:
      linear-gradient(100deg, rgba(255, 255, 255, 0.76), transparent 50%),
      url("./assets/glass-bubbles-bg.png") right -110px top 72px / 620px auto no-repeat;
    opacity: 0.58;
  }

  .workspace {
    grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
    padding-inline: 18px;
  }
}

@media (max-width: 780px) {
  .topbar {
    top: 10px;
    width: calc(100% - 20px);
    border-radius: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand {
    align-items: flex-start;
    flex: 1 1 100%;
  }

  .toolbar {
    display: flex;
    width: 100%;
    justify-content: flex-end;
  }

  .toolbar .icon-button {
    width: 36px;
    height: 36px;
  }

  h1 {
    font-size: 15px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    padding: 22px 10px 18px;
    gap: 14px;
  }

  .input-panel,
  .output-panel {
    border-radius: 24px;
    min-height: 560px;
  }

  .section-title h2 {
    font-size: 26px;
  }

  .field-grid,
  .model-selector-grid {
    grid-template-columns: 1fr;
  }

  .empty-state {
    min-height: 460px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.34)),
      url("./assets/glass-bubbles-bg.png") right -60px bottom 18px / 360px auto no-repeat;
  }

  .empty-state h2 {
    font-size: 34px;
  }
}

/* Final glass-theme overrides over the earlier neon iteration. */
.input-panel::after {
  display: none;
}

.section-title h2,
.input-panel label,
.input-panel .subsection-label,
.input-panel .form-section label,
.model-select-field > span,
.rewrite-panel label {
  color: #22304a;
}

.input-panel label {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.48);
}

.input-panel input,
.input-panel textarea,
.input-panel select {
  border-color: rgba(105, 127, 160, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.input-panel input:focus,
.input-panel textarea:focus,
.input-panel select:focus {
  border-color: rgba(112, 146, 198, 0.62);
  box-shadow: 0 0 0 4px rgba(133, 166, 211, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.status-dot {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.48);
  color: #384967;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.progress-strip {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(121, 151, 200, 0.36) transparent;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(34px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.68) 52%, rgba(255, 255, 255, 0.16) 72%),
    url("./assets/glass-bubbles-bg.png") right 7% center / min(38%, 430px) auto no-repeat;
}

.empty-state h2 {
  max-width: min(56%, 620px);
  margin-top: 18px;
  color: #172033;
  font-size: clamp(38px, 3.8vw, 50px);
  text-wrap: balance;
}

.empty-state p {
  max-width: min(52%, 500px);
}

@media (max-width: 900px) {
  .empty-state {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.54) 62%, rgba(255, 255, 255, 0.18) 100%),
      url("./assets/glass-bubbles-bg.png") right -42px bottom 22px / 380px auto no-repeat;
  }

  .empty-state h2,
  .empty-state p {
    max-width: 100%;
  }
}

/* Remove the two visible bubble images while keeping the soft glass surface. */
.app-shell::before {
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.68), transparent 46%),
    radial-gradient(circle at 86% 18%, rgba(198, 216, 239, 0.24), transparent 30%),
    radial-gradient(circle at 72% 82%, rgba(246, 220, 231, 0.28), transparent 32%);
}

.empty-state {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.72) 58%, rgba(255, 255, 255, 0.3) 100%),
    radial-gradient(circle at 82% 42%, rgba(214, 228, 246, 0.3), transparent 34%),
    rgba(255, 255, 255, 0.46);
}

@media (max-width: 900px) {
  .empty-state {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.62) 100%),
      radial-gradient(circle at 82% 82%, rgba(214, 228, 246, 0.26), transparent 36%),
      rgba(255, 255, 255, 0.46);
  }
}

/* Full-canvas ribbon background from the provided reference image. */
body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(239, 246, 255, 0.12)),
    url("./assets/ribbon-background.png") center center / cover no-repeat fixed,
    #eef5ff;
}

.app-shell::before {
  background: rgba(255, 255, 255, 0.04);
}

.app-shell::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 30%),
    radial-gradient(circle at 10% 8%, rgba(255, 255, 255, 0.48), transparent 22%),
    radial-gradient(circle at 92% 78%, rgba(214, 228, 246, 0.24), transparent 34%);
}

/* Refinement pass: lighter glass, unified ribbon-tinted states, softer empty state. */
:root {
  --accent: #8b9fe0;
  --accent-dark: #657ac5;
  --blue: #9eb8f0;
  --coral: #e7a4d7;
  --gold: #e9d8b7;
  --neon: #9aa7ea;
  --violet: #d99bd8;
  --flare: #efb4dc;
  --signal: #b7c7f6;
  --line: rgba(117, 134, 178, 0.16);
  --shadow: 0 30px 82px rgba(83, 99, 135, 0.16);
  --inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.topbar {
  width: min(1460px, calc(100% - 44px));
  padding: 13px 15px 13px 20px;
  background: rgba(255, 255, 255, 0.36);
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 22px 62px rgba(92, 108, 143, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(138, 159, 224, 0.08);
}

.input-panel,
.output-panel,
.access-panel,
.rewrite-panel {
  border-color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.28)),
    rgba(249, 252, 255, 0.34);
  box-shadow:
    0 32px 86px rgba(82, 100, 137, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(123, 145, 195, 0.08);
}

.input-panel {
  padding: 21px;
}

.output-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(247, 250, 255, 0.22)),
    rgba(248, 251, 255, 0.3);
}

.section-title {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom-color: rgba(103, 122, 166, 0.11);
}

.section-title h2 {
  font-size: 29px;
  font-weight: 500;
  letter-spacing: 0;
}

.brand-mark,
.icon-button,
.status-dot,
.tab.active,
.secondary-action,
.framework-download,
.paragraph-rewrite-button {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 28px rgba(88, 105, 142, 0.1);
}

.icon-button:hover,
.secondary-action:hover:not(:disabled),
.framework-download:hover,
.paragraph-rewrite-button:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(160, 177, 229, 0.5);
}

.form-section,
.model-selector-section,
.framework-section,
.auto-framework-note,
.model-select-field,
.perspective-card,
.render-mode-card,
.framework-mode-card,
.branch-option,
.branch-node,
.branch-card,
.overview-card,
.concept-card,
.verdict,
.review-item,
.prompt-card,
.flow-overview-card,
.gate-overview-card,
.flow-stage-card,
.gate-card,
.evidence-list article,
.trace-card,
.framework-image-card,
.report-inline-visual,
.material-check-card,
.render-card,
.history-card,
.history-empty {
  border-color: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.22)),
    rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 16px 40px rgba(82, 101, 139, 0.07);
}

.form-section {
  padding: 15px;
}

.form-section .subsection-label,
.subsection-label {
  color: #1f2d49;
}

.form-section .subsection-label::before {
  background: linear-gradient(180deg, rgba(145, 160, 224, 0.62), rgba(226, 154, 212, 0.58));
  box-shadow: 0 0 18px rgba(168, 152, 226, 0.18);
}

input,
textarea,
select,
.input-panel input,
.input-panel textarea,
.input-panel select {
  border-color: rgba(115, 132, 174, 0.16);
  background: rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 20px rgba(87, 106, 143, 0.035);
}

input:focus,
textarea:focus,
select:focus,
.input-panel input:focus,
.input-panel textarea:focus,
.input-panel select:focus {
  border-color: rgba(143, 158, 224, 0.62);
  background: rgba(255, 255, 255, 0.66);
  box-shadow:
    0 0 0 4px rgba(166, 178, 231, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.primary-action,
.input-panel .primary-action[type="submit"] {
  border-color: rgba(255, 255, 255, 0.76);
  background:
    linear-gradient(135deg, rgba(123, 141, 211, 0.88), rgba(221, 151, 211, 0.78)),
    rgba(142, 157, 222, 0.74);
  color: #ffffff;
  font-weight: 720;
  box-shadow:
    0 18px 42px rgba(123, 141, 211, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 0 rgba(78, 91, 145, 0.14);
}

.primary-action:hover:not(:disabled) {
  background:
    linear-gradient(135deg, rgba(135, 153, 224, 0.94), rgba(230, 162, 219, 0.84)),
    rgba(142, 157, 222, 0.78);
  transform: translateY(-1px);
}

.tabs {
  padding: 15px 18px 10px;
}

.tab {
  color: rgba(43, 54, 82, 0.56);
}

.tab.active {
  color: #202c47;
}

.progress-strip {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.26);
  scrollbar-color: rgba(151, 164, 224, 0.34) transparent;
}

.input-panel,
.input-panel form,
.output-panel,
.output-panel .result-view.active,
.progress-strip,
.render-gallery,
.render-plan-list,
.history-list,
.framework-picker {
  scrollbar-color: rgba(151, 164, 224, 0.42) transparent !important;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(151, 164, 224, 0.48);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(218, 156, 216, 0.56);
}

.progress-strip span.active,
.progress-strip span.done {
  color: #293758;
}

.progress-strip span.done::after {
  background: linear-gradient(90deg, rgba(142, 158, 224, 0.7), rgba(224, 159, 214, 0.62));
}

.perspective-card.active,
.render-mode-card:has(input:checked),
.framework-mode-card.active,
.framework-mode-card:has(input:checked),
.branch-option.selected,
.history-card.active,
.framework-picker label:has(input:checked) {
  border-color: rgba(145, 160, 224, 0.54);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(237, 239, 255, 0.42)),
    rgba(255, 255, 255, 0.38);
  box-shadow:
    0 18px 42px rgba(127, 142, 206, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.perspective-card input,
.render-mode-card input,
.framework-mode-card input,
.framework-picker input,
.branch-option input {
  accent-color: #8b9fe0;
}

.perspective-card,
.render-mode-card,
.framework-mode-card,
.framework-picker label,
.branch-option {
  overflow: visible;
}

.framework-mode-card input,
.branch-option input {
  box-sizing: border-box;
  margin: 0;
  border: 1.5px solid rgba(96, 112, 154, 0.72);
  background: rgba(255, 255, 255, 0.82);
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  transform: none;
  overflow: visible;
}

.framework-mode-card input[type="radio"],
.branch-option input[type="radio"] {
  border-radius: 999px;
}

.framework-mode-card input[type="checkbox"],
.branch-option input[type="checkbox"] {
  border-radius: 4px;
}

.framework-mode-card input:checked,
.branch-option input:checked {
  border-color: #5369b9;
  background:
    radial-gradient(circle, #5369b9 0 38%, transparent 41%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(139, 159, 224, 0.16);
}

.framework-mode-card input[type="checkbox"]:checked,
.branch-option input[type="checkbox"]:checked {
  background: #5369b9;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.86),
    0 0 0 3px rgba(139, 159, 224, 0.16);
}

.framework-picker input {
  box-sizing: border-box;
  flex: 0 0 14px;
  margin: 0;
  transform: translateY(0);
}

.status-dot,
.eyebrow,
.brief-list span,
.flow-chain span,
.tag-row span,
.compact-tags span,
.metric-strip span,
.framework-picker label {
  color: rgba(43, 54, 82, 0.7);
}

.framework-picker label {
  min-height: 34px;
  align-items: center;
  padding-top: 7px;
  padding-bottom: 7px;
  line-height: 1.25;
}

.framework-picker input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  flex: 0 0 14px;
  align-self: center;
  margin: 0;
  transform: translateY(0);
  vertical-align: middle;
  overflow: visible;
}

.perspective-card input[type="radio"],
.render-mode-card input[type="radio"],
.framework-mode-card input[type="radio"],
.branch-option input[type="radio"],
.framework-picker input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  box-sizing: border-box !important;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1.5px solid rgba(88, 106, 154, 0.66) !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: none !important;
  line-height: 0 !important;
  overflow: visible !important;
  transform: none !important;
}

.perspective-card input[type="radio"],
.render-mode-card input[type="radio"],
.framework-mode-card input[type="radio"],
.branch-option input[type="radio"] {
  border-radius: 999px !important;
}

.framework-picker input[type="checkbox"] {
  border-radius: 4px !important;
}

.perspective-card input[type="radio"]:checked,
.render-mode-card input[type="radio"]:checked,
.framework-mode-card input[type="radio"]:checked,
.branch-option input[type="radio"]:checked {
  border-color: #5369b9 !important;
  background:
    radial-gradient(circle, #5369b9 0 38%, transparent 42%),
    rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 0 0 3px rgba(139, 159, 224, 0.16) !important;
}

.framework-picker input[type="checkbox"]:checked {
  border-color: #5369b9 !important;
  background: #5369b9 !important;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.86),
    0 0 0 3px rgba(139, 159, 224, 0.16) !important;
}

.perspective-card input[type="radio"],
.render-mode-card input[type="radio"] {
  top: 16px !important;
  left: 14px !important;
}

.framework-mode-card input[type="radio"],
.branch-option input[type="radio"] {
  align-self: flex-start !important;
  margin-top: 2px !important;
}

.framework-picker input[type="checkbox"] {
  align-self: center !important;
  flex: 0 0 14px !important;
}

.empty-state {
  min-height: 520px;
  justify-content: center;
  align-items: center;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.22)),
    radial-gradient(circle at 50% 26%, rgba(255, 255, 255, 0.72), transparent 26%),
    radial-gradient(circle at 70% 76%, rgba(229, 165, 217, 0.13), transparent 36%),
    rgba(255, 255, 255, 0.3);
}

.empty-state h2 {
  max-width: 720px;
  margin-top: 12px;
  font-size: clamp(34px, 3.4vw, 46px);
  font-weight: 430;
  line-height: 1.12;
}

.empty-state p {
  max-width: 520px;
  color: rgba(43, 54, 82, 0.58);
  font-size: 14px;
  line-height: 1.78;
}

.report-body {
  background: rgba(255, 255, 255, 0.5);
}

.report-body h1 {
  font-weight: 430;
}

@media (max-width: 780px) {
  .topbar {
    width: calc(100% - 22px);
    background: rgba(255, 255, 255, 0.48);
  }

  .input-panel,
  .output-panel {
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.36)),
      rgba(249, 252, 255, 0.36);
  }

  .empty-state {
    min-height: 430px;
    padding: 34px 24px;
  }

  .empty-state h2 {
    font-size: 32px;
  }
}

.progress-strip span {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(43, 54, 82, 0.56);
}

.progress-strip span.active,
.progress-strip span.done {
  border-color: rgba(151, 164, 224, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(238, 232, 255, 0.42)),
    rgba(255, 255, 255, 0.3);
  color: #273657;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.progress-strip span.active {
  background:
    linear-gradient(135deg, rgba(226, 231, 255, 0.72), rgba(248, 219, 244, 0.58)),
    rgba(255, 255, 255, 0.44);
}

.flow-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: -2px 0 12px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(246, 249, 255, 0.2)),
    rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 14px 32px rgba(82, 101, 139, 0.07);
}

.flow-nav-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 6px;
  align-items: center;
  min-width: 0;
  min-height: 56px;
  padding: 8px;
  border: 1px solid rgba(128, 145, 189, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.34);
  color: #24314f;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.flow-nav-item:hover,
.flow-nav-item.active {
  border-color: rgba(151, 164, 224, 0.45);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(240, 234, 255, 0.42)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 10px 24px rgba(95, 112, 154, 0.09);
  transform: translateY(-1px);
}

.flow-nav-index {
  grid-row: span 2;
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: rgba(43, 54, 82, 0.56);
  font-size: 11px;
  font-weight: 800;
}

.flow-nav-title {
  overflow: hidden;
  color: #1f2d49;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-nav-status {
  justify-self: start;
  padding: 2px 6px;
  border: 1px solid rgba(117, 134, 178, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  color: rgba(43, 54, 82, 0.56);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
}

.flow-nav-item[data-status="filled"] .flow-nav-status {
  border-color: rgba(82, 168, 141, 0.26);
  background: rgba(217, 248, 239, 0.54);
  color: #19715e;
}

.flow-nav-item[data-status="needs"] .flow-nav-status {
  border-color: rgba(223, 153, 89, 0.28);
  background: rgba(255, 238, 212, 0.56);
  color: #966123;
}

.flow-nav-item[data-status="locked"] .flow-nav-status {
  border-color: rgba(129, 145, 210, 0.3);
  background: linear-gradient(135deg, rgba(229, 233, 255, 0.66), rgba(249, 224, 246, 0.52));
  color: #5866a5;
}

.flow-nav-item[data-status="locked"] .flow-nav-index {
  color: #5866a5;
}

.hidden,
.empty-state.hidden,
.branch-desk.hidden,
.overview-grid.hidden,
.rewrite-dialog.hidden,
.access-lock.hidden {
  display: none !important;
}

@media (max-width: 780px) {
  .flow-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 18px;
  }

  .flow-nav-item {
    min-height: 52px;
  }
}

@media (max-width: 420px) {
  .flow-nav {
    grid-template-columns: 1fr;
  }
}

.topbar .example-select {
  height: 40px;
  min-width: 86px;
  flex: 0 0 auto;
  padding: 0 30px 0 14px;
  border: 1px solid rgba(188, 200, 239, 0.46);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #26304a;
  font-size: 13px;
  font-weight: 800;
  outline: none;
  backdrop-filter: blur(18px);
}

.topbar .example-select option {
  color: #1f2d49;
  background: #ffffff;
}

.topbar {
  width: min(1580px, calc(100% - 44px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 18px;
  overflow: hidden;
}

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

.topbar .toolbar {
  min-width: 0;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 3px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.topbar .toolbar .icon-button {
  flex: 0 0 38px;
}

@media (max-width: 780px) {
  .topbar {
    width: calc(100% - 22px);
    grid-template-columns: minmax(0, 1fr);
    row-gap: 10px;
    border-radius: 24px;
    align-items: start;
  }

  .topbar .toolbar {
    width: 100%;
    justify-self: stretch;
  }

  .topbar .example-select {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.auto-framework-note strong {
  color: #30416d !important;
  text-shadow: none !important;
}

.auto-framework-note span {
  color: #52617f !important;
}
