/* TradeTrack — Shell + Primitive Component Styles
 * Ported from docs/DesignSystem/reference/tt-shell.css plus the .tt-filters
 * primitives that live in tt-holdings.css in the reference.
 */

/* ── App layout ───────────────────────────────────────────────── */
.tt-app {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
  background: var(--bg-deep);
}
.tt-app.is-collapsed { grid-template-columns: 64px 1fr; }
.tt-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
}
.tt-page {
  padding: 24px 32px 64px;
  max-width: 1640px;
  width: 100%;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.tt-side {
  background: var(--bg-base);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.tt-side.is-collapsed .tt-side__sec-label { display: none; }

.tt-side__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.tt-side.is-collapsed .tt-side__top { padding: 18px 8px; justify-content: center; }
.tt-side__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.tt-logo { display: flex; align-items: center; gap: 12px; }
.tt-logo__word { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.tt-logo__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.tt-logo__tag {
  font-size: 13.125px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 2px;
}
.tt-side.is-collapsed .tt-logo__word { display: none; }
.tt-side__collapse {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--ink-4);
  flex-shrink: 0;
}
.tt-side__collapse:hover { color: var(--ink); background: var(--bg-overlay); }
.tt-side.is-collapsed .tt-side__collapse { position: absolute; right: -11px; top: 22px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 50%; }

.tt-side__nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 24px;
}
.tt-side.is-collapsed .tt-side__nav { padding: 16px 8px; }
.tt-side__sec { margin-bottom: 18px; }
.tt-side__sec-label {
  font-size: 13.125px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-5);
  padding: 8px 12px 6px;
  font-weight: 500;
}
.tt-side__sec ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; }
.tt-side__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 16.875px;
  text-align: left;
  transition: background .12s ease, color .12s ease;
}
.tt-side.is-collapsed .tt-side__item { justify-content: center; padding: 9px 6px; }
.tt-side.is-collapsed .tt-side__label,
.tt-side.is-collapsed .tt-side__badge,
.tt-side.is-collapsed .tt-side__spinner,
.tt-side.is-collapsed .tt-side__soon { display: none; }
.tt-side__item:hover { background: var(--bg-overlay); color: var(--ink); }
.tt-side__item.is-active {
  background: var(--bg-overlay);
  color: var(--ink);
  position: relative;
}
.tt-side__item.is-active::before {
  content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px;
  width: 2.5px; background: var(--accent); border-radius: 0 2px 2px 0;
}
.tt-side__item.is-active .tt-side__icon { color: var(--accent); }
.tt-side__item.is-soon { color: var(--ink-5); cursor: default; }
.tt-side__item.is-soon:hover { background: transparent; color: var(--ink-5); }
.tt-side__icon {
  display: grid; place-items: center;
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.9;
}
.tt-side__label { flex: 1; white-space: nowrap; }
.tt-side__soon {
  font-size: 11.875px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-5);
  background: var(--bg-overlay);
  padding: 1px 6px;
  border-radius: 999px;
}
.tt-side__badge {
  font-family: var(--font-mono);
  font-size: 13.125px;
  background: var(--signal-soft);
  color: var(--signal);
  padding: 1.5px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.tt-side__badge.is-warn { background: var(--warn-soft); color: var(--warn); }
.tt-side__spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: var(--signal);
  animation: tt-spin .7s linear infinite;
  flex-shrink: 0;
}

