/* =====================================================================
   Valore app shell — exact "Valore - V3" design layer.
   Loaded last. Tokens mirror the design file's :root / html.theme-light
   sets (prefixed --a3-* so the legacy --bg/--ink/--gold tokens used by
   older in-shell screens are untouched). Light is the default; dark sits
   under [data-theme="dark"].
   ===================================================================== */
#appShell {
  --a3-bg: #F7F5F0; --a3-sub: #FFFCF5; --a3-card: #FFFFFF; --a3-field: #F2F0EA;
  --a3-line: #E4E0D6; --a3-line-soft: #EDEAE1; --a3-strong: #8C8677;
  --a3-ink: #0B1A32; --a3-muted: #5C6779; --a3-gold: #D4A84B; --a3-gold-ink: #B8862F;
  --a3-green-bg: #E3F5EC; --a3-green: #15784C; --a3-coral: #B4503C; --a3-amber: #8A6516;
  --a3-shadow: rgba(11,26,50,.12);
  --a3-serif: 'Source Serif 4', Georgia, serif;
  --a3-mo: cubic-bezier(.22,.7,.3,1); --a3-mio: cubic-bezier(.4,0,.2,1);
  /* keep the older --nf-* screens on the same palette */
  --nf-bg: #F7F5F0; --nf-panel: #FFFFFF; --nf-side: #FFFFFF; --nf-line: #E4E0D6;
  --nf-line-soft: #EDEAE1; --nf-field: #F2F0EA;
}
[data-theme="dark"] #appShell {
  --a3-bg: #0B1A32; --a3-sub: #0D1D37; --a3-card: #101F3D; --a3-field: #0B1A32;
  --a3-line: #1E2E4D; --a3-line-soft: #16253F; --a3-strong: #2A3C60;
  --a3-ink: #FFFFFF; --a3-muted: #8B95A6; --a3-gold: #D4A84B; --a3-gold-ink: #D4A84B;
  --a3-green-bg: #123527; --a3-green: #34D399; --a3-coral: #E08A7A; --a3-amber: #D08C3C;
  --a3-shadow: rgba(0,0,0,.42);
  --nf-bg: #0B1A32; --nf-panel: #101F3D; --nf-side: #101F3D; --nf-line: #1E2E4D;
  --nf-line-soft: #16253F; --nf-field: #0B1A32;
}
body:has(.shell-view:not(.is-hidden)) { background: #F7F5F0; }
[data-theme="dark"] body:has(.shell-view:not(.is-hidden)) { background: #0B1A32; }
#appShell { background: var(--a3-bg); font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }

@keyframes a3fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Sidebar ---------- */
#appShell .shell-sidebar {
  flex: none; width: 240px; height: 100vh; position: sticky; top: 0; padding: 0; gap: 0;
  background: var(--a3-card); border-right: 1px solid var(--a3-line); color: var(--a3-muted);
  display: flex; flex-direction: column; overflow-y: auto;
}
#appShell .shell-brand {
  display: block; padding: 26px 22px 22px; margin: 0; text-decoration: none;
  font-family: var(--a3-serif); font-size: 25px; font-weight: 600; letter-spacing: 0; line-height: 1.2;
  color: var(--a3-gold-ink);
}
#appShell .shell-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; margin: 0; flex: none; overflow: visible; }
#appShell .shell-nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; margin: 0; border: none; border-radius: 9px; background: transparent;
  color: var(--a3-muted); font-family: Inter, system-ui, sans-serif; font-size: 13.5px; font-weight: 500;
  line-height: 1.25; text-decoration: none; cursor: pointer; text-align: left;
  transition: color 200ms var(--a3-mio), background-color 200ms var(--a3-mio);
}
#appShell .shell-nav-item svg { width: 17px; height: 17px; flex: none; opacity: 1; color: inherit; stroke-width: 1.5; }
#appShell .shell-nav-item::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: transparent; transition: background-color 200ms var(--a3-mio);
}
#appShell .shell-nav-item:hover { background: transparent; color: var(--a3-gold-ink); }
#appShell .shell-nav-item.is-active { background: rgba(212,168,75,.10); color: var(--a3-gold-ink); font-weight: 600; border: none; }
#appShell .shell-nav-item.is-active::before { background: var(--a3-gold); }
#appShell .shell-nav-item.is-active svg { color: var(--a3-gold-ink); }
#appShell .shell-pro {
  margin-left: auto; font-family: Inter, system-ui, sans-serif; font-size: 8.5px; font-weight: 700; letter-spacing: .08em;
  color: var(--a3-gold-ink); background: none; border: 1px solid var(--a3-gold-ink); border-radius: 6px; padding: 2px 5px; line-height: 1.3;
}
#appShell .shell-foot { margin-top: auto; padding: 8px 12px 10px; border-top: 1px solid var(--a3-line); }
#appShell .shell-foot .shell-nav-item svg { stroke-width: 1.4; }
#appShell .shell-user { display: flex; align-items: center; gap: 11px; padding: 16px; margin: 0; border-top: 1px solid var(--a3-line); }
#appShell .shell-user-avatar {
  flex: none; width: 32px; height: 32px; border-radius: 99px; background: var(--a3-line);
  display: flex; align-items: center; justify-content: center;
  font-family: Inter, system-ui, sans-serif; font-size: 11.5px; font-weight: 600; color: var(--a3-gold-ink);
}
#appShell .shell-user-meta { min-width: 0; flex: 1; }
#appShell .shell-user-name { display: block; font-size: 12.5px; font-weight: 500; color: var(--a3-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#appShell .shell-user-role { display: block; font-size: 10.5px; color: var(--a3-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#appShell .shell-signout { background: none; border: none; cursor: pointer; padding: 4px; display: flex; color: var(--a3-muted); }
#appShell .shell-signout:hover { color: var(--a3-gold-ink); }
#appShell .shell-signout svg { width: 16px; height: 16px; }

