:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #151821;
  --muted: #687083;
  --line: #e3e7ef;
  --soft: #eef2ff;
  --accent: #3d52d5;
  --accent-dark: #2c3db1;
  --good: #087a55;
  --warn: #9b6400;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.shell { max-width: 1220px; margin: 0 auto; padding: 48px 24px 72px; }
.hero { display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; margin-bottom: 30px; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
h1 { font-size: clamp(42px, 7vw, 72px); line-height: .95; margin: 10px 0 14px; letter-spacing: -.055em; }
.hero p { color: var(--muted); margin: 0; font-size: 18px; }
.trust { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 10px 15px; white-space: nowrap; font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab, button { font: inherit; cursor: pointer; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 10px 16px; border-radius: 10px; font-weight: 650; }
.tab.active { background: var(--ink); color: white; }
.panel { display: none; }
.panel.active { display: block; }
.workspace { display: grid; gap: 18px; }
.chat-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); }
.single-grid { grid-template-columns: 1fr; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 35px rgba(30, 40, 80, .055); padding: 22px; }
.card-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
h2 { margin: 0 0 5px; font-size: 19px; }
.card-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.messages { min-height: 310px; max-height: 520px; overflow-y: auto; padding: 4px 2px 16px; display: flex; flex-direction: column; gap: 11px; }
.message { max-width: 84%; padding: 11px 14px; border-radius: 14px; line-height: 1.6; white-space: pre-wrap; font-size: 14px; }
.message.user { align-self: flex-end; background: var(--ink); color: white; border-bottom-right-radius: 4px; }
.message.assistant { align-self: flex-start; background: #f1f3f8; border-bottom-left-radius: 4px; }
.field-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 4px 0 7px; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--line); background: #fbfcfe; color: var(--ink); border-radius: 12px; padding: 12px 13px; outline: none; font: inherit; line-height: 1.55; }
textarea:focus { border-color: #9da9f2; box-shadow: 0 0 0 3px rgba(61, 82, 213, .09); }
.jd-input { min-height: 300px; margin-bottom: 12px; }
.jd-input.compact { min-height: 90px; max-height: 180px; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.composer textarea { min-height: 54px; max-height: 180px; }
.primary { border: 0; background: var(--accent); color: white; border-radius: 11px; padding: 12px 18px; font-weight: 700; min-height: 45px; }
.primary:hover { background: var(--accent-dark); }
.primary:disabled { opacity: .55; cursor: not-allowed; }
.ghost { border: 1px solid var(--line); background: white; border-radius: 10px; padding: 8px 11px; color: var(--muted); }
.meta { margin-top: 12px; font-size: 12px; color: var(--muted); }
.trace, .result { border-top: 1px solid var(--line); padding-top: 16px; }
.empty { color: var(--muted); font-size: 13px; }
.trace-step { display: grid; grid-template-columns: 28px 1fr; gap: 10px; position: relative; padding: 0 0 17px; }
.trace-step:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 1px; background: var(--line); }
.trace-dot { width: 27px; height: 27px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; color: var(--accent); font-size: 12px; font-weight: 800; }
.trace-label { font-size: 12px; font-weight: 800; margin-bottom: 3px; }
.trace-value { color: var(--muted); font-size: 13px; line-height: 1.5; }
.trace-evidence { font-size: 11px; margin-top: 5px; color: var(--accent); }
.requirement { border: 1px solid var(--line); border-radius: 13px; padding: 13px; margin-top: 10px; }
.requirement-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 750; font-size: 13px; }
.requirement p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.badge { padding: 3px 7px; border-radius: 999px; background: #f1f3f8; font-size: 11px; white-space: nowrap; }
.error { color: var(--danger); }
code { background: #f1f3f8; padding: 2px 5px; border-radius: 5px; }
@media (max-width: 860px) {
  .chat-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; flex-direction: column; }
  .trust { white-space: normal; }
  .composer { grid-template-columns: 1fr; }
}