.tt-side__foot { padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.tt-side.is-collapsed .tt-side__foot { display: none; }

/* Custom Analysis pages: "+" create entry, custom-page list, empty hint, and name modal. */
.tt-side__sec-head { display: flex; align-items: center; }
.tt-side__sec-head .tt-side__sec-label { flex: 1; }
.tt-side__add {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  margin-right: 4px;
  border-radius: 6px;
  color: var(--ink-4);
  transition: background .12s ease, color .12s ease;
}
.tt-side__add:hover { color: var(--accent); background: var(--bg-overlay); }
.tt-side.is-collapsed .tt-side__add { display: none; }
.tt-side__custom-dot {
  display: grid; place-items: center;
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: var(--ink-5);
}
.tt-side__custom-dot::before {
  content: ""; width: 7px; height: 7px;
  border-radius: 50%; border: 1.5px solid currentColor;
}
.tt-side__item.is-active .tt-side__custom-dot { color: var(--accent); }
.tt-side__custom-empty {
  padding: 4px 12px 6px;
  color: var(--ink-5);
  font-size: 13.75px;
  line-height: 1.4;
}
.tt-side.is-collapsed .tt-side__custom-empty { display: none; }

.tt-modal-scrim {
  position: fixed; inset: 0;
  z-index: 2000;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(2, 6, 12, 0.68);
  opacity: 0;
  transition: opacity .16s ease;
}
/* The author display:grid above outranks the UA [hidden] rule, so restore it explicitly - otherwise
   the invisible (opacity:0) scrim would cover the viewport and swallow every click before it opens. */
.tt-modal-scrim[hidden] { display: none; }
.tt-modal-scrim.is-open { opacity: 1; }
.page-name-modal {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-raised);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  padding: 20px;
  transform: translateY(6px);
  transition: transform .16s ease;
}
.tt-modal-scrim.is-open .page-name-modal { transform: translateY(0); }
.page-name-modal__kicker {
  margin-bottom: 6px;
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-name-modal__title { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.page-name-modal__sub { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.page-name-modal__input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-deep);
  color: var(--ink);
  font-size: 16px;
}
.page-name-modal__input:focus-visible { outline: none; border-color: var(--accent); }
.page-name-modal__route {
  margin: 8px 0 0;
  display: flex; align-items: center; gap: 8px;
}
.page-name-modal__route-label {
  color: var(--ink-5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11.875px;
}
.page-name-modal__slug { font-family: var(--font-mono); font-size: 13.75px; color: var(--ink-4); }
.page-name-modal__error { margin: 10px 0 0; color: var(--neg); font-size: 13.75px; line-height: 1.4; }
.page-name-modal__actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 18px;
}

/* ── Settings: manage custom pages (design spec Section D) ── */
.pages-manage td { vertical-align: middle; }
.pages-manage__row-name { display: flex; align-items: center; gap: 8px; }
.pages-manage__name-link { color: var(--ink); font-weight: 500; text-decoration: none; }
.pages-manage__name-link:hover { color: var(--accent); }
.pages-manage__name-input {
  height: 28px; width: 220px; max-width: 100%; padding: 0 8px;
  font-size: 14.5px; color: var(--ink);
  background: var(--bg-deep); border: 1px solid var(--accent); border-radius: var(--r-1);
}
.pages-manage__name-input:focus-visible { outline: none; }
.pages-manage__route { font-family: var(--font-mono); font-size: 13px; color: var(--ink-4); }
.pages-manage__metrics-preview { display: flex; gap: 4px; flex-wrap: wrap; }
.pages-manage__metric-chip {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-4);
  background: var(--bg-overlay); border-radius: 3px; padding: 1px 5px;
}
.pages-manage__metric-chip--more { color: var(--ink-5); }
.pages-manage__actions { display: flex; gap: 6px; justify-content: flex-end; }
.pages-manage__confirm { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pages-manage__confirm span { font-size: 13px; color: var(--warn); }
.pages-manage__error { margin: 8px 0 0; color: var(--neg); font-size: 13px; line-height: 1.4; text-align: right; }
/* An author display:flex outranks the UA [hidden] rule, so restore it for the toggled groups
   (same gotcha as .tt-modal-scrim[hidden] above) - otherwise a hidden group would still render. */
.pages-manage__actions[hidden], .pages-manage__confirm[hidden] { display: none; }

/* Brand mark — three-stem T in a vertical bronze gradient */
.tt-mark {
  width: 28px; height: 28px;
  display: block;
  flex-shrink: 0;
}

/* ── Topbar ───────────────────────────────────────────────────── */
.tt-top {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 520px) auto;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(to bottom, var(--bg-base), var(--bg-deep));
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.tt-top__crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 16.875px;
  color: var(--ink-3);
  min-width: 0;
}
.tt-crumb { white-space: nowrap; }
.tt-crumb.is-last { color: var(--ink); font-weight: 500; }
.tt-crumb__sep { margin: 0 6px; color: var(--ink-5); }