/* ---------- Top bar ---------- */
#appShell .shell-topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 28px; background: var(--a3-card); border-bottom: 1px solid var(--a3-line); box-shadow: none;
}
#appShell .shell-page-title { font-family: var(--a3-serif); font-size: 22px; font-weight: 600; color: var(--a3-ink); margin: 0; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#appShell .shell-tools { display: flex; align-items: center; gap: 10px; flex: none; }
#appShell .shell-wsseg { display: flex; align-items: center; gap: 2px; background: var(--a3-field); border: 1px solid var(--a3-line); border-radius: 999px; padding: 3px; margin-right: 34px; }
#appShell .shell-wsseg a { font-family: Inter, system-ui, sans-serif; border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 500; color: var(--a3-muted); text-decoration: none; transition: background-color 150ms var(--a3-mio), color 150ms var(--a3-mio); }
#appShell .shell-wsseg a:not(.is-active):hover { background: rgba(212,168,75,.10); color: var(--a3-gold-ink); }
#appShell .shell-wsseg a.is-active { background: #D4A84B; color: #0B1A32; font-weight: 600; cursor: default; }
#appShell .shell-iconbtn {
  position: relative; width: 34px; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--a3-strong); border-radius: 9px; color: var(--a3-muted); cursor: pointer;
  transition: border-color 150ms var(--a3-mio);
}
#appShell .shell-iconbtn:hover { border-color: var(--a3-gold-ink); color: var(--a3-muted); }
#appShell .shell-iconbtn svg { width: 16px; height: 16px; }
#appShell .shell-iconbtn .shell-dot { position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 99px; background: #D4A84B; border: none; }
#appShell #themeToggle .a3-sun { display: none; }
[data-theme="dark"] #appShell #themeToggle .a3-sun { display: block; }
[data-theme="dark"] #appShell #themeToggle .a3-moon { display: none; }

/* ---------- Page scaffolding ---------- */
#appShell .shell-content { padding: 0; background: var(--a3-bg); }
#appShell .shell-view { padding: 24px 28px 48px; }
#appShell .shell-view.a3 { color: var(--a3-ink); font-family: Inter, system-ui, sans-serif; }
#appShell .a3 button { font-family: inherit; }
#appShell .a3-stack { display: flex; flex-direction: column; gap: 18px; }
#appShell .a3-num { font-variant-numeric: tabular-nums; }
#appShell .a3-card { background: var(--a3-card); border: 1px solid var(--a3-line); border-radius: 12px; }
#appShell .a3-eyebrow { font-size: 10.5px; letter-spacing: .14em; color: var(--a3-muted); text-transform: uppercase; }
#appShell .a3-h3 { font-family: var(--a3-serif); font-size: 17.5px; font-weight: 600; color: var(--a3-ink); margin: 0; }
#appShell .a3-note { font-size: 11.5px; color: var(--a3-muted); margin: 0; line-height: 1.55; }
#appShell .a3-link { background: none; border: none; padding: 0; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--a3-gold-ink); text-align: left; text-decoration: none; }
#appShell .a3-link:hover { color: var(--a3-gold); }

