:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-soft: #f8f7f3;
  --ink: #20221f;
  --muted: #6b6e68;
  --line: #deded7;
  --line-strong: #b9bbb3;
  --green: #2e6a4b;
  --green-soft: #e9f2ec;
  --blue: #315f80;
  --blue-soft: #e9f1f7;
  --red: #a54237;
  --red-soft: #f7ece9;
  --amber: #a16b22;
  --amber-soft: #f6efe2;
  --shadow: 0 12px 40px rgba(32, 34, 31, 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }
button { color: inherit; }

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

.topbar {
  height: 68px;
  padding: 0 clamp(18px, 3vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand, .topbar-actions, .brand > div { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand > div { gap: 10px; min-width: 0; }
.brand strong { font-size: 15px; white-space: nowrap; }
.brand > div > span { font-size: 12px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: #fff; border-radius: 6px; font-size: 15px; font-weight: 700; }
.topbar-actions { gap: 10px; }
.status-badge { height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid #bfd5c6; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 650; }
.status-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.icon-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; font-weight: 700; }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-soft); }

main { width: min(1480px, 100%); margin: 0 auto; padding: 22px clamp(14px, 3vw, 42px) 48px; }

.notice {
  min-height: 50px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #c8d8cf;
  border-left: 4px solid var(--green);
  background: var(--green-soft);
}
.notice > div { display: flex; align-items: baseline; gap: 10px; }
.notice strong { font-size: 13px; }
.notice span, .notice li { color: #4d6256; font-size: 12px; }
.notice ul { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; }
.notice li { position: relative; padding-left: 10px; white-space: nowrap; }
.notice li::before { content: ""; width: 3px; height: 3px; background: var(--green); border-radius: 50%; position: absolute; left: 0; top: 7px; }

.section-tabs { margin-top: 18px; min-height: 48px; display: flex; align-items: flex-end; gap: 28px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; }
.section-tab { position: relative; height: 47px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; }
.section-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.section-tab:hover { color: var(--ink); }
.section-tab.active { color: var(--ink); font-weight: 700; }
.section-tab.active::after { background: var(--ink); }

.section { display: none; }
.section.active { display: block; }

.mobile-view-tabs { display: none; }

.workbench {
  margin-top: 20px;
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(230px, 0.78fr) minmax(420px, 1.55fr) minmax(260px, 0.9fr);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.task-panel, .conversation-panel, .execution-panel { min-width: 0; }
.task-panel { border-right: 1px solid var(--line); background: var(--surface-soft); }
.execution-panel { border-left: 1px solid var(--line); background: var(--surface-soft); }
.panel-heading, .conversation-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); }
.eyebrow { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; line-height: 1; font-weight: 750; text-transform: uppercase; }
.panel-heading h1, .panel-heading h2, .conversation-header h2 { margin: 0; font-size: 17px; line-height: 1.25; }
.count { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-size: 13px; }

.scenario-list { padding: 8px; }
.scenario-button { width: 100%; min-height: 74px; display: grid; grid-template-columns: 35px 1fr; gap: 10px; align-items: start; padding: 13px 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.scenario-button:hover { background: #fff; border-color: var(--line); }
.scenario-button.active { background: #fff; border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(32, 34, 31, 0.05); }
.scenario-number { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.scenario-button.active .scenario-number { color: #fff; border-color: var(--ink); background: var(--ink); }
.scenario-copy strong { display: block; font-size: 13px; line-height: 1.3; }
.scenario-copy span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.scope-summary { margin: 8px 16px 18px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.scope-summary span { color: var(--muted); font-size: 10px; }
.scope-summary strong { display: block; margin: 7px 0; font-size: 12px; }
.scope-summary p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

.conversation-panel { display: flex; flex-direction: column; background: var(--surface); }
.simulation-label { padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 10px; }
.messages { flex: 1; padding: 24px clamp(18px, 3vw, 36px); overflow: auto; }
.message { display: grid; grid-template-columns: 30px 1fr; gap: 12px; margin-bottom: 22px; }
.message-avatar { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 700; }
.message.agent .message-avatar { color: #fff; background: var(--ink); border-color: var(--ink); }
.message-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.message-meta strong { font-size: 11px; }
.message-meta span { color: var(--muted); font-size: 10px; }
.message-body { max-width: 680px; color: #3e413d; font-size: 13px; line-height: 1.65; }
.message-body p { margin: 0 0 8px; }
.message-body p:last-child { margin-bottom: 0; }
.message-body ul { margin: 8px 0 0; padding-left: 18px; }
.message-body li { margin: 4px 0; }
.inline-status { display: inline-block; margin-right: 5px; padding: 1px 6px; border-radius: 4px; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-weight: 700; }
.composer { margin: 0 20px 20px; display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; overflow: hidden; }
.composer:focus-within { border-color: var(--ink); }
.composer input { min-width: 0; height: 44px; padding: 0 14px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.composer button { margin: 5px; padding: 0 14px; border: 0; border-radius: 4px; color: #fff; background: var(--ink); font-size: 11px; cursor: pointer; }
.composer button:hover { background: #353833; }
.composer p { grid-column: 1 / -1; margin: 0; padding: 7px 12px; border-top: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 9px; }

.execution-heading { padding-inline: 18px; }
.run-state { padding: 4px 7px; border-radius: 4px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 700; }
.run-state.blocked { color: var(--red); background: var(--red-soft); }
.execution-list { margin: 0; padding: 20px 18px 8px; list-style: none; counter-reset: trace; }
.execution-list li { position: relative; min-height: 62px; padding: 0 0 20px 34px; counter-increment: trace; }
.execution-list li::before { content: counter(trace); position: absolute; left: 0; top: 0; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 750; }
.execution-list li::after { content: ""; position: absolute; left: 9px; top: 24px; bottom: 4px; width: 1px; background: var(--line); }
.execution-list li:last-child::after { display: none; }
.execution-list strong { display: block; font-size: 11px; line-height: 1.4; }
.execution-list span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.approval-gate { margin: 4px 18px 18px; padding: 14px; border-left: 3px solid var(--amber); background: var(--amber-soft); }
.approval-gate.blocked { border-left-color: var(--red); background: var(--red-soft); }
.approval-gate span { color: var(--muted); font-size: 9px; font-weight: 750; }
.approval-gate strong { display: block; margin: 6px 0 4px; font-size: 12px; }
.approval-gate p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.content-section { margin-top: 20px; padding: clamp(28px, 4vw, 56px); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.content-header { max-width: 720px; margin-bottom: 36px; }
.content-header h2 { margin: 0 0 10px; font-size: clamp(24px, 3vw, 36px); line-height: 1.2; }
.content-header p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.matrix { border-top: 2px solid var(--ink); }
.matrix-row { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.matrix-row span { min-height: 54px; display: flex; align-items: center; padding: 13px 16px; border-right: 1px solid var(--line); font-size: 12px; line-height: 1.45; }
.matrix-row span:last-child { border-right: 0; }
.matrix-head span { min-height: 46px; font-size: 11px; font-weight: 750; background: var(--surface-soft); }
.matrix-head span:nth-child(1) { color: var(--green); }
.matrix-head span:nth-child(2) { color: var(--amber); }
.matrix-head span:nth-child(3) { color: var(--red); }
.boundary-strip { margin-top: 24px; padding: 18px 20px; display: grid; grid-template-columns: 100px 1fr; gap: 18px; background: var(--ink); color: #fff; }
.boundary-strip strong { font-size: 12px; }
.boundary-strip p { margin: 0; color: #d8d9d5; font-size: 12px; line-height: 1.6; }

.standard-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.standard-column { padding: 30px 32px 34px; }
.standard-column:first-child { border-right: 1px solid var(--line); padding-left: 0; }
.standard-column:last-child { padding-right: 0; }
.standard-title { display: flex; align-items: center; gap: 14px; }
.standard-index { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: var(--blue); font: 700 11px ui-monospace, monospace; }
.fashion-standard .standard-index { background: var(--red); }
.standard-title strong, .standard-title small { display: block; }
.standard-title strong { font-size: 16px; }
.standard-title small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.standard-column > ul { margin: 26px 0; padding: 0; list-style: none; }
.standard-column > ul li { position: relative; margin: 13px 0; padding-left: 17px; color: #484b46; font-size: 12px; line-height: 1.5; }
.standard-column > ul li::before { content: ""; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; background: var(--blue); }
.fashion-standard > ul li::before { background: var(--red); }
.visual-check { height: 66px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #cbd9e2; background: var(--blue-soft); }
.visual-check span { color: var(--blue); font-size: 10px; font-weight: 700; }
.visual-check i { width: 18px; height: 1px; background: #91adbf; }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-pair > div { aspect-ratio: 3 / 2; padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid #dbcac7; background: var(--red-soft); }
.photo-pair span { margin-bottom: auto; color: var(--red); font: 700 9px ui-monospace, monospace; }
.photo-pair b { font-size: 11px; }
.photo-pair small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.workflow-line { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.workflow-line li { position: relative; min-height: 190px; padding: 26px 16px 20px; border-right: 1px solid var(--line); }
.workflow-line li:last-child { border-right: 0; }
.workflow-line li > span { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 32px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font: 700 9px ui-monospace, monospace; background: #fff; }
.workflow-line small, .workflow-line strong { display: block; }
.workflow-line small { margin-bottom: 7px; color: var(--green); font-size: 9px; font-weight: 750; }
.workflow-line strong { font-size: 12px; line-height: 1.4; }
.workflow-line p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.workflow-line .human-step { background: var(--amber-soft); }
.workflow-line .human-step small { color: var(--amber); }
.workflow-line .manual-only { background: var(--red-soft); }
.workflow-line .manual-only small { color: var(--red); }

.access-steps { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.access-steps li { min-height: 190px; display: grid; grid-template-columns: 42px 1fr; gap: 16px; padding: 28px 22px; border-right: 1px solid var(--line); }
.access-steps li:last-child { border-right: 0; }
.access-steps li > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 5px; color: #fff; background: var(--ink); font: 700 10px ui-monospace, monospace; }
.access-steps small, .access-steps strong { display: block; }
.access-steps small { margin-bottom: 8px; color: var(--green); font-size: 9px; font-weight: 750; }
.access-steps strong { font-size: 13px; line-height: 1.45; }
.access-steps p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.access-callout { margin-top: 24px; padding: 20px; display: grid; grid-template-columns: minmax(190px, 0.7fr) minmax(280px, 1.3fr); gap: 28px; align-items: center; color: #fff; background: var(--ink); }
.access-callout strong { font-size: 13px; }
.access-callout p { margin: 0; color: #d8d9d5; font-size: 11px; line-height: 1.65; }

.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-strong); }
.privacy-grid > div { min-height: 140px; padding: 24px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.privacy-grid > div:nth-child(2n) { border-right: 0; }
.privacy-grid strong { font-size: 13px; }
.privacy-grid p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.local-file-note { margin-top: 24px; display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center; padding: 16px; border: 1px solid #bfd5c6; background: var(--green-soft); }
.local-file-note > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-weight: 700; }
.local-file-note p { margin: 0; color: #425749; font-size: 11px; line-height: 1.55; }

footer { width: min(1480px, 100%); margin: 0 auto; padding: 0 clamp(14px, 3vw, 42px) 28px; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }

dialog { width: min(520px, calc(100% - 32px)); padding: 30px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink); background: #fff; box-shadow: 0 22px 70px rgba(0, 0, 0, 0.2); }
dialog::backdrop { background: rgba(25, 27, 24, 0.48); }
dialog h2 { margin: 0 0 12px; font-size: 22px; }
dialog p, dialog li { color: var(--muted); font-size: 12px; line-height: 1.65; }
dialog ul { margin: 18px 0 0; padding-left: 18px; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 4px; background: var(--surface-soft); cursor: pointer; font-size: 18px; }

@media (max-width: 980px) {
  .notice { align-items: flex-start; }
  .notice ul { display: grid; gap: 4px; }
  .workbench { grid-template-columns: 220px minmax(370px, 1fr); }
  .execution-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 220px 1fr 280px; border-left: 0; border-top: 1px solid var(--line); }
  .execution-panel .panel-heading { border-bottom: 0; border-right: 1px solid var(--line); }
  .execution-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .execution-list li::after { display: none; }
  .approval-gate { align-self: center; }
  .workflow-line { grid-template-columns: repeat(3, 1fr); }
  .workflow-line li:nth-child(3) { border-right: 0; }
  .workflow-line li:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .topbar { height: 60px; padding-inline: 14px; }
  .brand > div { display: block; }
  .brand > div > span { display: block; margin-top: 2px; padding-left: 0; border-left: 0; }
  .status-badge { display: none; }
  main { padding-top: 14px; }
  .notice { display: block; padding: 12px 14px; }
  .notice > div { display: block; }
  .notice > div span { display: block; margin-top: 4px; }
  .notice ul { margin-top: 8px; }
  .notice li { white-space: normal; }
  .section-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 10px; align-items: stretch; overflow: visible; }
  .section-tab { width: 100%; height: 42px; border-bottom: 1px solid var(--line); }
  .mobile-view-tabs { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-bottom: 0; background: var(--surface-soft); }
  .mobile-view-tab { height: 40px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; }
  .mobile-view-tab:last-child { border-right: 0; }
  .mobile-view-tab.active { background: var(--ink); color: #fff; }
  .workbench { display: block; min-height: 610px; margin-top: 0; box-shadow: none; }
  .mobile-view { display: none; min-height: 608px; border: 0; }
  .mobile-view.active { display: flex; flex-direction: column; }
  .task-panel.active { background: var(--surface-soft); }
  .execution-panel.active { display: flex; }
  .messages { min-height: 420px; padding: 18px 14px; }
  .composer { margin: 0 12px 12px; }
  .execution-list { display: block; width: 100%; }
  .content-section { margin-top: 14px; padding: 26px 18px; box-shadow: none; }
  .content-header { margin-bottom: 26px; }
  .matrix { overflow-x: auto; }
  .matrix-row { min-width: 650px; }
  .boundary-strip { grid-template-columns: 1fr; gap: 7px; }
  .standard-grid { grid-template-columns: 1fr; }
  .standard-column { padding: 26px 0; }
  .standard-column:first-child { padding-left: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .standard-column:last-child { padding-right: 0; }
  .workflow-line { grid-template-columns: 1fr 1fr; }
  .workflow-line li { min-height: 160px; border-bottom: 1px solid var(--line); }
  .workflow-line li:nth-child(2n) { border-right: 0; }
  .workflow-line li:nth-child(3) { border-right: 1px solid var(--line); }
  .workflow-line li:nth-last-child(-n+2) { border-bottom: 0; }
  .access-steps { grid-template-columns: 1fr; }
  .access-steps li { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .access-steps li:last-child { border-bottom: 0; }
  .access-callout { grid-template-columns: 1fr; gap: 10px; }
  .privacy-grid { grid-template-columns: 1fr; }
  .privacy-grid > div { min-height: auto; border-right: 0; }
  footer { gap: 12px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
