/* FlexTrust explorer components on the Kinetic tokens (tokens.css loads
   after this file and owns the cascade). Class idiom follows the sibling
   app: block__element and block--modifier. */

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hov); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--accent); color: var(--on-accent); padding: 0.5rem 1rem;
}
.skip-link:focus { left: 0; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.65rem 1.25rem;
  background: var(--nav-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-8);
}
/* One mark size everywhere = the icon controls (32px): nav, topbar, auth,
   footer (design review 2026-09-14). flex: 0 0 auto keeps flexbox from
   shrinking the SVG in a tight pill; the wordmark gives way first. */
.app-header__brand {
  display: flex; align-items: center; gap: 0.5625rem; min-width: 0;
  color: var(--accent); font-family: var(--font-display);
  font-weight: 700; font-size: var(--fs-table); letter-spacing: 0.01em;
}
.app-header__brand .ft-logo { flex: 0 0 auto; }
/* Wordmark rule (Christian, 2026-08-08, refined via screenshot): ONE
   word, ALL CAPS with wide tracking — matching the FLEXYIELD sibling
   wordmark — in one colour, the ink tone (white on dark; ink stays
   legible on the light seam where pure white would vanish). Only the
   logo carries the accent. */
.app-header__wordmark {
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  font-size: var(--fs-table);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.shell-topbar .app-header__wordmark { font-size: var(--fs-body); }
.app-header__nav { display: flex; gap: 1rem; margin-left: auto; align-items: center; }
.app-header__nav a { color: var(--ink2); font-size: var(--fs-table); }
.app-header__nav a:hover, .app-header__nav a[aria-current="page"] { color: var(--ink); }

/* .seam-toggle: quiet button, styled in forms.css; the icon variant is .seam-toggle--icon. */

/* Logo orbit animation */
.ft-logo__outer { transform-origin: 22px 22px; animation: ft-spin 14s linear infinite; }
.ft-logo__inner { transform-origin: 22px 22px; animation: ft-spin-ccw 9s linear infinite; }
@keyframes ft-spin { to { transform: rotate(360deg); } }
@keyframes ft-spin-ccw { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ft-logo__outer, .ft-logo__inner { animation: none; }
}

/* Shell */
.app-main { flex: 1; width: 100%; max-width: 72rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.app-footer {
  border-top: 1px solid var(--line-8); padding: 1.25rem;
  color: var(--ink3); font-size: var(--fs-meta); text-align: center;
}

.app-footer__legal ul { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.25rem; }
.app-footer__legal a { color: var(--ink2); }

.page-title { font-family: var(--font-display); font-size: var(--fs-mast); margin: 0 0 0.35rem; }
.page-subtitle { color: var(--ink2); margin: 0 0 1.75rem; max-width: 46rem; }

/* Legal pages: plain running text in one reading column, no cards
   (Christian 2026-09-30 — same shape as flexyield.io's .legal-page). */
.legal-page { max-width: 54rem; margin-inline: auto; }
.legal-page section { margin-top: 2.75rem; }
.legal-page h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-section); letter-spacing: -0.01em; margin: 1.75rem 0 0.6rem; }
.legal-page section > h2:first-child { margin-top: 0; }
.legal-page h3 { font-size: var(--fs-card); font-weight: 700; margin: 1.25rem 0 0.4rem; }
.legal-page section p, .legal-page section :is(ul, ol) { color: var(--ink2); font-size: var(--fs-card); line-height: 1.65; margin: 0 0 0.75rem; max-width: 72ch; }
.legal-page section :is(ul, ol) { padding-left: 1.375rem; display: grid; gap: 0.5rem; }
.legal-page section strong { color: var(--ink); }
.legal-page section a { color: var(--accent); }
.legal-page code { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 4px; padding: 1px 6px; font-size: var(--fs-meta); }