.tt-top__search {
  display: flex; align-items: center;
  gap: 9px;
  padding: 0 12px;
  height: 36px;
  background: var(--bg-base);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
  transition: border-color .15s ease, background .15s ease;
}
.tt-top__search:focus-within { border-color: var(--bronze); background: var(--bg-raised); }
.tt-top__search:focus-within kbd { opacity: 0.4; }
.tt-top__search svg { color: var(--ink-4); flex-shrink: 0; }
.tt-top__search input {
  flex: 1; min-width: 0;
  background: transparent;
  border: 0;
  font-size: 16.25px;
  outline: none;
  color: var(--ink);
}
.tt-top__search input::placeholder { color: var(--ink-4); }
.tt-top__search kbd {
  font-family: var(--font-mono);
  font-size: 13.75px;
  padding: 1.5px 6px;
  background: var(--bg-overlay);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--ink-3);
}

.tt-top__right { display: flex; align-items: center; gap: 16px; justify-self: end; }
.tt-scope {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--bg-base);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
}
.tt-scope__label {
  font-size: 13.125px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-4);
}
.tt-scope select {
  background: transparent; border: 0; outline: none;
  font-size: 16.25px; color: var(--ink);
  cursor: pointer;
}
.tt-scope select option {
  background: #ffffff;
  color: #111827;
}
.tt-market { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-3); }
.tt-market__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); box-shadow: 0 0 0 3px transparent; }
.tt-market.is-open .tt-market__dot { background: var(--pos); box-shadow: 0 0 0 3px var(--pos-soft); }
.tt-market-session { display: flex; align-items: center; min-width: 0; max-width: 270px; font-size: 15px; color: var(--ink-4); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Analysis data-confidence chip (plan item 3.1): Complete = green, Gaps = amber, Unreliable = red. */
.tt-dq { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-3); cursor: default; white-space: nowrap; }
.tt-dq__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); box-shadow: 0 0 0 3px transparent; }
.tt-dq.is-complete .tt-dq__dot { background: var(--pos); box-shadow: 0 0 0 3px var(--pos-soft); }
.tt-dq.is-gaps .tt-dq__dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.tt-dq.is-unreliable .tt-dq__dot { background: var(--neg); box-shadow: 0 0 0 3px var(--neg-soft); }
.tt-dq.is-gaps .tt-dq__label { color: var(--warn); }
.tt-dq.is-unreliable .tt-dq__label { color: var(--neg); }
.tt-build {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13.75px;
  color: var(--ink-4);
  white-space: nowrap;
}
.tt-build span {
  color: var(--ink-5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tt-build strong {
  color: var(--ink-3);
  font-weight: 500;
}

/* -- QuoteService status badge ------------------- */
/* Calm informational pill - not alarming. Online = positive (pos),
   Offline = muted (ink-4). Mirrors the tt-market dot/label idiom. */
.tt-qs-status { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-3); }
.tt-qs-status__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); box-shadow: 0 0 0 3px transparent; }
.tt-qs-status.is-online .tt-qs-status__dot { background: var(--pos); box-shadow: 0 0 0 3px var(--pos-soft); }
.tt-qs-status.is-online .tt-qs-status__label { color: var(--ink-3); }
.tt-qs-status.is-offline .tt-qs-status__dot { background: var(--ink-4); }
.tt-qs-status.is-offline .tt-qs-status__label { color: var(--ink-4); }