#appShell .a3-pills { display: flex; flex-wrap: wrap; gap: 8px; }
#appShell .a3-pill { background: none; border: 1px solid var(--a3-strong); color: var(--a3-muted); font-size: 12.5px; font-weight: 500; padding: 7px 15px; border-radius: 999px; cursor: pointer; line-height: 1.3; transition: border-color 150ms var(--a3-mio), color 150ms var(--a3-mio); }
#appShell .a3-pill.is-on { border-color: var(--a3-gold-ink); color: var(--a3-gold-ink); }
#appShell .a3-pill.dashed { border-style: dashed; }
#appShell .a3-pill.dashed:hover { border-color: var(--a3-gold-ink); color: var(--a3-gold-ink); }
#appShell .a3-pill.sm { font-size: 11.5px; padding: 7px 13px; }

#appShell .a3-btn-gold { background: #D4A84B; border: none; color: #0B1A32; font-size: 13.5px; font-weight: 600; padding: 12px 22px; border-radius: 9px; cursor: pointer; }
#appShell .a3-btn-gold:hover { background: #E8C475; }
#appShell .a3-btn-gold.sm { font-size: 13px; padding: 11px 20px; }
#appShell .a3-btn-line { background: none; border: 1px solid var(--a3-strong); color: var(--a3-ink); font-size: 13px; font-weight: 600; padding: 11px 20px; border-radius: 9px; cursor: pointer; }
#appShell .a3-btn-line.gold { border-color: var(--a3-gold); color: var(--a3-gold-ink); }
#appShell .a3-btn-line.gold:hover { background: rgba(212,168,75,.10); }

#appShell .a3-empty { background: var(--a3-card); border: 1px solid var(--a3-line); border-radius: 12px; padding: 96px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
#appShell .a3-empty svg { width: 40px; height: 40px; color: var(--a3-muted); }
#appShell .a3-empty p { font-size: 14px; color: var(--a3-muted); margin: 0; text-align: center; max-width: 460px; line-height: 1.55; }
#appShell .a3-empty .a3-link { font-size: 13px; }

#appShell .a3-input { width: 100%; background: var(--a3-field); border: 1px solid var(--a3-line); border-radius: 10px; padding: 12px 16px; font-size: 14px; color: var(--a3-ink); outline: none; font-family: inherit; }
#appShell .a3-input:focus { border-color: var(--a3-gold); }
#appShell .a3-input::placeholder { color: var(--a3-muted); opacity: 1; }
#appShell .a3-search { position: relative; }
#appShell .a3-search svg { position: absolute; left: 14px; top: 13px; width: 16px; height: 16px; color: var(--a3-gold-ink); pointer-events: none; }
#appShell .a3-search .a3-input { padding-left: 40px; }

#appShell .a3-toggle { flex: none; width: 38px; height: 21px; border-radius: 999px; background: none; border: 1px solid var(--a3-strong); padding: 2px; cursor: pointer; display: flex; align-items: center; justify-content: flex-start; }
#appShell .a3-toggle span { width: 15px; height: 15px; border-radius: 99px; background: var(--a3-muted); }
#appShell .a3-toggle.is-on { background: rgba(212,168,75,.18); border-color: var(--a3-gold); justify-content: flex-end; }
#appShell .a3-toggle.is-on span { background: var(--a3-gold-ink); }

#appShell .a3-status { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
#appShell .a3-status.warn { background: rgba(224,138,122,.12); color: var(--a3-coral); }
#appShell .a3-status.ok { background: var(--a3-green-bg); color: var(--a3-green); }
#appShell .a3-status.mute { background: rgba(139,149,166,.14); color: var(--a3-muted); }

