/* today.css -- the "Today" weekly brief (Private Bank redesign).
   Every rule is scoped under #today-tab. Tokens fall back to the Private Bank
   values, so the screen looks right before or after the shell's tokens land. */

#today-tab.tab-content.active { display: block; overflow-y: auto; background: var(--bg-app, #f7f4ec); }

#today-tab *, #today-tab *::before, #today-tab *::after { box-sizing: border-box; }

#today-tab .td-wrap {
  max-width: 1180px; margin: 0 auto; padding: 40px 48px 32px;
  display: flex; flex-direction: column; gap: 28px;
  color: var(--ink, #14213d);
  font: 400 17px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---- header ---- */
#today-tab .td-head { display: flex; flex-direction: column; gap: 10px; }
#today-tab .td-eyebrow {
  font: 600 13px/1.3 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4, #6b6558);
}
#today-tab .td-title {
  margin: 0; max-width: 820px; text-wrap: balance;
  font: 700 42px/1.1 'Space Grotesk', Inter, sans-serif; letter-spacing: -.025em; color: var(--ink, #14213d);
}
#today-tab .td-sub { margin: 0; font-size: 18px; color: var(--ink-3, #4b5363); }

/* ---- grid ---- */
#today-tab .td-row { display: grid; gap: 20px; }
#today-tab .td-row1 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
#today-tab .td-row2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ---- cards ---- */
#today-tab .td-card {
  background: var(--surface, #fffdf8); border: 1px solid var(--line, rgba(20,33,61,.11));
  border-radius: 14px; min-width: 0;
}
#today-tab .td-pad { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
/* "Tell us about your business" nudge above the steps; only while no profile fact is confirmed. */
#today-tab .td-nudge { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; padding: 16px 22px; margin-bottom: 20px; }
#today-tab .td-nudge .td-body { margin: 0; font-weight: 600; flex: 1 1 260px; }
#today-tab .td-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
#today-tab .td-card-title { margin: 0; font: 600 22px/1.25 'Space Grotesk', Inter, sans-serif; color: var(--ink, #14213d); }
#today-tab .td-body { margin: 0; font-size: 17px; color: var(--ink-2, #2c3a52); }
#today-tab .td-empty { margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink-2, #2c3a52); }
#today-tab .td-muted { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-3, #4b5363); }
#today-tab .td-small { font-size: 14px; color: var(--ink-4, #6b6558); }
#today-tab .td-soon { border-top: 1px solid var(--line, rgba(20,33,61,.11)); padding-top: 14px; margin-top: auto; }
#today-tab .td-skeleton { min-height: 180px; background: linear-gradient(90deg, var(--surface-3, #efe9dc), #e4ddcd, var(--surface-3, #efe9dc)); }

/* ---- tags ---- */
#today-tab .td-tag { font: 600 13px/1.4 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .02em; color: var(--good, #1f6b4a); }
#today-tab .td-tag-overdue { color: var(--brand, #8c2f39); }
#today-tab .td-tag-muted { color: var(--ink-4, #6b6558); font-weight: 500; }

/* ---- buttons and links ---- */
#today-tab .td-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#today-tab .td-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 12px 18px; border-radius: 11px; white-space: nowrap; text-decoration: none; cursor: pointer;
  font: 700 15px/1.2 'Space Grotesk', Inter, sans-serif;
  transition: background .15s ease, border-color .15s ease;
}
#today-tab .td-btn-primary {
  background: var(--brand, #8c2f39); color: var(--surface, #fffdf8); border: 1px solid var(--brand, #8c2f39);
  box-shadow: 0 10px 26px -6px rgba(140,47,57,.5);
}
#today-tab .td-btn-primary:hover { background: var(--brand-hover, #5e1f27); border-color: var(--brand-hover, #5e1f27); }
#today-tab .td-btn-secondary { background: var(--surface-2, #f1ece1); color: var(--ink, #14213d); border: 1px solid var(--line-strong, rgba(20,33,61,.18)); }
#today-tab .td-btn-secondary:hover { background: var(--surface-3, #efe9dc); }
#today-tab .td-btn:focus-visible, #today-tab .td-link:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(140,47,57,.18); }
#today-tab .td-link { font: 600 15px/1.3 'Space Grotesk', Inter, sans-serif; color: var(--brand, #8c2f39); text-decoration: none; border-radius: 4px; }
#today-tab .td-link:hover { text-decoration: underline; }

