/* dashboard.css — Socratii dashboard preview page styles (uses tokens from style.css) */

/* ============ PAGE INTRO ============ */
.dash-hero {
  padding-block: clamp(var(--space-12), 7vw, var(--space-20)) var(--space-10);
  border-bottom: 1px solid var(--color-divider);
}
.dash-hero-copy h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-top: var(--space-3);
}
.dash-hero-copy p {
  margin-top: var(--space-5);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 74ch;
}
.dash-hero-copy p strong {
  color: var(--color-text);
}

/* ============ JUMP NAV (mirrors .learn-jumpnav / .calc-jumpnav) ============ */
.dash-jumpnav {
  margin-top: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.dash-jumpnav .learn-jumpnav-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-right: var(--space-1);
}
.dash-jumpnav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}
.dash-jumpnav a:hover {
  text-decoration: underline;
  background: var(--color-surface-offset);
}
.dash-jumpnav span[aria-hidden] {
  color: var(--color-text-faint);
}
.dash-jumpnav .learn-jumpnav-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  background: var(--color-gold);
}

/* ============ CATEGORY SECTIONS (mirrors .learn-category) ============ */
.dash-category {
  border-bottom: 1px solid var(--color-divider);
  scroll-margin-top: var(--space-20);
}
.dash-category--alt {
  background: var(--color-surface-2);
}
.dash-category:last-of-type {
  border-bottom: none;
}

.dash-category-head {
  max-width: 900px;
  margin-bottom: var(--space-10);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.dash-category-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  margin-top: var(--space-1);
}
.dash-category-icon svg {
  width: 24px;
  height: 24px;
}
.dash-category-head-copy {
  flex: 1;
  min-width: 220px;
}
.dash-category-head-copy .eyebrow {
  margin-bottom: var(--space-1);
}
.dash-category-head h2 {
  font-size: var(--text-xl);
  font-weight: 700;
}
.dash-category-head p {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-base);
}
.dash-category-head .sample-note {
  margin-top: var(--space-1);
  flex-shrink: 0;
}

/* ============ KPI CARD GRID ============ */
.kpi-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1080px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  content-visibility: auto;
  contain-intrinsic-size: 0 220px;
  transition:
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive),
    border-color var(--transition-interactive);
}
.kpi-card:hover,
.kpi-card:focus-within {
  box-shadow: var(--shadow-md);
  border-color: oklch(from var(--color-primary) l c h / 0.3);
  transform: translateY(-2px);
}

.kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.kpi-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}

.sample-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-gold-active);
  background: var(--color-gold-highlight);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  white-space: nowrap;
}
[data-theme='dark'] .sample-tag {
  color: var(--color-gold);
}

.kpi-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.1;
}
.kpi-value-unit {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-left: var(--space-1);
}

.kpi-status-copy {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.kpi-sparkline {
  width: 100%;
  height: 28px;
  display: block;
  overflow: visible;
}
.kpi-sparkline polyline {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.kpi-progress-track {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-surface-offset-2);
  overflow: hidden;
}
.kpi-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  transition: width 0.35s var(--ease-out-expo);
}
.kpi-progress-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}

.kpi-foot {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: auto;
}

/* Status tags — reuse existing semantic-safe tokens only */
.status-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  white-space: nowrap;
}
.status-tag--ontrack {
  color: var(--color-success);
  background: var(--color-success-highlight);
}
.status-tag--attention {
  color: var(--color-warning);
  background: var(--color-warning-highlight);
}

/* Asset allocation stacked bar */
.alloc-bar {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-surface-offset-2);
}
.alloc-bar li {
  height: 100%;
}
.alloc-stocks {
  background: var(--color-primary);
}
.alloc-bonds {
  background: var(--color-gold);
}
.alloc-cash {
  background: var(--color-text-faint);
}

/* Mock checklist for Action Items */
.kpi-card--checklist {
  gap: var(--space-4);
}
.mock-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.mock-checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.mock-checklist li.is-done {
  color: var(--color-text-faint);
  text-decoration: line-through;
}
.mock-checklist-mark {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-inverse);
}
.mock-checklist li.is-done .mock-checklist-mark {
  background: var(--color-success);
  border-color: var(--color-success);
}