/* Cards, stats */
.card {
  background: var(--surface); border: 1px solid var(--line-8);
  border-radius: var(--r-card); padding: 1.25rem;
  box-shadow: 0 8px 30px var(--shadow-c);
}
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; margin-bottom: 1.75rem; }
.stat { background: var(--surface); border: 1px solid var(--line-8); border-radius: var(--r-card); padding: 0.875rem 1rem; }
.stat__value { font-family: var(--font-display); font-size: var(--fs-mast); font-weight: 700; }
.stat__label { color: var(--ink3); font-size: var(--fs-meta); margin-top: 0.15rem; }

/* Search */
.search-form { display: flex; gap: 0.6rem; margin-bottom: 1.75rem; }
.search-form input[type="search"] { flex: 1; width: auto; }

/* Tables (design review 2026-09-14): header 11/700 caps muted over the
   one 1px rule; cells 14px tabular; muted tones one and two steps down;
   the card is the overflow container (no sticky header backing). Under
   860px rows become labelled cards — labels come from table_cards_controller. */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-table); font-variant-numeric: tabular-nums; }
.data-table th {
  text-align: left; color: var(--ink3); font-weight: 700; font-size: var(--fs-micro);
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line-10);
}
.data-table td { padding: 0.7rem 0.75rem 0.7rem 0; border-bottom: 1px solid var(--line-4); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--accent-08); }
.data-table tfoot td { border-top: 1px solid var(--line-10); border-bottom: 0; font-weight: 700; }
.cell-muted { color: var(--ink3); }
.cell-dim { color: var(--ink3); font-size: var(--fs-meta); }
.row--muted td { color: var(--ink3); }
.cell-num { text-align: right; }
@media (max-width: 860px) {
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table thead, .data-table colgroup { display: none; }
  .data-table { table-layout: auto !important; }
  .data-table tr { border: 1px solid var(--line-10); border-radius: var(--r-control); padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; }
  .data-table tbody tr:hover { background: transparent; }
  .data-table td { border: 0; padding: 0.3rem 0; display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 0.5rem; align-items: baseline; }
  .data-table td::before { content: attr(data-label); font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink3); }
  .data-table td:not([data-label]) { display: block; }
  .data-table td:not([data-label])::before { content: none; }
  .data-table td:first-child { display: block; font-size: var(--fs-card); font-weight: 600; }
  .data-table td:first-child::before { content: none; }
  .data-table td:empty { display: none; }
  .data-table .cell-truncate { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .data-table .cell-num { text-align: left; }
}
.cell-truncate { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rank { color: var(--ink3); font-variant-numeric: tabular-nums; width: 2.5rem; }

/* Score chips */
.score-chip {
  display: inline-block; min-width: 3.2rem; text-align: center;
  padding: 0.2rem 0.55rem; border-radius: 999px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--accent-14); color: var(--accent);
}
.score-chip--large { font-size: 2.6rem; padding: 0.4rem 1.4rem; border-radius: 18px; }
.chip {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: var(--fs-meta); background: var(--line-8); color: var(--ink2);
}
.chip--ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.chip--warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }

/* Score page */
.score-hero { display: flex; align-items: center; gap: 1.75rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.score-hero__meta { flex: 1; min-width: 16rem; }
.score-hero__meta h1 { margin: 0 0 0.3rem; font-family: var(--font-display); font-size: var(--fs-section); word-break: break-all; }
.score-hero__meta dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.9rem; font-size: var(--fs-meta); }
.score-hero__meta dt { color: var(--ink3); }
.score-hero__meta dd { margin: 0; word-break: break-all; }

.factor-table .bar {
  height: 6px; border-radius: 3px; background: var(--line-8);
  position: relative; min-width: 8rem;
}
.factor-table .bar__fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 3px;
  background: var(--accent); min-width: 2px;
}
.factor-note { color: var(--ink3); font-size: var(--fs-meta); }

