/* ============================================================
   TÍO LIBRE FC — "Terrace" visual system
   Appearance layer, loaded AFTER styles.css. Screens are converted
   one at a time to the .tr-* classes below; unconverted screens keep
   their old styles until they move over. Values are measured from the
   design handoff (design_handoff_terrace) and are final.
   ============================================================ */

:root {
  /* Ground + ink */
  --tr-ground: #0A0A0A;
  --tr-ink: #F2F0EB;
  --tr-ink-strong: #FFFFFF;
  --tr-ink-secondary: #D8D4CB;
  --tr-ink-prose: #E4E0D7;
  --tr-ink-muted: #8A867D;   /* 5.46:1 on ground — do not darken */
  --tr-ink-dim: #A8A49C;     /* losing side's score */
  --tr-ink-disabled: #4A4741;
  /* Gold — functional only: active, watchlist, Ask Tío, CL cut */
  --tr-gold: #C9A45C;
  --tr-gold-light: #E8CE93;
  /* Rules + borders */
  --tr-rule: rgba(242, 240, 235, .12);
  --tr-rule-strong: rgba(242, 240, 235, .14);
  --tr-border: rgba(242, 240, 235, .2);
  --tr-border-strong: rgba(242, 240, 235, .28);
  /* Live is GREEN with a pulse (the old Tío ticker green), gold stays functional-only */
  --tr-live: #3AD07E;
  --tr-photo-caption: #C7BFB2;
  --tr-cl-cut: rgba(201, 164, 92, .45);
  --tr-tap: rgba(242, 240, 235, .04);
  --tr-pad: 22px;
}

/* Club colours for the 3px row bar + hero duotone. Neutral fallback #241F20. */
:root {
  --c-liverpool: #C8102E;   --c-arsenal: #EF0107;      --c-man-city: #6CABDD;
  --c-man-united: #DA020E;  --c-chelsea: #034694;      --c-spurs: #132257;
  --c-everton: #003399;     --c-brighton: #0057B8;     --c-aston-villa: #7A263A;
  --c-crystal-palace: #1B458F; --c-brentford: #E30613; --c-fulham: #CC0000;
  --c-newcastle: #241F20;
}

/* ---------- ground ---------- */
body.tr { background: var(--tr-ground); }
/* clear the fixed 84px tab bar + the home-indicator inset, plus breathing room,
   so the last rows always scroll clear of the bar on every view. This selector
   (.tr .view.tr-scroll) is the one that wins on specificity, so the bottom
   clearance MUST live here, not on a bare .tr-scroll rule. */
.tr .view.tr-scroll { padding: 0 0 calc(84px + env(safe-area-inset-bottom) + 28px); }

/* ---------- 1. masthead ---------- */
.tr-masthead {
  display: flex; align-items: center; justify-content: space-between;
  /* clear the iOS status bar / notch (black-translucent runs content under it);
     the safe-area inset MUST be here or the wordmark hides behind the status bar */
  padding: calc(env(safe-area-inset-top) + 20px) var(--tr-pad) 14px;
  background: var(--tr-ground);
}
.tr-wordmark {
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  letter-spacing: .36em; text-transform: uppercase; color: var(--tr-ink);
  margin: 0;
}
.tr-icon-btn {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--tr-ink);
}
.tr-icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--tr-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* modal-style masthead may carry a one-line subtitle under the wordmark */
.tr-masthead .tr-mh-sub {
  font-family: var(--font-utility); font-size: 10px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted);
}

/* ---------- 2. competition tab strip ---------- */
.tr-tabs {
  display: flex; gap: 22px; padding: 0 var(--tr-pad); overflow-x: auto;
  border-bottom: 1px solid var(--tr-rule-strong);
  scrollbar-width: none;
}
.tr-tabs::-webkit-scrollbar { display: none; }
.tr-tab {
  flex: 0 0 auto; height: 46px; background: none; border: 0; padding: 0;
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
  font-family: var(--font-utility); font-size: 11px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted);
}
.tr-tab.is-active { border-bottom-color: var(--tr-ink); color: var(--tr-ink); font-weight: 600; }
.tr-tab.is-gold { color: var(--tr-gold); font-weight: 600; }

