/* Living Market 02 — isolated, reversible presentation layer. */
:root {
  --bg:#f5f7fb; --surface:#fff; --surface-strong:#fff;
  --text:#101722; --muted:#58677d; --line:#e3e9f2;
  --accent:#345cff; --accent-soft:#edf2ff; --positive:#00836e;
  --negative:#c13b52; --sidebar:#101722; --sidebar-text:#f6f8ff;
  --shadow:0 12px 40px rgba(31,53,91,.045);
}
[data-theme="dark"] {
  --bg:#0b1019; --surface:#131c2a; --surface-strong:#192538;
  --text:#f3f6ff; --muted:#a3b2c9; --line:#29364b;
  --accent:#87a4ff; --accent-soft:#202e4c; --positive:#54d3b4;
  --negative:#ff8999; --sidebar:#080d15;
}
body { font-family:"DM Sans",sans-serif; -webkit-font-smoothing:antialiased; }
html,body { width:100%; max-width:100%; overflow-x:clip; }
.app-shell,.main-content,.view { min-width:0; max-width:100%; }
.view > * { min-width:0; max-width:100%; }
button,input,select,textarea { accent-color:var(--accent); }
button { touch-action:manipulation; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline:3px solid var(--accent); outline-offset:4px;
}
h1,h2,h3,.hero-value { font-family:Manrope,"DM Sans",sans-serif; }
.hero-value,.holding-value,.performance-stats { font-variant-numeric:tabular-nums; }
.primary-button,.secondary-button,.ghost-button,.text-button,.quote-status {
  position:relative; overflow:hidden; isolation:isolate; display:inline-flex; align-items:center; justify-content:center; gap:7px; width:auto;
  font-weight:700; line-height:1; cursor:pointer; transition:transform .16s ease,background .16s ease,border-color .16s ease,box-shadow .16s ease,color .16s ease;
}
.primary-button { background:linear-gradient(180deg,#4168ff,#3157ef); color:#fff; border:1px solid #3157ef; border-radius:12px; box-shadow:0 6px 18px #345cff24, inset 0 1px #ffffff35; }
.primary-button:hover { background:#2448df; box-shadow:0 8px 22px #345cff30; }
.primary-button:active { transform:translateY(1px); }
.secondary-button { background:linear-gradient(135deg,#f8faff 0%,#e8eeff 100%); color:#294dcc; border:1px solid #cfdaff; border-radius:11px; box-shadow:0 4px 13px rgba(52,92,255,.08),inset 0 1px rgba(255,255,255,.95); }
.secondary-button:hover { background:linear-gradient(135deg,#fff,#dfe7ff); border-color:#b9c8ff; color:#2448df; transform:translateY(-1px); box-shadow:0 8px 21px rgba(52,92,255,.14),inset 0 1px #fff; }
.ghost-button { background:linear-gradient(145deg,var(--surface),#f5f7fb); color:var(--text); border:1px solid #dce3ee; border-radius:11px; box-shadow:0 3px 10px rgba(31,53,91,.055),inset 0 1px rgba(255,255,255,.9); }
.ghost-button:hover { background:linear-gradient(145deg,#fff,#edf1f7); border-color:#c9d3e2; color:var(--text); transform:translateY(-1px); box-shadow:0 7px 18px rgba(31,53,91,.09); }
.text-button { min-height:34px; padding:8px 11px; color:#3455c5; background:linear-gradient(145deg,#f8faff,#eef2f9); border:1px solid #dfe6f0; border-radius:9px; box-shadow:0 2px 8px rgba(31,53,91,.04),inset 0 1px #fff; }
.text-button:hover { background:linear-gradient(145deg,#fff,#e7edff); border-color:#ccd7ff; color:#2448df; transform:translateY(-1px); box-shadow:0 6px 15px rgba(52,92,255,.1); }
.primary-button::after,.secondary-button::after,.ghost-button::after,.text-button::after {
  content:""; position:absolute; z-index:1; inset:0; pointer-events:none; opacity:.45;
  background:linear-gradient(110deg,transparent 28%,rgba(255,255,255,.62) 48%,transparent 68%);
  transform:translateX(-125%); transition:transform .52s ease;
}
.primary-button:hover::after,.secondary-button:hover::after,.ghost-button:hover::after,.text-button:hover::after { transform:translateX(125%); }
.primary-button:active,.secondary-button:active,.ghost-button:active,.text-button:active { transform:translateY(0); }
[data-theme="dark"] .secondary-button,[data-theme="dark"] .text-button { border-color:var(--line); }
button:disabled { cursor:wait; opacity:.55; box-shadow:none; }
.panel,.table-card,.performance-card,.saved-candidate-card,.journal-card,.mobile-position-card {
  border:1px solid var(--line); background:var(--surface); border-radius:18px; box-shadow:var(--shadow);
}
.company-logo { background:var(--accent-soft); color:var(--accent); border:1px solid var(--line); border-radius:14px; }
.brand-mark { background:linear-gradient(135deg,#88ccff,#345cff); color:#fff; border:0; font-weight:800; }
.app-launch-screen { background:#101722; }
.auth-intro { background:linear-gradient(145deg,#101722,#172c61); }
.auth-dialog::backdrop { background:rgba(9,16,30,.65); }
.sidebar,.mobile-dock { background:#101722; }
.nav-item.active { background:#345cff; color:#fff; }
.nav-item:hover:not(.active) { background:#ffffff0d; }
.mini-progress span { background:#84b6ff; }
.hero-card {
  position:relative; display:grid; grid-template-columns:minmax(0,1fr) minmax(240px,.85fr);
  gap:20px 36px; padding:32px; min-height:0; color:var(--text);
  background:var(--surface); border:1px solid var(--line); border-radius:22px; overflow:hidden;
  box-shadow:var(--shadow); isolation:isolate;
}
.hero-card::before,.hero-card::after { display:none; }
[data-theme="dark"] .hero-card { color:var(--text); }
.hero-card > div:first-child { grid-column:1; position:relative; z-index:1; }
.hero-card .eyebrow { color:var(--muted); }
.hero-card .hero-value { font-size:clamp(34px,4.6vw,66px); letter-spacing:-.055em; line-height:1.12; margin:14px 0; overflow-wrap:anywhere; }
.hero-card .daily-return-card { background:transparent; border:0; padding:0; color:var(--text); display:flex; flex-wrap:wrap; gap:8px; }
.hero-card .daily-return-label { width:100%; color:var(--muted); }
.hero-card .return-line { color:var(--muted); font-size:12px; margin-top:14px; }
.hero-card .hero-meta { grid-column:1; position:static; max-width:none; width:auto; text-align:left; display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.hero-meta > span { color:var(--muted); }
.hero-card #refreshQuotesButton {
  position:relative; overflow:hidden; width:auto; min-width:154px; min-height:42px; margin:4px 0 0; padding:0 16px 0 12px;
  border:1px solid #cfdaff; border-radius:12px; background:linear-gradient(135deg,#f8faff 0%,#e8eeff 100%);
  color:#294dcc; font-size:12px; font-weight:700; letter-spacing:.01em; opacity:1;
  box-shadow:0 5px 16px rgba(52,92,255,.11),inset 0 1px rgba(255,255,255,.95);
}
.hero-card #refreshQuotesButton::before {
  content:"↻"; display:grid; place-items:center; width:24px; height:24px; flex:0 0 24px; border-radius:8px;
  background:#fff; color:#345cff; box-shadow:0 2px 8px rgba(52,92,255,.12); font-size:14px;
}
.hero-card #refreshQuotesButton::after {
  content:""; position:absolute; inset:0; background:linear-gradient(110deg,transparent 30%,rgba(255,255,255,.72) 48%,transparent 66%);
  transform:translateX(-120%); transition:transform .5s ease; pointer-events:none;
}
.hero-card #refreshQuotesButton:hover { background:linear-gradient(135deg,#fff,#dfe7ff); border-color:#b9c8ff; color:#2448df; transform:translateY(-1px); box-shadow:0 9px 24px rgba(52,92,255,.17),inset 0 1px #fff; }
.hero-card #refreshQuotesButton:hover::after { transform:translateX(120%); }
.hero-card #refreshQuotesButton:active { transform:translateY(0); box-shadow:0 3px 10px rgba(52,92,255,.12); }
.hero-card #refreshQuotesButton.is-loading::before { animation:quote-spin .8s linear infinite; }
.hero-card #refreshQuotesButton.is-success { color:#087260; border-color:#b9e4d8; background:linear-gradient(135deg,#f7fffc,#e5f7f1); }
.hero-card #refreshQuotesButton.is-success::before { content:"✓"; color:#087260; }
.hero-card #refreshQuotesButton.is-error { color:#a52f45; border-color:#f0c3cc; background:linear-gradient(135deg,#fffafa,#fdecef); }
.hero-card #refreshQuotesButton.is-error::before { content:"!"; color:#b7354d; }
@keyframes quote-spin { to { transform:rotate(360deg); } }
.hero-card .sparkline { grid-column:1/-1; position:relative; inset:auto; height:200px; width:100%; opacity:1; pointer-events:auto; border-top:1px solid var(--line); padding-top:16px; }
.hero-card .chart-ranges { grid-column:1/-1; position:static; display:flex; gap:6px; margin:0; }
.chart-ranges button { color:var(--muted); background:var(--bg); border:1px solid transparent; min-width:44px; min-height:36px; border-radius:8px; }
.hero-card .chart-ranges button.active { background:var(--accent); color:var(--surface); opacity:1; }
.living-allocation { grid-column:2; grid-row:1/3; min-width:0; align-self:center; }
.living-heading { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:8px; }
.living-heading h2 { font-size:17px; }
.living-heading > span { color:var(--muted); font-size:11px; }
.allocation-track { display:flex; height:72px; margin:26px 4px 22px; transform:perspective(600px) rotateX(16deg); border-radius:12px; box-shadow:0 16px 22px #345cff20; }
.allocation-track > span { flex-basis:0; min-width:0; background:linear-gradient(135deg,hsl(var(--tile-hue) 95% 76%),hsl(var(--tile-hue) 92% 49%)); border:1px solid #ffffff77; box-shadow:inset 0 2px 3px #ffffffaa,inset 0 -8px 9px #12387733; transition:transform .25s ease,filter .25s ease; }
.allocation-track > span:first-child { border-radius:12px 0 0 12px; }
.allocation-track > span:last-child { border-radius:0 12px 12px 0; }
.allocation-track > span:only-child { border-radius:12px; }
.allocation-track > span.selected { transform:translateY(-7px); filter:brightness(1.08); }
.allocation-options { display:grid; gap:4px; max-height:156px; overflow-y:auto; padding:5px; }
.allocation-option { display:flex; justify-content:space-between; gap:12px; text-align:left; padding:9px 10px; border:1px solid transparent; border-radius:9px; background:transparent; color:var(--text); font-size:12px; }
.allocation-option span { min-width:0; overflow-wrap:anywhere; }
.allocation-option strong { white-space:nowrap; }
.allocation-option[aria-pressed="true"] { background:var(--accent-soft); border-color:var(--line); }
.allocation-detail { min-height:34px; font-size:11px; color:var(--muted); line-height:1.5; margin:10px 5px; }
.allocation-tiles.is-empty { height:10px; margin:22px 0 18px; border:0; border-radius:999px; background:linear-gradient(90deg,#dfe6f2 0 54%,#edf1f7 54% 78%,#f3f5f9 78%); overflow:hidden; }
.allocation-tiles.is-empty::after { content:""; display:block; width:32%; height:100%; border-radius:inherit; background:linear-gradient(90deg,#b9c8ff,#d5ddff); opacity:.8; }
.living-allocation > .text-button { font-size:12px; padding:8px 5px; }
.control-stats button { background:var(--surface); border:1px solid var(--line); border-radius:14px; }
.attention-panel { border-left:3px solid var(--accent); }
.next-step-card,.insight-card { background:#101722; color:#f5f8ff; border-color:#26344b; }
.next-step-card p,.next-step-card .next-step-number,.insight-card p,.insight-card .eyebrow { color:#b8c7df; }
.holding-row { transition:background .18s ease; border-radius:10px; }
.holding-row:hover { background:var(--accent-soft); }
.empty-portfolio-onboarding { border-color:#dce4f1; background:linear-gradient(135deg,#fff 0%,#f8faff 100%); box-shadow:0 10px 32px rgba(31,53,91,.05); }
.empty-portfolio-onboarding .onboarding-icon { background:linear-gradient(145deg,#edf2ff,#dfe7ff); color:var(--accent); border:1px solid #d8e1ff; }
.empty-state.compact { min-height:190px; padding:32px 24px; border-style:solid; background:linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--accent-soft) 45%,var(--surface))); box-shadow:var(--shadow); }
.empty-state.compact > span { box-shadow:0 7px 20px #345cff14; }
.hero-card.is-empty { grid-template-columns:minmax(0,1.05fr) minmax(280px,.8fr); gap:22px 46px; padding-block:34px; }
.hero-card.is-empty .sparkline,.hero-card.is-empty .chart-ranges { display:none; }
.hero-card.is-empty .living-allocation { grid-row:1/3; padding:22px; border:1px solid var(--line); border-radius:16px; background:linear-gradient(145deg,var(--bg),var(--surface)); }
.hero-card.is-empty .allocation-detail { min-height:0; margin:0 0 14px; }
.hero-card.is-empty .hero-meta { align-self:end; }
.control-stats button { text-align:left; box-shadow:0 4px 18px rgba(31,53,91,.035); transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease; }
.control-stats button:hover { transform:translateY(-2px); border-color:#cad5e6; box-shadow:0 10px 28px rgba(31,53,91,.075); }
.view.active { animation:living-enter .25s ease both; }
@keyframes living-enter { from { opacity:.5; transform:translateY(5px); } to { opacity:1; transform:none; } }
@media(min-width:1101px) {
  .app-shell { display:grid; grid-template-columns:220px minmax(0,1fr); }
  .sidebar { position:sticky; top:0; width:220px; height:100dvh; display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; padding:24px 16px; overflow-y:auto; }
  .sidebar .brand { font-size:18px; }
  .sidebar .main-nav { position:static; display:grid; grid-template-columns:minmax(0,1fr); flex-shrink:0; transform:none; opacity:1; visibility:visible; width:100%; max-height:none; margin-top:24px; padding:0; background:transparent; border:0; box-shadow:none; }
  .sidebar:not(.menu-open) .main-nav,.sidebar:not(.menu-open) .main-nav * { pointer-events:auto!important; }
  .main-nav .nav-group { display:grid; gap:4px; padding:0; border:0; background:transparent; }
  .sidebar .nav-item { min-height:44px; }
  .sidebar .nav-item.active { background:#345cff; color:white; box-shadow:none; }
  .sidebar .nav-item.active .nav-icon { background:#ffffff20; color:white; }
  .nav-group-label { font-size:9px; margin-top:12px; }
  .nav-item { width:100%; padding:11px; border-radius:10px; }
  .sidebar .nav-item small { display:none; }
  .sidebar .site-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:22px; }
  .sidebar .menu-toggle { display:none; }
  .sidebar .account-button { width:100%; color:#e8efff; background:#1b2739; border-color:#30415b; }
  .sidebar .icon-button { color:#e8efff; background:#1b2739; border-color:#30415b; }
  .sidebar-note { margin-top:20px; }
  .main-content { padding:28px clamp(24px,3vw,52px) 64px; width:100%; max-width:1500px; }
  .topbar { position:static; padding:0; margin:0 0 26px; background:transparent; }
}
/* Compact desktop: MacBook-sized viewports and browser zoom. */
@media(min-width:1101px) and (max-width:1366px) {
  .app-shell { grid-template-columns:190px minmax(0,1fr); }
  .sidebar { width:190px; padding:20px 12px; }
  .sidebar .brand { padding-inline:7px; font-size:16px; }
  .sidebar .brand-mark { width:34px; height:34px; }
  .sidebar .main-nav { margin-top:16px; gap:1px; }
  .sidebar .nav-group { gap:1px; }
  .sidebar .nav-item { min-height:39px; padding:7px; gap:8px; }
  .sidebar .nav-icon { width:29px; height:29px; }
  .nav-group-label { margin-top:7px; padding-bottom:4px; }
  .sidebar .site-actions { margin-top:14px; }
  .sidebar .account-button { min-height:38px; }
  .sidebar-note { margin-top:12px; padding:12px; }
  .sidebar-note strong { font-size:13px; }
  .main-content { padding:22px clamp(18px,2.3vw,32px) 54px; }
  .topbar { min-height:74px; margin-bottom:20px; }
  .topbar h1 { font-size:clamp(25px,2.5vw,32px); }
  .view { width:100%; }
  .hero-card { padding:26px; gap:18px 28px; }
  .hero-card .sparkline { height:170px; }
}
@media(min-width:1101px) and (max-height:820px) {
  .sidebar { overflow-y:auto; scrollbar-width:thin; }
  .sidebar-note { display:none; }
}
@media(max-width:700px) {
  .hero-card { grid-template-columns:minmax(0,1fr); padding:22px 18px; gap:18px; border-radius:18px; }
  .hero-card.is-empty { grid-template-columns:minmax(0,1fr); padding:22px 18px; }
  .hero-card .hero-value { font-size:clamp(32px,9vw,46px); }
  .hero-card .hero-meta { grid-column:1; grid-row:2; font-size:12px; }
  .hero-card .sparkline { grid-column:1; grid-row:3; height:156px; }
  .hero-card .chart-ranges { grid-column:1; grid-row:4; }
  .living-allocation { grid-column:1; grid-row:5; border-top:1px solid var(--line); padding-top:18px; }
  .hero-card.is-empty .living-allocation { grid-column:1; grid-row:3; padding:18px; border:1px solid var(--line); }
  .hero-card.is-empty .hero-meta { grid-row:2; }
  .empty-portfolio-onboarding { grid-template-columns:auto minmax(0,1fr); }
  .empty-portfolio-onboarding .primary-button { grid-column:1/-1; width:100%; }
  .allocation-track { height:36px; transform:none; box-shadow:none; margin:18px 4px; }
  .allocation-track > span.selected { transform:translateY(-3px); }
  .allocation-option { min-height:44px; }
  .sidebar .main-nav { background:#101722; }
  .mobile-dock { background:#101722; border-top:1px solid #29364b; padding-bottom:max(12px,env(safe-area-inset-bottom)); }
  .mobile-dock-item { color:#bac6d8; }
  .mobile-dock-item.active { background:#213255; color:#9dbbff; }
  .mobile-trade-action { background:#345cff; color:white; border-color:#345cff; }
  .mobile-trade-action span,.mobile-trade-action small { color:white; }
  input,select,textarea,.auth-fields input { font-size:16px; }
  .auth-dialog { overflow-y:auto; }
}
@media(prefers-reduced-motion:reduce) {
  .view.active,.allocation-track > span,button,.holding-row { animation:none!important; transition:none!important; }
  .allocation-track { transform:none; }
}
