/* Tool-Lifes - modern UI overlay (loaded after frame.css).
 * Refines chrome for all apps: type, cards, header, spacing, mobile.
 * Does NOT weaken dark-hero contrast locks in frame.css.
 */

:root {
  /* Contrast: muted ≥ ~7:1 on white (WCAG AA body). Brand accent stays #03C75A. */
  --tl-bg: #f3f5f7;
  --tl-surface: #ffffff;
  --tl-text: #111827;
  --tl-muted: #4b5563;
  --tl-border: #e2e8f0;
  --tl-radius: 14px;
  --tl-radius-sm: 8px;
  --tl-radius-md: 10px;
  --tl-shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 6px 18px rgba(17, 24, 39, .06);
  --tl-elev: 0 4px 10px rgba(17, 24, 39, .05), 0 16px 40px rgba(17, 24, 39, .09);
  --tl-header-h: 60px;
  --maxw: 1140px;
  --header-bg: rgba(255, 255, 255, .86);
  --bg: var(--tl-bg);
  --surface: var(--tl-surface);
  --ink: var(--tl-text);
  --ink2: #1f2937;
  --muted: #4b5563;
  --line: var(--tl-border);
  --radius: var(--tl-radius);
  --shadow: var(--tl-shadow);
  --shadow-soft: 0 1px 0 rgba(17, 24, 39, .05);
  --tl-chip-pad-y: 8px;
  --tl-chip-pad-x: 14px;
  --tl-glance-min: 158px;
  --tl-explore-min: 200px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--tl-header-h) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -.011em;
  text-wrap: pretty;
}

h1, h2, h3, h4 {
  text-wrap: balance;
  letter-spacing: -.028em;
  line-height: 1.22;
}
h1 { font-weight: 750; }
h2 { font-weight: 720; font-size: clamp(1.22rem, 2vw, 1.5rem); }
h3 { font-weight: 700; }

.wrap {
  max-width: var(--maxw);
  padding-left: clamp(16px, 3vw, 28px);
  padding-right: clamp(16px, 3vw, 28px);
}