/* ---------- section label block ---------- */
.tr-section-label {
  padding: 22px var(--tr-pad) 10px;
  border-top: 1px solid var(--tr-rule-strong);
  font-family: var(--font-utility); font-size: 10px; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase; color: var(--tr-ink-muted);
}
.tr-section-label.is-gold { color: var(--tr-gold); }
.tr-section-label--flush { border-top: 0; }

/* ---------- 3. fixture row (the core component) ---------- */
.tr-fx {
  display: flex; align-items: stretch; width: 100%; padding: 0;
  background: none; border: 0; border-bottom: 1px solid var(--tr-rule);
  text-align: left; cursor: pointer; color: inherit; min-height: 78px;
  transition: background .15s ease;
}
.tr-fx:active { background: var(--tr-tap); }
.tr-fx__bar { flex: 0 0 3px; align-self: stretch; background: var(--c-bar, #241F20); }
.tr-fx__time {
  flex: 0 0 64px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  font-family: var(--font-utility); font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--tr-ink);
}
.tr-fx__live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tr-live); animation: tr-pulse 1.8s ease-in-out infinite; }
.tr-fx__min { font-size: 11px; font-weight: 700; color: var(--tr-live); }
.tr-fx__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 18px 0; }
.tr-fx__title { font-family: var(--font-editorial); font-size: 19px; font-weight: 400; color: var(--tr-ink); line-height: 1.15; }
.tr-fx__title b { font-weight: 600; }
.tr-fx__title .tr-lose { color: var(--tr-ink-dim); }
.tr-fx__meta { font-family: var(--font-utility); font-size: 10px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted); }
.tr-fx.is-watched .tr-fx__meta { color: var(--tr-gold); }
.tr-fx__crests { flex: 0 0 auto; display: flex; align-items: center; padding-right: 20px; }
.tr-fx__crests img { width: 34px; height: 34px; object-fit: contain; }
.tr-fx__crests img + img { margin-left: -8px; }
.tr-fx.is-result .tr-fx__crests img + img { opacity: .7; }
/* Today variant: +/✓ watchlist button in place of crests */
.tr-fx__watch {
  flex: 0 0 auto; width: 48px; height: 48px; margin-right: 12px; align-self: center;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--tr-gold);
}
.tr-fx__watch svg { width: 22px; height: 22px; stroke: var(--tr-gold); fill: none; stroke-width: 1.8; }

/* day-label row inside a fixtures list */
.tr-daylabel {
  padding: 8px var(--tr-pad) 10px; border-bottom: 1px solid var(--tr-rule-strong);
  font-family: var(--font-utility); font-size: 10px; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase; color: var(--tr-ink-muted);
}

/* ---------- matchweek header (Fixtures / Rundown) ---------- */
.tr-mw {
  display: flex; align-items: center; gap: 16px; padding: 20px var(--tr-pad) 16px;
}
.tr-mw__num { font-family: var(--font-editorial); font-size: 64px; font-weight: 600; line-height: .82; color: var(--tr-ink); }
.tr-mw__label { flex: 1 1 auto; font-family: var(--font-utility); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted); line-height: 1.6; }
.tr-mw__nav { display: flex; gap: 4px; }
.tr-arrow { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; color: var(--tr-ink); }
.tr-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tr-arrow[disabled] { color: var(--tr-ink-disabled); cursor: default; }

/* ---------- page title ---------- */
.tr-title { font-family: var(--font-editorial); font-weight: 600; color: var(--tr-ink); line-height: .98; padding: 6px var(--tr-pad) 0; }
.tr-title--lg { font-size: 52px; }
.tr-title--md { font-size: 40px; }