/* ============ EDUCATION CARD GRID (link-style, no mock numbers) ============ */
.edu-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .edu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1080px) {
  .edu-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.edu-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition:
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive),
    border-color var(--transition-interactive);
}
.edu-card:hover,
.edu-card:focus-within {
  box-shadow: var(--shadow-md);
  border-color: oklch(from var(--color-primary) l c h / 0.3);
  transform: translateY(-2px);
}
.edu-card--soon {
  background: var(--color-surface-2);
}
.edu-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.edu-card h3 {
  font-size: var(--text-base);
  font-weight: 700;
}
.edu-card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  flex: 1;
}
.edu-card-link {
  align-self: flex-start;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  margin-top: var(--space-1);
}
.edu-card-link:hover {
  text-decoration: underline;
}

/* ============ CLOSING CTA ============ */
.dash-closing {
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
}
.dash-closing .container {
  max-width: 760px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.dash-closing .eyebrow {
  justify-content: center;
}
.dash-closing h2 {
  font-size: var(--text-xl);
  font-weight: 700;
}
.dash-closing p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  max-width: 60ch;
}
.dash-closing .btn {
  margin-top: var(--space-2);
}

/* ============ RESPONSIVE TWEAKS ============ */
@media (max-width: 480px) {
  .dash-category-head {
    gap: var(--space-3);
  }
  .dash-category-icon {
    width: 40px;
    height: 40px;
  }
  .dash-category-icon svg {
    width: 20px;
    height: 20px;
  }
  .kpi-card,
  .edu-card {
    padding: var(--space-5);
  }
  .dash-category-head .sample-note {
    margin-top: 0;
  }
}