/* -- QuoteService status popover ------------------- */
.tt-qs-status { position: relative; cursor: default; }
.tt-qs-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  max-width: 420px;
  background: var(--bg-elevated, var(--bg-base));
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  z-index: 200;
  white-space: nowrap;
}
.tt-qs-status:hover .tt-qs-pop,
.tt-qs-status:focus-within .tt-qs-pop,
.tt-qs-status.is-open .tt-qs-pop { opacity: 1; pointer-events: auto; }
.tt-qs-pop__rows { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13.75px; }
.tt-qs-pop__rows dt { color: var(--ink-4); font-weight: 500; }
.tt-qs-pop__rows dd { color: var(--ink-2); margin: 0; }
/* -- QuoteService endpoint editor ------------------- */
.tt-qs-pop__editor { margin-top: 9px; border-top: 1px solid var(--line-soft); padding-top: 7px; white-space: normal; }
.tt-qs-pop__editor-header { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.tt-qs-pop__editor-label { font-size: 12.5px; font-weight: 500; color: var(--ink-4); text-transform: uppercase; letter-spacing: .04em; }
.tt-qs-pop__override-badge { font-size: 12.5px; color: var(--warn, #e5a000); background: var(--warn-soft, rgba(229,160,0,.12)); border-radius: 3px; padding: 1px 5px; }
.tt-qs-pop__editor-controls { display: flex; gap: 4px; align-items: center; }
.tt-qs-pop__input { flex: 1; min-width: 0; font-size: 13.75px; padding: 3px 6px; border: 1px solid var(--line-soft); border-radius: var(--r-1, 3px); background: var(--bg-base); color: var(--ink-1); }
.tt-qs-pop__btn { font-size: 12.5px; padding: 3px 8px; border: 1px solid var(--line-soft); border-radius: var(--r-1, 3px); background: var(--bg-elevated, var(--bg-base)); color: var(--ink-2); cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.tt-qs-pop__btn:hover { background: var(--bg-subtle, var(--bg-base)); }
.tt-qs-pop__btn--reset { color: var(--ink-4); }
.tt-qs-pop__editor-msg { font-size: 12.5px; margin-top: 4px; }
.tt-qs-pop__editor-msg.is-ok { color: var(--pos, #22c55e); }
.tt-qs-pop__editor-msg.is-err { color: var(--neg, #ef4444); }

/* -- Offline "Reduced mode" banner --------- */
/* Full-width strip above the app shell. Rendered by both the Razor _Layout.cshtml and the
   Blazor TradeTrackLayout.razor; toggled live by quote-status.js from the same
   /api/quote-status signal that drives the soft degrade gate. Plain block element with no
   `display` here, so the [hidden] attribute hides it natively when QuoteService is online. */
.tt-degraded-notice { background: #7a3b00; color: #fff; padding: 6px 12px; font-size: 1.062rem; }

/* ── Card ─────────────────────────────────────────────────────── */
.tt-card {
  background: var(--bg-base);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  overflow: hidden;
}
.tt-card.is-padded .tt-card__head { padding: 16px var(--pad-card) 0; }
.tt-card.is-padded .tt-card__body { padding: 12px var(--pad-card) var(--pad-card); }
.tt-card__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
}
.tt-card__title-wrap { min-width: 0; }
.tt-card__kicker {
  font-size: 13.125px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 4px;
}
.tt-card__title {
  font-size: var(--fs-h6);
  font-weight: 500;
  color: var(--ink);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.tt-card__action { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.review-batch-header .tt-card__body {
  display: grid;
  gap: 14px;
}
.review-batch-picker {
  display: grid;
  gap: 6px;
}
.review-batch-picker__label {
  font-size: 13.75px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.review-batch-picker__list {
  width: min(100%, 1120px);
  display: grid;
  gap: 0;
}
.review-batch-picker__primary,
.review-batch-picker__option-main {
  color: var(--ink);
  font-weight: 600;
}
.review-batch-picker__meta,
.review-batch-picker__option-meta,
.review-batch-picker__option-foot {
  color: var(--ink-3);
  font-size: 15px;
}
.review-batch-picker__option {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(260px, 1.4fr) auto;
  align-items: center;
  column-gap: 16px;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink);
  text-align: left;
  white-space: normal;
}
.review-batch-picker__option:first-child {
  border-top: 0;
}
.review-batch-picker__option:hover,
.review-batch-picker__option:focus,
.review-batch-picker__option.is-selected {
  background: var(--bg-overlay);
  color: var(--ink);
  outline: none;
}
.review-batch-picker__source {
  color: var(--ink-2);
  font-weight: 500;
}
.review-batch-picker__option-foot {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px 10px;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}
.review-batch-picker__option-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.review-batch-picker__option-main {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 820px) {
  .review-batch-picker__option {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .review-batch-picker__option-foot {
    justify-content: flex-start;
    flex-wrap: wrap;
    white-space: normal;
  }
  .review-batch-picker__option-meta,
  .review-batch-picker__option-main {
    white-space: normal;
  }
}
.review-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 12, 0.68);
}
.review-confirm-modal__panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-raised);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  padding: 18px;
}
.review-confirm-modal__kicker {
  margin-bottom: 6px;
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.review-confirm-modal__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}
.review-confirm-modal__message {
  margin: 0;
  color: var(--ink-2);
  font-size: 16.25px;
  line-height: 1.45;
}
.review-confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.review-auto-recheck-alert {
  align-items: center;
  border: 1px solid rgba(248, 113, 113, 0.55);
  box-shadow: inset 4px 0 0 var(--neg);
  font-size: 18.75px;
  line-height: 1.45;
  padding: 16px 18px;
}
.review-auto-recheck-alert strong,
.review-auto-recheck-alert span {
  display: block;
}
.review-auto-recheck-alert strong {
  font-size: 17px;
  line-height: 1.25;
}
.review-auto-recheck-alert span {
  margin-top: 3px;
  color: var(--ink-2);
}
.review-auto-recheck-lock {
  opacity: 0.58;
}
.review-auto-recheck-lock .tt-table-wrap,
.review-auto-recheck-lock .review-state-form {
  filter: grayscale(0.7);
}
.review-auto-recheck-lock .review-state-form,
.review-auto-recheck-lock .tt-table a {
  pointer-events: none;
}
.opening-repair-status-head,
.opening-repair-status-cell {
  text-align: center;
}
.opening-repair-status-cell {
  vertical-align: middle;
}
.opening-repair-checkmark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--neg);
  position: relative;
}
.opening-repair-checkmark::before {
  content: "";
  position: absolute;
  width: 7px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.opening-repair-set-head {
  padding: 14px var(--pad-card);
  border-bottom: 1px solid var(--line-soft);
}
.tt-hint {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--ink-4);
  background: var(--bg-overlay);
  cursor: help;
  user-select: none;
}
.tt-hint:hover { color: var(--ink); }

/* ── KPI ──────────────────────────────────────────────────────── */
.tt-kpi {
  display: flex; flex-direction: column;
  gap: 6px;
  padding: 16px 18px 14px;
  background: var(--bg-base);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  min-width: 0;
  position: relative;
}
.tt-kpi.is-tall { padding: 22px 22px 20px; }
.tt-kpi__label {
  font-size: 13.75px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: flex; align-items: center; gap: 4px;
}
.tt-kpi__value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  font-feature-settings: "lnum", "tnum";
}
.tt-kpi.is-tall .tt-kpi__value { font-size: 44px; }
.tt-kpi__note { font-size: 14.375px; color: var(--ink-4); }
.tt-kpi.kpi-pos .tt-kpi__value { color: var(--pos); }
.tt-kpi.kpi-neg .tt-kpi__value { color: var(--neg); }
.tt-kpi.kpi-warn .tt-kpi__value { color: var(--warn); }
.tt-kpi.kpi-blue .tt-kpi__value { color: var(--signal); }
.tt-kpi.kpi-bronze .tt-kpi__value { color: var(--bronze); }

/* ── Money / Pct ──────────────────────────────────────────────── */
.tt-money, .tt-pct { font-variant-numeric: tabular-nums; }
.tt-money.is-pos, .tt-pct.is-pos { color: var(--pos); }
.tt-money.is-neg, .tt-pct.is-neg { color: var(--neg); }

/* ── Pills ────────────────────────────────────────────────────── */
.tt-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13.75px;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-overlay);
  color: var(--ink-2);
}
.tt-pill--pos { color: var(--pos); border-color: transparent; background: var(--pos-soft); }
.tt-pill--neg { color: var(--neg); border-color: transparent; background: var(--neg-soft); }
.tt-pill--warn { color: var(--warn); border-color: transparent; background: var(--warn-soft); }
.tt-pill--bronze { color: var(--bronze); border-color: transparent; background: var(--bronze-soft); }
.tt-pill--signal { color: var(--signal); border-color: transparent; background: var(--signal-soft); }
.tt-pill.is-soft { opacity: 0.7; }

/* ── Buttons ──────────────────────────────────────────────────── */
.tt-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: var(--bg-base);
  color: var(--ink-2);
  font-size: 15.625px;
  transition: all .12s ease;
  cursor: pointer;
}
.tt-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--bg-raised); }
.tt-btn.is-primary { background: var(--bronze); border-color: var(--bronze); color: oklch(0.18 0.014 60); }
.tt-btn.is-primary:hover { background: var(--bronze-deep); border-color: var(--bronze-deep); }
.tt-btn.is-ghost { border-color: transparent; background: transparent; }
.tt-btn.is-ghost:hover { background: var(--bg-overlay); }
.tt-btn.is-active { background: var(--bg-deep); border-color: var(--accent); color: var(--accent); }
.tt-btn--sm { height: 24px; padding: 0 8px; font-size: 14.375px; }
.tt-icon-btn {
  width: 28px;
  padding: 0;
  justify-content: center;
}
.tt-icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tt-icon-btn.tt-btn--sm {
  width: 24px;
  padding: 0;
}
.tt-btn--danger { border-color: var(--neg); color: var(--neg); }
.tt-btn--danger:hover { background: var(--neg-soft); border-color: var(--neg); color: var(--neg); }
.tt-btn--warn { border-color: var(--warn); color: var(--warn); }
.tt-btn--warn:hover { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.tt-btn--success { border-color: var(--pos); color: var(--pos); }
.tt-btn--success:hover { background: var(--pos-soft); border-color: var(--pos); color: var(--pos); }
.tt-btn:disabled,
.tt-btn.is-loading {
  cursor: wait;
  opacity: 0.72;
  pointer-events: none;
}
.tt-spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: tt-spin .7s linear infinite;
}
@keyframes tt-spin {
  to { transform: rotate(360deg); }
}