/* ---------- 6. tab bar ---------- */
.tr-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: 84px; padding-bottom: 14px;
  display: flex; align-items: center;
  background: var(--tr-ground); border-top: 1px solid var(--tr-rule-strong);
}
.tr-tabbar__slot {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--tr-ink-muted);
}
.tr-tabbar__slot svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tr-tabbar__slot span { font-family: var(--font-utility); font-size: 9px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.tr-tabbar__slot[aria-current="page"] { color: var(--tr-ink); }
.tr-tabbar__slot[aria-current="page"] span { font-weight: 600; }
.tr-tabbar__ask {
  flex: 0 0 84px; display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.tr-tabbar__ask button {
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--tr-gold); box-shadow: 0 8px 24px rgba(0, 0, 0, .7);
}
.tr-tabbar__ask button svg { width: 26px; height: 26px; fill: none; stroke: var(--tr-ground); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tr-tabbar__ask.is-active button { outline: 2px solid var(--tr-ink); outline-offset: 0; }

/* ---------- 4. table row ---------- */
.tr-table-sub {
  padding: 4px var(--tr-pad) 12px;
  font-family: var(--font-utility); font-size: 10px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted);
}
.tr-tablehead {
  display: flex; align-items: center; padding: 10px 0;
  font-family: var(--font-utility); font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--tr-ink-muted);
  border-bottom: 1px solid var(--tr-rule);
}
.tr-tr { display: flex; align-items: center; min-height: 62px; border-top: 1px solid var(--tr-rule); width: 100%; background: none; text-align: left; cursor: pointer; color: inherit; padding: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.tr-tr:active { background: var(--tr-tap); }
.tr-tr__bar { flex: 0 0 3px; align-self: stretch; background: var(--c-bar, #241F20); }
.tr-tr__pos { flex: 0 0 27px; text-align: center; font-family: var(--font-utility); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tr-ink); }
.tr-tr__club { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 11px; }
.tr-tr__club img { width: 26px; height: 26px; object-fit: contain; }
.tr-tr__club span { font-family: var(--font-editorial); font-size: 18px; color: var(--tr-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-col { text-align: center; font-family: var(--font-utility); font-size: 13px; color: var(--tr-ink-muted); font-variant-numeric: tabular-nums; }
.tr-col--pl { flex: 0 0 34px; }
.tr-col--gd { flex: 0 0 40px; }
.tr-tr__pts { flex: 0 0 44px; text-align: right; padding-right: 20px; font-family: var(--font-utility); font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tr-ink); }
/* header widths mirror the row */
.tr-tablehead .tr-h-pos { flex: 0 0 30px; text-align: center; }
.tr-tablehead .tr-h-club { flex: 1 1 auto; }
.tr-tablehead .tr-h-pl { flex: 0 0 34px; text-align: center; }
.tr-tablehead .tr-h-gd { flex: 0 0 40px; text-align: center; }
.tr-tablehead .tr-h-pts { flex: 0 0 44px; text-align: right; padding-right: 20px; }
/* Champions League cut */
.tr-clcut { border-top: 1px solid var(--tr-cl-cut); }
.tr-clcut__label { padding: 8px var(--tr-pad) 8px 0; font-family: var(--font-utility); font-size: 9px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--tr-gold); text-align: left; padding-left: var(--tr-pad); }

@keyframes tr-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) {
  .tr-fx__live-dot { animation: none; }
}

.tr-fx__v { color: var(--tr-ink-muted); font-style: italic; font-family: var(--font-editorial); }

/* ---------- phone-first: centre the column on larger screens (preview/desktop) ---------- */
@media (min-width: 540px) {
  body.tr #app { max-width: 480px; margin: 0 auto; }
  body.tr .tr-tabbar { left: 50%; transform: translateX(-50%); width: 480px; }
}

/* Tío's-voice prose (Today intro, Ask answers, Briefing/Rundown) */
.tr-prose { font-family: var(--font-editorial); font-size: 18px; line-height: 1.6; color: var(--tr-ink-secondary); padding: 8px var(--tr-pad) 6px; text-wrap: pretty; margin: 0; }
/* Today row: gold watch button sits where crests would on other screens */
.tr-fx--today .tr-fx__watch svg { stroke: var(--tr-gold); }

/* ---------- hamburger menu (no menu comp in the handoff; built from Terrace's
   modal masthead + list-row patterns: ground sheet, hairlines, Newsreader, gold →) ---------- */
.tr-menu { position: fixed; inset: 0; z-index: 100; background: var(--tr-ground); display: flex; flex-direction: column; }
.tr-menu[hidden] { display: none; }
/* full-screen overlay runs under the notch, so the close (X) MUST clear the status bar */
.tr-menu-head { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 20px) var(--tr-pad) 14px; border-bottom: 1px solid var(--tr-rule-strong); }
.tr-menu-list { display: flex; flex-direction: column; }
.tr-menu-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 23px var(--tr-pad); background: none; border: 0; border-bottom: 1px solid var(--tr-rule);
  cursor: pointer; text-align: left; color: var(--tr-ink);
  font-family: var(--font-editorial); font-size: 21px; transition: background .15s ease;
}
.tr-menu-item:active { background: var(--tr-tap); }
.tr-menu-item svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--tr-gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 540px) {
  body.tr .tr-menu { left: 50%; right: auto; transform: translateX(-50%); width: 480px; border-left: 1px solid var(--tr-rule); border-right: 1px solid var(--tr-rule); }
}