.site-header {
  backdrop-filter: saturate(1.2) blur(16px);
  -webkit-backdrop-filter: saturate(1.2) blur(16px);
  border-bottom: 1px solid rgba(17, 24, 39, .06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset;
}
.site-header .wrap,
.site-header .tl-header-bar {
  min-height: var(--tl-header-h);
  gap: 12px 18px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  font-size: 1.14rem;
  font-weight: 780;
  letter-spacing: -.035em;
}
.brand .dot {
  color: var(--tl-accent);
  margin: 0 1px;
}
.appname {
  font-size: .9rem;
  font-weight: 600;
  color: #374151;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-nav-link {
  font-size: .88rem;
  font-weight: 650;
  color: #374151;
  padding: 6px 8px;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.tl-nav-link:hover {
  color: var(--ink);
  background: rgba(17, 24, 39, .04);
  text-decoration: none;
}

.tl-search-pill {
  border: 1.5px solid rgba(3, 199, 90, .55);
  border-radius: 999px;
  min-height: 40px;
  padding: 8px 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(3, 199, 90, .06);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.tl-search-pill:hover {
  border-color: var(--tl-accent);
  box-shadow: 0 4px 14px rgba(3, 199, 90, .14);
  text-decoration: none;
}
.tl-search-pill:focus-visible {
  outline: 2px solid #5eead4;
  outline-offset: 2px;
}
.lang-select {
  min-height: 36px;
  border-radius: 10px;
  border-color: var(--tl-border);
  font-weight: 600;
  transition: border-color .15s ease;
}
.lang-select:hover,
.lang-select:focus {
  border-color: #cbd5e1;
}

main {
  padding: clamp(28px, 4vw, 48px) 0 clamp(56px, 8vw, 88px);
}
.section-intro {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink2);
  max-width: 40rem;
  margin-bottom: 1.25rem;
}
main > .wrap > section + section,
main .wrap > section + section {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}
main h2 {
  margin: 0 0 .65rem;
  padding-bottom: .35rem;
}

.grid {
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card {
  border: 1px solid rgba(17, 24, 39, .06);
  border-radius: var(--tl-radius);
  padding: 20px 20px 18px;
  box-shadow: var(--tl-shadow);
  background: var(--tl-surface);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--tl-elev);
  border-color: color-mix(in srgb, var(--accent, var(--tl-accent)) 45%, var(--tl-border));
  text-decoration: none;
}
.card h3 {
  font-size: 1.08rem;
  margin: 0 0 6px;
  letter-spacing: -.02em;
}
.card .sub {
  font-size: .9rem;
  line-height: 1.5;
  color: var(--ink2);
}
.card .go {
  display: inline-flex;
  margin-top: 10px;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.related {
  gap: 14px;
  margin-top: 16px;
}

.pills {
  gap: 8px;
  margin-top: 20px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: var(--tl-chip-pad-y) var(--tl-chip-pad-x);
  font-size: .86rem;
  font-weight: 650;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--tl-border);
  color: #1f2937;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  -webkit-hyphens: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.pill:hover {
  color: var(--ink);
  border-color: #cbd5e1;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 24, 39, .07);
  text-decoration: none;
}
.pill.active {
  color: #111;
  font-weight: 780;
  background: #fff;
  border-color: transparent;
  box-shadow: inset 0 -2px 0 var(--tl-accent);
}
/* At-a-glance / quick-facts — shared with .tl-glance* */
.facts,
.tl-glance {
  display: grid;
  gap: 14px;
  margin: 14px 0 10px;
  grid-template-columns: repeat(auto-fill, minmax(var(--tl-glance-min), 1fr));
  align-items: stretch;
}
.fact,
.tl-glance-card {
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, .09);
  background: var(--tl-surface);
  padding: 16px 18px;
  box-shadow: var(--tl-shadow);
  min-height: 5.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.fact .v,
.tl-glance-card .v {
  font-size: 1.18rem;
  letter-spacing: -.02em;
  color: var(--ink);
  font-weight: 800;
}
.fact .k,
.tl-glance-card .k {
  font-size: .84rem;
  color: var(--muted);
  letter-spacing: .01em;
  font-weight: 600;
}

.tl-dock {
  gap: 8px 4px;
  margin: 1.25rem 0 0;
}
.tl-dock-row {
  gap: 10px 8px;
}
.tl-dock-item {
  border-radius: 14px;
  padding: 6px 4px 8px;
  transition: background .15s ease;
}
.tl-dock-item:hover {
  background: rgba(17, 24, 39, .03);
  text-decoration: none;
}
.tl-dock-ico,
.tl-dock-cover {
  border-radius: 16px;
  box-shadow: var(--tl-shadow);
  border: 1px solid rgba(17, 24, 39, .06);
}
.tl-dock-item:hover .tl-dock-ico,
.tl-dock-item--cover:hover .tl-dock-cover {
  transform: translateY(-2px);
  box-shadow: var(--tl-elev);
}
.tl-dock-lbl {
  font-size: .72rem;
  font-weight: 650;
  color: #374151;
  line-height: 1.3;
  margin-top: 6px;
}

.site-footer {
  border-top: 1px solid rgba(17, 24, 39, .06);
  background: #eef1f4;
  padding: 36px 0 48px;
}
.site-footer .links a,
.site-footer a {
  font-size: .86rem;
  font-weight: 600;
  color: #374151;
}
.site-footer a:hover {
  color: var(--tl-accent);
  text-decoration: none;
}
.site-footer .copy {
  color: #3f4754;
  font-size: .8rem;
}

:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}
a:focus:not(:focus-visible) { outline: none; }

body.hub-page .hero,
body.hub-page main {
  background: transparent;
}
body.hub-page .hub-hero h1 {
  letter-spacing: -.035em;
  font-weight: 780;
}

.tl-start-here .card,
.tl-popular .card {
  border-radius: 12px;
}

.tl-sec-jump--sticky,
.job-toc,
.spills {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 720px) {
  .site-header .wrap,
  .site-header .tl-header-bar {
    gap: 8px 10px;
  }
  .appname { max-width: 8rem; }
  .tl-nav-link { display: none; }
  .pill {
    min-height: 40px;
    padding: 9px 14px;
  }
  .card { padding: 16px; }
  main { padding-top: 22px; }
  .tl-search-pill { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  a.card,
  .pill,
  .tl-dock-ico,
  .tl-dock-cover,
  .tl-search-pill,
  .tl-nav-link {
    transition: none !important;
  }
  a.card:hover,
  .tl-dock-item:hover .tl-dock-ico,
  .tl-dock-item--cover:hover .tl-dock-cover {
    transform: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .tl-search-pill,
  .tl-dock { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
/* Article readability */
.tl-article, .section-intro, .tl-article .a, body[data-tl-article] main .wrap > section > p {
  max-width: 42rem;
  line-height: 1.75;
}
.tl-article h2 {
  margin-top: 2rem;
}

/* Hero: softer bottom fade on light pages */
.hero:not([data-dark]):not(.hero--dark) {
  border-radius: 0 0 20px 20px;
}
.hero .lede {
  max-width: 36rem;
  line-height: 1.65;
  font-size: 1.05rem;
}

/* Breadcrumbs — readable on light hubs */
.crumbs, .breadcrumb, nav[aria-label="Breadcrumb"] {
  font-size: .84rem;
  color: var(--muted);
  letter-spacing: -.01em;
}
.crumbs a, .breadcrumb a {
  color: #374151;
  font-weight: 600;
}
.crumbs a:hover { color: var(--tl-accent); text-decoration: none; }

/* Buttons / CTAs used across apps */
.btn, .cta, a.btn {
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: -.015em;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover, .cta:hover, a.btn:hover {
  transform: translateY(-1px);
}

/* Search panel polish if present */
.tl-search-panel, [data-tl-search], .tl-cmdk {
  border-radius: 16px;
  box-shadow: var(--tl-elev);
  border: 1px solid rgba(17, 24, 39, .08);
}

/* Sticky toc softer */
.job-toc, .spills, .tl-sec-jump {
  border-radius: 12px;
}
/* Command palette */
.tl-palette-backdrop {
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tl-palette-panel {
  margin-top: max(8vh, 48px);
  border-radius: 18px;
  border: 1px solid rgba(17, 24, 39, .08);
  box-shadow: 0 28px 80px -20px rgba(15, 23, 42, .5);
}
.tl-palette-input {
  font-size: 1.08rem;
  font-weight: 550;
  padding: 20px 22px;
}
.tl-palette-item {
  padding: 12px 20px;
  border-radius: 0;
  transition: background .12s ease;
}
.tl-palette-item.is-active {
  background: color-mix(in srgb, var(--tl-accent) 12%, transparent);
}

/* Back to top */
.tl-back-top {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, .08);
  background: #fff;
  color: #111;
  box-shadow: var(--tl-elev);
  font-size: 1.1rem;
  font-weight: 700;
  right: 16px;
  bottom: 16px;
}
.tl-back-top:hover {
  background: var(--tl-accent);
  color: #fff;
  border-color: transparent;
}

/* Header elevates when scrolled */
.site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(17, 24, 39, .06);
  border-bottom-color: rgba(17, 24, 39, .08);
}

/* Share FAB less cluttered */
.tl-share-fab {
  opacity: .9;
  gap: 8px;
  right: 16px;
  bottom: 68px;
}
.tl-share-btn {
  border-radius: 12px;
  min-height: 40px;
  padding: 8px 14px;
}
/* Hub tiles */
.app-tile {
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, .06);
  box-shadow: var(--tl-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.app-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--tl-elev);
  text-decoration: none;
}
.hub-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  letter-spacing: -.035em;
}
.hub-page .hub-hero {
  background: transparent;
  box-shadow: none;
  border: 0;
  padding-left: 0;
  padding-right: 0;
}

/* --------------------------------------------------------------------------
 * Hub polish: contrast locks + At-a-Glance / Explore grid (all apps)
 * Loads last — beats washed-out muted text and mid-word chip wraps.
 * -------------------------------------------------------------------------- */

/* Secondary copy on light surfaces */
.sub, .hint, .stat-note, .tl-detail, .hub-hint, .lab-hint,
.tl-popular-card span:last-child,
.hub-page .hub-hero .lede,
.hub-page .hero .lede {
  color: var(--ink2) !important;
}
.hub-page .hero .crumbs a,
.hub-page .hero .crumbs span,
.hub-page .hub-hero .crumbs a,
.hub-page .hub-hero .crumbs span {
  color: #374151 !important;
}
.hub-group h2,
.hub-stat span,
.tl-sec-jump-title,
.jtoc-label,
.tl-toc-title {
  color: #4b5563 !important;
}
.tl-toc a, .jtoc a,
.tl-sec-jump-chip {
  color: #111827 !important;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

/* No mid-word breaks on chips / compact labels */
.pill,
.food-chip,
.tl-explore-chip,
.tl-when-chip,
.tl-sec-jump-chip,
.tl-dock-lbl,
.legend .chip,
.mg-jobs a,
.tl-viz-pack {
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
  -webkit-hyphens: none !important;
}
.pill,
.food-chip,
.tl-explore-chip,
.tl-when-chip,
.tl-viz-pack {
  white-space: nowrap;
}
.tl-viz-pack {
  background: #fff;
  border-color: rgba(17, 24, 39, .12);
  color: #111827;
  box-shadow: var(--shadow-soft);
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  gap: 8px;
}
.tl-viz-packs {
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.tl-viz-shell.is-home {
  padding: .85rem 1rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, .08);
  background: #fff;
  box-shadow: var(--tl-shadow);
}
.tl-viz-kicker,
.tl-viz-cap {
  color: #374151 !important;
}
.tl-viz-hint {
  color: #4b5563 !important;
}
.tl-viz-shell:has(input[value="compact"]:checked) .tl-viz-packs {
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}
.tl-viz-shell:has(input[value="compact"]:checked) .tl-viz-pack {
  min-height: 40px;
  padding: 8px 10px;
  font-size: .78rem;
}

/* Explore / filter chips — icon + label + count */
.tl-explore-chip,
.food-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: var(--tl-chip-pad-y) var(--tl-chip-pad-x);
  border-radius: 999px;
  border: 1px solid var(--tl-border);
  background: var(--tl-surface);
  color: #1f2937;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.25;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, color .15s ease, background .15s ease;
}
.tl-explore-chip:hover,
.food-chip:hover {
  border-color: #cbd5e1;
  color: var(--ink);
  box-shadow: var(--tl-shadow);
  text-decoration: none;
}
.tl-explore-chip.on,
.tl-explore-chip[aria-pressed="true"],
.food-chip.on,
.food-chip[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent, var(--tl-accent)) 55%, var(--tl-border));
  color: var(--ink);
  background: color-mix(in srgb, var(--accent, var(--tl-accent)) 10%, #fff);
  box-shadow: inset 0 -2px 0 var(--accent, var(--tl-accent));
  font-weight: 780;
}
.tl-explore-chip .n,
.food-chip .n {
  margin-left: 2px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.food-filters,
.tl-explore-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Hub explorer grids — Start here / Popular / related */
.tl-explore-grid,
.tl-popular-row,
.tl-start-row,
.tl-related-in-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(var(--tl-explore-min), 1fr));
  align-items: stretch;
}
.tl-popular-card,
.tl-start-card,
.tl-related-in-card,
a.tl-glance-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  min-height: 6.5rem;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, .09);
  background: var(--tl-surface);
  box-shadow: var(--tl-shadow);
  color: inherit;
  text-decoration: none;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tl-popular-card:hover,