/* ── Segmented control ───────────────────────────────────────── */
.tt-segmented {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
  background: var(--bg-base);
  padding: 2px;
  gap: 0;
}
.tt-segmented button,
.tt-segmented a {
  padding: 4px 10px;
  font-size: 14.375px;
  border-radius: 5px;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
}
.tt-segmented button.is-active,
.tt-segmented button.active,
.tt-segmented a.is-active,
.tt-segmented a.active { background: var(--bg-deep); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.tt-segmented button:hover:not(.is-active):not(.active),
.tt-segmented a:hover:not(.is-active):not(.active) { color: var(--ink); }
.tt-segmented__disabled {
  padding: 4px 10px;
  font-size: 14.375px;
  border-radius: 5px;
  color: var(--ink-3);
  opacity: 0.55;
  white-space: nowrap;
}
.tt-segmented__sep {
  color: var(--ink-3);
  font-size: 12.5px;
  opacity: 0.4;
  padding: 0 2px;
  pointer-events: none;
  align-self: center;
}

/* ── Table ────────────────────────────────────────────────────── */
.tt-table-wrap {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-3);
  overflow: auto;
  background: var(--bg-base);
}
.tt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-small);
}
.tt-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-base);
  padding: 10px var(--pad-cell-x);
  text-align: left;
  font-size: 13.125px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  user-select: none;
  white-space: nowrap;
}
.tt-table tbody td {
  padding: var(--pad-cell-y) var(--pad-cell-x);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: middle;
  font-size: var(--fs-body);
}
.tt-table tbody tr:hover td { background: var(--bg-raised); color: var(--ink); }
.tt-table tbody tr:last-child td { border-bottom: 0; }
.tt-table .right { text-align: right; }
.tt-table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tt-table .sym {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.tt-table .sym__name { font-weight: 400; color: var(--ink-3); margin-left: 6px; font-size: 14.375px; }
.tt-table tr.is-clickable td { cursor: pointer; }

.review-row-context {
  display: grid;
  gap: 8px;
  min-width: 520px;
}
.review-row-context__record {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
  background: var(--bg-deep);
}
.review-row-context__record summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 13.125px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.review-row-context__source {
  display: grid;
  gap: 4px;
  padding: 0 10px 8px;
  color: var(--ink-4);
}
.review-row-context__source code {
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}
.review-row-context__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 10px;
  padding: 0 10px 10px;
  margin: 0;
}
.review-row-context__fields div {
  min-width: 0;
}
.review-row-context__fields dt {
  color: var(--ink-4);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.review-row-context__fields dd {
  margin: 1px 0 0;
}
.review-row-context__fields code {
  color: var(--ink-2);
  white-space: normal;
  overflow-wrap: anywhere;
}

.tt-th-sortable { cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.tt-th-sortable:hover { color: var(--ink-2); }

/* ── Filters bar (used above tables) ──────────────────────────── */
.tt-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-2);
}
.tt-filter {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-1);
  padding: 0 10px;
  height: 30px;
}
.tt-filter__lbl {
  font-size: 13.125px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.tt-filter select, .tt-filter input {
  background: var(--bg-raised);
  border: 0;
  outline: none;
  font-size: 15.625px;
  color: var(--ink);
}
.tt-filter select option {
  background: var(--bg-raised);
  color: var(--ink);
}
.tt-filter--search { padding: 0 10px; min-width: 200px; flex: 1; max-width: 320px; }
.tt-filter--search svg { color: var(--ink-4); }
.tt-filter--search input { flex: 1; }

/* ── Grid helpers ─────────────────────────────────────────────── */
.tt-grid { display: grid; gap: 16px; }
.tt-grid--kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tt-grid--kpis-tall { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tt-row { display: flex; align-items: center; gap: 10px; }
.tt-row--between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tt-row--wrap { flex-wrap: wrap; }
.tt-col { display: flex; flex-direction: column; gap: 10px; }
.tt-stack { display: flex; flex-direction: column; gap: 16px; }

/* ── Section header ───────────────────────────────────────────── */
.tt-section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 28px 0 14px;
  gap: 16px;
}
.tt-section-h:first-child { margin-top: 0; }
.tt-section-h h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.tt-section-h .tt-section-sub { color: var(--ink-3); font-size: 16.25px; }

/* ── Page heading ─────────────────────────────────────────────── */
.tt-page-h {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.tt-page-h__title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.0;
}
.tt-page-h__kicker {
  font-size: 13.75px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 500;
}
.tt-page-h__sub {
  color: var(--ink-3);
  font-size: 17.5px;
  margin-top: 8px;
  max-width: 60ch;
}
.review-page-heading .tt-page-h__sub {
  max-width: none;
}
.tt-page-h__right { display: flex; align-items: center; gap: 10px; }

/* ── Alert / Banner ───────────────────────────────────────────── */
.tt-alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  font-size: 15.625px;
  color: var(--ink-2);
}
.tt-alert--warn { background: var(--warn-soft); border-color: transparent; color: var(--ink); }
.tt-alert--warn strong { color: var(--warn); }
.tt-alert--info { background: var(--signal-soft); border-color: transparent; color: var(--ink); }
.tt-alert--info strong { color: var(--signal); }
.tt-alert--success { background: var(--pos-soft); border-color: transparent; color: var(--ink); }
.tt-alert--success strong { color: var(--pos); }
.tt-alert--danger { background: var(--neg-soft); border-color: transparent; color: var(--ink); }
.tt-alert--danger strong { color: var(--neg); }
.tt-alert--pos { --alert-line: var(--pos); background: var(--pos-soft); border-color: transparent; color: var(--ink); }
.tt-alert--pos strong { color: var(--pos); }
.tt-alert--neg { --alert-line: var(--neg); background: var(--neg-soft); border-color: transparent; color: var(--ink); }
.tt-alert--neg strong { color: var(--neg); }
.opening-repair-instructions {
  display: block;
}
.opening-repair-instructions summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 13.125px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.opening-repair-instructions p {
  margin-top: 8px;
  line-height: 1.45;
}
.tt-alert--bg-work {
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 15px;
  line-height: 1.25;
}
.tt-bg-work__body { min-width: 0; }
.tt-bg-work__title {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}
.tt-bg-work__list {
  margin: 1px 0 0;
  padding-left: 16px;
}
.tt-bg-work__list li { margin: 0; }

