:root {
  color-scheme: dark;
  --ink: #101411;
  --paper: #f5f3eb;
  --paper-deep: #e9e6da;
  --lime: #b8ff42;
  --green-dark: #6fb816;
  --bg: #0d100e;
  --panel: #151a17;
  --panel-2: #1c221e;
  --panel-3: #242b26;
  --line: rgba(255,254,248,.1);
  --line-strong: rgba(255,254,248,.18);
  --text: #fffef8;
  --text-secondary: #d5dbd5;
  --text-tertiary: #778078;
  --muted: #99a29a;
  --accent: #b8ff42;
  --accent-hover: #c7ff68;
  --accent-soft: rgba(184,255,66,.09);
  --accent-subtle: rgba(184,255,66,.055);
  --accent-border: rgba(184,255,66,.32);
  --accent-focus: rgba(184,255,66,.2);
  --accent-glow: rgba(184,255,66,.36);
  --control: #1c221e;
  --control-hover: #252c27;
  --input: #101411;
  --selected: rgba(184,255,66,.09);
  --hover-overlay: rgba(255,254,248,.045);
  --topbar: #101411;
  --statusbar: #0d100e;
  --scrollbar: #465047;
  --warning: #e5ad4f;
  --danger: #f18484;
  --logic: #d8f7c0;
  --ladder-wire: #aeb7af;
  --ladder-surface: #101411;
  --shadow: 0 16px 40px rgba(0,0,0,.2);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-ui);
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  font-family: var(--font-ui);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.topbar { position: relative; height: 76px; display: flex; align-items: center; gap: 14px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--topbar); box-shadow: 0 5px 18px rgba(0,0,0,.22); }
.topbar::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 1px; background: linear-gradient(90deg, var(--accent) 0 112px, var(--accent-border) 260px, transparent 520px); opacity: .8; }
.brand-copy { min-width: 0; display: grid; gap: 5px; }
.brand-copy h1 { max-width: min(48vw, 680px); margin: 0; overflow: hidden; color: var(--text); font-family: var(--font-display); font-size: 19px; font-weight: 680; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy p { min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font: 10px/1.2 var(--font-mono); letter-spacing: .015em; }
.brand-copy p > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-kind { display: inline-flex; align-items: center; min-height: 18px; padding: 0 6px; border: 1px solid var(--accent-border); border-radius: 4px; color: var(--accent); background: var(--accent-subtle); font: 750 8px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.badge { display: inline-flex; align-items: center; height: 28px; padding: 0 9px; border-radius: 4px; font-family: var(--font-ui); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.badge-safe { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); }
.badge-safe::before { content: ""; width: 5px; height: 5px; margin-right: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.badge-danger { color: var(--danger); background: rgba(241,132,132,.08); border: 1px solid rgba(241,132,132,.35); }
.button { border: 1px solid var(--line-strong); border-radius: 7px; padding: 9px 13px; cursor: pointer; transition: .15s ease; background: var(--control); font-family: var(--font-ui); font-weight: 600; letter-spacing: 0; }
.button:hover { transform: translateY(-1px); border-color: var(--accent-border); background: var(--control-hover); }
.button:disabled { opacity: .5; cursor: wait; transform: none; }
.button-primary { border-color: var(--accent); background: var(--accent); color: #ffffff; font-weight: 700; }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-quiet { color: var(--muted); background: transparent; }
.warning-banner { min-height: 50px; display: grid; grid-template-columns: 24px minmax(0, 1fr) 30px; align-items: center; gap: 11px; padding: 8px 14px 8px 18px; color: #f5c96d; background: linear-gradient(90deg, #352817, #2c2418); border-bottom: 1px solid rgba(229,173,79,.36); box-shadow: inset 3px 0 0 var(--warning), 0 5px 16px rgba(0,0,0,.12); }
.warning-icon { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid rgba(245,201,109,.48); border-radius: 50%; background: rgba(229,173,79,.11); font-size: 13px; font-weight: 800; }
.warning-copy { min-width: 0; display: flex; align-items: baseline; gap: 8px; font-size: 11px; line-height: 1.45; }
.warning-copy strong { flex: 0 0 auto; color: #ffe0a0; font-size: 11px; font-weight: 700; }
.warning-copy span { color: #d9c59e; }
.warning-dismiss { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; color: #d9c59e; background: transparent; cursor: pointer; transition: color .15s ease, background .15s ease; }
.warning-dismiss:hover { color: #fff0cd; background: rgba(255,255,255,.08); }
.warning-dismiss:focus-visible { outline: 2px solid var(--warning); outline-offset: 1px; }
.warning-dismiss svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.workspace { --sidebar-width: 300px; --assistant-width: 370px; height: calc(100vh - 104px); display: grid; grid-template-columns: var(--sidebar-width) 8px minmax(320px, 1fr) 8px var(--assistant-width); gap: 0; padding: 8px; }
.warning-banner:not(.hidden) + .workspace { height: calc(100vh - 154px); }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); }
.pane-resize { position: relative; z-index: 2; cursor: col-resize; touch-action: none; outline: none; }
.pane-resize::after { content: ""; position: absolute; top: 10px; bottom: 10px; left: 3px; width: 2px; border-radius: 999px; background: transparent; transition: background .15s ease, box-shadow .15s ease; }
.pane-resize:hover::after, .pane-resize:focus-visible::after, .pane-resize.active::after { background: var(--accent); box-shadow: 0 0 7px var(--accent-glow); }
body.resizing-panes { cursor: col-resize; user-select: none; }
body.resizing-panes iframe { pointer-events: none; }
.sidebar { display: flex; min-height: 0; flex-direction: column; overflow: hidden; padding: 13px 11px 9px; }
.panel-title { margin: 0 2px 9px; color: var(--text-secondary); font-family: var(--font-ui); font-size: 12px; font-weight: 650; letter-spacing: -.005em; }
.search-row { display: flex; gap: 5px; }
input, select, textarea { color: var(--text); background: var(--input); border: 1px solid var(--line-strong); border-radius: 7px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-focus); }
.search-row input { min-width: 0; flex: 1; padding: 9px 10px; }
.icon-button { width: 37px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--control); cursor: pointer; font-size: 20px; color: var(--accent); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 6px 0 10px; }
.filters select { min-width: 0; padding: 7px; font-size: 11px; color: var(--muted); }
.scroll-area { overflow: auto; scrollbar-color: var(--scrollbar) transparent; scrollbar-width: thin; }
.tree, .results { min-height: 0; flex: 1 1 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 7px 10px 7px 1px; }
.sidebar .scroll-area::-webkit-scrollbar { width: 7px; }
.sidebar .scroll-area::-webkit-scrollbar-track { background: transparent; }
.sidebar .scroll-area::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: var(--scrollbar); background-clip: padding-box; }
.search-results-summary { padding: 2px 8px 8px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.tree-section-label { margin: 12px 9px 7px; color: var(--text-tertiary); font-size: 11px; font-weight: 500; }
.tree-group { margin: 1px 0; }
.tree-summary { min-width: 0; height: 34px; display: grid; grid-template-columns: 12px 18px minmax(0, 1fr) auto; align-items: center; gap: 7px; list-style: none; cursor: pointer; padding: 0 8px; border-radius: 8px; color: var(--text-secondary); font-family: var(--font-ui); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.tree-summary::-webkit-details-marker { display: none; }
.tree-summary:hover { background: var(--hover-overlay); }
.tree-chevron { color: var(--text-tertiary); font-size: 17px; line-height: 1; transition: transform .12s; }
details[open] > .tree-summary .tree-chevron { transform: rotate(90deg); }
.tree-children { margin-left: 14px; padding-left: 8px; border-left: 1px solid rgba(128,128,128,.14); }
.tree-item, .result-item { width: 100%; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; color: var(--text-secondary); }
.tree-item { min-width: 0; height: 34px; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 0 9px; font-size: 12px; }
.tree-item:hover, .result-item:hover { color: var(--text); background: var(--hover-overlay); box-shadow: none; }
.tree-item.active { color: var(--text); background: var(--selected); box-shadow: none; }
.tree-icon { width: 18px; height: 18px; display: grid; place-items: center; color: var(--muted); }
.tree-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.tree-item.active .tree-icon { color: var(--accent); }
.tree-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-count, .tree-meta { color: var(--text-tertiary); font-size: 10px; font-weight: 450; }
.result-item { padding: 10px 8px; margin: 2px 0; border-bottom: 1px solid var(--line); }
.result-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.result-name { margin: 4px 0 3px; color: var(--text); font-size: 12px; font-weight: 700; }
.result-snippet { color: var(--muted); font-size: 11px; line-height: 1.4; }
.content { padding: 24px 26px; }
.empty-state { min-height: 100%; display: grid; place-items: center; text-align: center; }
.empty-inner { max-width: 560px; }
.empty-kicker, .eyebrow { color: var(--accent); font-family: var(--font-ui); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.empty-state h2 { margin: 12px 0 10px; font-family: var(--font-ui); font-size: clamp(27px, 3vw, 40px); font-weight: 650; letter-spacing: -.035em; }
.empty-state p { color: var(--muted); line-height: 1.65; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-heading-main { min-width: 0; display: flex; align-items: flex-start; gap: 11px; }
.page-heading h2 { margin: 0; font-family: var(--font-ui); font-size: 26px; font-weight: 650; letter-spacing: -.025em; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.navigation-back { height: 32px; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; margin-top: 1px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text-secondary); background: var(--control); cursor: pointer; font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: 0; transition: .15s ease; }
.navigation-back span { color: var(--accent); font-size: 16px; line-height: 1; }
.navigation-back:hover, .navigation-back:focus-visible { border-color: var(--accent); color: var(--text); background: var(--accent-soft); outline: none; transform: translateX(-1px); }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 18px; }
.summary-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metric { min-width: 0; padding: 13px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.metric-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metric-value { margin-top: 6px; font-family: var(--font-ui); font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric.count .metric-value { color: var(--accent); font-size: 22px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 23px 0 9px; color: var(--muted); font-family: var(--font-ui); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.section-title::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, var(--line), transparent); }
.description { color: var(--text-secondary); line-height: 1.6; font-size: 13px; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.data-table th { padding: 8px 9px; text-align: left; color: var(--muted); background: var(--panel-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-strong); font-family: var(--font-ui); font-size: 9px; font-weight: 650; letter-spacing: .06em; }
.data-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: var(--accent-subtle); }
.logic { color: var(--logic); font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.logic-block { padding: 15px; background: var(--input); border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ladder-routine { display: grid; gap: 12px; }
.ladder-rung-card { min-width: 0; overflow: hidden; border: 1px solid #35464c; border-radius: 5px; background: var(--ladder-surface); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.ladder-rung-card.interactive { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.ladder-rung-card.interactive:hover, .ladder-rung-card.interactive:focus-visible { border-color: var(--accent); box-shadow: 0 8px 28px rgba(0,0,0,.2), 0 0 0 1px var(--accent-focus); outline: none; transform: translateY(-1px); }
.ladder-rung-comment { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #1b1b1b; }
.ladder-rung-comment > span { padding-top: 2px; color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .1em; }
.ladder-rung-comment p { margin: 0; color: #b8c7cb; font-size: 11px; line-height: 1.45; white-space: pre-wrap; }
.ladder-canvas { max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-color: var(--scrollbar) transparent; scrollbar-width: thin; }
.ladder-network { display: grid; grid-template-columns: 54px minmax(640px, 1fr) 20px; width: max-content; min-width: 100%; padding: 9px 12px 9px 0; color: var(--ladder-wire); }
.ladder-rung-index { position: relative; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-right: 3px solid var(--ladder-wire); color: var(--muted); font-variant-numeric: tabular-nums; }
.ladder-rung-index span { font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.ladder-rung-index strong { color: var(--text); font: 750 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ladder-logic { min-width: 0; display: flex; align-items: center; }
.ladder-right-rail { min-height: 92px; border-left: 3px solid var(--ladder-wire); }
.ladder-sequence { position: relative; min-width: max-content; min-height: 76px; display: flex; flex: 1 0 auto; align-items: center; }
.ladder-sequence::before { content: ""; position: absolute; z-index: 0; top: 50%; right: 0; left: 0; border-top: 2px solid var(--ladder-wire); transform: translateY(-1px); }
.ladder-sequence-root { width: 100%; min-width: 620px; }
.ladder-node { position: relative; z-index: 2; width: 126px; min-height: 70px; display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; justify-content: center; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ladder-output { margin-left: auto; }
.ladder-operand { max-width: 150px; min-height: 27px; display: flex; align-items: end; justify-content: center; padding: 0 5px 4px; color: #d7e5e8; font-size: 10px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.ladder-contact-symbol, .ladder-coil-symbol { position: relative; z-index: 2; min-width: 58px; padding: 0 5px; color: #dce8ea; background: var(--ladder-surface); font: 750 22px/22px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; text-align: center; }
.ladder-mnemonic { margin-top: 4px; color: #6f8a91; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.ladder-block { width: 176px; min-height: 74px; align-self: center; justify-content: flex-start; margin: 6px 10px; overflow: hidden; border: 1px solid #717171; border-radius: 2px; background: #1b1b1b; box-shadow: 0 0 0 3px var(--ladder-surface); }
.ladder-block-title { width: 100%; padding: 5px 8px; border-bottom: 1px solid #555; color: var(--text); background: #292929; font-size: 10px; font-weight: 850; letter-spacing: .09em; text-align: center; }
.ladder-block-operand { width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr); border-bottom: 1px solid rgba(82,103,108,.45); font-size: 9px; line-height: 1.25; }
.ladder-block-operand:last-child { border-bottom: 0; }
.ladder-block-operand span { display: grid; place-items: center; padding: 4px; color: #6f8a91; background: rgba(255,255,255,.025); font-size: 7px; font-weight: 750; letter-spacing: .025em; text-align: center; }
.ladder-block-operand strong { min-width: 0; padding: 4px 6px; color: #cbd9dc; font-weight: 550; overflow-wrap: anywhere; }
.ladder-block-empty { padding: 7px 10px; color: var(--muted); font-size: 9px; }
.ladder-branch { position: relative; z-index: 1; min-width: max-content; display: flex; flex: 0 0 auto; flex-direction: column; align-self: center; margin: 7px 10px; border-right: 2px solid var(--ladder-wire); border-left: 2px solid var(--ladder-wire); background: var(--ladder-surface); }
.ladder-branch-path { min-width: 100%; display: flex; }
.ladder-branch-path .ladder-sequence { min-width: 100%; padding: 0 8px; }
.ladder-wire-spacer { width: 86px; min-height: 70px; }
.ladder-render-note { padding: 6px 10px; border-top: 1px solid #3f3824; color: var(--warning); background: rgba(62,49,24,.34); font-size: 9px; }
.ladder-unrendered { display: grid; gap: 6px; padding: 16px; color: var(--muted); }
.ladder-unrendered strong { color: var(--warning); font-size: 11px; }
.ladder-unrendered span { font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.logic-source { margin-top: 10px; border: 1px solid var(--line); border-radius: 7px; background: rgba(0,0,0,.12); }
.logic-source summary { cursor: pointer; padding: 9px 11px; color: var(--muted); font-size: 10px; font-weight: 750; }
.logic-source .logic-block { margin: 0 9px 9px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 10px ui-monospace, monospace; background: var(--panel-2); }
.diagnostic { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.diagnostic-level { color: var(--warning); font-size: 9px; font-weight: 800; }
.diagnostic-message { margin-top: 4px; font-size: 12px; line-height: 1.45; }
.assistant-panel { display: flex; min-height: 0; flex-direction: column; overflow: hidden; padding: 14px; box-shadow: var(--shadow), inset 0 1px var(--accent-focus); }
.assistant-mode-control { min-width: 0; display: flex; align-items: center; border: 1px solid #484848; border-radius: 999px; background: rgba(255,255,255,.025); transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.assistant-mode-control:hover { border-color: #626262; background: rgba(255,255,255,.045); }
.assistant-mode-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-focus); }
.assistant-mode { width: auto; min-width: 72px; padding: 5px 25px 5px 10px; border: 0; border-radius: 999px; color: var(--text-secondary); background-color: transparent; cursor: pointer; font-size: 10px; font-weight: 650; }
.assistant-mode:hover { color: var(--text); background-color: transparent; }
.assistant-mode:focus { border: 0; box-shadow: none; color: var(--text); background-color: transparent; }
.assistant-mode:disabled { border-color: transparent; color: var(--text-tertiary); background-color: transparent; cursor: not-allowed; opacity: .72; }
.assistant-mode-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.context-card { position: relative; margin: 0 0 14px; padding: 12px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text-secondary); background: var(--panel-2); box-shadow: inset 3px 0 var(--accent); }
.context-label { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; color: var(--muted); }
.context-indicator { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px var(--accent-glow); }
.context-value { color: var(--text); font-size: 11px; font-weight: 620; line-height: 1.45; letter-spacing: -.005em; overflow-wrap: anywhere; }
.prompt-label { margin: 0 2px 7px; color: var(--muted); }
.suggestions { display: grid; gap: 5px; margin-bottom: 12px; }
.suggestion { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-secondary); background: var(--panel-2); text-align: left; cursor: pointer; font-size: 10px; line-height: 1.35; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.suggestion:hover, .suggestion:focus-visible { border-color: var(--accent); color: var(--text); background: var(--accent-soft); outline: none; }
.chat-history-heading { display: flex; align-items: center; justify-content: space-between; min-height: 28px; margin: 0 2px 2px; border-bottom: 1px solid var(--line); }
.chat-history-label { margin: 0; color: var(--muted); }
.chat-copy-button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
.chat-copy-button:hover { border-color: var(--line); color: var(--text); background: var(--control); }
.chat-copy-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.25; }
.answer { flex: 1 1 0; min-height: 120px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 7px 8px 18px 2px; border-top: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.68; overflow-wrap: anywhere; }
.assistant-composer { flex: 0 0 auto; margin-top: 8px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--input); box-shadow: 0 4px 14px rgba(0,0,0,.16); transition: border-color .15s ease, box-shadow .15s ease; }
.assistant-composer:focus-within { border-color: #565656; box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 6px 18px rgba(0,0,0,.2); }
.assistant-composer[data-composer-mode="change"] { border-color: var(--accent-border); box-shadow: 0 0 0 1px var(--accent-focus), 0 5px 16px rgba(0,0,0,.2); }
.composer-intent { min-height: 36px; display: flex; align-items: center; gap: 3px; padding: 5px 7px 0; }
.composer-intent-button { height: 27px; display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; font-weight: 750; }
.composer-intent-button span { color: var(--text-tertiary); font-size: 10px; }
.composer-intent-button:hover:not(:disabled) { color: var(--text); background: var(--control); }
.composer-intent-button.active { border-color: var(--line-strong); color: var(--text); background: var(--control); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.composer-intent-button.active span { color: var(--accent); }
.composer-intent-button:disabled { opacity: .38; cursor: not-allowed; }
.composer-intent > button:last-child { min-width: 0; margin-left: auto; padding: 4px 5px; overflow: hidden; border: 0; border-radius: 5px; color: var(--text-tertiary); background: transparent; cursor: default; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.composer-intent > button:last-child.suggested { color: var(--accent); background: var(--accent-soft); cursor: pointer; }
.assistant-composer textarea { width: 100%; min-height: 68px; max-height: 150px; resize: none; padding: 12px 13px 5px; border: 0; border-radius: 0; line-height: 1.45; background: transparent; }
.assistant-composer textarea:focus { border: 0; box-shadow: none; }
.assistant-composer textarea::placeholder { color: var(--text-tertiary); }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 7px 7px 9px; }
.composer-tools { min-width: 0; display: flex; align-items: center; gap: 3px; }
.change-mode-note { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; color: var(--text-secondary); font-size: 9px; font-weight: 650; }
.change-mode-note span { color: var(--accent); }
.assistant-send { width: 36px; height: 36px; display: grid; flex: 0 0 36px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #161616; background: #b8b8b8; cursor: pointer; transition: background .15s ease, transform .15s ease, opacity .15s ease; }
.assistant-send:hover:not(:disabled) { background: #dedede; transform: translateY(-1px); }
.assistant-send:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.assistant-send:disabled { opacity: .32; cursor: not-allowed; }
.assistant-send.working { cursor: wait; }
.assistant-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-turn { margin: 0 0 14px; }
.chat-turn-meta { display: flex; justify-content: space-between; gap: 10px; margin: 0 3px 5px; color: var(--muted); font: 8px/1.3 var(--font-mono); letter-spacing: .035em; }
.chat-turn-meta span:first-child { color: var(--accent); font-weight: 800; text-transform: uppercase; }
.chat-turn-meta span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-worked-time { margin: 0 3px 8px; color: var(--muted); font: 9px/1.3 var(--font-mono); }
.chat-question { margin-left: 28px; padding: 9px 11px; border: 1px solid var(--accent-border); border-radius: 9px 9px 2px 9px; color: var(--text); background: var(--accent-soft); white-space: pre-wrap; }
.chat-question-change { border-color: var(--accent-border); box-shadow: inset 3px 0 var(--accent); }
.chat-answer { min-width: 0; }
.change-turn-card { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text-secondary); background: var(--panel-2); }
.change-turn-card.blocked { border-color: rgba(241,132,132,.4); }
.change-turn-card.approved { border-color: var(--accent-border); }
.change-turn-card.applied { border-color: rgba(96,197,127,.55); }
.change-turn-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); }
.change-turn-heading > div:first-child { min-width: 0; display: grid; gap: 3px; }
.change-turn-heading > div:first-child span { color: var(--accent); font-size: 7px; font-weight: 850; letter-spacing: .1em; }
.change-turn-card.blocked .change-turn-heading > div:first-child span { color: var(--danger); }
.change-turn-heading strong { color: var(--text); font-size: 11px; }
.change-turn-counts { display: flex; gap: 5px; }
.change-turn-counts span { min-width: 23px; height: 21px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; font: 750 8px var(--font-mono); }
.change-turn-counts .error { color: var(--danger); }
.change-turn-counts .warning { color: var(--warning); }
.change-turn-intent { display: grid; gap: 4px; padding: 9px 11px; border-bottom: 1px solid var(--line); background: var(--accent-subtle); }
.change-turn-intent strong { color: var(--accent); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.change-turn-intent span { color: var(--text-secondary); font-size: 10px; line-height: 1.45; }
.change-turn-operations { display: grid; gap: 5px; margin: 0; padding: 10px 12px 10px 27px; color: var(--text-secondary); font-size: 10px; line-height: 1.4; }
.change-turn-findings { border-top: 1px solid var(--line); }
.change-turn-findings summary { cursor: pointer; padding: 8px 11px; color: var(--muted); font-size: 9px; font-weight: 700; }
.change-turn-findings ul { display: grid; gap: 7px; margin: 0; padding: 0 11px 10px; list-style: none; }
.change-turn-findings li { display: grid; gap: 2px; padding-left: 8px; border-left: 2px solid var(--warning); }
.change-turn-findings li.error { border-color: var(--danger); }
.change-turn-findings strong { color: var(--text); font: 700 8px var(--font-mono); }
.change-turn-findings span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.change-review-button { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; border: 0; border-top: 1px solid var(--line); color: var(--text); background: var(--control); cursor: pointer; font-size: 10px; font-weight: 700; text-align: left; }
.change-review-button:hover { color: var(--accent); background: var(--control-hover); }
.change-turn-approval { display: grid; gap: 7px; padding: 10px 11px 11px; border-top: 1px solid var(--line); }
.change-turn-approval > span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.change-turn-approval code { color: var(--logic); font: 700 9px/1.4 var(--font-mono); overflow-wrap: anywhere; }
.change-turn-approval input { width: 100%; min-width: 0; padding: 8px 9px; font: 9px var(--font-mono); }
.change-card-primary { width: 100%; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 7px; color: #fff; background: var(--accent); cursor: pointer; font-size: 9px; font-weight: 750; }
.change-card-primary:hover:not(:disabled) { background: var(--accent-hover); }
.change-card-primary:disabled { opacity: .5; cursor: wait; }
.change-card-secondary { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text); background: var(--control); cursor: pointer; font-size: 9px; font-weight: 750; }
.change-card-secondary:hover:not(:disabled) { border-color: var(--accent-border); color: var(--accent); background: var(--control-hover); }
.change-card-secondary:disabled { opacity: .5; cursor: not-allowed; }
.change-turn-status { min-height: 12px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.change-turn-blocked { padding: 10px 11px; border-top: 1px solid rgba(241,132,132,.25); color: var(--danger); background: rgba(241,132,132,.06); font-size: 9px; line-height: 1.45; }
.change-turn-error { padding: 11px; border: 1px solid rgba(241,132,132,.35); border-radius: 9px; color: var(--text-secondary); background: rgba(241,132,132,.06); }
.change-turn-error strong { color: var(--danger); font-size: 10px; }
.change-turn-error p { margin: 6px 0 10px; font-size: 9px; line-height: 1.45; }
.change-turn-error button { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text); background: var(--control); cursor: pointer; font-size: 9px; }
.change-clarification-message { padding: 2px 3px 0; }
.change-clarification-question { margin: 0 0 7px; color: var(--text); font-size: 11px; font-weight: 650; line-height: 1.55; white-space: pre-wrap; }
.change-clarification-reason { margin: 0 0 7px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.change-clarification-reply { margin: 0; color: var(--accent); font-size: 9px; line-height: 1.5; }
.chat-error { padding: 11px 12px; border: 1px solid rgba(241,132,132,.35); border-radius: 5px; color: var(--danger); background: rgba(80,25,25,.24); }
.chat-turn .working-state { min-height: 180px; height: auto; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--input); }
.answer-section { margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--input); }
.answer-section h3 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 11px; border-bottom: 1px solid var(--line); color: var(--text); background: var(--panel-2); font-size: 10px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.answer-section-icon { width: 18px; height: 18px; display: inline-grid; flex: 0 0 18px; place-items: center; border-radius: 5px; color: var(--accent); background: var(--accent-subtle); font-size: 11px; }
.answer-section-body { padding: 11px 12px 12px; }
.answer-section-body p { margin: 0 0 9px; white-space: pre-wrap; }
.answer-section-body p:last-child { margin-bottom: 0; }
.answer-section-body ul, .answer-section-body ol { margin: 1px 0 3px; padding-left: 20px; }
.answer-section-body li { padding-left: 2px; margin: 0 0 7px; }
.answer-section-body li:last-child { margin-bottom: 0; }
.answer-section-body li::marker { color: var(--accent); font-weight: 750; }
.answer-section-body strong { color: var(--text); font-weight: 750; }
.answer-section-body code { padding: 2px 5px; border: 1px solid var(--accent-border); border-radius: 4px; color: var(--logic); background: var(--panel-2); font: 10px/1.55 var(--font-mono); white-space: pre-wrap; }
.answer-reference { display: inline-flex; align-items: baseline; gap: 3px; margin: 0; padding: 0; border: 0; border-radius: 4px; color: inherit; background: transparent; cursor: pointer; vertical-align: baseline; text-align: left; }
.answer-reference > span { color: var(--accent); font-size: .72em; opacity: 0; transform: translate(-2px, 1px); transition: opacity .12s ease, transform .12s ease; }
.answer-reference:hover > span, .answer-reference:focus-visible > span { opacity: 1; transform: translate(0, 1px); }
.answer-reference:hover code, .answer-reference:focus-visible code, .answer-reference:hover strong, .answer-reference:focus-visible strong { color: var(--accent); border-color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.answer-reference:focus-visible { outline: 2px solid var(--accent-glow); outline-offset: 2px; }
.answer-section-limits { border-color: rgba(237,195,109,.25); }
.answer-section-limits h3 { background: rgba(74,57,25,.32); }
.answer-section-limits .answer-section-icon { color: var(--warning); background: rgba(237,195,109,.1); }
.answer-section-checks { border-color: var(--accent-border); }
.answer-empty { height: 100%; display: grid; align-content: center; justify-items: center; color: var(--muted); text-align: center; line-height: 1.5; }
.answer-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-size: 22px; }
.answer-empty p { max-width: 260px; }
.working-state { position: relative; min-height: 210px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; overflow: hidden; text-align: center; }
.working-orb { position: relative; width: 58px; height: 58px; display: grid; place-items: center; }
.working-orb-core { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent-glow), 0 0 38px var(--accent-focus); animation: working-pulse 1.8s ease-in-out infinite; }
.working-orb-ring { position: absolute; inset: 5px; border: 1px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent-border); border-radius: 50%; animation: working-spin 2.4s linear infinite; }
.working-orb-ring-two { inset: 0; border-top-color: transparent; border-right-color: var(--accent-glow); border-bottom-color: var(--accent-focus); animation-duration: 3.6s; animation-direction: reverse; }
.working-copy { display: grid; gap: 5px; }
.working-title { color: var(--text); font-size: 13px; font-weight: 720; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.working-detail { color: var(--muted); font-size: 10px; }
.working-shimmer { width: min(230px, 78%); display: grid; gap: 7px; }
.working-shimmer span { position: relative; height: 5px; overflow: hidden; border-radius: 999px; background: rgba(141,162,170,.09); }
.working-shimmer span:nth-child(2) { width: 84%; justify-self: center; }
.working-shimmer span:nth-child(3) { width: 62%; justify-self: center; }
.working-shimmer span::after { content: ""; position: absolute; inset: 0; width: 42%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--accent-glow), transparent); animation: working-shimmer 1.75s ease-in-out infinite; }
.working-shimmer span:nth-child(2)::after { animation-delay: .14s; }
.working-shimmer span:nth-child(3)::after { animation-delay: .28s; }
@keyframes working-spin { to { transform: rotate(360deg); } }
@keyframes working-pulse { 50% { transform: scale(.72); opacity: .68; } }
@keyframes working-shimmer { from { transform: translateX(-130%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) {
  .working-orb-core, .working-orb-ring, .working-shimmer span::after { animation: none; }
}
.statusbar { height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 14px; color: var(--muted); background: var(--statusbar); border-top: 1px solid var(--line); font: 9px/1 var(--font-mono); letter-spacing: .015em; }
#statusText::before { content: ""; width: 5px; height: 5px; display: inline-block; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); vertical-align: 1px; }
.toast { position: fixed; left: 50%; bottom: 42px; transform: translateX(-50%); padding: 9px 13px; color: var(--text); background: var(--control); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); font-size: 11px; }
.button-settings { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); background: transparent; border-color: transparent; }
.button-settings span { color: var(--text); font-size: 13px; }
.button-settings:hover { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.settings-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
.settings-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(5px); }
.settings-dialog { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow-x: hidden; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--panel); box-shadow: 0 28px 80px rgba(0,0,0,.48); }
.settings-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 19px; border-bottom: 1px solid var(--line); }
.settings-header h2 { margin: 3px 0 0; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.settings-close { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 22px; line-height: 1; }
.settings-close:hover, .settings-close:focus-visible { border-color: var(--line); color: var(--text); background: var(--panel-2); outline: none; }
.settings-section { display: grid; gap: 14px; padding: 19px; }
.settings-label { display: grid; gap: 4px; }
.settings-label strong { font-size: 13px; font-weight: 650; }
.settings-label span { color: var(--muted); font-size: 11px; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-option { min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--panel-2); cursor: pointer; text-align: left; transition: .15s ease; }
.theme-option:hover { border-color: var(--line-strong); background: var(--panel-3); }
.theme-option.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-focus); }
.theme-option > span:last-child { min-width: 0; display: grid; gap: 2px; }
.theme-option strong { font-size: 11px; font-weight: 650; }
.theme-option small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.theme-swatch { width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 7px; box-shadow: inset 0 0 0 4px rgba(128,128,128,.08); }
.theme-swatch-dark { background: #111111; }
.theme-swatch-light { background: #ffffff; }
.theme-swatch-system { background: linear-gradient(135deg, #ffffff 0 49%, #111111 51%); }
.change-review-page { min-width: 0; }
.proposal-summary { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.proposal-summary h3 { margin: 4px 0; font: 700 18px/1.3 var(--font-mono); }
.proposal-summary p { max-width: 720px; margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.proposal-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.proposal-counts span { padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.proposal-counts .error { color: var(--danger); border-color: rgba(241,132,132,.35); }
.proposal-counts .warning { color: var(--warning); border-color: rgba(229,173,79,.35); }
.proposal-integrity { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 13px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--panel-2); font-size: 9px; }
.proposal-integrity code { color: var(--logic); }
.proposal-intent { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 16px; padding: 12px; border: 1px solid var(--accent-border); border-radius: 8px; background: var(--accent-soft); }
.proposal-intent > div { min-width: 0; }
.proposal-intent > div strong { color: var(--text); font-size: 12px; }
.proposal-intent > div p { margin: 4px 0 0; color: var(--text-secondary); font-size: 10px; line-height: 1.5; }
.proposal-intent > span { align-self: start; padding: 4px 6px; border: 1px solid var(--accent-border); border-radius: 5px; color: var(--accent); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.proposal-intent ul { grid-column: 1 / -1; display: grid; gap: 6px; margin: 2px 0 0; padding: 9px 0 0; border-top: 1px solid var(--accent-border); list-style: none; }
.proposal-intent li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; color: var(--text-secondary); font-size: 9px; line-height: 1.4; }
.proposal-intent li strong { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.proposal-issues { display: grid; gap: 6px; }
.proposal-issue { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.proposal-issue > span { padding-top: 2px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.proposal-issue-error > span { color: var(--danger); }
.proposal-issue-warning > span { color: var(--warning); }
.proposal-issue strong { font: 700 10px/1.3 var(--font-mono); }
.proposal-issue p { margin: 3px 0; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.proposal-issue small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.proposal-diff { margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-2); }
.proposal-diff > header { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.proposal-diff > header > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: var(--accent-soft); font: 750 9px var(--font-mono); }
.proposal-diff header div { display: grid; gap: 2px; }
.proposal-diff header strong { font-size: 11px; }
.proposal-diff header small { color: var(--muted); font: 8px/1.3 var(--font-mono); }
.proposal-source-link { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-secondary); background: var(--control); cursor: pointer; font-size: 9px; }
.proposal-source-link:hover { border-color: var(--accent-border); color: var(--accent); }
.visual-diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.visual-diff > div { min-width: 0; padding: 10px; background: var(--panel); }
.diff-label { margin-bottom: 7px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .09em; }
.visual-diff .ladder-network { grid-template-columns: 48px minmax(520px, 1fr) 16px; }
.visual-diff .ladder-sequence-root { min-width: 500px; }
.change-object-json, .xml-diff pre { max-height: 360px; margin: 0; padding: 11px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; color: var(--logic); background: var(--input); font: 9px/1.55 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.change-empty, .change-deleted { min-height: 86px; display: grid; place-items: center; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 7px; color: var(--muted); font-size: 11px; }
.change-deleted { color: var(--danger); }
.xml-diff { margin: 16px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.xml-diff summary { cursor: pointer; padding: 11px 12px; color: var(--text-secondary); font-size: 10px; font-weight: 700; }
.xml-diff pre { margin: 0 10px 10px; color: var(--text-secondary); }
.proposal-workspace-note { display: flex; align-items: start; gap: 10px; margin-top: 16px; padding: 12px; border: 1px solid var(--accent-border); border-radius: 8px; background: var(--accent-soft); }
.proposal-workspace-note > span { color: var(--accent); }
.proposal-workspace-note strong { font-size: 11px; }
.proposal-workspace-note p { margin: 3px 0 0; color: var(--text-secondary); font-size: 10px; }

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f3eb;
  --panel: #fffef8;
  --panel-2: #efede4;
  --panel-3: #e9e6da;
  --line: rgba(16,20,17,.13);
  --line-strong: rgba(16,20,17,.22);
  --text: #101411;
  --text-secondary: #404840;
  --text-tertiary: #7b847c;
  --muted: #5e665f;
  --accent: #356c08;
  --accent-hover: #285706;
  --accent-soft: rgba(53,108,8,.1);
  --accent-subtle: rgba(53,108,8,.065);
  --accent-border: rgba(53,108,8,.42);
  --accent-focus: rgba(53,108,8,.22);
  --accent-glow: rgba(111,184,22,.35);
  --control: #fffef8;
  --control-hover: #f3f1e9;
  --input: #fffef8;
  --selected: rgba(111,184,22,.1);
  --hover-overlay: rgba(26,28,31,.045);
  --topbar: #fffef8;
  --statusbar: #e9e6da;
  --scrollbar: #aeb5ac;
  --warning: #9a6914;
  --danger: #b64141;
  --logic: #355d0a;
  --ladder-wire: #515b52;
  --ladder-surface: #fffef8;
  --shadow: 0 12px 30px rgba(16,20,17,.08);
}
html[data-theme="light"] body { background: var(--bg); }
html[data-theme="light"] .topbar { box-shadow: 0 4px 16px rgba(35,35,30,.07); }
html[data-theme="light"] .badge-safe { border-color: var(--accent-border); background: var(--accent-soft); }
html[data-theme="light"] .button { color: var(--text); }
html[data-theme="light"] .button-primary { border-color: var(--accent); color: #fff; background: var(--accent); }
html[data-theme="light"] .button-primary:hover { border-color: var(--accent-hover); color: #fff; background: var(--accent-hover); }
html[data-theme="light"] .navigation-back { border-color: var(--line-strong); color: var(--text-secondary); background: #ffffff; }
html[data-theme="light"] .navigation-back:hover, html[data-theme="light"] .navigation-back:focus-visible { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
html[data-theme="light"] .panel { background: var(--panel); }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea { color: var(--text); background: #fff; }
html[data-theme="light"] .icon-button { background: #fff; }
html[data-theme="light"] .tree-section-label { color: var(--text-tertiary); }
html[data-theme="light"] .tree-summary, html[data-theme="light"] .tree-item, html[data-theme="light"] .result-item { color: var(--text-secondary); }
html[data-theme="light"] .tree-summary:hover, html[data-theme="light"] .tree-item:hover, html[data-theme="light"] .result-item:hover { color: var(--text); background: var(--hover-overlay); }
html[data-theme="light"] .tree-item.active { color: var(--text); background: var(--selected); }
html[data-theme="light"] .tree-children { border-left-color: rgba(26,28,31,.1); }
html[data-theme="light"] .result-name, html[data-theme="light"] .description { color: #383b3a; }
html[data-theme="light"] .metric { background: #fafaf9; }
html[data-theme="light"] .data-table th { background: var(--panel-2); }
html[data-theme="light"] .data-table td { border-bottom-color: #e5e5e1; }
html[data-theme="light"] .logic-block { background: #f6f7f5; }
html[data-theme="light"] .ladder-rung-card { border-color: #d7d8d3; background: var(--ladder-surface); box-shadow: 0 6px 18px rgba(35,35,30,.06); }
html[data-theme="light"] .ladder-rung-comment { border-bottom-color: #deded9; background: #f2f4f2; }
html[data-theme="light"] .ladder-rung-comment p { color: #4f5553; }
html[data-theme="light"] .ladder-contact-symbol, html[data-theme="light"] .ladder-coil-symbol, html[data-theme="light"] .ladder-branch { color: #303634; background: var(--ladder-surface); }
html[data-theme="light"] .ladder-operand, html[data-theme="light"] .ladder-rung-index strong { color: #252927; }
html[data-theme="light"] .ladder-block { border-color: #7d8884; background: #f8f8f6; box-shadow: 0 0 0 3px var(--ladder-surface); }
html[data-theme="light"] .ladder-block-title { border-bottom-color: #bbc2bf; color: #242725; background: #e9edeb; }
html[data-theme="light"] .ladder-block-operand strong { color: #404542; }
html[data-theme="light"] .logic-source, html[data-theme="light"] .suggestion { background: rgba(247,247,245,.7); }
html[data-theme="light"] .context-card { color: var(--text-secondary); background: #fafaf9; }
html[data-theme="light"] .assistant-mode-control { border-color: #c8c8c3; background: #fff; }
html[data-theme="light"] .assistant-mode-control:hover { border-color: #a5a5a0; background: #f7f7f5; }
html[data-theme="light"] .answer { color: #3f4341; }
html[data-theme="light"] .answer-section { background: #fff; }
html[data-theme="light"] .answer-section h3 { color: #303432; background: #f1f3f1; }
html[data-theme="light"] .answer-section-body code { color: #355d0a; background: rgba(111,184,22,.1); }
html[data-theme="light"] .answer-section-limits h3 { background: #faf4e8; }
html[data-theme="light"] .answer-icon { background: #fff; }
html[data-theme="light"] .working-shimmer span { background: rgba(40,50,46,.08); }
html[data-theme="light"] .statusbar { color: #707471; border-top-color: #d5d5d0; }
html[data-theme="light"] .warning-banner { color: #765113; background: linear-gradient(90deg, #fff8e8, #fffaf0); border-bottom-color: #e8cf9d; box-shadow: inset 3px 0 0 var(--warning), 0 4px 14px rgba(80,55,15,.07); }
html[data-theme="light"] .warning-icon { color: #8b5d0c; border-color: #d8b871; background: #fff1cf; }
html[data-theme="light"] .warning-copy strong { color: #6d4808; }
html[data-theme="light"] .warning-copy span, html[data-theme="light"] .warning-dismiss { color: #80683d; }
html[data-theme="light"] .warning-dismiss:hover { color: #563704; background: rgba(128,92,25,.09); }
html[data-theme="light"] .toast { color: #252826; background: #fff; border-color: #cacac5; }
html[data-theme="light"] .settings-backdrop { background: rgba(35,35,30,.34); }
html[data-theme="light"] .settings-dialog { background: #fff; box-shadow: 0 28px 70px rgba(35,35,30,.2); }
html[data-theme="light"] .theme-option { background: #fafaf9; }
html[data-theme="light"] .proposal-diff, html[data-theme="light"] .proposal-issue, html[data-theme="light"] .proposal-integrity, html[data-theme="light"] .change-turn-card { background: #fafaf9; }
html[data-theme="light"] .visual-diff > div { background: #fff; }
.hidden { display: none !important; }
@media (max-width: 620px) {
  .theme-options { grid-template-columns: 1fr; }
  .visual-diff { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .workspace { --sidebar-width: 260px; --assistant-width: 320px; }
  .summary-grid.six { grid-template-columns: repeat(3, 1fr); }
}

/* Chelix product system --------------------------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image:
    linear-gradient(rgba(184,255,66,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184,255,66,.16) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 38%);
}
button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.topbar {
  height: 78px;
  gap: 16px;
  padding: 0 18px;
  box-shadow: none;
}
.topbar::after { height: 2px; background: linear-gradient(90deg, var(--accent) 0 170px, var(--accent-border) 330px, transparent 620px); }
.app-brand { min-width: 196px; display: flex; align-items: center; color: var(--text); text-decoration: none; }
.brand-mark { width: 25px; height: 25px; display: inline-flex; flex: 0 0 auto; flex-direction: column; justify-content: center; gap: 4px; margin-right: 10px; border-right: 2px solid currentColor; border-left: 2px solid currentColor; }
.brand-mark i { display: block; width: 100%; height: 2px; background: var(--accent); }
.brand-word { font-size: 21px; font-weight: 780; letter-spacing: -.055em; }
.brand-word sup { margin-left: 2px; color: var(--muted); font-size: 9px; letter-spacing: 0; vertical-align: 8px; }
.brand-product { align-self: center; margin-left: 13px; padding-left: 13px; border-left: 1px solid var(--line-strong); color: var(--muted); font: 750 9px/1.25 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.topbar-divider { width: 1px; height: 34px; background: var(--line); }
.brand-copy { gap: 4px; }
.brand-copy h1 { font-size: 17px; font-weight: 670; }
.brand-copy p { font-size: 10px; }
.topbar-actions { gap: 7px; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 3px; padding: 8px 12px; font-size: 11px; }
.button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: var(--accent); color: var(--ink); background: var(--accent); box-shadow: 3px 3px 0 rgba(184,255,66,.14); }
.button-primary:hover { border-color: var(--accent-hover); color: var(--ink); background: var(--accent-hover); box-shadow: 5px 5px 0 rgba(184,255,66,.12); }
.button-secondary { color: var(--text); background: transparent; }
.button-settings { gap: 6px; }

.workspace {
  --sidebar-width: 276px;
  --assistant-width: 410px;
  height: calc(100vh - 106px);
  padding: 0;
  background: var(--bg);
}
.warning-banner:not(.hidden) + .workspace { height: calc(100vh - 156px); }
.panel { border-radius: 0; box-shadow: none; }
.sidebar { border-width: 0 1px 0 0; padding: 16px 13px 11px; }
.content { border: 0; padding: 28px 30px 40px; }
.assistant-panel { border-width: 0 0 0 1px; padding: 0; box-shadow: none; }
.pane-resize::after { left: 3px; width: 1px; border-radius: 0; }
.panel-heading-row { display: flex; align-items: center; justify-content: space-between; margin: 0 3px 12px; }
.panel-title { margin: 0; color: var(--text); font-size: 12px; font-weight: 700; }
.panel-shortcut { color: var(--text-tertiary); font: 9px var(--font-mono); }
.search-row input, .filters select { min-height: 36px; border-radius: 3px; font-size: 11px; }
.search-row input { padding-left: 11px; }
.icon-button { width: 38px; border-radius: 3px; color: var(--muted); }
.icon-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.filters { margin: 7px 0 13px; gap: 7px; }
.tree-section-label { margin-top: 14px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.tree-summary, .tree-item, .result-item { position: relative; border-radius: 2px; font-size: 12px; }
.tree-item.active { color: var(--text); background: var(--selected); }
.tree-item.active::before { content: ""; position: absolute; top: 7px; bottom: 7px; left: 0; width: 2px; background: var(--accent); }
.tree-item.active .tree-icon { color: var(--accent); }
.tree-count, .tree-meta, .result-snippet { font-size: 10px; }
.tree-empty { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 18px; color: var(--muted); text-align: center; }
.tree-empty .brand-mark { width: 28px; height: 28px; margin: 0 0 15px; color: var(--text); }
.tree-empty strong { margin-bottom: 6px; color: var(--text-secondary); font-size: 12px; }
.tree-empty small { max-width: 205px; font-size: 10px; line-height: 1.5; }

.assistant-heading { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 15px; border-bottom: 1px solid var(--line); background: var(--topbar); }
.assistant-heading > div { display: flex; align-items: center; gap: 8px; }
.assistant-heading strong { font-size: 13px; letter-spacing: -.01em; }
.assistant-spark { color: var(--accent); font-size: 14px; }
.connection-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: 700 9px var(--font-mono); text-transform: uppercase; }
.connection-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-tertiary); }
.connection-pill.connected { color: var(--accent); }
.connection-pill.connected i { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.context-card { margin: 12px 14px 0; padding: 10px 11px; border-radius: 2px; background: var(--panel-2); }
.context-value { font-size: 11px; line-height: 1.4; }
.eyebrow { color: var(--accent); font-size: 9px; letter-spacing: .11em; text-transform: uppercase; }
.prompt-label, .chat-history-heading { margin-right: 15px; margin-left: 15px; }
.suggestions { margin: 0 14px; }
.suggestion { border-radius: 2px; font-size: 11px; line-height: 1.4; }
.answer { padding: 4px 14px 14px; color: var(--text-secondary); font-size: 12px; line-height: 1.58; }
.answer-empty p { max-width: 290px; font-size: 12px; }
.answer-icon { width: 38px; height: 38px; border-radius: 2px; color: var(--accent); background: var(--accent-soft); }
.assistant-composer { margin: 0; padding: 10px 14px 13px; border-width: 1px 0 0; border-radius: 0; background: var(--topbar); box-shadow: none; }
.composer-intent { margin-bottom: 8px; }
.composer-intent-button { border-radius: 2px; font-size: 10px; }
.assistant-composer textarea { min-height: 68px; border-radius: 3px; padding: 11px 12px; font-size: 12px; line-height: 1.5; }
.assistant-send { width: 36px; height: 36px; border-radius: 2px; border-color: var(--accent); color: var(--ink); background: var(--accent); }
.assistant-send:hover:not(:disabled) { color: var(--ink); background: var(--accent-hover); }
.assistant-mode-control, .change-mode-note { min-height: 30px; border-radius: 2px; }
.assistant-mode, .assistant-mode-note { font-size: 9px; }
.chat-turn { margin: 0 0 15px; }
.chat-turn-meta, .chat-worked-time { font-size: 9px; }
.chat-question { border-radius: 2px; color: var(--text); }
.answer-section, .change-turn-card, .proposal-diff, .proposal-intent, .proposal-workspace-note { border-radius: 2px; }
.answer-section { background: transparent; }
.answer-section h3 { font-size: 10px; }
.answer-section-body { font-size: 12px; }
.change-card-primary, .change-card-secondary, .change-review-button { border-radius: 2px; font-size: 10px; }
.change-card-primary { border-color: var(--accent); color: var(--ink); background: var(--accent); }
.change-card-primary:hover:not(:disabled) { color: var(--ink); background: var(--accent-hover); }

.page-heading h2 { font-size: clamp(24px, 2.4vw, 34px); letter-spacing: -.045em; }
.page-heading p, .description { font-size: 12px; }
.metric { border-radius: 2px; background: var(--panel-2); }
.metric-label { font-size: 9px; }
.metric.count .metric-value { color: var(--accent); }
.section-title { font-size: 9px; }
.data-table { font-size: 12px; }
.ladder-rung-card { border-radius: 2px; border-color: var(--line-strong); background-color: var(--ladder-surface); background-image: linear-gradient(rgba(255,254,248,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,254,248,.025) 1px, transparent 1px); background-size: 22px 22px; }
.ladder-rung-comment { background: var(--panel-2); }
.ladder-mnemonic, .ladder-rung-comment > span { color: var(--accent); }
.ladder-block, .ladder-contact-symbol, .ladder-coil-symbol { background: var(--ladder-surface); }
.statusbar { height: 28px; padding: 0 16px; font-size: 9px; }
.statusbar #aiStatus { color: var(--text-tertiary); }
.toast { bottom: 44px; border-radius: 2px; border-color: var(--accent-border); background: var(--panel-2); }

/* Empty workspace */
.empty-state { position: relative; min-height: 100%; place-items: stretch; text-align: left; }
.empty-state::after { content: ""; position: absolute; top: 6%; right: 2%; width: 380px; height: 380px; pointer-events: none; background: radial-gradient(circle, rgba(184,255,66,.11), transparent 68%); filter: blur(6px); }
.empty-inner.onboarding { position: relative; z-index: 1; width: min(900px, 100%); max-width: none; margin: auto; padding: 42px 18px 54px; }
.empty-kicker { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.empty-kicker i { width: 7px; height: 7px; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.empty-state h2 { max-width: 760px; margin: 22px 0 18px; font-size: clamp(44px, 5.5vw, 76px); font-weight: 760; line-height: .96; letter-spacing: -.065em; }
.empty-state h2 span { color: var(--accent); font-weight: 520; }
.empty-lede { max-width: 700px; margin: 0; color: var(--muted); font-size: 14px !important; line-height: 1.7 !important; }
.onboarding-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 38px; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.onboarding-card { min-height: 238px; display: grid; grid-template-columns: 1fr auto; align-content: start; padding: 20px 22px; border: 0; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); color: var(--text); background: rgba(21,26,23,.82); cursor: pointer; text-align: left; transition: background .16s ease, transform .16s ease; }
.onboarding-card:hover { background: var(--panel-2); transform: translateY(-2px); }
.onboarding-card:focus-visible { position: relative; z-index: 1; }
.onboarding-index { color: var(--text-tertiary); font: 700 9px var(--font-mono); }
.onboarding-icon { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.onboarding-upload { grid-column: 2; grid-row: 1 / span 2; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--accent); font-size: 18px; }
.onboarding-card strong { grid-column: 1 / -1; margin-top: 44px; font-size: 20px; letter-spacing: -.035em; }
.onboarding-card small { grid-column: 1 / -1; max-width: 330px; margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.onboarding-card b { grid-column: 1 / -1; align-self: end; margin-top: 24px; color: var(--accent); font-size: 10px; letter-spacing: .02em; }
.onboarding-create { background: linear-gradient(135deg, rgba(184,255,66,.1), rgba(21,26,23,.84) 60%); }
.onboarding-proof { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 18px; color: var(--text-tertiary); font: 700 9px var(--font-mono); text-transform: uppercase; }
.onboarding-proof span::before { content: "✓"; margin-right: 7px; color: var(--accent); }

/* Dialogs and setup */
.settings-backdrop { background: rgba(8,11,9,.72); }
.settings-dialog { border-radius: 2px; border-color: var(--line-strong); background: var(--panel); box-shadow: 10px 10px 0 rgba(184,255,66,.1), 0 28px 90px rgba(0,0,0,.4); }
.new-project-dialog { width: min(720px, 100%); }
.settings-header { padding: 18px 20px; }
.settings-header h2 { font-size: 22px; letter-spacing: -.035em; }
.settings-close { border-radius: 2px; }
.new-project-intro { padding: 15px 20px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--panel-2); font-size: 11px; line-height: 1.55; }
.new-project-intro strong { color: var(--text-secondary); }
.new-project-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 19px 20px 10px; }
.field { min-width: 0; display: grid; gap: 6px; color: var(--text-secondary); font-size: 10px; font-weight: 700; }
.field.span-two { grid-column: 1 / -1; }
.field span { display: flex; justify-content: space-between; }
.field em { color: var(--text-tertiary); font-style: normal; font-weight: 500; }
.field input, .field textarea, .api-key-row input { width: 100%; min-width: 0; border-radius: 2px; padding: 10px 11px; font-size: 12px; font-weight: 450; }
.field small { color: var(--text-tertiary); font-size: 9px; font-weight: 450; line-height: 1.4; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 19px; }
.form-error { margin: 7px 20px 0; padding: 9px 10px; border-left: 2px solid var(--danger); color: var(--danger); background: rgba(241,132,132,.07); font-size: 10px; }
.settings-section + .settings-section { border-top: 1px solid var(--line); }
.settings-label span { max-width: 450px; font-size: 10px; line-height: 1.5; }
.api-key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; }
.settings-status { color: var(--text-tertiary); font-size: 9px; }
.theme-option { border-radius: 2px; }
.theme-swatch { border-radius: 2px; }
.theme-swatch-dark { background: #101411; }
.theme-swatch-light { background: #f5f3eb; }
.theme-swatch-system { background: linear-gradient(135deg, #f5f3eb 0 49%, #101411 51%); }

html[data-theme="light"] .button-primary { border-color: #101411; color: #101411; background: #b8ff42; }
html[data-theme="light"] .button-primary:hover { border-color: #101411; color: #101411; background: #c6ff65; }
html[data-theme="light"] .onboarding-card { color: var(--text); background: rgba(255,254,248,.88); }
html[data-theme="light"] .onboarding-create { background: linear-gradient(135deg, rgba(184,255,66,.26), rgba(255,254,248,.9) 62%); }
html[data-theme="light"] .onboarding-card:hover { background: #fffef8; }
html[data-theme="light"] .assistant-send, html[data-theme="light"] .change-card-primary { color: #101411; background: #b8ff42; }
html[data-theme="light"] .settings-dialog { background: #fffef8; box-shadow: 10px 10px 0 rgba(111,184,22,.14), 0 28px 70px rgba(16,20,17,.18); }
html[data-theme="light"] .new-project-intro { background: #efede4; }

@media (max-width: 1260px) {
  .workspace { --sidebar-width: 244px; --assistant-width: 350px; }
  .brand-product { display: none; }
  #downloadSourceButton { width: 38px; height: 38px; display: grid; flex: 0 0 38px; place-items: center; padding: 0; font-size: 0; }
  .app-brand { min-width: 118px; }
}

@media (max-width: 960px) {
  html, body { height: auto; min-height: 100%; overflow: auto; }
  .topbar { position: sticky; z-index: 20; top: 0; min-height: 72px; height: auto; flex-wrap: wrap; padding: 12px 14px; }
  .topbar-divider, .brand-copy { display: none; }
  .topbar-actions { flex: 1; justify-content: flex-end; }
  .workspace, .warning-banner:not(.hidden) + .workspace { height: auto; min-height: calc(100vh - 106px); display: grid; grid-template-columns: minmax(0, 1fr); }
  .sidebar { max-height: 320px; border: 0; border-bottom: 1px solid var(--line); }
  .content { min-height: 620px; }
  .assistant-panel { min-height: 680px; border: 0; border-top: 1px solid var(--line); }
  .pane-resize { display: none; }
  .statusbar { position: sticky; bottom: 0; z-index: 18; }
  .summary-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .empty-inner.onboarding { padding-top: 54px; }
}

@media (max-width: 680px) {
  .app-brand { min-width: auto; }
  .brand-word { font-size: 18px; }
  .topbar-actions { flex-wrap: wrap; gap: 5px; }
  .button-settings { width: 38px; padding: 0; font-size: 0; }
  .button-secondary, .button-primary { padding: 8px 10px; }
  .content { min-height: 700px; padding: 20px 16px 32px; }
  .empty-state h2 { font-size: clamp(42px, 14vw, 62px); }
  .onboarding-actions { grid-template-columns: 1fr; }
  .onboarding-card { min-height: 210px; }
  .new-project-fields { grid-template-columns: 1fr; }
  .field.span-two { grid-column: auto; }
  .settings-overlay { align-items: start; padding: 10px; }
  .settings-dialog { max-height: calc(100dvh - 20px); }
  .api-key-row { grid-template-columns: 1fr 1fr; }
  .api-key-row input { grid-column: 1 / -1; }
  .summary-grid, .summary-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proposal-summary { display: grid; }
  .proposal-counts { justify-content: flex-start; }
  .visual-diff { grid-template-columns: 1fr; }
  .statusbar { align-items: flex-start; height: auto; min-height: 34px; flex-direction: column; gap: 3px; padding: 7px 12px; }
}