/* two-column page (main + 320px rail) */
#appShell .a3-cols { display: flex; align-items: flex-start; gap: 24px; }
#appShell .a3-main { flex: 1; min-width: 0; }
#appShell .a3-rail { flex: none; width: 320px; position: sticky; top: 95px; display: flex; flex-direction: column; gap: 14px; }
#appShell .a3-rail .a3-card { padding: 20px 22px; }
#appShell .a3-rail h3 { font-family: var(--a3-serif); font-size: 16px; font-weight: 600; color: var(--a3-ink); margin: 0 0 4px; }
#appShell .a3-rail-sub { font-size: 11px; color: var(--a3-muted); margin-bottom: 16px; }
#appShell .a3-rail .a3-link { padding-top: 14px; display: inline-block; }
#appShell .a3-rank { display: flex; flex-direction: column; gap: 11px; }
#appShell .a3-rank-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#appShell .a3-rank-row > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
#appShell .a3-rank-n { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--a3-muted); width: 12px; }
#appShell .a3-rank-name { font-size: 13px; color: var(--a3-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#appShell .a3-delta { display: flex; align-items: center; gap: 5px; flex: none; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: var(--a3-gold-ink); }
#appShell .a3-delta svg { width: 11px; height: 11px; }
#appShell .a3-delta.down { color: var(--a3-coral); }
#appShell .a3-delta.flat { color: var(--a3-muted); }
#appShell .a3-rowbtns { display: flex; flex-direction: column; gap: 2px; }
#appShell .a3-rowbtn { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-radius: 8px; padding: 9px 8px; cursor: pointer; color: var(--a3-ink); }
#appShell .a3-rowbtn:hover { background: var(--a3-line-soft); }
#appShell .a3-rowbtn svg { width: 12px; height: 12px; flex: none; margin-top: 3px; color: var(--a3-gold-ink); }
#appShell .a3-rowbtn.down svg { color: var(--a3-coral); }
#appShell .a3-rowbtn .t { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.45; color: var(--a3-ink); }
#appShell .a3-rowbtn .w { flex: none; font-size: 10.5px; color: var(--a3-muted); margin-top: 2px; }
#appShell .a3-rowbtn.col { flex-direction: column; gap: 5px; padding: 10px 8px; }
#appShell .a3-rowbtn.col .w { margin: 0; }

/* ---------- News Feed ---------- */
#appShell .a3-welcome { position: relative; background: var(--a3-card); border: 1px solid var(--a3-gold); border-radius: 12px; padding: 26px 28px; margin-bottom: 26px; animation: a3fade .3s var(--a3-mo) both; }
#appShell .a3-welcome h2 { font-family: var(--a3-serif); font-size: 23px; font-weight: 600; color: var(--a3-ink); margin: 0 0 8px; letter-spacing: 0; }
#appShell .a3-welcome > p { font-size: 13.5px; line-height: 1.6; color: var(--a3-muted); margin: 0 0 22px; max-width: 520px; }
#appShell .a3-welcome-x { position: absolute; top: 14px; right: 14px; background: none; border: none; padding: 4px; cursor: pointer; display: flex; color: var(--a3-muted); }
#appShell .a3-welcome-x svg { width: 14px; height: 14px; }
#appShell .a3-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
#appShell .a3-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; background: var(--a3-sub); border: 1px solid var(--a3-line); border-radius: 10px; padding: 18px; cursor: pointer; text-decoration: none; transition: border-color 150ms var(--a3-mio); }
#appShell .a3-tile:hover { border-color: var(--a3-gold-ink); }
#appShell .a3-tile svg { width: 20px; height: 20px; color: var(--a3-gold-ink); }
#appShell .a3-tile b { font-size: 13.5px; font-weight: 600; color: var(--a3-ink); }
#appShell .a3-tile span { font-size: 11.5px; line-height: 1.5; color: var(--a3-muted); }
#appShell .a3-tile i { font-style: normal; font-size: 13px; color: var(--a3-gold-ink); }
#appShell .a3-areas { margin-bottom: 26px; }
#appShell .a3-areas > h2 { font-family: var(--a3-serif); font-size: 17px; font-weight: 600; color: var(--a3-ink); margin: 0 0 4px; }
#appShell .a3-areas > .sub { font-size: 11.5px; color: var(--a3-muted); margin-bottom: 14px; }
#appShell .a3-areas > .rule { height: 1px; background: var(--a3-line); margin-top: 26px; }
#appShell .a3-feed { display: flex; flex-direction: column; gap: 14px; }
#appShell .a3-feed > * { animation: a3fade 250ms var(--a3-mo) both; }
#appShell .a3-post { background: var(--a3-card); border: 1px solid var(--a3-line); border-radius: 12px; padding: 22px 24px; }
#appShell .a3-post[data-openreport] { cursor: pointer; transition: border-color 150ms var(--a3-mio); }
#appShell .a3-post[data-openreport]:hover { border-color: var(--a3-gold-ink); }
#appShell .a3-post-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
#appShell .a3-tag { display: inline-block; background: rgba(139,149,166,.14); color: var(--a3-muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; border-radius: 6px; }
#appShell .a3-tag.gold { background: rgba(212,168,75,.12); color: var(--a3-gold-ink); }
#appShell .a3-mark { flex: none; background: none; border: none; padding: 2px; cursor: pointer; display: flex; color: var(--a3-muted); }
#appShell .a3-mark svg { width: 15px; height: 15px; fill: none; }
#appShell .a3-mark.is-on { color: var(--a3-gold-ink); }
#appShell .a3-mark.is-on svg { fill: currentColor; }
#appShell .a3-post h3 { font-family: Inter, system-ui, sans-serif; font-size: 16.5px; font-weight: 600; color: var(--a3-ink); margin: 0 0 9px; line-height: 1.35; }
#appShell .a3-post p { font-size: 13.5px; line-height: 1.6; color: var(--a3-muted); margin: 0 0 14px; }
#appShell .a3-post .when { display: flex; justify-content: flex-end; font-size: 11.5px; color: var(--a3-muted); }
#appShell .a3-more { display: flex; justify-content: center; margin-top: 18px; }
#appShell .a3-more button { padding: 11px 24px; }