/* ============ MY WATCHLIST (working module) ============ */
.dash-category--watch .dash-category-head p a { color: var(--color-primary); font-weight: 600; }
.p2v-watch {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.p2v-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.p2v-count { flex: 1 1 200px; font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }
.p2v-add { display: flex; gap: var(--space-2); }
.p2v-add input,
.p2v-table select,
.p2v-table input {
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg, var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  min-height: 36px;
}
.p2v-add input { width: 13rem; text-transform: uppercase; }
.p2v-add input::placeholder { text-transform: none; }
.p2v-add input:focus,
.p2v-table select:focus,
.p2v-table input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.p2v-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.p2v-actions .btn,
.p2v-add .btn { min-height: 36px; padding-block: 0.4rem; font-size: var(--text-sm); }
.p2v-empty { text-align: center; padding: var(--space-10) var(--space-4); }
.p2v-empty h3 { font-size: var(--text-lg); }
.p2v-empty p { color: var(--color-text-muted); max-width: 52ch; margin: var(--space-3) auto var(--space-5); }
.p2v-table-wrap { overflow-x: auto; }
.p2v-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.p2v-table th,
.p2v-table td { padding: var(--space-2) var(--space-2); border-bottom: 1px solid var(--color-divider); text-align: left; vertical-align: middle; }
.p2v-table thead th { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-faint); }
.p2v-table tbody tr:last-child > * { border-bottom: none; }
.p2v-sym { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p2v-kind { font-size: 0.7rem; font-weight: 700; color: var(--color-gold-active); background: var(--color-gold-highlight); border-radius: var(--radius-full); padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }
.p2v-name { min-width: 8rem; }
.p2v-muted { color: var(--color-text-muted); }
.p2v-table td input[data-field="note"] { width: 100%; min-width: 7rem; }
.p2v-num { text-align: right; }
.p2v-table th.p2v-num { text-align: right; }
.p2v-num input { width: 4.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.p2v-links { white-space: nowrap; text-align: right; }
.p2v-links a { color: var(--color-primary); font-weight: 600; margin-right: var(--space-3); text-decoration: none; }
.p2v-links a:hover { text-decoration: underline; }
.p2v-remove { background: none; border: 0; cursor: pointer; width: 32px; height: 32px; border-radius: var(--radius-sm); color: var(--color-text-muted); vertical-align: middle; }
.p2v-remove svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.p2v-remove:hover { background: var(--color-error-highlight); color: var(--color-error); }
.p2v-remove:focus-visible { outline: 2px solid var(--color-primary); }
.p2v-sketch { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--color-divider); }
.p2v-sketch-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-3); }
.p2v-sketch-head h3 { font-size: var(--text-base); font-weight: 700; }
.p2v-sketch-total { font-size: var(--text-sm); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.p2v-sketch-total.p2v-full { color: var(--color-success); font-weight: 600; }
.p2v-sketch-total.p2v-over { color: var(--color-error); font-weight: 600; }
.p2v-sketch-bar { display: flex; height: 12px; border-radius: var(--radius-full); overflow: hidden; background: var(--color-surface-offset); }
.p2v-sketch-bar li { height: 100%; }
.p2v-sketch-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-3); font-size: var(--text-sm); }
.p2v-sketch-legend li { display: inline-flex; align-items: center; gap: var(--space-2); }
.p2v-sketch-legend .p2v-flag { flex-basis: 100%; color: var(--color-warning); }
.p2v-dot { width: 10px; height: 10px; border-radius: var(--radius-full); flex-shrink: 0; }
.p2v-sketch-note,
.p2v-foot { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-4); max-width: 90ch; }
.p2v-sketch-note a { color: var(--color-primary); }
/* Narrow screens: each symbol becomes a card instead of a wide table row. */
@media (max-width: 1100px) {
  .p2v-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .p2v-table,
  .p2v-table tbody { display: block; }
  .p2v-table tr {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "sym name price day" "stage note pct links";
    gap: var(--space-2) var(--space-3);
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-divider);
  }
  .p2v-table tbody tr:last-child { border-bottom: none; }
  .p2v-table th,
  .p2v-table td { display: block; padding: 0; border: 0; }
  .p2v-table .p2v-hide-sm { display: none; }
  .p2v-sym { grid-area: sym; }
  .p2v-name { grid-area: name; min-width: 0; }
  .p2v-links { grid-area: links; }
  .p2v-table td:has(select) { grid-area: stage; }
  .p2v-table td.p2v-hide-md { grid-area: note; display: block; }
  .p2v-table td:has(input[data-field="pct"]) { grid-area: pct; }
  .p2v-table td.p2v-price { grid-area: price; }
  .p2v-table td.p2v-ytd { display: none; }
  .p2v-table td.p2v-day { display: block; grid-area: day; }
  .p2v-table td input[data-field="note"] { min-width: 0; }
}
@media (max-width: 640px) {
  .p2v-table tr {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "sym name price" "stage stage pct" "note note note" "links links links";
  }
  .p2v-links { text-align: left; }
  .p2v-table td.p2v-day { display: none; }
  .p2v-table select { width: 100%; }
  .p2v-add { flex: 1 1 100%; }
  .p2v-add input { flex: 1; width: auto; }
  .p2v-watch { padding: var(--space-4); }
}

