:root {
  --bg: #f3f5f8;
  --sidebar: #e8edf3;
  --card: #ffffff;
  --card-hover: #f6f8fb;
  --input: #ffffff;
  --drawer: #ffffff;
  --stroke: #d3dce6;
  --stroke-strong: #b7c4d4;
  --text: #1b2a41;
  --muted: #5a6b80;
  --footer: #6d7a8b;
  --blue: #2b6fd6;
  --blue-soft: rgba(43, 111, 214, 0.10);
  --green: #16875a;
  --green-soft: rgba(22, 135, 90, 0.12);
  --yellow: #b58912;
  --yellow-soft: rgba(181, 137, 18, 0.14);
  --red: #d14b3e;
  --red-soft: rgba(209, 75, 62, 0.12);
  --shadow: 0 8px 24px rgba(27, 42, 65, 0.08);
  --focus-border: #7aa2d4;
  --focus-ring: rgba(43, 111, 214, 0.18);
  --inset: rgba(27, 42, 65, 0.04);
  --dot-ring: rgba(27, 42, 65, 0.06);
  --chip-checked-border: rgba(43, 111, 214, 0.45);
  --chip-dot-ring: rgba(43, 111, 214, 0.18);
  --btn-outline: rgba(43, 111, 214, 0.40);
  --overlay: rgba(27, 42, 65, 0.40);
  --green-border: rgba(22, 135, 90, 0.40);
  --green-wash: rgba(22, 135, 90, 0.08);
  --yellow-border: rgba(181, 137, 18, 0.45);
  --yellow-wash: rgba(181, 137, 18, 0.10);
  --red-border: rgba(209, 75, 62, 0.40);
  --red-wash: rgba(209, 75, 62, 0.08);
  --active-buy-border: rgba(22, 135, 90, 0.50);
  --active-watch-border: rgba(43, 111, 214, 0.50);
  --active-avoid-border: rgba(209, 75, 62, 0.50);
  --avatar-s: 32%;
  --avatar-l: 86%;
  --avatar-fg: #1b2a41;
  --select-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%235a6b80' stroke-width='1.6' stroke-linecap='round' d='M1.5 1.5L6 6l4.5-4.5'/></svg>");
  --radius: 12px;
  --sidebar-width: 280px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1118;
    --sidebar: #101820;
    --card: #151d28;
    --card-hover: #1a2432;
    --input: #0c1118;
    --drawer: #121a24;
    --stroke: #273244;
    --stroke-strong: #32445c;
    --text: #e8eef6;
    --muted: #8b97a8;
    --footer: #6d7a8b;
    --blue: #5b9fff;
    --blue-soft: rgba(91, 159, 255, 0.14);
    --green: #3ecf8e;
    --green-soft: rgba(62, 207, 142, 0.12);
    --yellow: #e8c547;
    --yellow-soft: rgba(232, 197, 71, 0.12);
    --red: #ef6b5b;
    --red-soft: rgba(239, 107, 91, 0.12);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    --focus-border: #3d5f8a;
    --focus-ring: rgba(91, 159, 255, 0.15);
    --inset: rgba(255, 255, 255, 0.03);
    --dot-ring: rgba(255, 255, 255, 0.04);
    --chip-checked-border: rgba(91, 159, 255, 0.55);
    --chip-dot-ring: rgba(91, 159, 255, 0.18);
    --btn-outline: rgba(91, 159, 255, 0.45);
    --overlay: rgba(6, 10, 16, 0.62);
    --green-border: rgba(62, 207, 142, 0.4);
    --green-wash: rgba(62, 207, 142, 0.07);
    --yellow-border: rgba(232, 197, 71, 0.45);
    --yellow-wash: rgba(232, 197, 71, 0.07);
    --red-border: rgba(239, 107, 91, 0.4);
    --red-wash: rgba(239, 107, 91, 0.07);
    --active-buy-border: rgba(62, 207, 142, 0.55);
    --active-watch-border: rgba(91, 159, 255, 0.55);
    --active-avoid-border: rgba(239, 107, 91, 0.55);
    --avatar-s: 24%;
    --avatar-l: 24%;
    --avatar-fg: #d5e4f7;
    --select-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%238b97a8' stroke-width='1.6' stroke-linecap='round' d='M1.5 1.5L6 6l4.5-4.5'/></svg>");
  }
}