/* ---------- Watchlist ---------- */
#appShell .a3-portfolio { padding: 30px; margin-bottom: 16px; }
#appShell .a3-portfolio .a3-eyebrow { margin-bottom: 22px; }
#appShell .a3-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
#appShell .a3-kpi-l { font-size: 10.5px; letter-spacing: .1em; color: var(--a3-muted); text-transform: uppercase; margin-bottom: 10px; }
#appShell .a3-kpi-v { font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 700; color: var(--a3-ink); letter-spacing: -.02em; line-height: 1.2; }
#appShell .a3-kpi-v.gold { color: var(--a3-gold-ink); }
#appShell .a3-wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
#appShell .a3-wgrid > * { animation: a3fade 250ms var(--a3-mo) both; }
#appShell .a3-wcard { background: var(--a3-card); border: 1px solid var(--a3-line); border-radius: 12px; padding: 20px 22px 22px; cursor: pointer; transition: border-color .18s ease; }
#appShell .a3-wcard:hover { border-color: var(--a3-gold-ink); }
#appShell .a3-wcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
#appShell .a3-wcard-top > div { display: flex; align-items: center; gap: 11px; }
#appShell .a3-check { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--a3-strong); background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; color: var(--a3-gold-ink); }
#appShell .a3-check svg { width: 11px; height: 11px; display: none; }
#appShell .a3-check.is-on { border-color: var(--a3-gold-ink); }
#appShell .a3-check.is-on svg { display: block; }
#appShell .a3-thumb { width: 44px; height: 44px; border-radius: 9px; background: var(--a3-field); border: 1px solid var(--a3-line); display: flex; align-items: center; justify-content: center; color: var(--a3-muted); }
#appShell .a3-thumb svg { width: 19px; height: 19px; }
#appShell .a3-unsave { background: none; border: none; padding: 4px; cursor: pointer; display: flex; color: var(--a3-gold-ink); }
#appShell .a3-unsave svg { width: 16px; height: 16px; fill: currentColor; }
#appShell .a3-wname { font-size: 14.5px; font-weight: 500; color: var(--a3-ink); margin-bottom: 3px; }
#appShell .a3-warea { font-size: 12px; color: var(--a3-muted); margin-bottom: 16px; }
#appShell .a3-wval { display: flex; align-items: baseline; gap: 10px; }
#appShell .a3-wval > b { font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 700; color: var(--a3-ink); }
#appShell .a3-wval .a3-delta { font-size: 12.5px; gap: 4px; }
#appShell .a3-wupd { font-size: 11px; color: var(--a3-muted); margin-top: 12px; }
#appShell .a3-walert { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--a3-line-soft); }
#appShell .a3-walert-row { display: flex; align-items: center; gap: 10px; }
#appShell .a3-walert-row > span { font-size: 11.5px; color: var(--a3-muted); }
#appShell .a3-walert-row .a3-link { margin-left: auto; font-size: 11.5px; }
#appShell .a3-cond-text { font-size: 11px; color: var(--a3-muted); margin-top: 8px; }
#appShell .a3-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
#appShell .a3-cond select { flex: 1; min-width: 150px; background: var(--a3-field); border: 1px solid var(--a3-line); border-radius: 8px; padding: 9px 10px; font-size: 12px; color: var(--a3-ink); outline: none; font-family: inherit; }
#appShell .a3-cond .pct { display: flex; align-items: center; gap: 6px; background: var(--a3-field); border: 1px solid var(--a3-line); border-radius: 8px; padding: 0 10px; font-size: 12px; color: var(--a3-muted); }
#appShell .a3-cond .pct input { width: 48px; background: none; border: none; padding: 9px 0; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--a3-ink); outline: none; font-family: inherit; }
#appShell .a3-cond button { background: none; border: 1px solid var(--a3-gold); color: var(--a3-gold-ink); font-size: 12px; font-weight: 600; padding: 9px 14px; border-radius: 8px; cursor: pointer; }
#appShell .a3-cond button:hover { background: rgba(212,168,75,.10); }
#appShell .a3-selbar { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 50; background: var(--a3-card); border: 1px solid var(--a3-line); border-radius: 12px; padding: 12px 14px 12px 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 22px 48px var(--a3-shadow); }
#appShell .a3-selbar span, #appShell .a3-selbar .plain { font-size: 12.5px; color: var(--a3-muted); }
#appShell .a3-selbar .plain { background: none; border: none; padding: 0; cursor: pointer; }
#appShell .a3-selbar .a3-btn-gold { font-size: 13px; padding: 10px 18px; }