/* ---- card 1: ranked steps ---- */
#today-tab .td-steps:not(.td-pad) { padding: 8px 0; }
#today-tab .td-step-list { list-style: none; margin: 0; padding: 0; }
#today-tab .td-step {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 22px 26px;
}
#today-tab .td-step + .td-step { border-top: 1px solid var(--line, rgba(20,33,61,.11)); }
#today-tab .td-step-n {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(140,47,57,.4); color: var(--brand, #8c2f39);
  font: 700 18px 'Space Grotesk', Inter, sans-serif;
}
#today-tab .td-step-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#today-tab .td-step-title { margin: 0; font: 600 20px/1.3 'Space Grotesk', Inter, sans-serif; color: var(--ink, #14213d); overflow-wrap: anywhere; }
#today-tab .td-step-why {
  margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-3, #4b5363); text-wrap: pretty; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#today-tab .td-steps-more { padding: 10px 26px 16px; border-top: 1px solid var(--line, rgba(20,33,61,.11)); }

/* ---- card 2: latest results ---- */
#today-tab .td-period { margin: 0; font-size: 16px; color: var(--ink-3, #4b5363); }
#today-tab .td-period strong { font: 600 18px 'Space Grotesk', Inter, sans-serif; color: var(--ink, #14213d); }
#today-tab .td-stats { display: flex; flex-direction: column; background: var(--surface-3, #efe9dc); border-radius: 11px; padding: 4px 16px; }
#today-tab .td-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; min-width: 0; }
#today-tab .td-stat + .td-stat { border-top: 1px solid var(--line, rgba(20,33,61,.11)); }
#today-tab .td-stat-k { font: 600 12px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-4, #6b6558); }
#today-tab .td-stat-v { font: 700 22px/1.2 'Space Grotesk', Inter, sans-serif; color: var(--ink, #14213d); text-align: right; overflow-wrap: anywhere; min-width: 0; }
#today-tab .td-cpi { border-top: 1px solid var(--line, rgba(20,33,61,.11)); padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
#today-tab .td-cpi-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
#today-tab .td-cpi-k { font-size: 16px; color: var(--ink-2, #2c3a52); }
#today-tab .td-cpi-v { font: 700 28px 'Space Grotesk', Inter, sans-serif; color: var(--ink, #14213d); }