/* ---------- Scenario Lab ---------- */
.tr-lab-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px var(--tr-pad) 12px; }
.tr-lab-head__t { min-width: 0; }
.tr-labstat { display: flex; border-top: 1px solid var(--tr-rule-strong); border-bottom: 1px solid var(--tr-rule-strong); }
.tr-labstat__cell { flex: 1 1 0; padding: 14px var(--tr-pad); }
.tr-labstat__cell + .tr-labstat__cell { border-left: 1px solid var(--tr-rule); }
.tr-labstat__k { display: block; font-family: var(--font-utility); font-size: 9px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--tr-ink-muted); margin-bottom: 4px; }
.tr-labstat__v { font-family: var(--font-editorial); font-size: 26px; font-weight: 600; color: var(--tr-ink); }
.tr-labstat__v.is-gold { color: var(--tr-gold); }
.tr-labstat__tot { font-size: 15px; color: var(--tr-ink-muted); }
/* scenario row: bar · fixture + lean · H/D/A */
.tr-scn { display: flex; align-items: stretch; border-bottom: 1px solid var(--tr-rule); min-height: 92px; }
.tr-scn__bar { flex: 0 0 3px; align-self: stretch; background: #3A3A3A; }
.tr-scn__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 16px 14px 16px var(--tr-pad); }
.tr-scn__fix { font-family: var(--font-editorial); font-size: 17px; color: var(--tr-ink); }
.tr-scn__lean { font-family: var(--font-utility); font-size: 9.5px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted); }
.tr-scn__hda { display: flex; align-items: center; gap: 6px; padding-right: var(--tr-pad); }
.tr-hda {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 0; cursor: pointer;
  background: none; border: 1px solid var(--tr-border); color: var(--tr-ink-muted);
  font-family: var(--font-utility); font-size: 15px; font-weight: 600; transition: all .15s ease;
}
.tr-hda.is-on { background: var(--tr-gold); border-color: var(--tr-gold); color: var(--tr-ground); font-weight: 700; }
/* the exact-score / form extras below a scenario row (kept functional, quietened) */
.tr-scn__extra { padding: 0 var(--tr-pad) 14px; }
.tr-scn__extra:empty { display: none; }
/* lab controls restyled to Terrace buttons */
.tr-lab-controls { padding: 12px var(--tr-pad) 4px; }
.tr-lab-controls .lab-save-row { display: flex; gap: 10px; }
.tr-lab-controls .lab-btn {
  min-height: 52px; padding: 0 22px; border-radius: 0; cursor: pointer;
  background: none; border: 1px solid var(--tr-border-strong); color: var(--tr-ink);
  font-family: var(--font-utility); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.tr-lab-controls .lab-btn.ok { background: var(--tr-gold); border-color: var(--tr-gold); color: var(--tr-ground); }
.tr-lab-controls .lab-btn.ghost { color: var(--tr-ink-muted); }
.tr-lab-controls .lab-btn[disabled] { opacity: .4; }
.tr-lab-controls .lab-btn.icon { width: 52px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.tr-lab-controls .lab-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
/* projected-table toggle */
.lab-tabs { display: flex; gap: 22px; padding: 4px var(--tr-pad) 0; }
.lab-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 0; cursor: pointer; font-family: var(--font-utility); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted); }
.lab-tab.on { color: var(--tr-ink); border-bottom-color: var(--tr-ink); }

/* ---------- Clubs index (list, not grid) ---------- */
.tr-clubrow { display: flex; align-items: center; width: 100%; min-height: 70px; padding: 0; background: none; border: 0; border-bottom: 1px solid var(--tr-rule); text-align: left; cursor: pointer; transition: background .15s ease; }
.tr-clubrow:active { background: var(--tr-tap); }
.tr-clubrow__bar { flex: 0 0 3px; align-self: stretch; }
.tr-clubrow__crest { width: 34px; height: 34px; object-fit: contain; margin: 0 14px 0 var(--tr-pad); flex: 0 0 34px; }
.tr-clubrow__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 14px 0; }
.tr-clubrow__name { font-family: var(--font-editorial); font-size: 18px; color: var(--tr-ink); }
.tr-clubrow__meta { font-family: var(--font-utility); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--tr-ink-muted); }
.tr-clubrow__fav { font-family: var(--font-utility); font-size: 9.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--tr-gold); padding-right: var(--tr-pad); flex: 0 0 auto; }