/* ---------- Compare ---------- */
#appShell .a3-savedrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 4px; }
#appShell .a3-savedrow .a3-eyebrow { margin-right: 6px; }
#appShell .a3-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
#appShell .a3-slot-empty { width: 100%; background: none; border: 1px dashed var(--a3-strong); border-radius: 12px; padding: 18px 20px; min-height: 74px; display: flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; color: var(--a3-muted); font-size: 13px; }
#appShell .a3-slot-empty:hover { border-color: var(--a3-gold-ink); color: var(--a3-gold-ink); }
#appShell .a3-slot-empty svg { width: 15px; height: 15px; }
#appShell .a3-slot { background: var(--a3-card); border: 1px solid var(--a3-line); border-radius: 12px; padding: 18px 20px; min-height: 74px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
#appShell .a3-slot b { display: block; font-size: 14px; font-weight: 500; color: var(--a3-ink); }
#appShell .a3-slot span { display: block; font-size: 11.5px; color: var(--a3-muted); margin-top: 4px; }
#appShell .a3-x { flex: none; background: none; border: none; padding: 2px; cursor: pointer; display: flex; color: var(--a3-muted); }
#appShell .a3-x svg { width: 14px; height: 14px; }
#appShell .a3-cmptable { width: 100%; border-collapse: collapse; min-width: 620px; }
#appShell .a3-cmptable th { text-align: left; vertical-align: middle; width: 190px; font-size: 11px; font-weight: 500; letter-spacing: .06em; color: var(--a3-muted); text-transform: uppercase; padding: 14px 18px 14px 0; border-bottom: 1px solid var(--a3-line-soft); background: none; }
#appShell .a3-cmptable td { vertical-align: middle; border-left: 2px solid transparent; border-bottom: 1px solid var(--a3-line-soft); padding: 14px 18px 14px 14px; font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 500; color: var(--a3-ink); line-height: 1.35; background: none; }
#appShell .a3-cmptable tr.head th, #appShell .a3-cmptable tr.head td { padding-top: 18px; padding-bottom: 18px; }
#appShell .a3-cmptable tr.head td { font-size: 15px; font-weight: 600; }
#appShell .a3-cmptable td.win { background: rgba(212,168,75,.08); border-left-color: var(--a3-gold); color: var(--a3-gold-ink); font-weight: 600; }
#appShell .a3-cmptable tr:last-child th, #appShell .a3-cmptable tr:last-child td { border-bottom: none; }
#appShell .a3-cmpfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--a3-line); }
#appShell .a3-cmpfoot .a3-note { margin-left: auto; }

