/* ─────────────────────────────────────────────────────────────
   Type pairing — same voice as the landing page.
   Display  : Bricolage Grotesque (Latin) + Anuphan (Thai)
   Accent   : Instrument Serif italic (Latin) + Noto Serif Thai
   Flourish : Fraunces italic, used once per screen at most
   Body     : IBM Plex Sans + IBM Plex Sans Thai
   Data     : IBM Plex Mono, tabular figures
   Scope: dashboard first (#view-dashboard). Other views opt in later.
   ───────────────────────────────────────────────────────────── */
:root {
  --tp-display: "Bricolage Grotesque", "Anuphan", "IBM Plex Sans Thai", system-ui, sans-serif;
  --tp-serif: "Instrument Serif", "Noto Serif Thai", Georgia, serif;
  --tp-flourish: "Fraunces", "Instrument Serif", "Noto Serif Thai", Georgia, serif;
  --tp-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* Greeting: "Good evening," in serif italic, the name in heavy display */
html[data-theme] #view-dashboard .view__title {
  font-family: var(--tp-display);
  font-weight: 800;
  letter-spacing: -0.04em;
}
html[data-theme] #view-dashboard .greet__hi {
  font-family: var(--tp-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-3);
  margin-right: .12em;
}
html[data-theme] #view-dashboard .greet__name {
  font-family: var(--tp-flourish);
  font-style: italic;
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.03em;
  color: var(--text-1);
}
html[data-theme] #view-dashboard .view__subtitle {
  font-family: var(--tp-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--text-3);
}

/* Card headings in display, their one-line notes in serif italic */
html[data-theme] #view-dashboard .card__title,
html[data-theme] #view-dashboard .cal-month-title {
  font-family: var(--tp-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
html[data-theme] #view-dashboard .card__sub {
  font-family: var(--tp-serif);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--text-3);
}

/* Numbers read as data: mono, tabular, tight */
html[data-theme] #view-dashboard .kpi__value {
  font-family: var(--tp-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}
html[data-theme] #view-dashboard .kpi__label,
html[data-theme] #view-dashboard .view__eyebrow {
  font-family: var(--tp-mono);
}

/* Motivation quote: the one serif moment with weight */
html[data-theme] #view-dashboard .motivation-card__quote {
  font-family: var(--tp-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.005em;
}
html[data-theme] #view-dashboard .motivation-card__author {
  font-family: var(--tp-mono);
  font-style: normal;
}

/* Thai: Anuphan for display (keeps marks clear), Noto Serif Thai for accents; no negative tracking */
html[data-theme]:lang(th) #view-dashboard .view__title,
html[data-theme]:lang(th) #view-dashboard .card__title,
html[data-theme]:lang(th) #view-dashboard .cal-month-title {
  font-family: "Anuphan", var(--tp-display);
  letter-spacing: 0;
  line-height: 1.3;
}
html[data-theme]:lang(th) #view-dashboard .greet__hi,
html[data-theme]:lang(th) #view-dashboard .greet__name,
html[data-theme]:lang(th) #view-dashboard .view__subtitle,
html[data-theme]:lang(th) #view-dashboard .card__sub,
html[data-theme]:lang(th) #view-dashboard .motivation-card__quote {
  letter-spacing: 0;
}
html[data-theme]:lang(th) #view-dashboard .kpi__value {
  font-family: var(--tp-mono);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* ─────────────────────────────────────────────────────────────
   Daily-use screens: All Trades, Analytics, Journal, Gallery,
   Playbook, and the Log Trade dialog.
   Readability rules for these:
   • serif italic only for one-line subtitles at ≥15px, never for
     labels, form help, table cells or anything you scan
   • labels are sentence case, sans, 13px, no letter-spacing tricks
   • every number is tabular so columns line up
   ───────────────────────────────────────────────────────────── */
html[data-theme] :is(#view-trades,#view-analytics,#view-journal,#view-gallery,#view-playbook) .view__title {
  font-family: var(--tp-display);
  font-weight: 800;
  letter-spacing: -0.04em;
}
html[data-theme] :is(#view-trades,#view-analytics,#view-journal,#view-gallery,#view-playbook) .view__subtitle {
  font-family: var(--tp-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.4;
  color: var(--text-3);
}
html[data-theme] :is(#view-trades,#view-analytics,#view-journal,#view-gallery,#view-playbook,#tradeModal) :is(.card__title,.modal__title,.cal-month-title) {
  font-family: var(--tp-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
html[data-theme] :is(#view-trades,#view-analytics,#view-journal,#view-gallery,#view-playbook) .card__sub {
  font-family: var(--tp-serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-3);
}
/* the dialog is a task: its helper text stays plain sans so it reads fast */
html[data-theme] #tradeModal .modal__sub {
  font-family: var(--ff-sans);
  font-style: normal;
  font-size: 14px;
  color: var(--text-3);
}

/* labels: plain and readable */
html[data-theme] :is(#view-trades,#view-analytics,#view-journal,#view-gallery,#view-playbook,#tradeModal) :is(.form-label,.filter-label) {
  font-family: var(--ff-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
}
html[data-theme] #tradeModal .tf-section__label,
html[data-theme] :is(#view-trades,#view-analytics,#view-journal,#view-gallery,#view-playbook) :is(.kpi__label,.view__eyebrow) {
  font-family: var(--tp-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* numbers */
html[data-theme] :is(#view-trades,#view-analytics,#view-journal,#view-gallery,#view-playbook,#tradeModal) :is(.kpi__value,[class*="__value"],[class*="__num"]) {
  font-family: var(--tp-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
html[data-theme] #tradeModal input:is([type="number"],[inputmode="decimal"],[inputmode="numeric"]) {
  font-family: var(--tp-mono) !important;
  font-variant-numeric: tabular-nums;
}
html[data-theme] #tradeModal :is(input,select,textarea) { font-size: 15px; }

/* tables: sans body, mono header, aligned figures, comfortable rows */
html[data-theme] :is(#view-trades,#view-analytics,#view-journal,#view-playbook) table :is(th) {
  font-family: var(--tp-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
html[data-theme] :is(#view-trades,#view-analytics,#view-journal,#view-playbook) table td {
  font-family: var(--ff-sans);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* Thai: Anuphan for display, no negative tracking anywhere, more line-height */
html[data-theme]:lang(th) :is(#view-trades,#view-analytics,#view-journal,#view-gallery,#view-playbook,#tradeModal) :is(.view__title,.card__title,.modal__title,.cal-month-title) {
  font-family: "Anuphan", var(--tp-display);
  letter-spacing: 0;
  line-height: 1.3;
}
html[data-theme]:lang(th) :is(#view-trades,#view-analytics,#view-journal,#view-gallery,#view-playbook) :is(.view__subtitle,.card__sub) {
  letter-spacing: 0;
  line-height: 1.55;
}