/* ---------- Rundown highlight rows ---------- */
.tr-rd-row { display: flex; align-items: stretch; width: 100%; min-height: 78px; padding: 0; background: none; border: 0; border-bottom: 1px solid var(--tr-rule); text-align: left; cursor: pointer; transition: background .15s ease; }
.tr-rd-row:active { background: var(--tr-tap); }
.tr-rd-row__bar { flex: 0 0 3px; align-self: stretch; }
.tr-rd-row__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 16px 20px 16px var(--tr-pad); }
.tr-rd-row__lab { font-family: var(--font-utility); font-size: 9px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--tr-gold); }
.tr-rd-row__result { font-family: var(--font-editorial); font-size: 18px; color: var(--tr-ink); }
.tr-rd-row__result b { font-weight: 600; }

/* ---------- Competitions directory rows ---------- */
.tr-comprow { display: flex; align-items: center; width: 100%; padding: 22px var(--tr-pad); background: none; border: 0; border-bottom: 1px solid var(--tr-rule); cursor: pointer; text-align: left; color: var(--tr-ink); transition: background .15s ease; }
.tr-comprow:active { background: var(--tr-tap); }
.tr-comprow__crest { flex: 0 0 auto; display: inline-flex; margin-right: 14px; }
.tr-comprow__crest img, .tr-comprow__crest svg { width: 26px; height: 26px; object-fit: contain; }
.tr-comprow__name { flex: 1 1 auto; min-width: 0; font-family: var(--font-editorial); font-size: 21px; }
.tr-comprow__arrow { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--tr-gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Account ---------- */
.tr-acct { padding: 16px var(--tr-pad) 0; display: flex; flex-direction: column; gap: 12px; }
.tr .acct-input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 0;
  background: none; border: 1px solid var(--tr-border); color: var(--tr-ink);
  font-family: var(--font-editorial); font-size: 17px;
}
.tr .acct-input::placeholder { color: var(--tr-ink-muted); }
.tr .acct-input:focus { outline: none; border-color: var(--tr-gold); }
.tr .acct-msg { font-family: var(--font-editorial); font-size: 15px; color: var(--tr-ink-muted); margin: 2px 0; }
/* general Terrace button (Account + anywhere lab-btn appears) */
.tr .lab-btn {
  min-height: 52px; padding: 0 22px; border-radius: 0; cursor: pointer;
  background: none; border: 1px solid var(--tr-border-strong); color: var(--tr-ink);
  font-family: var(--font-utility); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.tr .lab-btn.ok { background: var(--tr-gold); border-color: var(--tr-gold); color: var(--tr-ground); }
.tr .lab-btn.ghost { color: var(--tr-ink-muted); background: none; }
.tr .lab-btn[disabled] { opacity: .4; }

/* ---------- 5. hero photo block (Club/Stadium/Match/Calendar) ---------- */
.tr-hero { position: relative; overflow: hidden; background: #141414; }
.tr-hero--club { height: 300px; }
.tr-hero--stadium { height: 320px; }
.tr-hero--match { height: 360px; }
.tr-hero--cal { height: 340px; }
.tr-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 34%; filter: grayscale(1) contrast(1.15) brightness(.62); }
.tr-hero--stadium .tr-hero__img { object-position: 50% 40%; }
.tr-hero__tint { position: absolute; inset: 0; mix-blend-mode: color; opacity: .85; }
.tr-hero__grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,10,.05) 0%, rgba(10,10,10,.4) 42%, rgba(10,10,10,.9) 80%, #0A0A0A 100%); }
.tr-hero__top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 14px 12px; }
.tr-hero__btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
.tr-hero__btn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tr-hero__live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 2px; font-family: var(--font-utility); font-size: 10px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: #fff; }
.tr-hero__live .tr-fx__live-dot { background: #fff; }
.tr-hero__content { position: absolute; left: var(--tr-pad); right: 40%; bottom: 20px; z-index: 3; }
.tr-hero__eyebrow { font-family: var(--font-utility); font-size: 10px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--tr-photo-caption); }
.tr-hero__crest { width: 64px; height: 64px; object-fit: contain; margin-bottom: 10px; display: block; }
.tr-hero__name { font-family: var(--font-editorial); font-size: 42px; font-weight: 600; color: #fff; line-height: .96; }
.tr-hero__name--sm { font-size: 34px; }
/* match hero: 96px score, loser dimmed */
.tr-hero__score { display: flex; align-items: flex-end; gap: 16px; }
.tr-hero__score b { font-family: var(--font-editorial); font-size: 96px; font-weight: 600; letter-spacing: -.03em; line-height: .8; color: #fff; }
.tr-hero__score .tr-hero__dash { font-family: var(--font-editorial); font-size: 44px; color: rgba(255,255,255,.62); padding-bottom: 10px; }
.tr-hero__score .lose { color: rgba(255,255,255,.62); }
.tr-hero__namerow { display: flex; align-items: center; gap: 12px; padding: 16px var(--tr-pad); border-bottom: 1px solid var(--tr-rule); }
.tr-hero__namerow img { width: 30px; height: 30px; object-fit: contain; }
.tr-hero__namerow span.away { margin-left: auto; }
.tr-hero__namerow img.away { margin-left: 0; }
.tr-hero__namerow .away.lose, .tr-hero__namerow .home.lose { color: var(--tr-ink-dim); }
.tr-hero__namerow span { font-family: var(--font-editorial); font-size: 17px; color: var(--tr-ink); }

/* ---------- fact list (Club/Stadium) ---------- */
.tr-facts { border-top: 1px solid var(--tr-rule); }
.tr-fact { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px var(--tr-pad); border-bottom: 1px solid var(--tr-rule); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.tr-fact__k { font-family: var(--font-utility); font-size: 9.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted); }
.tr-fact__v { font-family: var(--font-editorial); font-size: 17px; color: var(--tr-ink); display: inline-flex; align-items: center; gap: 8px; }
.tr-fact--link { cursor: pointer; }
.tr-fact--link .tr-fact__v svg { width: 16px; height: 16px; fill: none; stroke: var(--tr-gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* light Terrace pass over remaining club/stadium sub-sections still on old markup */
.tr .players { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px var(--tr-pad) 0; }
.tr .player { font-family: var(--font-utility); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--tr-ink-secondary); border: 1px solid var(--tr-border); padding: 8px 12px; }
.tr .player--sm { font-size: 10px; }
.tr .club-story, .tr .club-narr { font-family: var(--font-editorial); font-size: 18px; line-height: 1.6; color: var(--tr-ink-secondary); padding: 8px var(--tr-pad) 0; text-wrap: pretty; }
.tr .cfx-list, .tr .cfx { }

/* ---------- broad Terrace fallbacks for screens/sections still on old markup ---------- */
.tr .section { padding: 0; margin: 0; }
.tr .eyebrow { padding: 22px var(--tr-pad) 10px; border-top: 1px solid var(--tr-rule-strong); font-family: var(--font-utility); font-size: 10px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--tr-ink-muted); display: block; }
.tr .card { background: none; border: 0; border-radius: 0; padding: 0 var(--tr-pad); }
.tr .match-matters, .tr .club-story, .tr .comp-overview, .tr .rd-recap, .tr .club-narr { font-family: var(--font-editorial); font-size: 18px; line-height: 1.6; color: var(--tr-ink-secondary); padding: 8px var(--tr-pad) 0; text-wrap: pretty; }
.tr .table-note { font-family: var(--font-utility); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--tr-ink-muted); padding: 0 var(--tr-pad); line-height: 1.6; }
.tr .factlist { list-style: none; margin: 0; padding: 0; }
.tr .factlist li { display: flex; align-items: center; justify-content: space-between; padding: 16px var(--tr-pad); border-bottom: 1px solid var(--tr-rule); }
.tr .factlist .k { font-family: var(--font-utility); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted); }
.tr .factlist .v { font-family: var(--font-editorial); font-size: 17px; color: var(--tr-ink); }
.tr .change { display: flex; gap: 10px; padding: 8px var(--tr-pad); }
.tr .change-marker { width: 5px; height: 5px; border-radius: 50%; background: var(--tr-gold); margin-top: 9px; flex: 0 0 auto; }
.tr .change-text { font-family: var(--font-editorial); font-size: 16px; line-height: 1.5; color: var(--tr-ink-secondary); }
.tr .story-club { display: flex; align-items: center; gap: 10px; padding: 14px var(--tr-pad) 4px; font-family: var(--font-utility); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted); }
.tr .verify-note { font-family: var(--font-editorial); font-style: italic; font-size: 14px; color: var(--tr-ink-muted); padding: 6px var(--tr-pad) 0; }
.tr .btn-outline { min-height: 52px; padding: 0 22px; border-radius: 0; background: none; border: 1px solid var(--tr-border-strong); color: var(--tr-ink); font-family: var(--font-utility); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin: 12px var(--tr-pad); cursor: pointer; }