.p2v-price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p2v-table td.p2v-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.p2v-up { color: var(--color-success); }
.p2v-down { color: var(--color-error); }
.p2v-asof { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-3); }
.p2v-foot a { color: var(--color-primary); }
.p2v-sub { display: block; font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
@media (max-width: 1100px) { .p2v-sub { display: none; } }

/* ============ BUILD MY PLAN (plan2vest-plan.js) ============ */
#build-plan [hidden], .pl-tip[hidden], .status-tag[hidden] { display: none !important; }
.pl-setup { scroll-margin-top: var(--space-20); }
.pl-start { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 860px) { .pl-start { grid-template-columns: repeat(3, 1fr); } }
.pl-option {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-3);
}
.pl-option h3 { font-size: var(--text-base); font-weight: 700; }
.pl-option p { font-size: var(--text-sm); color: var(--color-text-muted); }
.pl-option-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pl-option-links { font-size: var(--text-xs) !important; }
.pl-option-links a, .pl-privacy a, .pl-review a { color: var(--color-primary); }
.pl-file { position: relative; cursor: pointer; }
.pl-file input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; font-size: 0; }
.pl-file:focus-within { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.pl-privacy { margin-top: var(--space-5); font-size: var(--text-xs); color: var(--color-text-muted); max-width: 80ch; }

.pl-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.pl-bar-status { font-size: var(--text-sm); color: var(--color-text-muted); }
.pl-bar-status strong { color: var(--color-text); }
.pl-bar-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pl-bar-actions .btn, .pl-option-actions .btn, .pl-review-actions .btn, .pl-editor-actions .btn, .pl-add {
  min-height: 38px; padding-block: 0.45rem; font-size: var(--text-sm);
}
.pl-clear { background: none; border: 1px solid transparent; color: var(--color-text-muted); text-decoration: underline; cursor: pointer; padding-inline: var(--space-3); border-radius: var(--radius-md); font: inherit; font-size: var(--text-sm); }
.pl-clear:hover { color: var(--color-error); }
.pl-sample-flag, .pl-tag {
  display: inline-flex; align-items: center; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase; border-radius: var(--radius-full); padding: var(--space-1) var(--space-3); white-space: nowrap;
}
.pl-sample-flag { color: var(--color-gold-active); background: var(--color-gold-highlight); margin-left: var(--space-1); }
.pl-tag { flex-shrink: 0; color: var(--color-primary); background: var(--color-primary-highlight); }
.pl-note--yours { color: var(--color-primary) !important; background: var(--color-primary-highlight) !important; }
.pl-error, .pl-error-inline { color: var(--color-error); font-size: var(--text-sm); font-weight: 600; }
.pl-muted { color: var(--color-text-muted); font-size: var(--text-sm); }

/* Review after upload */
.pl-review, .pl-editor {
  margin-top: var(--space-5); background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4);
}
.pl-review:focus { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.pl-review h3, .pl-editor h3 { font-size: var(--text-base); font-weight: 700; }
.pl-review-facts { display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.pl-review-facts li::before { content: "\2022"; color: var(--color-gold); margin-right: var(--space-2); }
.pl-review-notes summary, .pl-details summary { cursor: pointer; font-size: var(--text-sm); font-weight: 600; color: var(--color-primary); }
.pl-review-notes ul { margin-top: var(--space-2); padding-left: var(--space-5); list-style: disc; font-size: var(--text-sm); color: var(--color-text-muted); display: grid; gap: var(--space-1); }
.pl-review-actions, .pl-editor-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Editor */
.pl-tabs { display: flex; flex-wrap: wrap; gap: var(--space-1); border-bottom: 1px solid var(--color-divider); }
.pl-tabs [role="tab"] {
  font: inherit; font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); background: none;
  border: 0; border-bottom: 2px solid transparent; padding: var(--space-2) var(--space-3); cursor: pointer; margin-bottom: -1px;
}
.pl-tabs [role="tab"][aria-selected="true"] { color: var(--color-primary); border-bottom-color: var(--color-gold); }
.pl-tabs [role="tab"]:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: var(--radius-sm); }
.pl-panel { display: flex; flex-direction: column; gap: var(--space-4); }
.pl-sub { font-size: var(--text-sm); font-weight: 700; margin-top: var(--space-2); }
.pl-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .pl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .pl-grid { grid-template-columns: repeat(3, 1fr); } }
.pl-field label, .pl-cell-label { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--color-text); margin-bottom: var(--space-1); }
.pl-hint { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); }
.pl-cell, .pl-field { min-width: 0; }
.pl-input { min-width: 0; display: flex; align-items: center; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.pl-input:focus-within { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.pl-input span { padding-inline: var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.pl-input input { flex: 1; min-width: 0; font: inherit; font-size: var(--text-sm); color: var(--color-text); background: none; border: 0; padding: 0.5rem var(--space-3); outline: none; font-variant-numeric: tabular-nums; }
.pl-input--prefix input { padding-left: 0; }
.pl-input--suffix input { padding-right: 0; }
.pl-cell select {
  width: 100%; font: inherit; font-size: var(--text-sm); color: var(--color-text); background: var(--color-bg);
  border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 0.5rem var(--space-2);
}
.pl-list { display: flex; flex-direction: column; gap: var(--space-2); }
.pl-list-head, .pl-list-row { display: grid; gap: var(--space-2); align-items: end; }
.pl-list--accounts .pl-list-head, .pl-list--accounts .pl-list-row { grid-template-columns: 2fr 1.6fr 1fr 1fr 36px; }
.pl-list--debts .pl-list-head, .pl-list--debts .pl-list-row { grid-template-columns: 2fr 1.4fr 1fr 0.8fr 1fr 36px; }
.pl-list--goals .pl-list-head, .pl-list--goals .pl-list-row { grid-template-columns: 1.8fr 1.3fr 1fr 0.8fr 1fr 1fr 36px; }
.pl-list-head span { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); }
.pl-list-row .pl-cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pl-remove { width: 36px; height: 38px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: none; color: var(--color-text-muted); font-size: 1.1rem; cursor: pointer; }
.pl-remove:hover { color: var(--color-error); border-color: var(--color-error); }
.pl-add { align-self: flex-start; }
@media (max-width: 820px) {
  .pl-list-head { display: none; }
  .pl-list-row { grid-template-columns: 1fr 1fr !important; padding: var(--space-3); border: 1px solid var(--color-divider); border-radius: var(--radius-md); align-items: end; }
  .pl-list-row .pl-cell-label { position: static; width: auto; height: auto; clip: auto; }
  .pl-list-row .pl-cell:first-child { grid-column: 1 / -1; }
  .pl-remove { grid-column: 1 / -1; justify-self: end; }
}

/* Cards with the visitor's numbers */
.pl-live .kpi-card { content-visibility: visible; }
.pl-foot { color: var(--color-text-muted); }
.pl-foot a { color: var(--color-primary); }
@media (min-width: 1080px) { #my-plan.pl-live .kpi-grid { grid-template-columns: repeat(5, 1fr); } .pl-span2 { grid-column: span 2; } }
.pl-extra { margin-top: var(--space-5); display: grid; gap: var(--space-5); }
.pl-wide:hover { transform: none; }
.pl-cf-total { font-size: var(--text-sm); color: var(--color-text-muted); }
.pl-cf-bar { display: flex; height: 14px; border-radius: var(--radius-full); overflow: hidden; background: var(--color-surface-offset-2); }
.pl-cf-bar span { height: 100%; }
.pl-seg-spend { background: var(--color-primary); }
.pl-seg-debt { background: var(--color-gold); }
.pl-seg-save { background: var(--color-success); }
.pl-seg-left { background: var(--color-text-faint); }
.pl-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-size: var(--text-sm); color: var(--color-text-muted); }
.pl-legend strong { color: var(--color-text); font-variant-numeric: tabular-nums; }
.pl-dot { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius-full); margin-right: var(--space-2); vertical-align: 0; }
.pl-over { color: var(--color-error); font-weight: 600; }
.pl-over strong { color: var(--color-error); }

.pl-chart-wrap { position: relative; }
.pl-chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.pl-grid-line { stroke: var(--color-divider); stroke-width: 1; }
.pl-axis { fill: var(--color-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pl-area { fill: var(--color-primary-highlight); }
.pl-line { fill: none; stroke: var(--color-primary); stroke-width: 2.5; stroke-linejoin: round; }
.pl-retire-line { stroke: var(--color-gold); stroke-width: 2; stroke-dasharray: 5 4; }
.pl-mark-label { fill: var(--color-text); font-size: 12px; font-weight: 600; }
.pl-mark-warn { fill: var(--color-error); }
.pl-deplete { fill: var(--color-error); }
.pl-hover-line { stroke: var(--color-text-muted); stroke-width: 1; }
.pl-hover-dot { fill: var(--color-surface); stroke: var(--color-primary); stroke-width: 2.5; }
.pl-hit { fill: transparent; cursor: crosshair; }
.pl-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; white-space: nowrap;
  background: var(--color-text); color: var(--color-bg); font-size: var(--text-xs); padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md); font-variant-numeric: tabular-nums;
}
.pl-chart-summary { font-size: var(--text-sm); color: var(--color-text-muted); }
.pl-details { border-top: 1px solid var(--color-divider); padding-top: var(--space-3); }
.pl-table-wrap { max-height: 360px; overflow: auto; margin-top: var(--space-3); }
.pl-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.pl-table th, .pl-table td { padding: var(--space-1) var(--space-3); text-align: right; border-bottom: 1px solid var(--color-divider); white-space: nowrap; }
.pl-table th:first-child, .pl-table td:first-child { text-align: left; }
.pl-table thead th { position: sticky; top: 0; background: var(--color-surface); font-size: var(--text-xs); color: var(--color-text-muted); }
.pl-row-retire td { background: var(--color-gold-highlight); font-weight: 600; }
.pl-short { color: var(--color-error); font-size: var(--text-xs); }
.pl-notes { margin-top: var(--space-3); padding-left: var(--space-5); list-style: disc; display: grid; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.pl-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--color-primary); text-decoration: underline; cursor: pointer; }