/* Every pre is its own scroll box (phone overflow check, design review 2026-09-14). */
pre { max-width: 100%; overflow-x: auto; }
pre:not(.code-block) { background: var(--code-bg); color: var(--code-ink); border-radius: var(--r-control); padding: 0.9rem 1.1rem; font-size: var(--fs-meta); font-family: ui-monospace, "SF Mono", monospace; }
.code-block {
  background: var(--code-bg); color: var(--code-ink); border-radius: var(--r-control);
  padding: 0.9rem 1.1rem; font-size: var(--fs-meta); overflow-x: auto;
  font-family: ui-monospace, "SF Mono", monospace;
}

/* Heading roles (design review 2026-09-14): masthead 28 · section 19 · card title 15 · quiet caps label 12 (.k-label). No rule under any of them. */
.section-title { font-family: var(--font-display); font-size: var(--fs-section); font-weight: 800; line-height: 1.15; margin: 2rem 0 0.75rem; }
.card-title { font-family: var(--font-display); font-size: var(--fs-card); font-weight: 800; margin: 0 0 var(--sp-1); }
.empty-note { color: var(--ink3); padding: 2rem 0; text-align: center; }

/* Metrics histogram (single-series magnitude, seam accent). Bars keep a
   2px surface gap via column gap; data-ends rounded 4px; labels wear
   ink tokens, never the series color. */