/* ---------- Calendar day view (§3a) ---------- */
.tr-dayhead { display: flex; align-items: baseline; justify-content: space-between; padding: 18px var(--tr-pad) 2px; }
.tr-dayhead__meta { font-family: var(--font-utility); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted); }
.tr-daysel { display: flex; align-items: center; gap: 6px; padding: 8px var(--tr-pad) 2px; border-bottom: 1px solid var(--tr-rule-strong); }
.tr-daysel__d { flex: 1 1 0; height: 52px; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-family: var(--font-utility); font-size: 16px; font-weight: 500; color: var(--tr-ink-muted); font-variant-numeric: tabular-nums; }
.tr-daysel__d.is-on { color: var(--tr-gold); border-bottom-color: var(--tr-gold); font-weight: 700; }
.tr-daysel__grid { flex: 0 0 44px; height: 52px; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
.tr-daysel__grid svg { width: 22px; height: 22px; fill: none; stroke: var(--tr-ink-muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tr-hero--cal { cursor: pointer; }

/* ---------- Map: chrome only (plot + OGL attribution unchanged) ---------- */
.tr .map-sheet { position: static; background: var(--tr-ground); border: 0; border-top: 1px solid var(--tr-rule-strong); border-radius: 0; box-shadow: none; padding: 0 0 8px; max-width: none; margin: 0; }
.tr .map-sheet-x { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; }
.tr .map-sheet-x svg { width: 20px; height: 20px; stroke: var(--tr-ink); fill: none; stroke-width: 1.7; }
.tr .ms-head { display: flex; align-items: center; gap: 12px; padding: 18px var(--tr-pad) 12px; }
.tr .ms-crest { width: 44px; height: 44px; object-fit: contain; flex: 0 0 44px; }
.tr .ms-name { font-family: var(--font-editorial); font-size: 21px; color: var(--tr-ink); }
.tr .ms-meta, .tr .ms-place { font-family: var(--font-utility); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--tr-ink-muted); margin-top: 3px; }
.tr .map-sheet-actions { display: flex; flex-direction: column; }
.tr .map-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 18px var(--tr-pad); background: none; border: 0; border-top: 1px solid var(--tr-rule); border-radius: 0; cursor: pointer; text-align: left; font-family: var(--font-editorial); font-size: 18px; color: var(--tr-ink); }
.tr .map-btn.ghost { color: var(--tr-ink-secondary); }
.tr .map-btn.static { color: var(--tr-ink-muted); font-size: 14px; }
.tr .map-btn:not(.static)::after { content: "→"; color: var(--tr-gold); font-family: var(--font-utility); font-size: 18px; }
.tr .ms-rivalry-name { font-family: var(--font-editorial); font-size: 26px; color: var(--tr-ink); padding: 18px var(--tr-pad) 2px; }
.tr .ms-rivalry-type { font-family: var(--font-utility); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted); padding: 0 var(--tr-pad); }
.tr .ms-rivalry-text { font-family: var(--font-editorial); font-size: 17px; line-height: 1.55; color: var(--tr-ink-secondary); padding: 10px var(--tr-pad) 4px; }
.tr .ms-chips-label { font-family: var(--font-utility); font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--tr-ink-muted); padding: 14px var(--tr-pad) 4px; }