/* ---------- IAS 40 ---------- */
#appShell .a3-iashead { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
#appShell .a3-iashead > span { font-size: 12.5px; line-height: 1.6; color: var(--a3-muted); max-width: 540px; }
#appShell .a3-iashead .a3-btn-gold { margin-left: auto; }
#appShell .a3-iasbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
#appShell .a3-iasbar .a3-search { flex: 1; min-width: 240px; max-width: 420px; }
#appShell .a3-iasbar .a3-search svg { left: 13px; top: 12px; width: 15px; height: 15px; color: var(--a3-muted); }
#appShell .a3-iasbar .a3-input { border-radius: 9px; padding: 11px 14px 11px 36px; font-size: 13.5px; }
#appShell .a3-iasbar .a3-pills { gap: 6px; margin-left: auto; }
#appShell .a3-clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
#appShell .a3-client { background: var(--a3-card); border: 1px solid var(--a3-line); border-radius: 12px; padding: 22px 24px; cursor: pointer; display: flex; flex-direction: column; gap: 18px; transition: border-color 140ms var(--a3-mo); }
#appShell .a3-client:hover { border-color: var(--a3-gold); }
#appShell .a3-client-top { display: flex; align-items: flex-start; gap: 12px; }
#appShell .a3-client-top > div { flex: 1; min-width: 0; }
#appShell .a3-client-name { font-size: 15px; font-weight: 500; color: var(--a3-ink); }
#appShell .a3-client-period { font-size: 11.5px; color: var(--a3-muted); margin-top: 5px; }
#appShell .a3-client-mid { display: flex; align-items: flex-end; gap: 14px; }
#appShell .a3-client-mid > div:first-child { flex: 1; min-width: 0; }
#appShell .a3-client-mid .a3-eyebrow { font-size: 10px; margin-bottom: 6px; }
#appShell .a3-client-total { font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 600; color: var(--a3-ink); }
#appShell .a3-client-count { flex: none; font-size: 11.5px; color: var(--a3-muted); text-align: right; }
#appShell .a3-client-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--a3-line-soft); padding-top: 12px; }
#appShell .a3-client-foot b { font-size: 11.5px; font-weight: 600; color: var(--a3-gold-ink); }
#appShell .a3-client-foot span { font-size: 11px; color: var(--a3-muted); }
#appShell .a3-back { background: none; border: none; padding: 0; cursor: pointer; font-size: 12.5px; color: var(--a3-muted); white-space: nowrap; }
#appShell .a3-back:hover { color: var(--a3-gold-ink); }
#appShell .a3-table { width: 100%; border-collapse: collapse; }
#appShell .a3-table th { text-align: left; font-size: 10.5px; letter-spacing: .1em; color: var(--a3-muted); text-transform: uppercase; font-weight: 600; padding: 0 14px 12px 0; border-bottom: 1px solid var(--a3-line); background: none; }
#appShell .a3-table td { padding: 16px 14px 16px 0; border-bottom: 1px solid var(--a3-line-soft); font-size: 13.5px; color: var(--a3-ink); background: none; }
#appShell .a3-table th.r, #appShell .a3-table td.r { text-align: right; padding-right: 0; }
#appShell .a3-table tr[data-openreport] { cursor: pointer; }
#appShell .a3-table tr[data-openreport]:hover td { background: var(--a3-line-soft); }
#appShell .a3-table .big { font-variant-numeric: tabular-nums; font-size: 21px; font-weight: 600; color: var(--a3-gold-ink); }