.tl-start-card:hover,
.tl-related-in-card:hover,
a.tl-glance-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--tl-elev);
  border-color: color-mix(in srgb, var(--accent, var(--tl-accent)) 40%, var(--tl-border));
  text-decoration: none;
}
.tl-popular-card .tl-dot {
  width: 8px;
  height: 8px;
  margin: 0 0 2px;
}
.tl-popular-card strong,
.tl-start-card strong,
.tl-related-in-card strong,
.tl-glance-card strong {
  font-family: var(--font-display, var(--tl-font));
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.3;
}
.tl-popular-card span:not(.tl-dot),
.tl-start-card span:not(.tl-start-k),
.tl-related-in-card span {
  font-size: .86rem;
  line-height: 1.45;
  color: var(--ink2);
}
.tl-start-k {
  font-size: 1.15rem;
  line-height: 1;
  margin-bottom: 2px;
}

/* Compact toggle variant for dense hubs */
.tl-explore-grid--compact {
  --tl-explore-min: 160px;
  gap: 10px;
}
.tl-explore-grid--compact .tl-popular-card,
.tl-explore-grid--compact .tl-start-card,
.tl-explore-grid--compact .tl-glance-card {
  min-height: 0;
  padding: 12px 14px;
}

@media (max-width: 720px) {
  .facts,
  .tl-glance {
    --tl-glance-min: 140px;
    gap: 10px;
  }
  .tl-explore-grid,
  .tl-popular-row,
  .tl-start-row {
    --tl-explore-min: 160px;
    gap: 10px;
  }
  .pill,
  .food-chip,
  .tl-explore-chip {
    white-space: normal;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-popular-card,
  .tl-start-card,
  .tl-related-in-card,
  a.tl-glance-card,
  .tl-explore-chip,
  .food-chip {
    transition: none !important;
  }
  .tl-popular-card:hover,
  .tl-start-card:hover,
  .tl-related-in-card:hover,
  a.tl-glance-card:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
 * Retail-calm layer. Shopping-app structure (light canvas, card grids,
 * category rail), not a GS Shop clone: no pink, no copied assets.
 *
 * --tl-bg           cool paper canvas
 * --tl-surface      card white
 * --tl-text         primary ink #111827 (~16:1 on white)
 * --tl-ink-soft     secondary ink #3f4754 (~9.4:1); floor is 7:1
 * --tl-rail         leaf accent for rails, focus, active chips (#0c5c3c, ~8:1)
 * --tl-accent       wordmark green #03C75A — logo dot stays this green
 * --tl-border       hairline
 * --tl-radius       card corner
 * --tl-shadow       soft lift
 * --tl-header-h     sticky bar (shorter padding on small screens)
 * --tl-glance-min   at-a-glance column
 * --tl-explore-min  explore-card column
 * --tl-chip-h       minimum chip / tap height
 * -------------------------------------------------------------------------- */
:root {
  --tl-bg: #f4f6f8;
  --tl-surface: #ffffff;
  --tl-text: #111827;
  --tl-ink-soft: #3f4754;
  --tl-rail: #0c5c3c;
  --tl-accent: #03C75A;
  --tl-border: #e5e7eb;
  --tl-radius: 12px;
  --tl-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 22px rgba(17, 24, 39, .05);
  --tl-elev: 0 4px 10px rgba(17, 24, 39, .05), 0 16px 36px rgba(17, 24, 39, .08);
  --tl-glance-min: 172px;
  --tl-explore-min: 210px;
  --tl-chip-h: 40px;
  --ink: var(--tl-text);
  --ink2: #1f2937;
  --muted: var(--tl-ink-soft);
  --bg: var(--tl-bg);
  --surface: var(--tl-surface);
}

/* Light surfaces: secondary copy stays ≥ ~7:1. Dark heroes are not in this set. */
.site-header,
.site-footer,
main,
.hub-page .hero,
.hub-page .hub-hero,
.card,
.fact,
.tl-glance:not(:has(.bar)),
.tl-viz-shell {
  color: var(--tl-text);
}
.site-footer .copy,
.site-footer .links a,
.site-footer a,
.sub,
.hint,
.stat-note,
.card .sub,
.fact .k,
.tl-glance .k,
.crumbs,
.crumbs a,
.tl-search-pill,
.tl-search-ph,
.tl-heat-legend,
.tl-heat-legend span {
  color: var(--tl-ink-soft);
}
.site-header {
  background: rgba(255, 255, 255, .97);
  color: var(--tl-text);
  border-bottom: 1px solid rgba(17, 24, 39, .08);
}
.site-header .brand { color: #111827; }
.site-header .brand .dot { color: var(--tl-accent); }
.site-header .appname,
.site-header .tl-nav-link,
.site-header .lang-select,
.site-header .tl-apps > summary,
.site-header .sep {
  color: #1f2937;
}
.tl-search-pill {
  color: var(--tl-ink-soft);
  border: 1px solid color-mix(in srgb, var(--tl-rail) 42%, #d1d5db);
  box-shadow: none;
}
.tl-search-pill svg { color: var(--tl-rail); }
.tl-search-pill:hover {
  color: var(--tl-ink-soft);
  border-color: var(--tl-rail);
  box-shadow: 0 1px 2px rgba(12, 92, 60, .08);
}
.tl-viz-hbars,
.tl-viz-score,
.tl-sec-jump,
.tl-sec-scroller,
.tl-sec-jump-row,
.tl-x3-skip-row {
  max-width: 100%;
}
.tl-viz-hbars,
.tl-sec-scroller,
.tl-sec-jump-row,
.tl-x3-skip-row {
  overflow-x: auto;
}
:focus-visible {
  outline: 2px solid var(--tl-rail);
  outline-offset: 2px;
}

/* Score intensity + score bars: never break a metric mid-word.
 * overflow-wrap:anywhere made min-content a single glyph ("Trainabili / ty").
 * Column is max-content so the longest unspaced label stays one line. */
html[lang] .tl-heat-score,
.tl-heat-score {
  grid-template-columns: max-content minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
}
html[lang] .tl-heat-score-lab,
.tl-heat-score-lab,
html[lang] .tl-viz-hbar-lab,
.tl-viz-hbar-lab,
body.talent .tal-meter > span:first-child {
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
  -webkit-hyphens: none;
  white-space: nowrap;
  min-width: max-content;
  line-height: 1.3;
}
.tl-heat-score-lab {
  color: #111827;
  font-size: .84rem;
  font-weight: 650;
}
.tl-viz-hbar {
  grid-template-columns: max-content minmax(0, 1fr) auto;
  gap: 8px 12px;
}
.tl-viz-hbar-lab { color: #111827; }
.tl-heat-score-cells { min-width: 0; }
.tl-heat--scores { overflow-x: auto; }
.tl-heat-legend {
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 12px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--tl-ink-soft);
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.tl-heat-legend span {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.tl-viz-shell:has(input[value="compact"]:checked) .tl-heat-score {
  gap: 5px 10px;
}
.tl-viz-shell:has(input[value="compact"]:checked) .tl-heat-score-lab,
.tl-viz-shell:has(input[value="compact"]:checked) .tl-viz-hbar-lab {
  font-size: .78rem;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
body.talent .tal-meter {
  grid-template-columns: max-content minmax(0, 1fr) 2.4rem;
  gap: .5rem .75rem;
}

/* At-a-glance / explore: even tracks, hairline + soft shadow, label not glued to the icon. */
.facts,
.tl-glance:not(:has(.bar)),
.tl-explore-grid,
.tl-popular-row,
.tl-start-row,
.tl-related-in-row {
  align-items: stretch;
  grid-auto-rows: 1fr;
}
.fact,
.tl-glance:not(:has(.bar)) > .stat:has(> .k),
.tl-popular-card,
.tl-start-card,
.tl-related-in-card,
a.tl-glance-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 16px 18px;
  border-radius: var(--tl-radius);
  border: 1px solid rgba(17, 24, 39, .1);
  background: var(--tl-surface);
  box-shadow: var(--tl-shadow);
  grid-template-columns: none;
}
.fact .k,
.tl-glance:not(:has(.bar)) > .stat .k,
.tl-glance-card .k,
.tl-popular-card strong,
.tl-start-card strong,
.tl-related-in-card strong {
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
  -webkit-hyphens: none;
}
.fact .k,
.tl-glance:not(:has(.bar)) > .stat .k {
  color: var(--tl-ink-soft);
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.35;
}
.fact .v,
.tl-glance:not(:has(.bar)) > .stat .v {
  color: #111827;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: normal;
  word-break: keep-all;
}
.tl-popular-card .tl-dot,
.tl-start-k {
  flex: 0 0 auto;
  margin: 0 0 2px;
}
.tl-explore-grid--compact,
.tl-viz-shell:has(input[value="compact"]:checked) .tl-explore-grid {
  --tl-explore-min: 168px;
  gap: 10px;
}
.tl-explore-grid--compact .tl-popular-card,
.tl-explore-grid--compact .tl-start-card,
.tl-explore-grid--compact .tl-glance-card,
.tl-explore-grid--compact .tl-related-in-card,
.tl-viz-shell:has(input[value="compact"]:checked) .tl-popular-card,
.tl-viz-shell:has(input[value="compact"]:checked) .tl-start-card {
  min-height: 0;
  padding: 12px 14px;
  gap: 6px;
}

/* Category rail: horizontal chips, full words, no edge fade clipping the label. */
.tl-sec-scroller {
  mask-image: none;
  -webkit-mask-image: none;
}
.tl-sec-jump-chip,
.jtoc a,
.tl-x3-skip-row a:not(.tl-skip) {
  white-space: nowrap;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  hyphens: none;
  -webkit-hyphens: none;
  min-height: var(--tl-chip-h);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, .12);
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}
.tl-sec-jump-chip:hover,
.jtoc a:hover,
.tl-x3-skip-row a:not(.tl-skip):hover {
  color: #111827;
  background: #f3f6f4;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .06);
}
.tl-sec-jump-chip.active,
.tl-sec-jump-chip[aria-current="true"],
.jtoc a.is-active,
.jtoc a.is-on,
.tl-x3-skip-row a[aria-current="true"] {
  color: #111827;
  background: #fff;
  font-weight: 800;
  border-color: color-mix(in srgb, var(--tl-rail) 40%, #e5e7eb);
  box-shadow: inset 0 -2px 0 var(--tl-rail);
}

@media (max-width: 720px) {
  :root {
    --tl-header-h: 88px;
    --tl-glance-min: 148px;
    --tl-explore-min: 156px;
    --tl-chip-h: 44px;
  }
  .site-header .wrap,
  .site-header .tl-header-bar {
    min-height: 0;
    padding-top: 4px;
    padding-bottom: 4px;
    gap: 4px 8px;
  }
  .brand { font-size: 1.02rem; }
  .tl-search-pill,
  .lang-select,
  .tl-apps > summary,
  .pill,
  .food-chip,
  .tl-explore-chip,
  .tl-viz-dens label {
    min-height: 44px;
  }
  .tl-search-pill { padding-top: 8px; padding-bottom: 8px; }
  main { padding-top: 12px; }
  .tl-sec-jump,
  .tl-sec-rail,
  .tl-sec-jump--sticky {
    margin-bottom: .65rem;
    padding-top: .35rem;
    padding-bottom: .35rem;
  }
  .tl-sec-jump-row,
  .tl-sec-scroller ol,
  .tl-x3-skip-row {
    flex-wrap: nowrap;
    gap: 8px;
    padding-right: 4px;
  }
  .facts,
  .tl-glance:not(:has(.bar)) {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-sec-jump-chip,
  .tl-search-pill,
  .fact,
  .tl-glance > .stat {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
 * Phone + tablet (390px and 768px).
 * 768px covers the gap above the older 720px rules (iPad portrait still got
 * the desktop header). 390px stacks explore cards.
 * No overflow-x on html/body: clip/hidden there crops :focus-visible rings.
 * Dark heroes stay light-on-charcoal (frame.css). Light ink stays #111827 /
 * #3f4754 (~7:1+ on white) — this block does not lighten them.
 * html body[class] beats per-app copies of these shared classes.
 * -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --tl-header-h: 108px;
    --tl-glance-min: 140px;
    --tl-explore-min: 160px;
    --tl-chip-h: 44px;
  }

  /* Header: search on its own row; lang + apps stay 44px and can shrink. */
  html body[class] .site-header {
    overflow: visible;
  }
  html body[class] .site-header .wrap,
  html body[class] .site-header .tl-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  html body[class] .site-header .tl-header-bar > * {
    min-width: 0;
    position: relative;
  }
  html body[class] .site-header .brand,
  html body[class] .site-header .appname {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  html body[class] .site-header .brand {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 1.02rem;
  }
  html body[class] .site-header .sep { flex: 0 0 auto; }
  html body[class] .site-header .appname {
    flex: 1 1 auto;
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html body[class] .site-header .spacer,
  html body[class] .site-header .tl-nav-link,
  html body[class] .tl-search-kbd {
    display: none;
  }
  html body[class] .tl-apps-discover { display: flex; }
  html body[class] .tl-apps-discover a,
  html body[class] .tl-apps-panel a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  html body[class] .site-header .tl-apps { flex: 0 0 auto; }
  html body[class] .site-header .tl-apps > summary,
  html body[class] .site-header .lang-select,
  html body[class] .site-header .tl-search-pill {
    min-height: 44px;
    min-width: 44px;
    box-sizing: border-box;
  }
  html body[class] .site-header .tl-apps > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
  }
  html body[class] .site-header .lang-select {
    flex: 0 1 auto;
    max-width: min(34vw, 8.5rem);
    padding-top: 8px;
    padding-bottom: 8px;
  }
  html body[class] .site-header .tl-search-pill {
    flex: 1 1 100%;
    order: 10;
    max-width: 100%;
    width: 100%;
    margin: 0;
  }
  html body[class] .tl-apps-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: var(--tl-header-h);
    width: auto;
    min-width: 0;
    max-width: none;
  }

  /* Explore / glance: track min cannot exceed the column, so the page does not scroll. */
  html body[class] main,
  html body[class] main .wrap,
  html body[class] .grid,
  html body[class] .grid.wide,
  html body[class] .facts,
  html body[class] .tl-glance,
  html body[class] .tl-explore-grid,
  html body[class] .tl-popular-row,
  html body[class] .tl-start-row,
  html body[class] .tl-related-in-row,
  html body[class] .hub-featured-row,
  html body[class] .tl-viz-packs,
  html body[class] .tl-dock-row {
    min-width: 0;
    max-width: 100%;
  }
  html body[class] .grid,
  html body[class] .grid.wide,
  html body[class] .tl-explore-grid,
  html body[class] .tl-popular-row,
  html body[class] .tl-start-row,
  html body[class] .tl-related-in-row,
  html body[class] .hub-featured-row,
  html body[class] .tl-viz-packs {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--tl-explore-min, 160px)), 1fr));
  }
  html body[class] .facts,
  html body[class] .tl-glance:not(:has(.bar)) {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--tl-glance-min, 140px)), 1fr));
  }
  html body[class] .tl-dock-row {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 84px), 1fr));
  }
  html body[class] .card,
  html body[class] .fact,
  html body[class] .tl-glance-card,
  html body[class] .tl-popular-card,
  html body[class] .tl-start-card,
  html body[class] .tl-related-in-card,
  html body[class] a.tl-glance-card {
    min-width: 0;
    max-width: 100%;
  }

  /* Score rows: wrap on spaces; an unbreakable label scrolls inside the block. */
  html body[class] .tl-heat--scores,
  html body[class] .tl-viz-hbars {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  html body[class] .tl-heat-score,
  html body[class] .tl-viz-hbar {
    width: max-content;
    min-width: 100%;
    max-width: none;
    grid-template-columns: max-content minmax(4.5rem, 1fr) auto;
  }
  html body[class] .tl-heat-score > .tl-heat-score-lab,
  html body[class] .tl-viz-hbar > .tl-viz-hbar-lab,
  html body[class] .tl-heat-score-lab,
  html body[class] .tl-viz-hbar-lab {
    min-width: 0;
    max-width: min(46vw, 12.5rem);
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    -webkit-hyphens: none;
  }
  html body[class] .tl-heat-legend {
    max-width: 100%;
    overflow-x: auto;
  }

  /* Jump / chip rails: end padding so overflow does not clip the last word. */
  html body[class] .tl-sec-scroller,
  html body[class] .tl-sec-jump > .tl-sec-jump-row,
  html body[class] .tl-x3-skip-row {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    mask-image: none;
    -webkit-mask-image: none;
    scroll-padding-inline: 12px;
    padding-block: 6px 10px;
  }
  html body[class] .tl-sec-jump-row,
  html body[class] .tl-sec-scroller ol,
  html body[class] .tl-x3-skip-row {
    flex-wrap: nowrap;
    gap: 8px;
    width: max-content;
    min-width: 100%;
    max-width: none;
    padding: 2px 22px 6px 2px;
    box-sizing: border-box;
    overflow: visible;
  }
  html body[class] .tl-sec-jump > .tl-sec-jump-row {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }
  html body[class] .tl-sec-jump-chip,
  html body[class] .tl-sec-scroller .jtoc a,
  html body[class] .tl-x3-skip-row a,
  html body[class] .jtoc a {
    flex: 0 0 auto;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }
  html body[class] .pill,
  html body[class] .food-chip,
  html body[class] .tl-explore-chip {
    max-width: 100%;
    white-space: normal;
    min-height: 44px;
  }
  html body[class] .tl-explore-chips,
  html body[class] .pills,
  html body[class] .food-filters {
    max-width: 100%;
    min-width: 0;
  }

  /* Tables and wide figures scroll inside themselves. Not the viz studio canvas. */
  html body[class] .tl-table-wrap,
  html body[class] figure,
  html body[class] .diagram,
  html body[class] .diagram .board {
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  html body[class] .tl-table,
  html body[class] .tl-x30-table,
  html body[class] main table {
    max-width: 100%;
  }
  html body[class] .diagram svg,
  html body[class] .board svg,
  html body[class] figure svg,
  html body[class] main .wrap > svg {
    max-width: 100%;
    height: auto;
  }
  html body.viz .vz-ed svg {
    max-width: none;
    height: auto;
  }
}

/* 390px: one explore card per row; header names give way to the controls. */
@media (max-width: 390px) {
  :root {
    --tl-header-h: 112px;
    --tl-glance-min: 140px;
    --tl-explore-min: 160px;
  }
  html body[class] .site-header .appname { max-width: 5.75rem; }
  html body[class] .site-header .lang-select {
    max-width: 6.25rem;
    font-size: .8rem;
  }
  html body[class] .grid,
  html body[class] .grid.wide,
  html body[class] .tl-explore-grid,
  html body[class] .tl-popular-row,
  html body[class] .tl-start-row,
  html body[class] .tl-related-in-row,
  html body[class] .hub-featured-row,
  html body[class] .tl-viz-packs,
  html body[class] .tl-x3-facts.tl-hub-x30,
  html body[class] .tl-series {
    grid-template-columns: minmax(0, 1fr);
  }
  html body[class] .facts,
  html body[class] .tl-glance:not(:has(.bar)) {
    grid-template-columns: minmax(0, 1fr);
  }
}