.histogram {
  display: flex; align-items: flex-end; gap: 2px;
  height: 180px; padding-top: 1.4rem;
}
.histogram__col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; height: 100%; position: relative; min-width: 0;
}
.histogram__bar {
  width: 100%; max-width: 3.2rem;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.histogram__col[title]:hover .histogram__bar { background: var(--accent-hov); }
.histogram__tick {
  color: var(--ink3); font-size: var(--fs-label); margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.histogram__peak-label {
  position: absolute; top: 0; color: var(--ink2); font-size: var(--fs-label);
  font-variant-numeric: tabular-nums;
}
.histogram-table { margin-top: 0.9rem; }
.histogram-table summary { color: var(--ink3); font-size: var(--fs-meta); cursor: pointer; }

/* Landing bands (Kinetic landing feel on the shared tokens; deep bg via
   body.landing in tokens.css). */
.band { max-width: 68rem; margin: 0 auto; padding: 3.2rem 0 1rem; }
.band--hero { padding-top: 4.5rem; text-align: left; }
.band__kicker { color: var(--accent); letter-spacing: 0.18em; text-transform: uppercase; font-size: var(--fs-meta); font-weight: 600; margin-bottom: 1rem; }
.hero__title { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; margin: 0 0 1rem; font-weight: 800; }
.hero__lead { color: var(--ink2); font-size: 1.15rem; max-width: 42rem; line-height: 1.6; }
.hero__ctas { display: flex; gap: 0.8rem; margin: 1.6rem 0 2.2rem; flex-wrap: wrap; }
.stat-strip--hero { margin-bottom: 0; }
.band__title { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.25; margin: 0 0 1.4rem; font-weight: 700; }
.band__lead { color: var(--ink2); max-width: 44rem; line-height: 1.6; }
.band__link { font-weight: 600; }
.cols-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.9rem; }
.card h3 { font-family: var(--font-display); margin: 0 0 0.5rem; font-size: var(--fs-card); font-weight: 800; }
.card p { font-size: var(--fs-table); line-height: 1.55; color: var(--ink2); margin: 0; }
.card__num { color: var(--accent); font-family: var(--font-display); font-weight: 800; margin-bottom: 0.4rem; }
.price { font-family: var(--font-display); font-size: var(--fs-mast); font-weight: 800; color: var(--ink); margin: 0.2rem 0 0.5rem; }
.band--honest .honest-list { list-style: none; padding: 0; max-width: 46rem; }
.band--honest .honest-list li { padding-left: 1.4rem; position: relative; margin-bottom: 0.8rem; color: var(--ink2); line-height: 1.55; }
.band--honest .honest-list li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

/* Pricing states + waitlist + flash */
.tier-state, .card .tier-state { font-size: var(--fs-meta); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin: 0.9rem 0 0.4rem; }
.tier-state--live { color: var(--ok); }
.tier-state--soon { color: var(--warn); }
.tier-state--waitlist { color: var(--ink3); }
.waitlist-form { display: flex; gap: 0.4rem; margin-top: 0.5rem; flex-wrap: wrap; }
.waitlist-form input[type="email"] { flex: 1; width: auto; min-width: 9rem; }
.flash { border-radius: var(--r-control); padding: 0.6rem 0.9rem; margin-bottom: 1rem; font-size: var(--fs-table); }
.flash--notice { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.flash--alert { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }

/* Auth pages: one centered card (design review 2026-09-14). */
.auth { min-height: calc(100vh - 8rem); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; padding: 1rem 0 2rem; }
.auth__brand { color: var(--accent); }
.auth-card {
  width: 100%; max-width: 26rem; background: var(--surface); border: 1px solid var(--line-10);
  border-radius: var(--r-card); padding: 2rem; box-shadow: 0 12px 40px var(--shadow-c);
}
.auth-card__title { font-family: var(--font-display); font-size: 1.375rem; font-weight: 800; line-height: 1.2; text-align: center; margin: 0 0 1.25rem; }
.auth-card__lead { font-size: var(--fs-meta); color: var(--ink2); text-align: center; margin: -0.5rem 0 1.25rem; line-height: 1.5; text-wrap: pretty; }
.auth-card .flash { margin-bottom: 1rem; }
.auth-card .button--block { margin-top: 0.25rem; }
.auth-card__links { text-align: center; font-size: var(--fs-table); color: var(--ink2); margin: 1.25rem 0 0; }
body.auth-page .app-main { padding-top: 5rem; }
.app-header .nav-cta { color: var(--accent) !important; font-weight: 600; }
.nav-signout { font-size: var(--fs-meta); }
.console-nav { display: flex; gap: 1rem; margin-bottom: 1.6rem; border-bottom: 1px solid var(--line-8); padding-bottom: 0.7rem; }
.console-nav a { color: var(--ink2); font-size: var(--fs-table); }
.console-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.key-reveal { border-color: var(--accent-35); margin-bottom: 1.6rem; }

/* App shell (bridge brief screenshots 05-08): topbar, left sidebar,
   content CENTERED in the main pane, k-card idiom with ALL-CAPS labels,
   share bars with explicit % labels, legends under misreadable numbers. */
.shell-body { display: block; }
.shell-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between;
  align-items: center; padding: 0.6rem 1.25rem; background: var(--nav-bg);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-8);
}
.shell-topbar__brand { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.shell-topbar__crumb { color: var(--ink3); font-size: var(--fs-table); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-topbar__links { display: flex; gap: 0.9rem; align-items: center; }
.shell-topbar__links a { color: var(--ink2); font-size: var(--fs-table); }
.shell-topbar__links a:hover { color: var(--ink); }
.shell-avatar { width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent);
  color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-meta); }
.shell-frame { display: flex; min-height: calc(100vh - 53px); }
.shell-sidebar { width: 200px; flex-shrink: 0; border-right: 1px solid var(--line-8);
  padding: 1.2rem 0.8rem; display: flex; flex-direction: column; gap: 0.2rem; }
.shell-sidebar a { display: block; padding: 0.5rem 0.8rem; border-radius: 8px;
  color: var(--ink2); font-size: var(--fs-table); }
