/* Atherion (product planning in the chat). Approved tokens only; the brand font through inheritance. Deliberately plain: no card backgrounds, no boxes, no pills, no shadows.
   Structure comes from one thin accent line down the left of a list, type size and spacing. 44px+ targets, safe on a 390px screen, no horizontal scroll. */
.ath { margin: 4px 0 8px; max-width: 640px; color: var(--text-primary); font-family: inherit; }
.ath * { box-sizing: border-box; }
.ath-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; min-height: 28px; }
.ath-mark { display: block; width: 20px; height: auto; flex: none; }
.ath-name { flex: none; white-space: nowrap; font-size: var(--sv-type-body-secondary-size); font-weight: 600; letter-spacing: 0.02em; text-transform: none; }
.ath-sub { min-width: 0; font-size: var(--sv-type-subtitle-size); line-height: 1.3; color: var(--text-secondary); margin-left: auto; text-align: right; text-transform: none; letter-spacing: normal; overflow-wrap: anywhere; }

.ath-q { display: flex; flex-direction: column; gap: 8px; }
.ath-topic { margin: 0; font-size: var(--sv-type-tool-label-size); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.ath-prompt { margin: 0; font-size: var(--sv-type-body-size); line-height: 1.4; font-weight: 600; text-transform: none; letter-spacing: normal; overflow-wrap: anywhere; }
.ath-why, .ath-hint, .ath-note { margin: 0; font-size: var(--sv-type-body-secondary-size); line-height: 1.5; color: var(--text-secondary); overflow-wrap: anywhere; }
.ath-error { margin: 0 0 8px; font-size: var(--sv-type-body-secondary-size); line-height: 1.5; color: var(--text-primary); border-left: 1px solid var(--glass-border-focus); padding-left: 12px; }
.ath-link { align-self: flex-start; min-height: 44px; padding: 0; background: none; border: 0; color: var(--text-secondary); font: inherit; font-size: var(--sv-type-body-secondary-size); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* The list: a single thin vertical line down the left; each row has its own short, brighter segment when chosen. */
.ath-opts { display: flex; flex-direction: column; margin: 4px 0 0; border-left: 1px solid var(--border-subtle); }
.ath-opt { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 10px 4px 10px 16px; cursor: pointer; }
.ath-opt::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 2px; background: transparent; transition: background var(--dur-fast, 120ms) ease; }
.ath-opt.on::before { background: var(--text-primary); }
.ath-opt:hover .ath-opt-label { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--glass-border); }
.ath-in { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }        /* a real checkbox / radio under the label: keyboard and screen readers use it */
.ath-opt:has(.ath-in:focus-visible) { outline: 2px solid var(--glass-border-focus); outline-offset: 2px; }
.ath-opt:has(.ath-in:disabled) { opacity: 0.5; cursor: default; }
.ath-opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ath-opt-label { font-size: var(--sv-type-body-size); line-height: 1.4; overflow-wrap: anywhere; }
.ath-opt-rec { display: inline; font-size: var(--sv-type-body-secondary-size); color: var(--text-secondary); }
.ath-opt-text > .ath-opt-label + .ath-opt-rec { margin-top: -2px; }
.ath-opt-detail { font-size: var(--sv-type-body-secondary-size); line-height: 1.45; color: var(--text-secondary); overflow-wrap: anywhere; }
.ath-tick { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--text-primary); opacity: 0; }
.ath-opt.on .ath-tick { opacity: 1; }

.ath-other { width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 0 8px 16px; background: transparent; border: 0; border-left: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); border-radius: 0; color: var(--text-primary); font: inherit; font-size: var(--sv-type-body-secondary-size); }
.ath-other:focus-visible, .ath-text:focus-visible { outline: 2px solid var(--glass-border-focus); outline-offset: 2px; }
.ath-text { width: 100%; min-height: 96px; padding: 10px 0 10px 16px; background: transparent; border: 0; border-left: 1px solid var(--border-subtle); border-radius: 0; color: var(--text-primary); font: inherit; font-size: var(--sv-type-body-secondary-size); line-height: 1.5; resize: vertical; }

