.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 32px; }
.topbar { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; min-height: 70px; }
.topbar h1 { margin: 2px 0 0; font-size: 20px; letter-spacing: -.03em; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--ink); color: var(--lime); font: 800 14px/1 ui-monospace, monospace; letter-spacing: -.08em; box-shadow: 0 8px 26px rgba(24,42,43,.14); }
.eyebrow { margin: 0; color: var(--muted); font: 700 10px/1.2 ui-monospace, monospace; letter-spacing: .15em; }
.refresh-button, .add-form button { min-height: 46px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; padding: 12px 18px; box-shadow: 0 8px 20px rgba(24,42,43,.12); transition: transform .18s ease, box-shadow .18s ease; }
.refresh-button:hover:not(:disabled), .add-form button:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(24,42,43,.17); }
.refresh-button::before { content: '↻'; margin-right: 8px; color: var(--lime); font-size: 17px; }

.hero-card { margin-top: 28px; display: grid; grid-template-columns: 1.45fr 1fr; gap: 24px; align-items: center; padding: 28px; border-radius: 30px; background: var(--ink); color: #fff; overflow: hidden; position: relative; box-shadow: 0 24px 70px rgba(24,42,43,.17); }
.hero-card::after { content: ''; position: absolute; right: -100px; top: -160px; width: 430px; height: 430px; border: 1px solid rgba(217,255,101,.28); border-radius: 50%; box-shadow: 0 0 0 55px rgba(217,255,101,.04), 0 0 0 110px rgba(217,255,101,.025); }
.hero-card > * { position: relative; z-index: 1; }
.live-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: #d6dedb; font-size: 12px; }
.live-badge i, .status i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(217,255,101,.12); }
.hero-card h2 { margin: 20px 0 12px; font-size: clamp(40px, 6vw, 68px); line-height: .98; letter-spacing: -.065em; }
.hero-card p { max-width: 520px; margin: 0; color: #aebcba; line-height: 1.75; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-stats div { min-height: 112px; display: flex; flex-direction: column; justify-content: end; padding: 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: rgba(255,255,255,.045); backdrop-filter: blur(8px); }
.hero-stats strong { color: var(--lime); font: 700 32px/1 ui-monospace, monospace; }
.hero-stats span { margin-top: 8px; color: #aebcba; font-size: 12px; }

.watch-section { margin-top: 26px; padding: 32px; border: 1px solid rgba(24,42,43,.08); border-radius: 26px; background: rgba(251,252,248,.88); box-shadow: 0 18px 55px rgba(24,42,43,.07); backdrop-filter: blur(12px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.section-heading h2 { margin: 6px 0 0; font-size: 26px; letter-spacing: -.04em; }
.updated-at { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.add-form { display: grid; grid-template-columns: 190px 180px auto; gap: 8px; }
.add-form input { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px 14px; outline: none; }
.add-form input:focus { border-color: #849853; box-shadow: 0 0 0 3px rgba(217,255,101,.35); }
.add-form button { background: var(--lime); color: var(--ink); box-shadow: none; }
.notice { margin: -2px 0 18px; padding: 11px 14px; border: 1px solid #cfdab4; border-radius: 12px; background: #f3f8e5; color: #56652e; font-size: 12px; line-height: 1.6; }
.error-notice { border-color: #e6c4be; background: #fff2ef; color: #9a4037; }
.quote-head, .quote-row { display: grid; grid-template-columns: minmax(280px, 1.5fr) .55fr .55fr .72fr 152px; align-items: center; gap: 18px; }
.quote-head { padding: 0 14px 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.quote-row { min-height: 82px; padding: 14px; border-top: 1px solid var(--line); }
.fund-cell { display: flex; align-items: center; gap: 13px; min-width: 0; }
.fund-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: #e7eee8; color: #4b6260; font: 800 12px/1 ui-monospace, monospace; }
.fund-cell > span:last-child { min-width: 0; }
.fund-cell strong, .fund-cell small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fund-cell strong { font-size: 15px; }
.fund-cell small { margin-top: 5px; color: var(--muted); font: 500 11px/1 ui-monospace, monospace; }
.price { font: 700 20px/1 ui-monospace, monospace; }
.up { color: var(--red); }
.down { color: var(--green); }
.flat { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.status i { background: #79aa81; box-shadow: none; }
.status-warn { color: var(--amber); }
.status-warn i { background: #d39b3d; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.history-button, .holdings-button, .remove-button { border: 0; border-radius: 9px; background: transparent; color: #899593; padding: 8px 7px; font-size: 11px; white-space: nowrap; }
.history-button, .holdings-button { border: 1px solid var(--line); background: #fff; color: #435c58; font-weight: 700; }
.history-button:hover, .history-button.active, .holdings-button:hover, .holdings-button.active { border-color: #bfd064; background: #eff8cb; color: var(--ink); }
.remove-button:hover { color: #b9483f; text-decoration: underline; }
.empty-state { padding: 50px 20px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 13px; }

.history-panel { margin-top: 24px; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: #edf2ec; }
.history-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.history-heading h3 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.035em; }
.history-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.history-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.history-controls button { min-height: 34px; border: 1px solid #d2dbd4; border-radius: 9px; background: rgba(255,255,255,.72); color: #637371; padding: 7px 10px; font-size: 11px; font-weight: 700; }
.history-controls button:hover, .history-controls button.active { border-color: #a7bd4e; background: var(--lime); color: var(--ink); }
.history-controls .history-refresh { margin-left: 5px; border-color: var(--ink); background: var(--ink); color: #fff; }
.history-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.history-summary span { display: flex; flex-direction: column; gap: 6px; padding: 13px 15px; border-radius: 12px; background: rgba(255,255,255,.7); }
.history-summary small { color: var(--muted); font-size: 10px; }
.history-summary strong { font: 700 17px/1.1 ui-monospace, monospace; }
.history-chart-wrap { margin-top: 10px; border: 1px solid rgba(24,42,43,.07); border-radius: 16px; background: #fff; overflow: hidden; }
.chart-readout { min-height: 43px; display: flex; align-items: center; gap: 16px; padding: 10px 16px 0; color: #637371; font: 600 11px/1 ui-monospace, monospace; overflow-x: auto; white-space: nowrap; }
.chart-readout strong { color: var(--ink); }
.history-chart { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart-grid-line { stroke: #e3e9e5; stroke-width: 1; stroke-dasharray: 4 7; }
.chart-axis-label { fill: #8a9795; font: 500 11px/1 ui-monospace, monospace; }
.chart-cursor { stroke: #94a19f; stroke-width: 1; stroke-dasharray: 4 4; }
.chart-hint { margin: -4px 16px 12px; color: var(--muted); font-size: 10px; }
.history-message { margin-top: 18px; min-height: 190px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.65); color: var(--muted); font-size: 13px; }
.history-message.error-notice { color: #9a4037; }

.holdings-panel { margin-top: 24px; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: #edf2ec; }
.holdings-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.holdings-heading h3 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.035em; }
.holdings-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.holdings-heading > button { min-height: 36px; border: 0; border-radius: 9px; background: var(--ink); color: #fff; padding: 8px 13px; font-size: 11px; font-weight: 700; }
.holdings-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.holdings-summary > span { display: flex; flex-direction: column; gap: 6px; padding: 14px 15px; border-radius: 12px; background: rgba(255,255,255,.72); }
.holdings-summary small { color: var(--muted); font-size: 10px; }
.holdings-summary strong { font-size: 15px; }
.holdings-table { margin-top: 12px; border: 1px solid rgba(24,42,43,.07); border-radius: 14px; background: #fff; overflow: hidden; }
.holdings-row { min-height: 58px; display: grid; grid-template-columns: 48px minmax(180px, 1.3fr) 1fr .8fr .8fr; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid #e7ece9; color: #566562; font-size: 12px; }
.holdings-row:first-child { border-top: 0; }
.holdings-head { min-height: 38px; background: #f7f9f5; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.holding-rank { color: #9aa5a3; font: 700 13px/1 ui-monospace, monospace; }
.holding-name strong, .holding-name small { display: block; }
.holding-name strong { color: var(--ink); font-size: 13px; }
.holding-name small { margin-top: 4px; color: var(--muted); font: 500 10px/1 ui-monospace, monospace; }
.holding-weight { display: grid; grid-template-columns: 48px minmax(50px, 1fr); align-items: center; gap: 9px; }
.holding-weight strong { color: var(--ink); font: 700 12px/1 ui-monospace, monospace; }
.holding-weight i { height: 5px; border-radius: 999px; background: #e4eae5; overflow: hidden; }
.holding-weight b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9db83e, var(--lime)); }
.holdings-note { margin: 12px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.live-shell footer { display: flex; justify-content: space-between; gap: 16px; padding: 20px 4px 0; color: var(--muted); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 940px) {
  .section-heading { align-items: stretch; flex-direction: column; }
  .add-form { grid-template-columns: 1fr 1fr auto; }
}

@media (max-width: 780px) {
  .app-shell { width: min(100% - 24px, 620px); padding-top: 14px; }
  .hero-card { grid-template-columns: 1fr; padding: 30px 24px; }
  .hero-card h2 { font-size: 44px; }
  .hero-stats { margin-top: 12px; }
  .watch-section { padding: 24px 16px; }
  .quote-head { display: none; }
  .quote-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px 14px; padding: 16px 6px; }
  .fund-cell { grid-row: span 2; }
  .price, .quote-row > .up, .quote-row > .down, .quote-row > .flat { text-align: right; }
  .status { grid-column: 2 / 3; justify-content: flex-end; }
  .row-actions { grid-column: 3; grid-row: 1 / span 2; flex-direction: column; }
  .history-heading { align-items: stretch; flex-direction: column; }
  .history-controls { justify-content: flex-start; }
  .history-summary { grid-template-columns: 1fr 1fr; }
  .history-panel { padding: 20px 14px; }
  .holdings-panel { padding: 20px 14px; }
  .holdings-heading { align-items: stretch; flex-direction: column; }
  .holdings-summary { grid-template-columns: 1fr 1fr; }
  .holdings-table { overflow-x: auto; }
  .holdings-row { min-width: 700px; }
  .live-shell footer { flex-direction: column; }
}

@media (max-width: 560px) {
  .topbar { grid-template-columns: auto 1fr; }
  .refresh-button { grid-column: 1 / -1; }
  .hero-stats div { min-height: 88px; padding: 12px; }
  .hero-stats strong { font-size: 25px; }
  .add-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.add-form { grid-template-columns: minmax(160px, 1fr) minmax(140px, 1fr) auto auto; }
.section-heading { flex-wrap: wrap; }
.symbol-results { width: 100%; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: white; }
.symbol-results p { margin: 4px 8px 10px; font-size: 12px; color: var(--muted); }
.symbol-results button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 12px 8px; border: 0; border-top: 1px solid var(--line); background: white; color: var(--ink); text-align: left; }
.symbol-results button:hover, .symbol-results button:focus-visible { background: #f3f8e5; }
.symbol-results small { display: block; margin-top: 4px; color: var(--muted); }
[hidden] { display: none !important; }
@media (max-width: 780px) { .add-form { grid-template-columns: 1fr; } }
.category-tabs { display:flex; flex-wrap:wrap; gap:5px; margin:0 0 12px; }
.category-tabs button { border:1px solid var(--line); border-radius:14px; padding:5px 8px; font-size:11px; line-height:1.25; background:white; color:var(--ink); }
.category-tabs button[aria-pressed=true] { background:var(--ink); color:var(--lime); }
.category-tabs small { align-self:center; color:var(--muted); }
.category-label { display:block; margin-top:7px; font-size:11px; color:var(--muted); }
.category-label select { max-width:160px; border:1px solid var(--line); border-radius:6px; background:#f3f8e5; color:var(--ink); font-size:11px; padding:3px; }
/* Match the laboratory's light card and blue accent system. */
.quotes-page{--ink:#182b49;--muted:#687b96;--line:#e0e7f2;--lime:#2864ff;--red:#c64c63;--green:#008b82;--amber:#a87019;background:#f4f6fa;color:var(--ink)}
.quotes-page .live-shell{display:block;max-width:1860px;padding:0 34px;margin:20px auto 50px}
.quotes-page .live-header{display:flex;padding:30px 34px 14px;max-width:1860px;margin:auto;background:transparent;color:var(--ink);gap:18px;flex-wrap:wrap}
.quotes-page .live-header p{color:var(--muted);font-size:13px;margin:0}.live-header .refresh-button{margin-left:auto;background:#2864ff;color:#fff;border-radius:9px;min-height:40px;padding:10px 18px;box-shadow:0 4px 12px #2864ff1a;font-size:13px}.live-header .refresh-button:before{color:white}.live-header .refresh-button:hover:not(:disabled){background:#1d52dc;transform:none}
.live-shell .hero-card{margin:0 0 20px;border:1px solid var(--line);border-radius:18px;padding:22px 26px;grid-template-columns:1fr 1fr;background:white;color:var(--ink);box-shadow:none}.live-shell .hero-card:after{display:none}.live-shell .hero-card p{color:var(--muted);font-size:12px;line-height:1.8;margin-top:8px}.live-shell .live-badge{border:0;background:#edf3ff;color:#2458cf}.live-shell .live-badge i{background:#2864ff;box-shadow:0 0 0 4px #2864ff12}.live-shell .hero-stats div{background:#f6f8fe;border:1px solid #e6edfc;min-height:90px;border-radius:12px;backdrop-filter:none}.live-shell .hero-stats strong{color:#2864ff;font-size:28px}.live-shell .hero-stats span{color:var(--muted)}
.live-shell .watch-section{margin:0;padding:24px;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:none;backdrop-filter:none}.live-shell .section-heading{align-items:center;margin-bottom:20px}.live-shell .section-heading h2{font-size:20px;letter-spacing:0;margin:4px 0}.live-shell .eyebrow{font:700 10px/1.2 'Segoe UI',sans-serif;letter-spacing:1.5px;color:#7289ac}.live-shell .add-form{flex:0 1 650px;max-width:100%}.live-shell .add-form input{padding:9px 10px;border-radius:8px;margin:0;font-size:12px;min-width:0}.live-shell .add-form button{min-height:39px;border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink);box-shadow:none;margin:0;font-size:12px;padding:8px 12px}.live-shell .add-form button[type=submit]{background:#2864ff;color:white;border-color:#2864ff}.live-shell .add-form input:focus{border-color:#9ab8ff;box-shadow:0 0 0 3px #2864ff12}.live-shell label{margin:0}.live-shell .notice{border:1px solid #dce7ff;background:#edf3ff;color:#46638f}.live-shell .error-notice{background:#fff2f3;color:#a44255;border-color:#f0d5dc}.live-shell .category-tabs{gap:8px;margin:0 0 18px}.live-shell .category-tabs button{margin:0;border-radius:8px;padding:7px 12px;color:#617796}.live-shell .category-tabs button[aria-pressed=true]{background:#edf3ff;color:#2458cf;border-color:#a9c2ff}.live-shell .quote-table{border:1px solid var(--line);border-radius:12px;overflow:hidden}.live-shell .quote-head{padding:12px 16px;background:#f0f4fa;letter-spacing:0;font-weight:600}.live-shell .quote-row{padding:16px;min-height:104px;border-color:#edf0f6}.live-shell .quote-row:hover{background:#fafcff}.live-shell .fund-icon{background:#edf3ff;color:#486caa;width:38px;height:38px;border-radius:10px}.live-shell .fund-cell strong{font-size:14px}.live-shell .fund-cell small{font:500 11px/1.2 'Segoe UI',sans-serif}.live-shell .category-label{font-size:11px;margin-top:6px}.live-shell .category-label select{background:#f7f9fe;border-color:#e0e7f2;min-height:25px;font-size:11px;padding:2px 5px;width:auto;margin:0}.live-shell .row-actions button{margin:0}.live-shell .history-button,.live-shell .holdings-button{color:#4c6386;font-weight:500;border-color:var(--line)}.live-shell .history-button.active,.live-shell .holdings-button.active,.live-shell .history-button:hover,.live-shell .holdings-button:hover{background:#edf3ff;border-color:#a9c2ff;color:#2458cf}.live-shell .symbol-results button:hover{background:#edf3ff}.live-shell .price{font-size:21px;font-variant-numeric:tabular-nums}.live-shell .status{font-size:11px}.live-shell .status i{background:#2864ff}.live-shell .status-warn i{background:#d39b3d}
.live-shell .history-panel,.live-shell .holdings-panel{background:#f8faff;border-color:var(--line);border-radius:14px;padding:22px;margin:24px 0 0}.live-shell h3{letter-spacing:0;font-size:17px}.live-shell .history-controls button{border-color:var(--line);background:white;color:#617796;font-weight:500;margin:0}.live-shell .history-controls button.active{background:#edf3ff;border-color:#a9c2ff;color:#2458cf}.live-shell .history-controls .history-refresh,.live-shell .holdings-heading>button{background:#2864ff;color:white;border-color:#2864ff}.live-shell .history-summary{grid-template-columns:repeat(5,minmax(0,1fr))}.live-shell .history-summary>span,.live-shell .holdings-summary>span{background:white;border:1px solid #e6edfc;border-radius:10px}.live-shell .history-summary strong{font-size:18px}.live-shell .history-chart{height:auto;background:white;border-radius:0}.live-shell .history-chart-wrap{border-color:var(--line)}.live-shell .chart-readout{margin:0;color:#617796;min-height:48px}.live-shell .chart-grid-line{stroke:#e6edfa;stroke-dasharray:none}.live-shell .chart-axis-label{fill:#7389a8}.live-shell .chart-hint{margin:2px 16px 14px;font-size:11px}.live-shell .holdings-head{background:#f0f4fa;letter-spacing:0}.live-shell .holding-weight b{background:#2864ff}.live-shell footer{padding-top:20px;color:var(--muted);font-size:11px}
@media(max-width:1100px){.quotes-page .live-shell{padding:0 20px}.quotes-page .live-header{padding:24px 20px 10px}.live-shell .add-form{flex:auto}.live-shell .quote-head,.live-shell .quote-row{grid-template-columns:minmax(225px,1.5fr) .55fr .55fr .8fr 144px;gap:12px}}
@media(max-width:780px){.quotes-page .live-shell{padding:0 16px;margin-top:16px}.quotes-page .live-header{padding:22px 18px 8px;gap:14px}.live-header .refresh-button{margin-left:0}.live-shell .hero-card{grid-template-columns:1fr;padding:18px;gap:12px}.live-shell .hero-stats{margin:0}.live-shell .hero-stats div{min-height:75px;padding:13px}.live-shell .hero-stats strong{font-size:25px}.live-shell .watch-section{padding:18px 14px}.live-shell .section-heading{align-items:stretch;gap:16px}.live-shell .quote-head{display:none}.live-shell .quote-row{grid-template-columns:minmax(0,1fr) auto auto;gap:7px 12px;padding:16px 12px}.live-shell .price{font-size:19px}.live-shell .fund-cell{gap:8px}.live-shell .fund-icon{display:none}.live-shell .fund-cell strong{white-space:normal}.live-shell .history-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.live-shell .history-panel,.live-shell .holdings-panel{padding:16px 12px}.live-shell .history-summary strong{font-size:16px}}
.live-shell .watch-section .section-heading{flex-direction:column;align-items:stretch;gap:16px}.live-shell .watch-title{display:flex;justify-content:space-between;align-items:center;gap:16px;width:100%}.live-shell .watch-title .refresh-button{flex:none;background:#2864ff;color:white;border:1px solid #2864ff;border-radius:9px;min-height:40px;padding:10px 18px;box-shadow:0 4px 12px #2864ff1a;font-size:13px;margin:0}.live-shell .watch-title .refresh-button:before{color:white}.live-shell .watch-title .refresh-button:hover:not(:disabled){background:#1d52dc;transform:none}.live-shell .watch-section .add-form{flex:auto;width:100%;max-width:none}.live-shell .watch-title .updated-at{margin-bottom:0}@media(max-width:450px){.live-shell .watch-title{gap:8px;align-items:flex-start}.live-shell .watch-title .refresh-button{font-size:12px;padding:9px 11px}}