/* ---------- Market Data ---------- */
#appShell .a3-md { display: flex; flex-direction: column; gap: 18px; max-width: 1440px; }
#appShell .a3-mdcols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px; animation: a3fade .25s var(--a3-mo) both; }
#appShell .a3-mdmain { flex: 1; min-width: 320px; max-width: 1100px; display: flex; flex-direction: column; gap: 16px; }
#appShell .a3-mdone { display: flex; flex-direction: column; gap: 16px; max-width: 1100px; animation: a3fade .25s var(--a3-mo) both; }
#appShell .a3-rates { padding: 26px; }
#appShell .a3-rates .a3-eyebrow { margin-bottom: 22px; }
#appShell .a3-rates-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
#appShell .a3-rate-l { font-size: 12.5px; color: var(--a3-muted); margin-bottom: 10px; }
#appShell .a3-rate-v { font-variant-numeric: tabular-nums; font-size: 42px; font-weight: 700; color: var(--a3-ink); letter-spacing: -.02em; line-height: 1; }
#appShell .a3-rate-d { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600; color: var(--a3-gold-ink); }
#appShell .a3-rate-d svg { width: 11px; height: 11px; }
#appShell .a3-rate-s { font-size: 11.5px; color: var(--a3-muted); margin-top: 8px; }
#appShell .a3-chartcard { padding: 24px; }
#appShell .a3-chartcard .a3-h3 { margin-bottom: 20px; }
#appShell .a3-chart { position: relative; padding-left: 48px; }
#appShell .a3-chart .ylab { position: absolute; left: 0; width: 40px; text-align: right; font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--a3-muted); transform: translateY(-50%); }
#appShell .a3-chart svg { width: 100%; height: 240px; display: block; }
#appShell .a3-chart .grid { stroke: var(--a3-line); stroke-width: 1; }
#appShell .a3-chart .line { fill: none; stroke: var(--a3-gold-ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
#appShell .a3-chart .xlab { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--a3-muted); }
#appShell .a3-pad { padding: 24px; }
#appShell .a3-pad p.lead { font-size: 14px; line-height: 1.7; color: var(--a3-ink); margin: 0; max-width: 820px; }
#appShell .a3-powered { display: flex; justify-content: flex-end; font-size: 11px; color: var(--a3-muted); }
#appShell .a3-mpc-date { font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 600; color: var(--a3-ink); letter-spacing: -.01em; line-height: 1; }
#appShell .a3-mpc-sub { font-size: 11.5px; line-height: 1.5; color: var(--a3-muted); margin-top: 9px; }
#appShell .a3-mpc-in { font-size: 12.5px; font-weight: 600; color: var(--a3-gold-ink); margin-top: 12px; }
#appShell .a3-mpc-src { font-size: 11px; color: var(--a3-muted); margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--a3-line-soft); }
#appShell .a3-spark { width: 120px; height: 30px; display: block; }
#appShell .a3-spark path { fill: none; stroke: var(--a3-gold-ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- Modal ---------- */
#appShell .a3-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(6,14,28,.72); display: flex; align-items: flex-start; justify-content: center; padding: 96px 24px; animation: a3fade .2s var(--a3-mo) both; }
#appShell .a3-modal { width: 100%; max-width: 520px; background: var(--a3-card); border: 1px solid var(--a3-line); border-radius: 14px; padding: 24px; box-shadow: 0 30px 70px var(--a3-shadow); color: var(--a3-ink); font-family: Inter, system-ui, sans-serif; }
#appShell .a3-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
#appShell .a3-modal h3 { font-family: var(--a3-serif); font-size: 18px; font-weight: 600; color: var(--a3-ink); margin: 0; }
#appShell .a3-modal label { display: block; font-size: 11.5px; color: var(--a3-muted); margin: 14px 0 6px; }
#appShell .a3-modal .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#appShell .a3-modal-foot { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
#appShell .a3-modal-foot .plain { background: none; border: none; padding: 0; cursor: pointer; font-size: 12.5px; color: var(--a3-muted); }
#appShell .a3-options { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; margin-top: 12px; }
#appShell .a3-option { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: none; border-radius: 9px; padding: 12px; cursor: pointer; color: var(--a3-ink); }
#appShell .a3-option:hover { background: var(--a3-line-soft); }
#appShell .a3-option svg { width: 15px; height: 15px; flex: none; color: var(--a3-muted); }
#appShell .a3-option b { display: block; font-size: 13.5px; font-weight: 400; color: var(--a3-ink); }
#appShell .a3-option span { display: block; font-size: 11.5px; color: var(--a3-muted); margin-top: 2px; }
#appShell .a3-option.is-on svg { color: var(--a3-gold-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1500px) { #appShell .a3-rail[data-rail] { display: none; } }
@media (max-width: 1100px) {
  #appShell .a3-cols { flex-direction: column; }
  #appShell .a3-rail, #appShell .a3-rail[data-rail] { display: flex; position: static; width: 100%; }
  #appShell .shell-wsseg { margin-right: 0; }
}
@media (max-width: 720px) {
  #appShell .shell-topbar { padding: 14px 16px; gap: 12px; }
  #appShell .shell-page-title { font-size: 19px; }
  #appShell .shell-tools { gap: 6px; }
  #appShell .shell-tools .a3-hide-sm { display: none; }
  #appShell .shell-view { padding: 18px 16px 40px; }
  #appShell .a3-welcome { padding: 20px 18px; }
  #appShell .a3-portfolio { padding: 22px 18px; }
  #appShell .a3-rate-v { font-size: 34px; }
  #appShell .a3-overlay { padding: 40px 14px; }
  #appShell .a3-modal .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  #appShell *, #appShell *::before, #appShell *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 720px) { #appShell .shell-sidebar { display: none; } }
