/* Shared workspace layer. Existing components retain their behavior and states. */
@font-face { font-family:Inter; font-style:normal; font-weight:400; font-display:swap; src:url('/static/fonts/inter-400.ttf') format('truetype'); }
@font-face { font-family:Inter; font-style:normal; font-weight:500; font-display:swap; src:url('/static/fonts/inter-500.ttf') format('truetype'); }
@font-face { font-family:Inter; font-style:normal; font-weight:600; font-display:swap; src:url('/static/fonts/inter-600.ttf') format('truetype'); }
@font-face { font-family:Inter; font-style:normal; font-weight:700; font-display:swap; src:url('/static/fonts/inter-700.ttf') format('truetype'); }
:root {
  --bg:#eef0ed; --surface:#fcfdf9; --surface-subtle:#f5f7f2;
  --surface-inset:#eaf0e7; --border:#d7ddd4; --border-strong:#b2bdb2;
  --text:#242d28; --text-2:#59665c; --text-3:#68766b;
  --accent:#21255e; --accent-strong:#171a42; --accent-soft:#e4e5ec;
  --sidebar:#111331; --sidebar-soft:#171a42; --sidebar-w:238px; --r:5px;
  --sans:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --terminal-gold:#cfbd8a;
  --workspace-width:1480px; --workspace-gutter:32px;
}
.terminal-ui { font-family:var(--sans); -webkit-font-smoothing:antialiased; }
.terminal-ui [hidden] { display:none !important; }
.skip-link { position:fixed; top:8px; left:8px; transform:translateY(-150%); z-index:100; background:var(--surface); color:var(--accent); padding:12px 18px; border:2px solid var(--accent); }
.skip-link:focus { transform:none; }
:where(a,button,input,select,textarea,summary):focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.sidebar { padding:26px 18px 20px; background:var(--sidebar); border-right:1px solid color-mix(in srgb,var(--accent) 47%,black); }
.brand { padding:0 10px 28px; gap:11px; }
.brand-mark { border:1px solid #7a8c77; background:transparent; color:color-mix(in srgb,var(--accent) 13%,white); border-radius:4px; font-weight:500; }
.brand-name { font-size:17px; letter-spacing:-.45px; font-weight:600; }
.brand-sub { font-size:10px; letter-spacing:1.25px; text-transform:uppercase; color:#b9c6b7; margin-top:5px; }
.nav { gap:4px; }
.nav-heading { padding:12px 12px 10px; font-size:10px; color:#aab9a9; letter-spacing:1.5px; }
.nav-link { min-height:42px; padding:11px 12px; border-left:2px solid transparent; border-radius:3px; color:color-mix(in srgb,var(--accent) 22%,white); font-size:13px; font-weight:450; }
.nav-link:hover { color:#fff; background:color-mix(in srgb,var(--accent) 85%,black); }
.nav-link.active { border-left-color:var(--terminal-gold); background:var(--sidebar-soft); color:#fff; font-weight:550; }
.sidebar :where(a,button,select):focus-visible { outline-color:var(--terminal-gold); }
.sidebar-controls { border-color:#425245; }
.sidebar-user span,.sidebar .text-button { color:color-mix(in srgb,var(--accent) 30%,white); }
.sidebar .language-control { border-color:#536452; background:color-mix(in srgb,var(--accent) 78%,black); color:#edf2e9; border-radius:4px; }
.terminal-ui .content { flex:1; width:calc(100% - var(--sidebar-w)); max-width:none; min-width:0; padding:0; }
.workspace-canvas { width:100%; max-width:var(--workspace-width); margin-inline:auto; padding:0 var(--workspace-gutter) 60px; }
.workspace-canvas--form { max-width:824px; }
.workspace-canvas--settings { max-width:704px; }
.workspace-topbar { margin:0 0 24px; background:#f8faf5; border-bottom:1px solid var(--border); color:var(--text-2); font-size:12px; }
.workspace-topbar-inner { width:100%; max-width:var(--workspace-width); margin-inline:auto; min-height:59px; display:flex; justify-content:space-between; align-items:center; gap:16px; padding:12px var(--workspace-gutter); }
.workspace-topbar-inner>div { display:flex; gap:12px; align-items:center; min-width:0; }
.workspace-product { color:var(--text-3); }
.workspace-context { flex-shrink:0; font-variant-numeric:tabular-nums; }
.workspace-demo { padding:4px 7px; border:1px solid color-mix(in srgb,var(--accent) 21%,white); border-radius:3px; color:var(--text-2); font-size:10px; }
.page-head,.watch-page-head { margin:0 0 22px; gap:20px; align-items:center; }
.page-head h1,.watch-page-head h1,.research-head h1,.deal-page-head h1 { font-family:var(--sans); font-size:29px; line-height:1.2; font-weight:550; letter-spacing:-.9px; margin:0; }
.page-head .sub { max-width:80ch; font-size:12px; line-height:1.65; margin-top:8px; }
.workspace-snapshot { color:var(--accent); font-variant-numeric:tabular-nums; }
.privacy-toolbar { margin-bottom:12px; }
.privacy-toolbar .btn { min-height:30px; padding:5px 10px; font-size:11px; }
.btn { font-family:var(--sans); border-radius:4px; font-size:12px; min-height:36px; box-shadow:none; }
.btn-primary { background:var(--accent); border-color:var(--accent); }
.btn-primary:hover { background:var(--accent-strong); }
.btn-ghost { background:var(--surface); }
.panel,.work-section,.form-section,.watch-board { border-radius:5px; box-shadow:none; background:var(--surface); }
.section-head,.panel-head,.form-section-head { padding:16px 20px; }
.section-head h2,.panel-title,.form-section-head h2,.deal-results .section-head h2,.deal-inputs .form-section-head h2 { font-family:var(--sans); font-size:14px; font-weight:600; letter-spacing:-.2px; }
.section-head p,.panel-meta { font-size:11px; line-height:1.6; color:var(--text-2); }
.metric-grid { gap:0; border:1px solid var(--border); border-top:2px solid color-mix(in srgb,var(--accent) 82%,white); border-radius:4px; background:var(--surface); overflow:hidden; margin-bottom:20px; }
.metric { padding:21px 20px; border:0; border-radius:0; border-right:1px solid var(--border); box-shadow:none; background:transparent; min-width:0; }
.metric:last-child { border-right:0; }
.metric-emphasis { background:#edf3e9; }
.metric-label { color:var(--text-2); font-size:10px; letter-spacing:.5px; }
.metric-value { font-family:var(--sans); font-size:clamp(21px,2.05vw,30px); font-weight:500; letter-spacing:-.85px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.metric-note { font-size:11px; line-height:1.55; margin-top:8px; }
.dashboard-grid { grid-template-columns:minmax(0,1.75fr) minmax(270px,1fr); grid-template-areas:'comparison attention' 'allocation allocation'; gap:20px; margin-bottom:20px; }
.dashboard-grid>.work-section { margin:0; }
.dashboard-comparison { grid-area:comparison; }
.dashboard-attention { grid-area:attention; }
.dashboard-allocation { grid-area:allocation; display:grid; grid-template-columns:205px minmax(0,1fr); align-items:center; }
.dashboard-allocation .section-head { border-bottom:0; }
.dashboard-allocation .allocation-chart { padding:20px; }
.dashboard-allocation .allocation-list { display:flex; gap:14px 30px; flex-wrap:wrap; }
.dashboard-allocation .allocation-list>div { display:flex; gap:12px; border:0; padding-bottom:0; }
.dashboard-allocation .allocation-list em { font-size:11px; }
.holding-bar-row { grid-template-columns:minmax(110px,1fr) minmax(90px,1.1fr) auto; }
.holding-bar-name { font-size:12px; }
.holding-bar-values b,.holding-bar-values em,.allocation-list b,.allocation-list em { font-family:var(--sans); font-variant-numeric:tabular-nums; }
.action-item { padding:16px 20px; }
.action-item b { font-size:12px; font-weight:550; }
.action-item em { font-size:11px; line-height:1.6; }
.tbl { font-size:12px; font-variant-numeric:tabular-nums; }
.tbl th { background:#f6f8f3; color:var(--text-2); font-size:10px; font-weight:600; letter-spacing:.5px; padding:12px 16px; }
.tbl td { padding:15px 16px; border-color:var(--border); }
.tbl .num,.watch-price,.watch-target,.watch-change,.watch-summary b,.watch-history-head strong { font-family:var(--sans); font-variant-numeric:tabular-nums; }
.tbl tbody tr:hover { background:#f1f5ed; }
.table-sub { font-size:10px; line-height:1.6; }
.table-scroll { max-width:100%; overflow-x:auto; }
.collection-toolbar { display:flex; flex-wrap:wrap; gap:14px; padding:18px 20px 12px; align-items:flex-end; border-bottom:1px solid var(--border); }
.collection-toolbar .fld { margin:0; min-width:145px; }
.collection-toolbar .collection-search { flex:1; min-width:200px; }
.collection-toolbar input,.collection-toolbar select { width:100%; }
.collection-result-count { padding:9px 20px; font-size:11px; color:var(--text-2); border-bottom:1px solid var(--border); }
.fld label { font-size:11px; font-weight:550; }
input,select,textarea { font-family:var(--sans); border-radius:4px; }
.deal-workspace { gap:20px; grid-template-columns:minmax(265px,305px) minmax(0,1fr); }
.deal-verdict-grid h2,.deal-empty-range span { font-family:var(--sans); font-size:23px; font-weight:550; letter-spacing:-.5px; }
.deal-numbers strong { font-weight:550; letter-spacing:-.5px; }
.deal-checks { line-height:1.75; }
.deal-price-check { --price-buy:#216443; --price-buy-bg:#edf6ee; --price-avoid:#a32e2e; --price-avoid-bg:#fcf0ef; --price-verify:#825b15; --price-verify-bg:#fbf5e7; }
.price-verdict { display:flex; align-items:flex-start; gap:13px; padding:20px; background:var(--surface-subtle); border-bottom:1px solid var(--border); color:var(--text-2); }
.price-verdict--buy { background:var(--price-buy-bg); color:var(--price-buy); }
.price-verdict--avoid { background:var(--price-avoid-bg); color:var(--price-avoid); }
.price-verdict--verify { background:var(--price-verify-bg); color:var(--price-verify); }
.price-verdict-icon { display:grid; place-items:center; flex:0 0 30px; height:30px; border:1px solid currentColor; border-radius:50%; font-size:21px; line-height:1; }
.price-verdict h2 { font:600 23px/1.25 var(--sans); letter-spacing:-.5px; margin:0 0 7px; color:inherit; }
.price-verdict p { font-size:12px; line-height:1.65; max-width:85ch; }
.price-context-grid h2 { font-size:18px; }
.price-comparison { border-top:1px solid var(--border); padding:20px; }
.price-comparison-head { display:flex; gap:12px; align-items:baseline; justify-content:space-between; margin-bottom:22px; }
.price-comparison-head h3 { font-size:14px; font-weight:600; }
.price-comparison-head>span { font-size:10px; color:var(--text-2); }
.price-bar-row { display:grid; grid-template-columns:minmax(130px,1fr) minmax(80px,2fr) minmax(110px,auto); gap:18px; align-items:center; margin:20px 0; font-size:12px; }
.price-bar-row>span { font-weight:550; }
.price-bar-row small,.price-range-summary small { display:block; margin-top:4px; font-size:10px; font-weight:400; color:var(--text-2); line-height:1.5; }
.price-bar-row strong { text-align:right; font-size:15px; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }
.price-bar-track { height:16px; background:#edf0eb; border-radius:3px; overflow:hidden; }
.price-bar-track i { display:block; height:100%; background:#77817b; border-radius:3px; }
.price-bar-row--buy .price-bar-track i { background:var(--price-buy); }
.price-bar-row--avoid .price-bar-track i { background:var(--price-avoid); }
.price-bar-row--verify .price-bar-track i { background:var(--price-verify); }
.price-bar-row--buy strong { color:var(--price-buy); }
.price-bar-row--avoid strong { color:var(--price-avoid); }
.price-bar-row--verify strong { color:var(--price-verify); }
.price-bar-row--market .price-bar-track i { background:var(--accent); }
.price-bar-row--ceiling .price-bar-track i { background:transparent; border:2px solid #637c6b; }
.price-range-summary { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; padding:15px; background:var(--surface-subtle); border:1px solid var(--border); border-radius:4px; margin-top:24px; font-size:12px; }
.price-range-summary strong { font-size:14px; font-weight:550; font-variant-numeric:tabular-nums; }
.price-comparison-note { font-size:10px; line-height:1.65; color:var(--text-2); margin:12px 0; }
.price-evidence { border-top:1px solid var(--border); margin-top:16px; }
.price-evidence summary { cursor:pointer; padding:14px 0 0; color:var(--accent); font-size:12px; }
.price-evidence[open] summary { padding-bottom:14px; }
@media(max-width:1150px) {
  .price-bar-row { grid-template-columns:minmax(0,1fr) auto; gap:8px 14px; }
  .price-bar-track { grid-column:1/-1; grid-row:2; }
  .price-bar-row strong { grid-column:2; grid-row:1; }
  .price-comparison-head { flex-direction:column; gap:6px; }
}
.research-layout { max-width:1100px; }
.research-history-bar { border:1px solid var(--border); border-radius:5px 5px 0 0; background:var(--surface); padding:14px 20px; }
.research-history-bar .fld { max-width:420px; }
.research-history-bar button { margin-left:auto; }
.research-layout>.research-note { border:1px solid var(--border); border-top:0; border-radius:0 0 5px 5px; padding:10px 20px; margin:0 0 18px; background:#f5f7f1; font-size:11px; }
.research-main { padding:0 24px 20px; border:1px solid var(--border); border-radius:5px; background:var(--surface); }
#research-chat { min-height:330px; max-height:60vh; padding:24px 2px; }
.research-welcome { min-height:300px; gap:15px; }
.research-welcome h2 { font-size:25px; font-weight:550; letter-spacing:-.6px; }
.research-avatar { background:var(--accent-soft); border-radius:5px; }
.research-prompts { gap:10px; }
.research-prompts button { border-radius:5px; padding:12px 15px; background:#f6f8f2; text-align:left; }
.research-prompts button:hover { border-color:var(--accent); background:var(--accent-soft); }
.research-compose { border-radius:6px; box-shadow:none; background:#fff; }
.research-user .research-bubble { border-radius:8px 8px 2px 8px; background:color-mix(in srgb,var(--accent) 11%,white); }
.research-message { margin-bottom:26px; }
.research-assistant .research-bubble { padding:0; }
.research-prose { max-width:82ch; }
.research-source-card { border-radius:4px; background:#f8faf5; }
.research-bubble p,.research-prose p { line-height:1.7; }
.watch-board { border-radius:5px; }
.watch-list-head h2 { font-size:21px; font-weight:550; }
.watch-main .watch-table th { font-size:10px; }
.watch-detail { border-top-color:var(--bg); }
.notice { line-height:1.6; border-radius:4px; }
.notice.success { border-color:#bed8c9; background:var(--green-soft); color:var(--green); }
.disclaimer { line-height:1.65; }
@media(max-width:1200px) {
  :root { --sidebar-w:210px; --workspace-gutter:24px; }
  .dashboard-grid { grid-template-columns:minmax(0,1fr); grid-template-areas:'comparison' 'attention' 'allocation'; }
  .metric { padding:18px 14px; }
  .deal-workspace { grid-template-columns:265px minmax(0,1fr); gap:16px; }
}
@media(max-width:900px) {
  :root { --workspace-gutter:22px; }
  .shell { display:block; }
  .sidebar { display:block; position:relative; width:100%; min-height:0; height:auto; padding:15px 18px; }
  .brand { padding:0 0 14px; }
  .brand-sub,.nav-heading { display:none; }
  .sidebar .nav { display:flex; flex-direction:row; flex-wrap:wrap; gap:4px; }
  .nav-link { min-height:36px; padding:8px 10px; font-size:12px; }
  .sidebar-controls { display:flex; align-items:center; justify-content:space-between; margin:12px 0 0; padding:0; border:0; }
  .sidebar-controls .sidebar-foot { display:flex; margin:0; padding:0; border:0; }
  .sidebar-controls .language-switcher { max-width:200px; margin:0; }
  .terminal-ui .content { width:100%; }
  .workspace-canvas { padding-bottom:40px; }
  .workspace-topbar { margin-bottom:20px; }
  .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric:nth-child(2) { border-right:0; }
  .metric:nth-child(-n+2) { border-bottom:1px solid var(--border); }
  .metric-value { font-size:26px; }
  .deal-workspace { grid-template-columns:minmax(0,1fr); }
  .dashboard-allocation { display:block; }
  .dashboard-allocation .section-head { border-bottom:1px solid var(--border); }
}
@media(max-width:600px) {
  :root { --workspace-gutter:14px; }
  .workspace-canvas { padding-bottom:30px; }
  .workspace-topbar { font-size:11px; }
  .workspace-product { display:none; }
  .workspace-product+span { display:none; }
  .workspace-topbar-inner>div { gap:7px; }
  .page-head,.research-head { align-items:flex-start; flex-direction:column; gap:14px; }
  .page-head h1,.watch-page-head h1,.research-head h1 { font-size:26px; }
  .page-actions { flex-wrap:wrap; }
  .metric-value { font-size:22px; }
  .metric { padding:16px 12px; }
  .holding-bar-row { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .holding-bars { grid-column:1; grid-row:2; }
  .holding-bar-values { grid-column:2; grid-row:1 / 3; }
  .collection-toolbar { padding:14px; gap:12px; }
  .collection-toolbar .fld { flex:1; min-width:120px; }
  .collection-toolbar .collection-search { min-width:100%; }
  .research-main { padding:0 14px 14px; }
  .research-history-bar { padding:14px; gap:10px; }
  .research-history-bar button { font-size:11px; }
  .research-layout>.research-note { padding:10px 14px; }
  .research-welcome { padding:20px 0; min-height:260px; }
  .research-prompts { flex-direction:column; width:100%; }
  .research-prompts button { max-width:none; width:100%; }
  .research-source-grid { grid-template-columns:1fr; }
  .research-footer { flex-wrap:wrap; }
}
/* Libretto logo: navy L and gold car, on a light tile wherever the background is dark */
.brand-logo-libretto { flex:none; width:auto; height:40px; padding:5px 7px; background:#fbfaf6; border-radius:8px; }
.auth-brand .auth-logo { width:auto; height:104px; }
.research-avatar.research-avatar-logo { background:#fbfaf6; border-color:var(--border); }
.research-avatar img { width:38px; height:auto; }

@media print {
  .workspace-topbar,.skip-link,.collection-toolbar,.collection-result-count { display:none; }
  .terminal-ui .content,.workspace-canvas { width:100%; padding:0; max-width:none; }
  .metric-grid,.work-section,.panel { break-inside:avoid; }
}