.ath-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 4px; }
.ath-count { font-size: var(--sv-type-body-secondary-size); color: var(--text-secondary); margin-left: auto; }

.ath-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin-top: 12px; }
.ath-actions .ath-primary { margin-left: auto; }
.ath-btn { min-height: 44px; padding: 0; background: none; border: 0; color: var(--text-secondary); font: inherit; font-size: var(--sv-type-body-secondary-size); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; }
.ath-btn:hover:not(:disabled) { color: var(--text-primary); text-decoration-color: var(--glass-border); }
.ath-btn:focus-visible, .ath-link:focus-visible { outline: 2px solid var(--glass-border-focus); outline-offset: 3px; border-radius: 2px; }
.ath-btn:disabled { opacity: 0.45; cursor: default; }
.ath-btn[aria-pressed="true"] { color: var(--text-primary); text-decoration-color: var(--text-primary); }
.ath-primary { color: var(--text-primary); font-weight: 600; text-decoration-color: var(--text-primary); }
.ath-primary::after { content: "  \2192"; text-decoration: none; display: inline-block; }

.ath-answers { margin-top: 18px; font-size: var(--sv-type-body-secondary-size); }
.ath-answers > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--text-secondary); }
.ath-answer { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; gap: 4px 12px; align-items: baseline; padding: 6px 0 6px 16px; border-left: 1px solid var(--border-subtle); }
.ath-answer-q { color: var(--text-secondary); font-size: var(--sv-type-tool-label-size); }
.ath-answer-a { overflow-wrap: anywhere; }

.ath-section { margin: 24px 0 4px; font-size: var(--sv-type-body-secondary-size); font-weight: 600; text-transform: none; letter-spacing: normal; }
.ath-tier { margin-top: 12px; }
.ath-tier > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: var(--sv-type-tool-label-size); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.ath-rec { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px 0 10px 16px; margin-left: 0; border-left: 1px solid var(--border-subtle); }
.ath-rec.in::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 2px; background: var(--text-primary); }
.ath-rec.out .ath-rec-name { text-decoration: line-through; text-decoration-color: var(--glass-border); color: var(--text-secondary); }
.ath-rec-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ath-rec-name { font-size: var(--sv-type-body-secondary-size); font-weight: 600; overflow-wrap: anywhere; }
.ath-rec-state { flex: none; font-size: var(--sv-type-tool-description-size); color: var(--text-secondary); }
.ath-rec-why, .ath-rec-meta, .ath-rec-care { margin: 0; font-size: var(--sv-type-tool-label-size); line-height: 1.5; color: var(--text-secondary); overflow-wrap: anywhere; }
.ath-rec-care { color: var(--text-primary); }
.ath-rec-actions { display: flex; gap: 20px; }
.ath-risks { margin-top: 12px; padding-left: 12px; border-left: 1px solid var(--glass-border-focus); }
.ath-risks p { margin: 4px 0; font-size: var(--sv-type-tool-label-size); line-height: 1.5; }

.ath-research { margin-top: 8px; }
.ath-sources { list-style: none; margin: 8px 0; padding: 0; }
.ath-sources li { padding: 6px 0 6px 16px; border-left: 1px solid var(--border-subtle); font-size: var(--sv-type-subtitle-size); overflow-wrap: anywhere; }
.ath-sources a { color: var(--text-primary); text-underline-offset: 3px; }
.ath-source-domain { color: var(--text-secondary); font-size: var(--sv-type-tool-label-size); }
.ath-final { margin-top: 20px; }

.ath-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; padding: 0 4px 4px; font-size: var(--sv-type-tool-label-size); color: var(--text-secondary); }
.ath-offer[hidden] { display: none; }
.ath-offer .ath-btn { color: var(--text-primary); }