/* ---------- Ask Tío overlay (§5b) — appearance only, voice logic untouched ---------- */
.tr .ask { background: var(--tr-ground); }
.tr .ask-head { border-bottom: 1px solid var(--tr-rule-strong); padding: 18px var(--tr-pad); align-items: center; }
.tr .ask-head .k { font-family: var(--font-display); font-size: 12px; letter-spacing: .36em; text-transform: uppercase; color: var(--tr-ink); }
.tr .ask-icon svg { stroke: var(--tr-ink); }
.tr .ask-x { color: var(--tr-ink); font-size: 22px; background: none; border: 0; cursor: pointer; }
.tr .ask-ctx { font-family: var(--font-utility); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--tr-ink-muted); padding: 12px var(--tr-pad) 4px; }
.tr .ask-thread { padding: 8px var(--tr-pad) 180px; }
.tr .ask-said { display: flex; justify-content: flex-end; margin: 18px 0 10px; }
.tr .ask-said .k { display: none; }
.tr .ask-said .t { max-width: 280px; background: #1A1A1A; border-left: 3px solid var(--tr-gold); border-radius: 0; padding: 14px 16px; font-family: var(--font-editorial); font-size: 17px; line-height: 1.5; color: var(--tr-ink); }
.tr .ask-spoke { margin-bottom: 8px; }
.tr .ask-spoke .k { font-family: var(--font-utility); font-size: 9px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--tr-ink-muted); margin-bottom: 6px; }
.tr .ask-spoke .t { font-family: var(--font-editorial); font-size: 18px; line-height: 1.6; color: var(--tr-ink-prose); text-wrap: pretty; }
.tr .ask-follow, .tr .ask-actions { display: flex; flex-direction: column; margin-top: 14px; }
.tr .ask-follow button, .tr .ask-actions button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 0; background: none; border: 0; border-top: 1px solid var(--tr-rule); border-radius: 0; text-align: left; font-family: var(--font-editorial); font-size: 17px; color: var(--tr-ink); cursor: pointer; }
.tr .ask-follow button::after, .tr .ask-actions button::after { content: "→"; color: var(--tr-gold); font-family: var(--font-utility); }
.tr .ask-foot { background: var(--tr-ground); border-top: 1px solid var(--tr-rule-strong); padding: 12px var(--tr-pad) 18px; }
.tr .ask-reply { display: flex; gap: 10px; }
.tr .ask-reply input { flex: 1; min-height: 56px; padding: 0 16px; background: none; border: 1px solid var(--tr-border); border-radius: 0; color: var(--tr-ink); font-family: var(--font-editorial); font-size: 17px; }
.tr .ask-reply input::placeholder { color: var(--tr-ink-muted); }
.tr .ask-reply button { min-height: 56px; padding: 0 20px; background: var(--tr-gold); border: 0; border-radius: 0; color: var(--tr-ground); font-family: var(--font-utility); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.tr .ask-mic-inline, .tr .ask-alt { min-height: 56px; padding: 0 16px; background: none; border: 1px solid var(--tr-border-strong); border-radius: 0; color: var(--tr-ink-muted); font-family: var(--font-utility); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.tr .ask-mic { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; justify-content: center; background: none; border: 1px solid var(--tr-border-strong); border-radius: 0; color: var(--tr-ink); font-family: var(--font-utility); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.tr .ask-hint, .tr .ask-foot-msg { font-family: var(--font-editorial); font-size: 14px; color: var(--tr-ink-muted); padding-bottom: 8px; }

/* map head: underline tab strip + (i) info affordance (matches §7a) */
.tr .tr-maphead { display: flex; align-items: stretch; border-bottom: 1px solid var(--tr-rule-strong); }
.tr .tr-maphead .tr-tabs { flex: 1 1 auto; border-bottom: 0; }
.tr .tr-map-info { flex: 0 0 44px; height: 46px; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
.tr .tr-map-info svg { width: 20px; height: 20px; fill: none; stroke: var(--tr-ink-muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tr .map-intro { padding: 14px var(--tr-pad) 6px; font-family: var(--font-editorial) !important; font-size: 15px !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--tr-ink-secondary) !important; }

/* hero photo credit (CC attribution, kept small + bottom-right) */
.tr-hero__credit { position: absolute; right: 12px; bottom: 8px; z-index: 3; max-width: 60%; text-align: right; font-family: var(--font-utility); font-size: 8px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--tr-photo-caption); opacity: .55; }