/* ── Empty state ──────────────────────────────────────────────── */
.tt-empty {
  padding: 60px 30px;
  text-align: center;
  color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.tt-empty h4 { font-family: var(--font-display); font-size: 22px; color: var(--ink); font-weight: 400; }

/* ── Wireframe stub ───────────────────────────────────────────── */
.tt-wire {
  border: 1px dashed var(--line-strong);
  background: repeating-linear-gradient(
    -45deg,
    transparent, transparent 8px,
    var(--bg-inset) 8px, var(--bg-inset) 9px
  );
  border-radius: var(--r-3);
  padding: 28px;
  color: var(--ink-3);
  text-align: center;
}
.tt-wire__kicker { font-size: 13.125px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4); }
.tt-wire h5 { font-family: var(--font-display); font-size: 22px; color: var(--ink); margin: 6px 0 4px; font-weight: 400; }

/* ── Accordion ────────────────────────────────────────────────── */
.tt-acc { border-radius: var(--r-3); border: 1px solid var(--line-soft); overflow: hidden; background: var(--bg-base); }
.tt-acc__item { border-bottom: 1px solid var(--line-soft); }
.tt-acc__item:last-child { border-bottom: 0; }
.tt-acc__head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  background: transparent;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.tt-acc__head:hover { background: var(--bg-raised); }
.tt-acc__head h4 { font-family: var(--font-display); font-size: 18px; font-weight: 400; }
.tt-acc__sub { font-size: 15px; color: var(--ink-4); }
.tt-acc__chev { color: var(--ink-4); transition: transform .15s ease; }
.tt-acc__item.is-open .tt-acc__chev { transform: rotate(90deg); }
.tt-acc__body { padding: 4px 20px 22px; }

/* ── Coming Soon banner ───────────────────────────────────────── */
.tt-coming-soon {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  margin: 0 0 18px;
  border-radius: var(--r-3);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: 16.25px;
}
.tt-coming-soon__badge {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg-deep);
  font-size: 13.125px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tt-coming-soon__text { line-height: 1.45; }

/* ── Misc utilities ───────────────────────────────────────────── */
.muted { color: var(--ink-4); }
.bigserif { font-family: var(--font-display); }
