.portfolio-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.2fr);
  align-items: center;
  gap: 24px;
  margin: 22px 0;
  padding: 22px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
}
.portfolio-briefing { min-height: 0; padding: 34px 42px; }
.portfolio-briefing .ai-summary { max-width: 860px; margin: 0 auto; white-space: normal; font: inherit; }
.portfolio-briefing .ai-session-heading { text-align: center; font: 400 32px/1.2 Georgia, serif; margin: 0 0 24px; color: #f5f0e4; }
.portfolio-briefing .ai-session-heading + .session-context { margin: -14px 0 24px; text-align: center; color: #c5a96d; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.ai-summary { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.ai-summary p { margin: 0 0 14px; font: 15px/1.7 Georgia, serif; }
.ai-summary h3, .performance-total h3 { margin: 22px 0 8px; font: 400 20px/1.3 Georgia, serif; }
.ai-summary h3:first-child { margin-top: 0; }
.ai-summary h4 { margin: 16px 0 7px 12px; padding-left: 10px; border-left: 2px solid var(--gold); font: 400 16px/1.35 Georgia, serif; color: var(--gold); }
.portfolio-briefing .ai-summary h3 { color: #e8d9b5; }
.ai-summary ul { margin: 0 0 16px; padding-left: 21px; }
.ai-summary li { margin: 0 0 7px; font: 15px/1.6 Georgia, serif; }
.ai-summary a { color: inherit; text-decoration-color: #c5a96d; text-underline-offset: 3px; }
.portfolio-briefing .ai-summary a { color: #e8d9b5; }
.ai-session-heading { margin: 0 0 22px; text-align: center; font: 400 30px/1.2 Georgia, serif; }
.portfolio-summary label {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}
.performance-total h3 { margin: 0; }
.portfolio-summary p { margin: 9px 0 0; font: 17px Georgia, serif; }
.leaders { display: flex; justify-content: flex-end; gap: 36px; }
.leaders div { display: grid; gap: 7px; }
.leaders strong, .holding h3 { font: 400 20px Georgia, serif; }
.holding h3 { margin: 0; }
.leaders span { font-size: 13px; }
.symbol-field { position: relative; min-width: 0; }
.symbol-field .ticker { width: 100%; }
.ticker-selected { display: block; min-height: 15px; padding: 4px 2px 0; color: var(--muted); font-size: 11px; }
.ticker-suggestions {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 260px;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 12px 26px rgb(24 25 20 / 14%);
}
.ticker-suggestions:empty { display: none; }
.ticker-option {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.ticker-option:last-child { border-bottom: 0; }
.ticker-option:hover, .ticker-option:focus-visible { background: #eee8dc; }
.ticker-option strong { font: 14px Georgia, serif; }
.ticker-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ticker-option small { color: var(--muted); font-size: 10px; }
.ticker-search-note { padding: 12px; color: var(--muted); font-size: 12px; }
.data-notice { margin: 16px 0; padding: 12px 16px; background: #fff7e6; border-left: 3px solid var(--gold); color: var(--ink); font-size: 12px; line-height: 1.55; }
.data-notice[hidden] { display: none; }
.market-notice { margin: 22px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.market-notice span { margin-left: 7px; color: var(--ink); font-weight: 700; }
.forecast-meta { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.forecast-meta span:first-child { color: var(--ink); font-weight: 700; }
.account-button { padding: 10px 14px; color: var(--ink); background: transparent; border: 1px solid var(--line); font-size: 11px; }
.account-panel { max-width: 520px; padding: 28px; background: var(--paper); border: 1px solid var(--line); }
.account-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.account-tabs button { padding: 12px 8px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 11px; }
.account-tabs button.active { color: var(--ink); border-bottom-color: var(--gold); }
#accountForm { display: grid; gap: 14px; margin-top: 22px; }
#accountForm label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
#accountForm label[hidden] { display: none; }
#accountForm input { width: 100%; padding: 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); font: 14px Arial, sans-serif; }
.account-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.password-match-feedback { margin: -6px 0 0; color: #2f6b3a; font-size: 12px; font-weight: 700; }
.password-match-feedback[hidden] { display: none; }
.account-status { min-height: 16px; margin: 4px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.account-email { font: 20px Georgia, serif; overflow-wrap: anywhere; }
#savePositionsButton[hidden] { display: none; }
#home.page.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 42px;
  max-width: none;
  min-height: calc(100vh - 166px);
  padding: 54px 6vw 62px;
}
#home .hero { width: min(100%, 900px); max-width: none; padding: 0; text-align: center; }
#home .hero h1 { margin: 22px 0; }
#home .hero > p:not(.fine) { margin-left: auto; margin-right: auto; }
#home .hero .fine { width: min(100%, 550px); margin: 24px auto 0; padding: 13px 0 0; border-top: 1px solid var(--line); border-left: 0; text-align: center; }
#home .choices { width: min(100%, 1120px); gap: 16px; border: 0; }
#home .choices button,
#home .choices button:last-child {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 218px;
  padding: 26px 24px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
#home .choices button:hover { background: #fdfcf8; border-color: var(--gold); transform: translateY(-3px); }
#home .choices strong { margin: 28px 0 12px; font-size: 22px; line-height: 1.25; }
#home .choices em { max-width: 290px; }
.market-moves.metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.economic-metrics.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.market-move { min-width: 0; }
.ticker-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ticker-title strong { overflow: hidden; color: var(--ink); font: 400 14px Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.ticker-title span { color: var(--muted); font-size: 10px; }
.market-move .ticker-price { display: block; margin-top: 12px; font: 400 21px Georgia, serif; }
.market-move .ticker-change { display: flex; flex-wrap: wrap; gap: 7px; align-items: baseline; margin-top: 7px; font-variant-numeric: tabular-nums; }
.market-move .ticker-change strong { margin: 0; font: 700 13px Arial, sans-serif; }
.market-move .ticker-change span { font-size: 12px; font-weight: 700; }
.market-move > small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
@media (max-width: 1000px) {
  .market-moves.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .account-button { padding: 9px; }
  .account-panel { padding: 20px; }
  #home.page.active { gap: 32px; min-height: auto; padding: 48px 6vw 60px; }
  #home .hero h1 { font-size: 46px; }
  #home .choices { grid-template-columns: 1fr; gap: 12px; }
  #home .choices button, #home .choices button:last-child { min-height: 0; padding: 22px 20px; }
  #home .choices strong { margin: 18px 0 9px; font-size: 20px; }
  .portfolio-briefing { padding: 26px 22px; }
  .portfolio-briefing .ai-session-heading { font-size: 27px; }
  .market-moves.metrics, .economic-metrics.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-summary { grid-template-columns: 1fr; gap: 20px; }
  .leaders { justify-content: flex-start; gap: 28px; }
  .ticker-option { grid-template-columns: 60px minmax(0, 1fr); }
  .ticker-option small { display: none; }
}
