/* Fixed icon boxes and predictable summary layout. */
.priority-group>summary{display:grid;grid-template-columns:24px minmax(0,1fr) auto 24px;align-items:center;gap:12px;list-style:none;padding:14px 16px}
.priority-group>summary::marker,.account-password>summary::marker{content:""}.priority-group>summary::-webkit-details-marker,.account-password>summary::-webkit-details-marker{display:none}
.priority-group>summary>.priority-icon{width:24px;height:24px;display:block;flex:none}.priority-group>summary>.priority-chevron{width:24px;height:24px;display:grid;place-items:center;line-height:1;font-size:20px;color:var(--muted);flex:none}
.priority-group>summary>span:not(.priority-chevron){min-width:0;line-height:1.4}.priority-count{min-width:28px;text-align:center;line-height:20px;justify-self:end}.priority-flag{vertical-align:middle;line-height:20px}.priority-flag .priority-icon{display:block;width:18px;height:18px}.priority-finding .finding-header{align-items:center;justify-content:space-between}.priority-finding .finding-header h4{min-width:0;flex:1 1 200px}.priority-finding .ref{flex:0 1 auto;overflow-wrap:anywhere}
.ui-icon{display:block;width:20px;height:20px;flex:0 0 20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.top-account{display:flex;align-items:center;gap:10px}.notifications,.account-dropdown{position:relative}.top-account .notification-trigger{width:36px;height:36px;padding:8px;border:1px solid var(--line);background:var(--surface);color:var(--muted);display:grid;place-items:center;border-radius:10px}.top-account .account-trigger{display:flex;align-items:center;gap:8px;padding:5px 9px;background:var(--surface);border:1px solid var(--line);color:var(--ink);height:36px}.account-trigger .account-name{font-size:12px;color:var(--ink);max-width:140px}.account-avatar{width:24px;height:24px;display:grid;place-items:center;background:#ccf3ed;color:#147779;border-radius:50%;font-size:11px}.account-trigger>.ui-icon{width:16px;height:16px;flex-basis:16px}.notification-popover,.account-dropdown-panel{position:absolute;right:0;top:calc(100% + 8px);min-width:180px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 40px #10243d20;z-index:70;padding:6px}.notification-popover{width:min(280px,calc(100vw - 30px));padding:16px}.notification-popover::before{content:"";position:absolute;top:-10px;left:0;right:0;height:10px}.notification-popover strong{font-size:13px}.notification-popover p{font-size:12px;color:var(--muted);padding:22px 0;text-align:center}.account-dropdown-panel button{display:block;width:100%;text-align:left;border:0;background:transparent;color:var(--ink);font-size:13px;padding:10px 12px;border-radius:7px}.account-dropdown-panel button:hover,.account-dropdown-panel button:focus-visible{background:var(--paper)}.account-dropdown-panel button:last-child{border-top:1px solid var(--line);border-radius:0;color:#dc2626}.account-modal{padding:0;border:1px solid var(--line);border-radius:16px;width:min(620px,calc(100vw - 28px));max-height:88dvh;overflow:auto;margin:auto;background:var(--surface);color:var(--ink);box-shadow:0 24px 80px #10243d40}.account-modal::backdrop{background:#091b3690;backdrop-filter:blur(3px)}.account-modal>.account-modal-heading{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;height:auto;padding:16px 20px;background:var(--surface);z-index:2;border-bottom:1px solid var(--line)}.account-modal-heading h2{font-size:17px;font-weight:700}.modal-close{padding:6px;border-radius:8px;background:var(--paper)}.account-modal-body{padding:20px}.account-email{font-size:14px;overflow-wrap:anywhere;margin-bottom:20px}.account-email span{display:block;font-size:11px;color:var(--muted);margin-top:4px}.account-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}.account-form label{display:block;font-size:12px;font-weight:600;margin-bottom:16px}.account-fields label{margin-bottom:0}.account-form input,.account-form select{display:block;min-width:0;width:100%;padding:10px 12px;margin-top:6px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font-size:14px}.account-form fieldset{border:0;padding:0;margin:0}.account-form fieldset:disabled input,.account-form fieldset:disabled select{opacity:1;color:var(--muted);background:var(--surface)}.account-form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.account-form .primary-button,.account-form .secondary-button{font-size:13px;padding:10px 16px;min-height:38px}.account-password{margin-top:22px;border-top:1px solid var(--line);padding-top:16px}.account-password>summary{display:flex;align-items:center;justify-content:space-between;font-size:13px;font-weight:600;cursor:pointer}.account-password[open]>summary .ui-icon{transform:rotate(180deg)}.account-password .account-form{padding-top:16px}.account-feedback{font-size:12px;color:var(--deep);margin-top:16px;line-height:1.6}.account-feedback.error{color:#dc2626}.account-feedback:empty{display:none}
/* Fill the workspace and keep scrolling inside the conversation. */
body.conversation-active .page{height:100dvh;min-width:0}body.conversation-active .page>main{max-width:none;width:100%;margin:0;flex:1 1 0;min-height:0;min-width:0;padding:14px 24px 12px}body.conversation-active #chat-thread{flex:1 1 0;min-height:0;width:100%;max-width:none;padding-left:0;padding-right:8px}body.conversation-active .chat-thread::before,.conversation-active .assistant-message::before,.conversation-active .past-response::before{display:none}.conversation-active .assistant-message,.conversation-active .past-response{width:100%;max-width:none;margin:12px 0 18px;border-radius:14px}.conversation-active .query-message,.conversation-active .past-query{max-width:min(90%,1000px)}.conversation-active .chat-composer{width:100%;max-width:none}.page>header{position:relative;z-index:40}.conversation-active .sidebar .chat-history{flex:1;min-height:0;overflow-y:auto}
:root[data-theme=dark]{color-scheme:dark;--ink:#e2e8f0;--muted:#a3b5c9;--line:#334155;--surface:#142033;--paper:#0e192a;--deep:#5eead4;--teal:#22d3ee;--auth-ink:#e2e8f0;--auth-muted:#a3b5c9;--auth-line:#334155}
[data-theme=dark] body{background:#0c2025;color:var(--ink)}[data-theme=dark] .sidebar,[data-theme=dark] .page>header,[data-theme=dark] .chat-composer,[data-theme=dark] .assistant-message,[data-theme=dark] .past-response,[data-theme=dark] .conversation-options,[data-theme=dark] .result-card,[data-theme=dark] .analysis-extra,[data-theme=dark] .professional-review-modal,[data-theme=dark] .review-modal-heading{background:var(--surface);color:var(--ink);border-color:var(--line)}[data-theme=dark] .hero,[data-theme=dark] .privacy-card{background:linear-gradient(120deg,#16333a,#1b3b43)}[data-theme=dark] .hero h1,[data-theme=dark] .hero p,[data-theme=dark] #results h3,[data-theme=dark] #results h4,[data-theme=dark] .compact-summary b{color:var(--ink)}[data-theme=dark] .hero .eyebrow{color:#5eead4}[data-theme=dark] .nav-item.active,[data-theme=dark] .account-avatar,[data-theme=dark] .local-badge{background:#1c3e45;color:#5eead4}[data-theme=dark] .priority-group,[data-theme=dark] .priority-finding{background:var(--surface);border-color:var(--line)}[data-theme=dark] .priority-group.high,[data-theme=dark] .priority-flag.high{--priority-bg:#3b1e2b;--priority-color:#f87171}[data-theme=dark] .priority-group.medium,[data-theme=dark] .priority-flag.medium{--priority-bg:#372e18;--priority-color:#facc15}[data-theme=dark] .priority-group.low,[data-theme=dark] .priority-flag.low{--priority-bg:#29424a;--priority-color:#a1b4b8}[data-theme=dark] .priority-group summary,[data-theme=dark] .priority-flag{color:var(--ink)}[data-theme=dark] .priority-group summary small,[data-theme=dark] .priority-finding .ref,[data-theme=dark] .context-assessment,[data-theme=dark] .result-footnote,[data-theme=dark] .compact-summary,[data-theme=dark] .chat-timestamp,[data-theme=dark] .message-label,[data-theme=dark] .ai-disclosure{color:var(--muted)}[data-theme=dark] .flagged-sentences blockquote,[data-theme=dark] .evidence-sentence,[data-theme=dark] .query-message,[data-theme=dark] .past-query{background:#1a343c;color:var(--ink);border-color:var(--line)}[data-theme=dark] .query-message p,[data-theme=dark] .past-query p{color:var(--ink)}[data-theme=dark] .conversation-active #input,[data-theme=dark] textarea,[data-theme=dark] input,[data-theme=dark] select{background:var(--paper);color:var(--ink);border-color:var(--line)}[data-theme=dark] .secondary-button,[data-theme=dark] .text-button,[data-theme=dark] .analysis-extra summary,[data-theme=dark] .why-details{color:#a7e1dc}[data-theme=dark] .risk-meter,[data-theme=dark] .source-panel,[data-theme=dark] .mapping,[data-theme=dark] .engagement-settings{background:var(--surface);color:var(--ink);border-color:var(--line)}[data-theme=dark] .risk-meter p,[data-theme=dark] .risk-meter small{color:var(--muted)}[data-theme=dark] .response-grid input,[data-theme=dark] .review-modal-body textarea{background:var(--paper)}
@media(max-width:600px){.priority-group>summary{gap:8px;padding:12px;grid-template-columns:22px minmax(0,1fr) auto 20px}.priority-group>summary strong{font-size:13px}.priority-group>summary small{font-size:11px}.top-account{gap:5px}.account-trigger .account-name{max-width:75px}.account-trigger .account-avatar{display:none}.account-fields{grid-template-columns:1fr}.account-modal-body{padding:16px}body.conversation-active .page>main{padding:8px 10px}.top-actions #startup-status{display:none}.top-account .account-trigger{padding:5px 8px}.page>header{padding:0 12px}}
[data-theme=dark] .table-scroll,[data-theme=dark] table,[data-theme=dark] th,[data-theme=dark] td,[data-theme=dark] .finding,[data-theme=dark] .response-grid>div,[data-theme=dark] .response-grid label,[data-theme=dark] .data-preview,[data-theme=dark] .stat-card{background:var(--surface);color:var(--ink);border-color:var(--line)}[data-theme=dark] .recommendation,[data-theme=dark] .finding>p,[data-theme=dark] .result-card-title p,[data-theme=dark] .text-preview,[data-theme=dark] .table-scroll small{color:var(--muted)}[data-theme=dark] .account-password .field-help{color:var(--muted)}[data-theme=dark] .source-actions>span,[data-theme=dark] .editor-bottom{color:var(--muted)}[data-theme=dark] .conversation-active #upload-trigger{background:var(--paper);border-color:var(--line);color:var(--deep)}[data-theme=dark] .chat-composer .source-actions{background:var(--surface)}
.correction-suggestion{margin:12px 0;padding:12px 14px;background:#effaf6;border:1px solid #c7e9db;border-radius:9px;font-size:12px;line-height:1.65;color:#244d42}.correction-suggestion>strong{display:block;margin-bottom:5px;font-size:12px}.correction-suggestion ul{list-style:disc;padding-left:18px;margin:0}.correction-suggestion li+li{margin-top:5px}.correction-suggestion p{margin:8px 0 0}.review-token-status{font-size:10px;color:var(--deep);padding:5px 7px;border-radius:6px;background:var(--paper);white-space:nowrap}[data-theme=dark] .correction-suggestion{background:#14332e;border-color:#28594c;color:#b4e2d1}@media(max-width:600px){.review-token-status{display:none}}

.settings-tabs{display:flex;gap:8px;border-bottom:1px solid var(--line);margin-bottom:20px;padding-bottom:10px}.settings-tabs button{padding:9px 16px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--muted);font-size:13px}.settings-tabs button[aria-selected=true]{background:var(--paper);border-color:var(--line);color:var(--deep);font-weight:600}.usage-plan{font-size:13px;font-weight:600;margin-bottom:16px}.usage-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px}.usage-metrics>div{padding:14px 10px;border:1px solid var(--line);border-radius:10px;background:var(--paper)}.usage-metrics span{display:block;font-size:11px;color:var(--muted)}.usage-metrics strong{display:block;font-size:24px;margin-top:6px;color:var(--ink)}.usage-progress{width:100%;height:10px;accent-color:var(--deep);margin-bottom:14px}.usage-feedback{font-size:12px;color:var(--muted);margin-top:10px}#usage-panel>.field-help{margin:10px 0 16px}#usage-panel[hidden],#preferences-panel[hidden]{display:none}

.notification-trigger.has-notification{position:relative}.notification-trigger.has-notification::after{content:"";position:absolute;top:3px;right:3px;width:8px;height:8px;border-radius:50%;background:#dc2626;border:2px solid var(--surface)}.account-usage-warning{display:flex;align-items:flex-start;gap:12px;flex:0 0 auto;padding:12px 24px;border-bottom:1px solid #f0cd7b;background:#fffbeb;color:#854d0e}.account-usage-warning>.ui-icon{margin-top:2px}.account-usage-warning>div:first-of-type{flex:1;min-width:0}.account-usage-warning strong{font-size:12px}.account-usage-warning p{font-size:11px;line-height:1.5;margin:3px 0 0}.usage-warning-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;font-size:12px}.usage-warning-actions a{font-weight:600;text-decoration:underline;text-underline-offset:3px;color:inherit}.account-usage-warning.exhausted{background:#fef2f2;border-color:#fecaca;color:#b91c1c}.token-notification{padding:12px 0 4px;color:#854d0e}.token-notification h3{font-size:13px;margin:0}.notification-popover .token-notification p{text-align:left;padding:8px 0;margin:0;font-size:12px;line-height:1.5}.token-notification.exhausted{color:#b91c1c}.token-notification .usage-warning-actions{margin-top:8px}[data-theme=dark] .account-usage-warning{background:#372e18;border-color:#66552a;color:#fde68a}[data-theme=dark] .account-usage-warning.exhausted{background:#3b1e2b;border-color:#63323e;color:#fca5a5}[data-theme=dark] .token-notification{color:#fde68a}[data-theme=dark] .token-notification.exhausted{color:#fca5a5}@media(max-width:600px){.account-usage-warning{padding:10px 12px;flex-wrap:wrap;gap:8px}.account-usage-warning>.usage-warning-actions{margin-left:28px}.account-usage-warning>div:first-of-type{flex-basis:calc(100% - 32px)}}

.subscription-plans{margin:22px 0}.subscription-plans h3{font-size:15px;margin-bottom:8px}.subscription-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}.subscription-price-card{border:1px solid var(--line);background:var(--paper);padding:18px;border-radius:12px;display:flex;flex-direction:column;min-width:0}.subscription-price-card.current{border-color:var(--teal);box-shadow:inset 0 3px var(--teal)}.plan-card-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.plan-card-heading h4{font-size:14px;overflow-wrap:anywhere}.plan-badge{font-size:9px;padding:4px 6px;border:1px solid var(--line);border-radius:5px;white-space:nowrap;color:var(--deep)}.plan-allowance{display:flex;flex-direction:column;gap:3px;margin-top:24px}.plan-allowance strong{font-size:32px;line-height:1.1;overflow-wrap:anywhere}.plan-allowance span,.plan-period{font-size:11px;color:var(--muted)}.plan-period{margin-top:8px}.subscription-price-card ul{font-size:11px;line-height:1.7;padding-left:16px;margin:18px 0;color:var(--muted);flex:1}.subscription-price-card button{padding:10px;border:1px solid var(--line);border-radius:8px;color:var(--muted);background:var(--surface);font-size:12px;cursor:not-allowed;opacity:.65}.site-footer{box-sizing:border-box;position:relative;z-index:35;width:100%;margin:0;padding:16px 24px;background:var(--surface);border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}.page{min-height:calc(100dvh - 50px)}body.conversation-active .page{height:calc(100dvh - 50px)}body.conversation-active .site-footer{display:flex;height:50px}[data-theme=dark] .site-footer{background:var(--surface);color:var(--muted)}@media(max-width:600px){.subscription-card-grid{grid-template-columns:1fr}.site-footer{padding:12px;justify-content:center;font-size:10px;gap:5px}.site-footer>span{width:100%;text-align:center}body.conversation-active .page{height:calc(100dvh - 80px)}body.conversation-active .site-footer{height:80px}}

/* Align the workspace chrome with the sidebar at every breakpoint. */
:root{--workspace-sidebar-width:244px;--workspace-blue:#d3e9e8}
body[data-account-state]{background-color:var(--workspace-blue)}
body[data-account-state] .page{background:var(--workspace-blue)}
body[data-account-state] .page>header{position:sticky;top:0;z-index:40;background:var(--surface);flex-shrink:0}
body[data-account-state] .sidebar{bottom:0;z-index:60}
body[data-account-state] .site-footer{margin-left:var(--workspace-sidebar-width);width:calc(100% - var(--workspace-sidebar-width));z-index:20}
[data-theme=dark]{--workspace-blue:#102c31}
@media(max-width:1150px){:root{--workspace-sidebar-width:214px}}
@media(max-width:850px){:root{--workspace-sidebar-width:0px}}

/* Give the welcome section its own spacing and compact it for account holders. */
body[data-account-state] .page>main>.hero{width:100%;box-sizing:border-box;margin:0 0 24px;padding:28px 30px;gap:20px}
body[data-account-state=guest] .hero .eyebrow{margin:0 0 12px}
body[data-account-state=signed-in] .page>main>.hero{min-height:0;margin-bottom:16px;padding:16px 20px}
body[data-account-state=signed-in] .hero .eyebrow,body[data-account-state=signed-in] .hero-right{display:none}
body[data-account-state=signed-in] .hero h1{font-size:22px;line-height:1.3;letter-spacing:-.4px;margin-bottom:6px}
body[data-account-state=signed-in] .hero-content>p:last-child{font-size:13px;line-height:1.5}
@media(max-width:600px){body[data-account-state] .page>main>.hero{padding:20px;margin-bottom:18px}body[data-account-state=signed-in] .page>main>.hero{padding:14px 16px;margin-bottom:12px}body[data-account-state=signed-in] .hero h1{font-size:19px}}

.subscription-price-card .plan-price{font-size:18px;font-weight:700;margin-top:12px;color:var(--deep)}

.account-form .review-preferences{border:1px solid var(--line);border-radius:12px;padding:16px;margin:20px 0}.review-preferences legend{font-size:14px;font-weight:700;padding:0 6px}.account-form .review-mode-toggle{display:flex;align-items:flex-start;gap:9px;line-height:1.6}.account-form .review-mode-toggle input[type=checkbox]{width:17px;height:17px;flex:0 0 17px;margin:2px 0 0;padding:0;accent-color:var(--deep)}.notification-popover{max-height:min(70vh,500px);overflow-y:auto}