* { box-sizing: border-box; }

html {
  color-scheme: light dark;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---- Sidebar ---- */

.settings {
  background: var(--sidebar);
  border-right: 1px solid var(--stroke);
  padding: 22px 18px 18px;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.sidebar-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-head .icon { color: var(--muted); }

.sidebar-body { flex: 1; }

.sidebar-foot {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 12px 12px 12px 10px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--inset);
  color: var(--muted);
}

.sidebar-foot .icon { margin-top: 1px; }
.sidebar-foot p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.field { margin: 0 0 16px; }

.profile-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.risk-help {
  margin-top: 8px;
}

.risk-help summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.risk-help summary::-webkit-details-marker { display: none; }

.risk-help summary::after {
  content: "▸";
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1;
}

.risk-help[open] summary::after {
  content: "▾";
}

.risk-help summary:hover { color: var(--text); }

.risk-help summary:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.risk-help-panel {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--inset);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.risk-help-heading {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.risk-help-panel p {
  margin: 0 0 10px;
}

.risk-help-panel strong {
  color: var(--text);
  font-weight: 600;
}

.risk-help-profiles {
  margin: 0 0 10px;
}

.risk-help-profiles dt {
  margin: 8px 0 2px;
  font-weight: 600;
  color: var(--text);
}

.risk-help-profiles dt:first-child { margin-top: 0; }

.risk-help-profiles dd {
  margin: 0;
}

.risk-help-distinction {
  margin: 0 0 10px;
  padding-top: 8px;
  border-top: 1px solid var(--stroke);
}

.risk-help-example {
  padding-top: 8px;
  border-top: 1px solid var(--stroke);
}

.risk-help-example-label {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--text);
}

.risk-help-example p {
  margin: 0 0 4px;
}

.risk-help-example ul {
  margin: 4px 0 0;
  padding: 0 0 0 18px;
}

.risk-help-example li {
  margin: 0 0 3px;
}

.risk-help-example li:last-child {
  margin-bottom: 0;
}

.field label,
.label,
legend {
  display: block;
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

input,
select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.select-wrap { position: relative; }
.select-wrap select {
  appearance: none;
  padding-right: 32px;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.currency-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--input);
}

.currency-input span {
  padding: 0 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.currency-input input {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-left: 4px;
}

.currency-input:focus-within {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--blue);
  height: 22px;
}

input[type="checkbox"] { width: auto; padding: 0; accent-color: var(--blue); }

.chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--input);
  font-size: 13px;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--stroke-strong);
  box-shadow: 0 0 0 3px var(--dot-ring);
}

.chip:has(input:checked) {
  border-color: var(--chip-checked-border);
  background: var(--blue-soft);
}

.chip:has(input:checked) .chip-dot {
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--chip-dot-ring);
}

.advanced {
  margin-top: 6px;
  padding-top: 4px;
}

.advanced summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.advanced summary::-webkit-details-marker { display: none; }

.advanced-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.advanced-title::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  margin-top: -4px;
}