.shell-sidebar a:hover { color: var(--ink); background: var(--line-4); }
.shell-sidebar a[aria-current="page"] { color: var(--accent); background: var(--accent-08); font-weight: 600; }
.shell-sidebar__foot { margin-top: auto; }
.shell-main { flex: 1; padding: 2rem 1.25rem 4rem; }
.shell-content { max-width: 52rem; margin: 0 auto; }
/* Compact shell (one boundary, 860px): the sidebar folds into the topbar drawer — same partial, every section stays reachable. */
.shell-drawer { display: none; position: relative; }
.shell-drawer > summary { list-style: none; cursor: pointer; border: 1px solid var(--line-18); color: var(--ink2); background: transparent; }
.shell-drawer > summary::-webkit-details-marker { display: none; }
.shell-drawer[open] > summary { color: var(--ink); border-color: var(--accent-35); }
.shell-drawer__panel {
  position: absolute; top: calc(100% + 0.6rem); left: 0; z-index: 30; min-width: 14rem; max-width: calc(100vw - 2rem);
  background: var(--surface); border: 1px solid var(--line-10); border-radius: var(--r-card); box-shadow: 0 16px 40px var(--shadow-c);
  padding: 0.6rem; max-height: calc(100vh - 5rem); overflow-y: auto;
}
.shell-drawer__panel a { display: block; padding: 0.5rem 0.8rem; border-radius: var(--r-control); color: var(--ink2); font-size: var(--fs-table); }
.shell-drawer__panel a[aria-current="page"] { color: var(--accent); background: var(--accent-08); font-weight: 600; }
.shell-drawer__panel .shell-sidebar__foot { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--line-8); }
@media (max-width: 860px) {
  .shell-sidebar { display: none; }
  .shell-drawer { display: block; }
  .shell-topbar { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .shell-topbar__crumb { display: none; }
  .shell-main { padding: 1.25rem 0.875rem 3rem; }
}

body.landing .k-card { border-radius: var(--r-card-public); }
.k-label { font-size: var(--fs-label); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink3); font-weight: 400; margin-bottom: var(--sp-1); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.8rem; margin-bottom: 1.2rem; }
.kpi { background: var(--surface); border: 1px solid var(--line-8); border-radius: var(--r-card); padding: 0.875rem 1rem; min-height: 5.25rem; }
.kpi__value { font-family: var(--font-display); font-size: var(--fs-mast); font-weight: 800; }
.kpi__value--accent { color: var(--accent); }
.kpi__hint { color: var(--ink3); font-size: var(--fs-label); margin-top: 0.15rem; }
.share-bar { display: inline-block; width: 7rem; height: 6px; border-radius: 3px;
  background: var(--line-8); vertical-align: middle; margin-right: 0.5rem; position: relative; overflow: hidden; }
.share-bar__fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; }
.k-legend { color: var(--ink3); font-size: var(--fs-label); line-height: 1.5; margin-top: 0.8rem; }

/* Explorer leaderboard grouped by evidence tier (handoff 2, approved
   2026-08-22). Pairs with table-layout:fixed + identical <colgroup> on
   the header table and every group table (single partial = single
   source of widths). */
.grp{border-bottom:1px solid var(--line-8)}
.grp:last-child{border-bottom:0}
.grp>summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:1fr auto auto auto;align-items:center;gap:1rem;padding:.85rem 0}
.grp>summary::-webkit-details-marker{display:none}
.grp>summary:hover .grp__name{color:var(--accent)}
.grp>summary::after{content:"+";color:var(--ink3);font-family:ui-monospace,monospace;width:1rem;text-align:center}
.grp[open]>summary::after{content:"\2013"}
.grp__name{font-family:var(--font-display);font-weight:700;font-size:var(--fs-table);display:flex;align-items:center;gap:.6rem;transition:color .2s var(--ease)}
.grp__count{color:var(--ink3);font-size:var(--fs-meta);font-variant-numeric:tabular-nums;white-space:nowrap}
.grp__bar{width:150px;height:8px;border-radius:4px;background:var(--line-10);overflow:hidden}
.grp__bar i{display:block;height:100%;background:var(--accent);border-radius:4px}
.grp__bar i.mute{background:var(--line-18)}
.grp table,.grp-head{table-layout:fixed}
.grp table{margin-bottom:.9rem}
.grp-head{margin:0}
.grp thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.grp__more{font-size:var(--fs-meta);color:var(--ink2);margin:0 0 .9rem}
@media(max-width:720px){.grp__bar{display:none}}