/* ---- row 2 left: your best neighborhoods ---- */
#today-tab .td-bestn .td-eyebrow { margin-bottom: -8px; }
#today-tab .td-best-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
#today-tab .td-best { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; min-width: 0; }
#today-tab .td-best + .td-best { border-top: 1px solid var(--line, rgba(20,33,61,.11)); }
#today-tab .td-best:first-child { padding-top: 0; }
#today-tab .td-best-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-width: 0; }
#today-tab .td-best-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#today-tab .td-best-type { font: 600 17px/1.3 Inter, system-ui, sans-serif; color: var(--ink, #14213d); overflow-wrap: anywhere; }
#today-tab .td-best-where {
  font: 500 12px/1.4 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .03em;
  color: var(--ink-4, #6b6558); overflow-wrap: anywhere;
}
#today-tab .td-best-score { display: flex; align-items: baseline; gap: 6px; flex-shrink: 0; }
#today-tab .td-best-k { font: 600 11px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .06em; color: var(--ink-4, #6b6558); }
#today-tab .td-best-v { font: 700 26px/1 'Space Grotesk', Inter, sans-serif; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
#today-tab .td-best-track { height: 6px; border-radius: 3px; background: var(--surface-3, #efe9dc); overflow: hidden; }
#today-tab .td-best-fill { display: block; height: 100%; border-radius: 3px; }
#today-tab .td-band-strong { --band: var(--good, #1f6b4a); }
#today-tab .td-band-okay { --band: var(--warn, #a87a26); }
#today-tab .td-band-low { --band: var(--brand, #8c2f39); }
#today-tab .td-best-v { color: var(--band, #1f6b4a); }
#today-tab .td-best-fill { background: var(--band, #1f6b4a); }
#today-tab .td-best-sk {
  height: 52px; border-radius: 8px; margin: 6px 0;
  background: linear-gradient(90deg, var(--surface-3, #efe9dc), #e4ddcd, var(--surface-3, #efe9dc));
}
#today-tab .td-best-loading { gap: 4px; }
#today-tab .td-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }

/* ---- row 2 right: buyer map sketch ---- */
#today-tab .td-map-box {
  position: relative; border-radius: 12px; background: var(--map-bg, #ebe5d7);
  aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden;
}
#today-tab .td-sketch { width: 100%; height: 100%; }
#today-tab .td-sk-radius { fill: rgba(61,90,128,.06); stroke: var(--ink, #14213d); stroke-width: .5; stroke-dasharray: 2 1.6; }
#today-tab .td-sk-area { fill: rgba(31,107,74,.28); stroke: var(--good, #1f6b4a); stroke-width: .5; }
#today-tab .td-sk-label { font: 700 3.6px 'Space Grotesk', Inter, sans-serif; fill: var(--good, #1f6b4a); }
#today-tab .td-sk-badge { fill: #fff; stroke: var(--good, #1f6b4a); stroke-width: .5; }
#today-tab .td-sk-home { fill: var(--brand, #8c2f39); stroke: rgba(140,47,57,.25); stroke-width: 1.6; }
#today-tab .td-map-empty .td-sk-pin {
  width: 16px; height: 16px; border-radius: 50%; background: var(--brand, #8c2f39);
  box-shadow: 0 0 0 4px rgba(140,47,57,.25);
}
#today-tab .td-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--ink-3, #4b5363); }
#today-tab .td-legend span { display: inline-flex; align-items: center; gap: 8px; }
#today-tab .td-lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
#today-tab .td-lg-home { background: var(--brand, #8c2f39); border-radius: 50%; }
#today-tab .td-lg-radius { border: 1.5px dashed var(--ink, #14213d); border-radius: 50%; }
#today-tab .td-lg-area { background: rgba(31,107,74,.45); border: 1px solid var(--good, #1f6b4a); border-radius: 50%; }

#today-tab .td-lg-best { background: var(--good, #1f6b4a); border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--good, #1f6b4a); border-radius: 50%; }
/* real map */
#today-tab .td-map-box.td-map-live { display: block; aspect-ratio: auto; height: 300px; z-index: 0; isolation: isolate; }
#today-tab .td-map-box .leaflet-container { border-radius: 12px; }
#today-tab .td-badge-wrap { background: none; border: 0; }
#today-tab .td-badge {
  position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box;
  background: #fff; color: var(--good, #1f6b4a); border: 1.5px solid var(--good, #1f6b4a);
  font: 700 12px/17px 'Space Grotesk', Inter, sans-serif; text-align: center; box-shadow: 0 1px 3px rgba(20,33,61,.3);
}
@media (max-width: 600px) { #today-tab .td-map-box.td-map-live { height: 240px; } }

/* ---- footer ---- */
#today-tab .td-strip { padding: 18px 22px; border: 1px solid var(--line, rgba(20,33,61,.11)); border-radius: 14px; }
#today-tab .td-disclaimer {
  border-top: 1px solid var(--line, rgba(20,33,61,.11)); padding-top: 16px;
  font-size: 14px; color: var(--ink-4, #6b6558);
}

/* ---- responsive ---- */
@media (max-width: 900px) {
  #today-tab .td-wrap { padding: 28px 16px 96px; gap: 22px; }
  #today-tab .td-title { font-size: 32px; }
  #today-tab .td-row1, #today-tab .td-row2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  #today-tab .td-pad { padding: 20px; }
  #today-tab .td-step { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 18px 20px; }
  #today-tab .td-step { align-items: start; }
  #today-tab .td-step-n { width: 40px; height: 40px; font-size: 17px; }
  #today-tab .td-step > .td-btn { grid-column: 1 / -1; width: 100%; }
  #today-tab .td-steps-more { padding: 10px 20px 14px; }
}

/* The header is a real <header>, so the old global `header` bar rules (flex row, topbar
   background, bottom border, sticky, `header p { display:none }`) must not apply. */
#today-tab header.td-head {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 10px;
  background: none; border: 0; padding: 0; position: static;
}
#today-tab header.td-head .td-title { font: 700 42px/1.1 'Space Grotesk', Inter, sans-serif; letter-spacing: -.025em; color: var(--ink, #14213d); }
#today-tab header.td-head .td-sub { display: block; }
/* The shell strip already carries the disclaimer on desktop. */
@media (min-width: 901px) { #today-tab .td-disclaimer { display: none; } }
@media (max-width: 900px) { #today-tab header.td-head .td-title { font-size: 30px; } }