.pl-goals { display: grid; gap: var(--space-4); }
.pl-goal-top { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-2); }
.pl-goal-amt { color: var(--color-text-muted); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-actions { display: grid; gap: var(--space-3); }
.pl-act { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); font-size: var(--text-sm); align-items: start; }
.pl-act input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--color-primary); }
.pl-act label { cursor: pointer; }
.pl-act--attention label::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--color-warning); margin-right: var(--space-2); vertical-align: 1px; }
.pl-act.is-done label { color: var(--color-text-muted); text-decoration: line-through; }
.pl-act-links { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-xs); font-weight: 600; }
.pl-act-links a { color: var(--color-primary); }

/* ============ MY INVESTMENTS (plan holdings at today's prices) ============ */
:root {
  --pl-seg-us: #0f2f7a; --pl-seg-intl: #6f8fd8; --pl-seg-bond: #c99b3f; --pl-seg-mixed: #2f7a6f;
  --pl-seg-real: #a5532f; --pl-seg-cash: #9aa1ab; --pl-seg-other: #5b6475;
}
[data-theme='dark'] {
  --pl-seg-us: #5e84dd; --pl-seg-intl: #a9bff0; --pl-seg-bond: #dcb35e; --pl-seg-mixed: #5fb7a5;
  --pl-seg-real: #d9845f; --pl-seg-cash: #6c7890; --pl-seg-other: #8b93a5;
}
.pl-seg-us { background: var(--pl-seg-us); }
.pl-seg-intl { background: var(--pl-seg-intl); }
.pl-seg-bond { background: var(--pl-seg-bond); }
.pl-seg-mixed { background: var(--pl-seg-mixed); }
.pl-seg-real { background: var(--pl-seg-real); }
.pl-seg-cash { background: var(--pl-seg-cash); }
.pl-seg-other { background: var(--pl-seg-other); }
.pl-cf-bar span + span { box-shadow: inset 2px 0 0 var(--color-surface); }
.pl-tag--live { color: var(--color-success); background: var(--color-success-highlight); }
.pl-up { color: var(--color-success); font-weight: 600; }
.pl-down { color: var(--color-error); font-weight: 600; }
@media (min-width: 1080px) { #my-investments.pl-live .kpi-grid.pl-grid-5 { grid-template-columns: repeat(5, 1fr); } }
.pl-table-wrap--open { max-height: none; }
.pl-holdings th[scope="row"] { text-align: left; font-weight: 500; white-space: normal; min-width: 11rem; }
.pl-sym { display: block; font-weight: 700; color: var(--color-text); }
.pl-sym-name { display: block; font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 400; white-space: normal; }
.pl-table tbody th[scope="row"] { text-align: left; }
.pl-attrib { font-size: var(--text-xs); color: var(--color-text-muted); border-top: 1px solid var(--color-divider); padding-top: var(--space-3); }
.pl-attrib strong { color: var(--color-text); }
.pl-wide .kpi-card-top .pl-linkbtn { font-size: var(--text-sm); font-weight: 600; }
.pl-list--holdings .pl-list-head, .pl-list--holdings .pl-list-row { grid-template-columns: 0.9fr 1.6fr 0.8fr 1fr 1.6fr 36px; }

.pl-extra > *, .pl-extra .pl-wide { min-width: 0; }
.pl-table--text2 th:nth-child(2), .pl-table--text2 td:nth-child(2) { text-align: left; }