/* the blueprint viewer (inside the shared modal): solid and wide enough to read a plan */
.modal:has(.ath-viewer-root) { width: min(860px, calc(100vw - 24px)); max-width: none; background: var(--bg-surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
.ath-viewer-root { width: 100%; max-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.ath-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 8px; }
.ath-viewer-bar .ath-head { margin: 0; }
.ath-viewer { overflow: auto; -webkit-overflow-scrolling: touch; padding: 0 2px 16px; }
.ath-md h2, .ath-md h3, .ath-md h4 { text-transform: none; letter-spacing: normal; }
.ath-md h2 { font-size: var(--sv-type-body-size); margin: 24px 0 8px; } .ath-md h3 { font-size: var(--sv-type-body-secondary-size); margin: 18px 0 6px; } .ath-md h4 { font-size: var(--sv-type-body-secondary-size); margin: 14px 0 4px; color: var(--text-secondary); }
.ath-md p, .ath-md li { font-size: var(--sv-type-subtitle-size); line-height: 1.55; overflow-wrap: anywhere; }
.ath-md ul { margin: 4px 0 8px; padding-left: 20px; }
.ath-md code { font-family: var(--font-mono, monospace); font-size: var(--sv-type-tool-label-size); }
.ath-code { margin: 8px 0; padding: 0 0 0 12px; overflow-x: auto; border-left: 1px solid var(--border-subtle); background: transparent; }
.ath-code code { white-space: pre; display: block; }

@media (max-width: 640px) {
  .ath { max-width: 100%; }
  .ath-prompt { font-size: var(--sv-type-body-size); }
  .ath-answer { grid-template-columns: 1fr auto; }
  .ath-answer-q { grid-column: 1 / -1; }
  .ath-actions .ath-primary { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .ath-opt::before { transition: none; } }

/* ---- Design workflow (directions, prototype, wireframes, feedback, approval, build) ----------------------------------------------------------------------- */
.athd { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
.athd-stage { margin: 0 0 8px; font-size: var(--sv-type-body-secondary-size); font-weight: 600; }
.athd-title { margin: 0 0 8px; font-size: var(--sv-type-body-size); } .athd-sub { margin: 14px 0 6px; font-size: var(--sv-type-tool-description-size); letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); font-weight: 400; }
.athd-dirs { display: flex; flex-direction: column; gap: 14px; margin: 10px 0; }
.athd-dir { border-left: 1px solid var(--border-subtle); padding: 2px 0 2px 14px; } .athd-dir.is-chosen { border-left: 2px solid var(--accent); }
.athd-dir-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; } .athd-dir-name { font-size: var(--sv-type-body-secondary-size); }
.athd-sws { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; } .athd-sw { display: block; width: 18px; height: 14px; }
.athd-facts { margin: 2px 0 0; font-size: var(--sv-type-tool-description-size); line-height: 1.5; color: var(--text-secondary); overflow-wrap: anywhere; }
.athd-details { margin: 12px 0; } .athd-details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.athd-list { list-style: none; margin: 0; padding: 0; } .athd-list li { padding: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.athd-link { min-height: 44px; padding: 0; border: 0; background: none; color: var(--text-primary); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.athd-input { width: 100%; min-height: 44px; font: inherit; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 12px; }
.athd-row { display: flex; gap: 8px; margin-bottom: 8px; } .athd-row .athd-input { flex: 1; min-width: 0; }
.athd-feedback .ath-btn, .athd-approve .ath-btn { margin-top: 8px; }
.athd-result { margin-top: 8px; border-left: 2px solid var(--accent); padding-left: 12px; } .athd-diff { flex-basis: 100%; white-space: pre-wrap; font-size: var(--sv-type-tool-description-size); color: var(--text-secondary); padding-left: 12px; }
.athd-proto { max-width: min(1180px, 96vw); } .athd-proto-bar, .athd-wireframe .ath-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.athd-proto-stage { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; } .athd-fig { margin: 0; flex: none; } .athd-fig figcaption { font-size: var(--sv-type-tool-description-size); color: var(--text-secondary); margin-bottom: 4px; }
.athd-frame { border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-surface); } .athd-frame.mobile { width: 390px; max-width: 86vw; height: 640px; } .athd-frame.desktop { width: min(1120px, 92vw); height: 620px; }
.athd-wire { margin: 8px 0; padding: 12px; overflow-x: auto; white-space: pre; font: var(--sv-type-tool-description-size)/1.35 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 8px; max-height: 60vh; }
.athd-regen { display: flex; gap: 8px; align-items: stretch; } .athd-wireframe, .athd-approval { max-width: min(760px, 94vw); }
.ath-btn-primary { background: var(--sv-accent); color: var(--sv-on-accent); border-color: transparent; padding: 0 16px; min-height: 44px; border-radius: 8px; }
@media (max-width: 640px) { .athd-row { flex-direction: column; } }
.modal:has(.athd-proto) { max-width: min(1240px, 96vw); } .modal:has(.athd-wireframe), .modal:has(.athd-approval) { max-width: min(820px, 96vw); }

/* =====================================================================================================================================================================
   ATHERION workspace: the floating Liquid Glass window opened from the chat menu ("Plan with ATHERION"). The glass itself comes from the shared .panel-sheet material
   (liquid-glass.css); this only sizes it and lays out its tabs, the blueprint reader, the review checks and the Changes history. Tokens only; 44px targets; no page-level
   horizontal scroll at 390px (wide tables and code scroll inside their own container).
   ===================================================================================================================================================================== */
.panel-sheet.ath-ws { width: min(1040px, 96vw); max-width: 96vw; height: min(86vh, 860px); max-height: 92dvh; display: flex; flex-direction: column; }
.ath-ws .panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 0; }
.aw-tabs { flex: none; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 10px; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.aw-tabs::-webkit-scrollbar { display: none; }
.aw-tab { flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--sv-type-body-secondary-size); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.aw-tab:hover { color: var(--text-primary); }
.aw-tab.on { background: rgba(var(--sv-accent-rgb), .18); color: var(--sv-accent-text); border-color: rgba(var(--sv-accent-rgb), .34); font-weight: 600; }
.aw-content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 2px 2px 20px; }
.aw-content:focus-visible { outline: 2px solid var(--sv-focus); outline-offset: -2px; }
.aw-pane { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.aw-pane > * { min-width: 0; }
.aw-lead { margin: 0; font-size: var(--sv-type-body-size); line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.aw-note { margin: 0; font-size: var(--sv-type-subtitle-size); line-height: 1.55; color: var(--text-secondary); overflow-wrap: anywhere; }
.aw-error { margin: 0; font-size: var(--sv-type-subtitle-size); line-height: 1.5; color: var(--text-primary); border-left: 2px solid var(--glass-border-focus, currentColor); padding-left: 10px; }
.aw-pane h4 { margin: 12px 0 2px; font-size: var(--sv-type-tool-description-size); letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; }
.aw-idea { width: 100%; min-height: 110px; resize: vertical; padding: 12px 14px; border-radius: 14px; font: inherit; font-size: var(--sv-type-body-secondary-size); line-height: 1.5; color: var(--text-primary); background: rgba(var(--sv-text-rgb), .05); border: 1px solid var(--lg-line, var(--border-subtle)); }
.aw-select { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; font: inherit; color: var(--text-primary); background: rgba(var(--sv-text-rgb), .05); border: 1px solid var(--lg-line, var(--border-subtle)); }
.aw-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.aw-actions .btn { min-height: 44px; }
.aw-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: var(--sv-type-tool-description-size); letter-spacing: .02em; color: var(--text-secondary); background: rgba(var(--sv-text-rgb), .07); border: 1px solid var(--lg-line, var(--border-subtle)); white-space: nowrap; }
.aw-chip.on, .aw-chip.cls-A, .aw-chip.cls-B { color: var(--sv-accent-text); background: rgba(var(--sv-accent-rgb), .14); border-color: rgba(var(--sv-accent-rgb), .3); }
.aw-chip.cls-E { color: var(--text-primary); border-color: var(--glass-border-focus, currentColor); font-weight: 600; }
.aw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aw-details { border-radius: 14px; border: 1px solid var(--lg-line, var(--border-subtle)); background: rgba(var(--sv-text-rgb), .035); }
.aw-details > summary { min-height: 48px; display: flex; align-items: center; padding: 0 14px; cursor: pointer; font-size: var(--sv-type-body-secondary-size); font-weight: 500; list-style: none; overflow-wrap: anywhere; }
.aw-details > summary::-webkit-details-marker { display: none; }
.aw-details > summary::after { content: "+"; margin-left: auto; color: var(--text-secondary); padding-left: 12px; }
.aw-details[open] > summary::after { content: "−"; }
.aw-details > summary:focus-visible { outline: 2px solid var(--sv-focus); outline-offset: -2px; border-radius: 14px; }
.aw-details-body { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 14px; min-width: 0; }
.aw-details .aw-details { background: rgba(var(--sv-text-rgb), .03); }
.aw-sec-head { display: flex; gap: 6px; flex-wrap: wrap; }
.aw-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: var(--sv-type-subtitle-size); line-height: 1.5; overflow-wrap: anywhere; }
.aw-scroll { overflow-x: auto; max-width: 100%; border-radius: 12px; border: 1px solid var(--lg-line, var(--border-subtle)); -webkit-overflow-scrolling: touch; }
.aw-table { border-collapse: collapse; width: 100%; font-size: var(--sv-type-tool-label-size); line-height: 1.4; }
.aw-table th, .aw-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--lg-line, var(--border-subtle)); }
.aw-table th { font-weight: 600; color: var(--text-secondary); white-space: nowrap; background: rgba(var(--sv-text-rgb), .04); }
.aw-table td { min-width: 90px; }
.aw-matrix td:not(:first-child), .aw-matrix th:not(:first-child) { text-align: center; min-width: 76px; }
.aw-matrix td:first-child { min-width: 180px; position: sticky; left: 0; background: var(--lg-glass-strong, var(--sv-card)); }
.aw-code { margin: 0; max-width: 100%; overflow-x: auto; padding: 12px; border-radius: 12px; font-size: var(--sv-type-tool-description-size); line-height: 1.55; background: rgba(0, 0, 0, .28); border: 1px solid var(--lg-line, var(--border-subtle)); -webkit-overflow-scrolling: touch; }
.aw-code code { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); white-space: pre; }
.aw-checks { display: flex; flex-direction: column; }
.aw-check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--lg-line, var(--border-subtle)); }
.aw-check-mark { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: var(--sv-type-tool-label-size); border: 1px solid var(--lg-line, var(--border-subtle)); }
.aw-check.ok .aw-check-mark { background: rgba(var(--sv-accent-rgb), .2); color: var(--sv-accent-text); border-color: rgba(var(--sv-accent-rgb), .4); }
.aw-check.blocked .aw-check-mark { color: var(--text-primary); border-color: var(--glass-border-focus, currentColor); }
.aw-check-state { color: var(--text-secondary); font-size: var(--sv-type-tool-label-size); }
.aw-approved { margin: 0; padding: 12px 14px; border-radius: 14px; font-size: var(--sv-type-body-secondary-size); line-height: 1.5; background: rgba(var(--sv-accent-rgb), .12); border: 1px solid rgba(var(--sv-accent-rgb), .3); }
.aw-held { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--glass-border-focus, currentColor); background: rgba(var(--sv-text-rgb), .05); }
.aw-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.aw-hist-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--lg-line, var(--border-subtle)); }
.aw-hist-top { display: flex; flex-wrap: wrap; gap: 6px; }
.aw-hist-text { font-size: var(--sv-type-body-secondary-size); line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .panel-sheet.ath-ws { width: 100vw; max-width: 100vw; height: 92dvh; border-radius: 22px 22px 0 0; }
  .aw-tab { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) { .aw-tab { transition: none; } }