.advanced[open] .advanced-title::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.criteria-summary {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.advanced-body {
  margin-top: 14px;
  padding-top: 4px;
}

.advanced-intro {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.settings-group-title {
  margin: 18px 0 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.settings-group-title:first-of-type {
  margin-top: 0;
}

.hint-example {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  font-style: italic;
}

.advanced-heading {
  margin: 16px 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--text);
  line-height: 1.4;
}

.field .check {
  font-weight: 500;
  color: var(--muted);
}

/* ---- Main ---- */

.app {
  min-width: 0;
}

.app-inner {
  max-width: 1560px;
  padding: 28px 36px 48px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.page-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.title-star {
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 6px;
}

.as-of {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.refresh-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.refresh-btn:hover { color: var(--text); border-color: var(--stroke-strong); }
.refresh-btn.is-spinning .icon { animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.how-it-works {
  margin-top: 10px;
  font-size: 13.5px;
}

.how-it-works summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  cursor: pointer;
  list-style: none;
  font-weight: 500;
}

.how-it-works summary::-webkit-details-marker { display: none; }
.how-it-works .icon { width: 16px; height: 16px; }
.link-chevron { font-size: 16px; line-height: 1; }

.strategy-content {
  margin-top: 12px;
  max-width: 58ch;
  padding: 14px 16px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.strategy-content p {
  margin: 0 0 10px;
}

.strategy-content p:last-of-type {
  margin-bottom: 14px;
}

.strategy-steps {
  margin: 0 0 16px;
  padding: 0 0 0 20px;
  list-style: decimal;
}

.strategy-steps li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.strategy-steps li:last-child {
  margin-bottom: 0;
}

.strategy-steps strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}

.disclaimer-panel {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--inset);
  font-size: 12px;
  line-height: 1.5;
}

.disclaimer-panel .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--muted);
  flex-shrink: 0;
}

.disclaimer-panel p {
  margin: 0 0 8px;
}

.disclaimer-panel p:last-child {
  margin-bottom: 0;
}

.disclaimer-title {
  margin: 0 0 6px !important;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.how-it-works ol {
  margin: 10px 0 0;
  padding: 12px 14px 12px 32px;
  max-width: 52ch;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  line-height: 1.55;
}

/* ---- Regime ---- */

.regime {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 18px 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--stroke);
  background: var(--card);
}

.regime-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.regime-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.regime-icon svg { width: 22px; height: 22px; }

.regime-GREEN { border-color: var(--green-border); background: var(--green-wash); }
.regime-YELLOW { border-color: var(--yellow-border); background: var(--yellow-wash); }
.regime-RED { border-color: var(--red-border); background: var(--red-wash); }

.regime-GREEN .regime-icon { background: var(--green-soft); color: var(--green); }
.regime-YELLOW .regime-icon { background: var(--yellow-soft); color: var(--yellow); }
.regime-RED .regime-icon { background: var(--red-soft); color: var(--red); }

.regime-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.regime-GREEN .hl { color: var(--green); }
.regime-YELLOW .hl { color: var(--yellow); }
.regime-RED .hl { color: var(--red); }

.regime-action {
  margin: 0;
  font-size: 14.5px;
  color: var(--text);
}

.why-disclosure {
  margin-top: 8px;
}

.why-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.why-toggle:hover { color: var(--text); }

.why-toggle:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.why-chevron {
  font-size: 11px;
  line-height: 1;
}

.why-panel {
  margin: 6px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.why-panel[hidden] { display: none; }

.indicators {
  display: flex;
  gap: 0;
  flex-shrink: 0;
}

.indicator {
  min-width: 132px;
  padding: 0 18px;
  border-left: 1px solid var(--stroke);
}

.indicator-name {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.indicator-price {
  margin: 2px 0 2px;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.indicator-detail {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.regime-GREEN .indicator-detail { color: var(--green); }
.regime-YELLOW .indicator-detail { color: var(--yellow); }
.regime-RED .indicator-detail { color: var(--red); }

/* ---- Summary + portfolio ---- */

.summary-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.summary-card:hover { background: var(--card-hover); }

.summary-card .count-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.summary-card .count-icon svg { width: 18px; height: 18px; }

.summary-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-copy span {
  font-size: 13px;
  color: var(--muted);
}

.summary-copy strong {
  font-size: 28px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.summary-card.is-buy .count-icon { background: var(--green-soft); color: var(--green); }
.summary-card.is-buy strong { color: var(--green); }
.summary-card.is-watch .count-icon { background: var(--blue-soft); color: var(--blue); }
.summary-card.is-watch strong { color: var(--blue); }

.portfolio-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 10px 14px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
}

.portfolio-strip .icon { color: var(--muted); }
.portfolio-strip b { color: var(--text); font-weight: 600; }

/* ---- Results ---- */

.opportunities h2 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.section-blurb {
  margin: 0 0 16px;
  max-width: 72ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.group-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 22px 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.section-blurb + .group-head {
  margin-top: 8px;
}

.group-head.is-watch { color: var(--blue); }
.group-head.is-buy { color: var(--green); }
.group-head.is-avoid { color: var(--red); }
.group-head .count-inline { font-weight: 500; }

.empty-quiet {
  margin: 4px 0 8px;
  max-width: 52ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.empty-quiet .empty-title {
  margin: 0 0 4px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.empty-quiet p { margin: 0; }

.avoided-block {
  margin-top: 28px;
}

.avoided-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.avoided-toggle:hover { color: var(--text); }

.avoided-toggle:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.avoided-chevron {
  font-size: 14px;
  line-height: 1;
}

#avoided-list {
  margin-top: 12px;
}

#avoided-list[hidden] { display: none; }

.stock-card {
  display: grid;
  grid-template-columns: minmax(168px, 1.35fr) minmax(150px, 1.15fr) repeat(5, minmax(72px, 0.72fr)) auto;
  gap: 10px 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: hsl(var(--avatar-hue, 210) var(--avatar-s) var(--avatar-l));
  color: var(--avatar-fg);
  flex-shrink: 0;
}

.identity h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.identity .meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-block .status-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.status-block .status-detail {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.metric {
  min-width: 0;
}

.metric-label {
  display: inline-block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  cursor: help;
  border-bottom: 1px dotted transparent;
}

.metric-label:hover { border-bottom-color: var(--muted); }

.metric-value {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.score-good { color: var(--green); }
.score-mid { color: var(--yellow); }
.score-low { color: var(--red); }
.score-muted { color: var(--muted); }
.metric-value.is-price { color: var(--text); }

.view-setup-btn {
  justify-self: end;
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--btn-outline);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.view-setup-btn:hover { background: var(--blue-soft); }

.status {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.page-footer {
  margin: 28px 0 0;
  text-align: center;
  color: var(--footer);
  font-size: 12px;
}

/* ---- Drawer ---- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  justify-content: flex-end;
  z-index: 40;
}

.drawer-overlay[hidden] { display: none; }

.drawer-panel {
  width: min(460px, 100%);
  height: 100%;
  background: var(--drawer);
  border-left: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  overflow-y: auto;
  padding: 22px 22px 32px;
}

.drawer-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.drawer-top h2 {
  margin: 0;
  font-size: 22px;
}

.drawer-top .meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.drawer-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  font-size: 13px;
}

.kv div {
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--bg);
}

.kv span {
  color: var(--muted);
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
}

.why-box,
.plan-box {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.why-box strong,
.plan-box strong { color: var(--text); }

.info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  margin-left: 4px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  font-size: 9px;
  color: var(--muted);
  cursor: help;
  vertical-align: middle;
}

@media (max-width: 1180px) {
  .stock-card {
    grid-template-columns: 1fr 1fr;
  }
  .view-setup-btn { justify-self: start; }
  .regime { flex-direction: column; align-items: flex-start; }
  .indicators { width: 100%; justify-content: space-between; }
  .indicator { min-width: 0; padding: 8px 12px 0 0; border-left: 0; }
}

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .settings {
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--stroke);
  }
  .app-inner { padding: 20px 16px 40px; }
  .page-header { flex-direction: column; }
  .summary-cards { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .stock-card { grid-template-columns: 1fr 1fr; }
  .indicators { flex-wrap: wrap; gap: 12px; }
  .summary-cards { grid-template-columns: 1fr; }
}
