/* ============================================================
   TradePass Demo Environment — application styles
   Cream page, Midnight structure, Gold twice per screen.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--tp-cream);
  color: var(--tp-midnight);
  font-family: var(--tp-font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--tp-font-display);
  margin: 0;
  letter-spacing: -0.025em;
}

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; }

::selection { background: var(--tp-gold); color: var(--tp-midnight); }

:focus-visible {
  outline: 2px solid rgba(203, 169, 107, 0.4);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   Typography primitives
   ------------------------------------------------------------ */

.tp-label {
  font-family: var(--tp-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tp-slate);
}

.tp-mono { font-family: var(--tp-font-mono); }

.tp-display {
  font-family: var(--tp-font-display);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.tp-h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.tp-h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.tp-h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; }

.tp-lead { font-size: 17px; line-height: 1.6; color: var(--tp-slate); }
.tp-body { font-size: 15px; line-height: 1.65; }
.tp-small { font-size: 13px; line-height: 1.5; }
.tp-muted { color: var(--tp-slate); }
.tp-num {
  font-family: var(--tp-font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   Wordmark & mark
   ------------------------------------------------------------ */

.tp-wordmark {
  font-family: var(--tp-font-display);
  letter-spacing: -0.035em;
  line-height: 1;
  white-space: nowrap;
}
.tp-wordmark .t { font-weight: 500; }
.tp-wordmark .p { font-weight: 800; }

.tp-ring { display: block; flex: none; }

/* Signature animation: three arcs rotate into alignment, 600ms, once. */
@keyframes tp-ring-settle {
  0%   { transform: rotate(-120deg); opacity: 0.35; }
  70%  { transform: rotate(8deg);    opacity: 1; }
  100% { transform: rotate(0deg);    opacity: 1; }
}
.tp-ring--settle { animation: tp-ring-settle 600ms cubic-bezier(0.22, 0.8, 0.3, 1) 1 both; }

@keyframes tp-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tp-rise { animation: tp-rise 240ms ease-out both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------
   App shell
   ------------------------------------------------------------ */

.tp-app {
  display: grid;
  grid-template-rows: var(--tp-topbar) 1fr;
  min-height: 100vh;
}

.tp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tp-6);
  padding: 0 var(--tp-8);
  background: var(--tp-cream);
  border-bottom: 1px solid var(--tp-line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.tp-topbar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
}
.tp-topbar__brand .tp-wordmark { font-size: 19px; }

.tp-topbar__env {
  font-family: var(--tp-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--tp-slate);
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-pill);
  padding: 4px 10px;
  margin-left: var(--tp-2);
  white-space: nowrap;
}

.tp-topbar__right {
  display: flex;
  align-items: center;
  gap: var(--tp-4);
}

/* Persona switcher --------------------------------------------------- */

.tp-persona {
  display: flex;
  align-items: center;
  background: var(--tp-white);
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-input);
  padding: 3px;
  gap: 2px;
}

.tp-persona__btn {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 4px;
  padding: 7px 13px;
  font-family: var(--tp-font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--tp-slate);
  cursor: pointer;
  transition: background var(--tp-ease), color var(--tp-ease);
  white-space: nowrap;
}
.tp-persona__btn:hover { color: var(--tp-midnight); background: var(--tp-midnight-soft); }
.tp-persona__btn[aria-pressed="true"] {
  background: var(--tp-midnight);
  color: var(--tp-cream);
}

/* Compact persona control, used only where four buttons will not fit. */
.tp-persona-select { display: none; width: auto; min-width: 170px; }

/* ------------------------------------------------------------
   Body: sidebar + content
   ------------------------------------------------------------ */

.tp-body {
  display: grid;
  grid-template-columns: var(--tp-sidebar) 1fr;
  min-height: 0;
}

.tp-sidebar {
  background: var(--tp-midnight);
  color: var(--tp-cream);
  padding: var(--tp-8) var(--tp-4) var(--tp-6);
  display: flex;
  flex-direction: column;
  gap: var(--tp-6);
  /* Stays in view on long pages: the nav is how the presenter moves
     between views mid-sentence, so it must never scroll away. */
  position: sticky;
  top: var(--tp-topbar);
  align-self: start;
  height: calc(100vh - var(--tp-topbar));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tp-sidebar__who {
  padding: 0 var(--tp-3) var(--tp-6);
  border-bottom: 1px solid var(--tp-line-dark);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tp-sidebar__role { font-family: var(--tp-font-mono); font-size: 9.5px; letter-spacing: 0.18em; color: var(--tp-gold); text-transform: uppercase; }
.tp-sidebar__name { font-family: var(--tp-font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--tp-cream); }
.tp-sidebar__meta { font-size: 12px; color: var(--tp-slate-dark); }

.tp-nav { display: flex; flex-direction: column; gap: 2px; }

.tp-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--tp-3);
  border-radius: var(--tp-r-input);
  font-size: 14px;
  font-weight: 500;
  color: var(--tp-slate-dark);
  cursor: pointer;
  transition: background var(--tp-ease), color var(--tp-ease);
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
}
.tp-nav__item:hover { background: rgba(247, 245, 240, 0.06); color: var(--tp-cream); }
.tp-nav__item.is-active { background: rgba(247, 245, 240, 0.10); color: var(--tp-cream); font-weight: 600; }
.tp-nav__item.is-active .tp-nav__dot { background: var(--tp-gold); }
.tp-nav__dot {
  width: 5px; height: 5px; border-radius: 999px;
  background: rgba(138, 148, 166, 0.5);
  flex: none;
  transition: background var(--tp-ease);
}

.tp-sidebar__foot { margin-top: auto; padding: var(--tp-4) var(--tp-3) 0; border-top: 1px solid var(--tp-line-dark); }
.tp-sidebar__msg { font-size: 12px; line-height: 1.6; color: var(--tp-slate-dark); }
.tp-sidebar__msg strong { color: var(--tp-cream); font-weight: 600; }

/* Content ------------------------------------------------------------ */

.tp-main {
  padding: var(--tp-8) var(--tp-12) var(--tp-24);
  min-width: 0;
}
.tp-main--flush { padding: 0; }

.tp-page { max-width: var(--tp-max); margin: 0 auto; }

.tp-page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--tp-6);
  padding-bottom: var(--tp-4);
  border-bottom: 1px solid var(--tp-midnight);
  margin-bottom: var(--tp-8);
  flex-wrap: wrap;
}
.tp-page__titles { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tp-page__actions { display: flex; align-items: center; gap: var(--tp-3); flex-wrap: wrap; }

.tp-backlink {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; color: var(--tp-slate);
  cursor: pointer; background: none; border: 0; padding: 0;
  margin-bottom: var(--tp-4);
  transition: color var(--tp-ease);
}
.tp-backlink:hover { color: var(--tp-midnight); }

.tp-section { margin-top: var(--tp-12); }
.tp-section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--tp-4); margin-bottom: var(--tp-4); flex-wrap: wrap;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.tp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--tp-font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 13px 24px;
  border-radius: var(--tp-r-input);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--tp-ease), color var(--tp-ease), border-color var(--tp-ease);
  white-space: nowrap;
  line-height: 1;
}
.tp-btn--primary { background: var(--tp-midnight); color: var(--tp-cream); }
.tp-btn--primary:hover { background: var(--tp-midnight-hover); }
.tp-btn--gold { background: var(--tp-gold); color: var(--tp-midnight); }
.tp-btn--gold:hover { background: var(--tp-gold-hover); }
.tp-btn--outline { border-color: var(--tp-midnight); color: var(--tp-midnight); background: transparent; }
.tp-btn--outline:hover { background: var(--tp-midnight); color: var(--tp-cream); }
.tp-btn--ghost { color: var(--tp-slate); background: transparent; padding: 13px 12px; }
.tp-btn--ghost:hover { color: var(--tp-midnight); background: var(--tp-midnight-soft); }
.tp-btn--sm { padding: 9px 16px; font-size: 13px; }
.tp-btn--block { width: 100%; }
.tp-btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* An author display rule outranks the UA [hidden] rule, so restate it. */
.tp-btn[hidden] { display: none; }

.tp-linkbtn {
  background: none; border: 0; padding: 4px 0;
  font-family: var(--tp-font-display); font-size: 14px; font-weight: 700;
  border-bottom: 2px solid var(--tp-gold); cursor: pointer;
  transition: border-color var(--tp-ease);
}
.tp-linkbtn:hover { border-color: var(--tp-midnight); }

/* ------------------------------------------------------------
   Cards, stats, badges
   ------------------------------------------------------------ */

.tp-card {
  background: var(--tp-white);
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-card);
  padding: var(--tp-6);
}
.tp-card--dark { background: var(--tp-midnight); border-color: var(--tp-midnight); color: var(--tp-cream); }
.tp-card--flush { padding: 0; overflow: hidden; }

.tp-grid { display: grid; gap: var(--tp-4); }
.tp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tp-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tp-grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tp-grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--tp-6); }
.tp-grid--halves { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tp-6); }

/* Stat tile */
.tp-stat {
  background: var(--tp-white);
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.tp-stat__label { font-family: var(--tp-font-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tp-slate); }
.tp-stat__value { font-family: var(--tp-font-display); font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tp-stat__foot { font-size: 12px; color: var(--tp-slate); }
.tp-stat--dark { background: var(--tp-midnight); border-color: var(--tp-midnight); }
.tp-stat--dark .tp-stat__label { color: var(--tp-gold); }
.tp-stat--dark .tp-stat__value { color: var(--tp-cream); }
.tp-stat--dark .tp-stat__foot { color: var(--tp-slate-dark); }

/* Value change flash after a session mutation */
@keyframes tp-flash {
  0%   { background: var(--tp-gold-soft); }
  100% { background: transparent; }
}
.tp-flash { animation: tp-flash 1200ms ease-out 1 both; border-radius: 4px; }

.tp-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--tp-font-mono); font-size: 11px; font-weight: 500;
  color: var(--tp-sage);
}

/* Badges */
.tp-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--tp-r-pill);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
}
.tp-badge--verified { background: var(--tp-sage-soft); color: var(--tp-sage); }
.tp-badge--verified::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--tp-sage); flex: none; }
.tp-badge--pending { background: var(--tp-gold-soft); color: #8A6C2E; }
.tp-badge--pending::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--tp-gold); flex: none; }
.tp-badge--neutral { background: var(--tp-midnight-soft); color: var(--tp-slate); }
.tp-badge--outline { border: 1px solid var(--tp-line); color: var(--tp-slate); background: transparent; }
.tp-badge--dark { background: var(--tp-midnight); color: var(--tp-cream); font-family: var(--tp-font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }
.tp-badge--returned { background: var(--tp-clay-soft); color: var(--tp-clay); }
.tp-badge--returned::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--tp-clay); flex: none; }

.tp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-pill);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--tp-slate);
  background: var(--tp-white);
}
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */

.tp-tablewrap {
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-card);
  background: var(--tp-white);
  overflow-x: auto;
}

.tp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tp-table th {
  font-family: var(--tp-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tp-slate);
  font-weight: 500;
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--tp-line);
  white-space: nowrap;
  background: var(--tp-white);
}
.tp-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--tp-line);
  vertical-align: middle;
}
.tp-table tbody tr:last-child td { border-bottom: 0; }
.tp-table tbody tr.is-clickable { cursor: pointer; transition: background var(--tp-ease); }
.tp-table tbody tr.is-clickable:hover { background: var(--tp-cream); }
.tp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-table .strong { font-weight: 600; }
.tp-table__primary { display: flex; flex-direction: column; gap: 2px; }
.tp-table__primary b { font-weight: 600; }
.tp-table__primary span { font-size: 12px; color: var(--tp-slate); }

.tp-empty {
  padding: var(--tp-12) var(--tp-6);
  text-align: center;
  color: var(--tp-slate);
  font-size: 14px;
}

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */

.tp-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.tp-field__label { font-family: var(--tp-font-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tp-slate); }
.tp-field__hint { font-size: 12px; color: var(--tp-slate); }

.tp-input, .tp-select {
  appearance: none;
  font-family: var(--tp-font-body);
  font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-input);
  background: var(--tp-white);
  color: var(--tp-midnight);
  width: 100%;
  transition: border-color var(--tp-ease);
}
.tp-input:focus, .tp-select:focus { border-color: var(--tp-midnight); outline: none; }
.tp-input::placeholder { color: var(--tp-slate); opacity: 0.7; }

.tp-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

.tp-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 240px;
  flex: 1;
}
.tp-search .tp-input { padding-left: 36px; }
.tp-search svg { position: absolute; left: 12px; pointer-events: none; }

.tp-filters {
  display: flex;
  align-items: center;
  gap: var(--tp-2);
  flex-wrap: wrap;
  margin-bottom: var(--tp-4);
}

.tp-filter {
  appearance: none;
  background: var(--tp-white);
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-pill);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--tp-slate);
  cursor: pointer;
  transition: all var(--tp-ease);
  white-space: nowrap;
}
.tp-filter:hover { border-color: var(--tp-midnight); color: var(--tp-midnight); }
.tp-filter[aria-pressed="true"] { background: var(--tp-midnight); border-color: var(--tp-midnight); color: var(--tp-cream); }

/* Toggle switch */
.tp-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
/* A switch is shorter than an input. Sat beside one in the same grid row,
   it takes the slack so both fields read on the same three lines: labels
   level, controls centred on each other, hints level. */
.tp-field > .tp-switch { flex: 1; }
.tp-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tp-switch__track {
  width: 42px; height: 24px; border-radius: 999px;
  background: var(--tp-line); position: relative;
  transition: background var(--tp-ease); flex: none;
}
.tp-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 999px; background: var(--tp-white);
  transition: transform var(--tp-ease);
  box-shadow: 0 1px 2px rgba(11,19,32,0.2);
}
.tp-switch input:checked + .tp-switch__track { background: var(--tp-sage); }
.tp-switch input:checked + .tp-switch__track::after { transform: translateX(18px); }

/* Range slider */
.tp-range { width: 100%; appearance: none; height: 4px; border-radius: 999px; background: var(--tp-line); outline: none; }
.tp-range::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; border-radius: 999px;
  background: var(--tp-midnight); cursor: pointer; border: 3px solid var(--tp-white);
  box-shadow: 0 0 0 1px var(--tp-line);
}
.tp-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 999px; border: 3px solid var(--tp-white);
  background: var(--tp-midnight); cursor: pointer; box-shadow: 0 0 0 1px var(--tp-line);
}

/* Validation */
.tp-alert {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: var(--tp-r-input);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}
.tp-alert--error { background: var(--tp-clay-soft); color: var(--tp-clay); }
.tp-alert--ok { background: var(--tp-sage-soft); color: var(--tp-sage); }
.tp-alert--info { background: var(--tp-midnight-soft); color: var(--tp-slate); }

/* ------------------------------------------------------------
   Charts
   ------------------------------------------------------------ */

/* Aspect ratio is preserved, so a user unit is roughly one CSS pixel
   at the usual container width: circles stay round, labels stay sharp. */
.tp-chart { width: 100%; height: auto; display: block; overflow: visible; }
.tp-chart .axis {
  font-family: var(--tp-font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  fill: var(--tp-slate);
}
.tp-chart .callout {
  font-family: var(--tp-font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  fill: var(--tp-midnight);
}
.tp-chart .grid { stroke: var(--tp-line); stroke-width: 1; }
.tp-chart .grid--base { stroke: var(--tp-slate); stroke-opacity: 0.35; }
.tp-chart .area { fill: url(#tpArea); }
.tp-chart .line { fill: none; stroke: var(--tp-midnight); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.tp-chart .dot { fill: var(--tp-white); stroke: var(--tp-midnight); stroke-width: 2.5; }
.tp-chart .dot--last { fill: var(--tp-gold); stroke: var(--tp-midnight); }

/* Horizontal bar list (top professionals, categories, locations) */
.tp-barlist { display: flex; flex-direction: column; gap: 2px; }
.tp-barrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--tp-4);
  padding: 11px 0;
  border-bottom: 1px solid var(--tp-line);
}
.tp-barrow:last-child { border-bottom: 0; }
.tp-barrow__label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tp-barrow__name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-barrow__track { height: 6px; border-radius: 999px; background: var(--tp-midnight-soft); overflow: hidden; }
.tp-barrow__fill { height: 100%; border-radius: 999px; background: var(--tp-midnight); transition: width 400ms ease-out; }
.tp-barrow--accent .tp-barrow__fill { background: var(--tp-gold); }
.tp-barrow__value { font-family: var(--tp-font-display); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-barrow--clickable { cursor: pointer; }
.tp-barrow--clickable:hover .tp-barrow__name { color: var(--tp-gold-hover); }

/* ------------------------------------------------------------
   Activity feed / timeline
   ------------------------------------------------------------ */

.tp-feed { display: flex; flex-direction: column; }
.tp-feed__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--tp-3);
  padding: 14px 0;
  border-bottom: 1px solid var(--tp-line);
}
.tp-feed__item:last-child { border-bottom: 0; }
.tp-feed__dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--tp-line); margin-top: 7px; flex: none;
}
.tp-feed__dot--gold { background: var(--tp-gold); }
.tp-feed__dot--sage { background: var(--tp-sage); }
.tp-feed__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tp-feed__msg { font-size: 14px; line-height: 1.5; }
.tp-feed__msg b { font-weight: 600; }
.tp-feed__time { font-family: var(--tp-font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--tp-slate); text-transform: uppercase; }

/* Attribution timeline (horizontal on desktop) */
.tp-timeline { display: flex; flex-direction: column; gap: 0; }
.tp-timeline__step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: var(--tp-3);
  position: relative;
  padding-bottom: var(--tp-4);
}
.tp-timeline__step:last-child { padding-bottom: 0; }
.tp-timeline__step::before {
  content: "";
  position: absolute;
  left: 13px; top: 22px; bottom: 0;
  width: 1px; background: var(--tp-line);
}
.tp-timeline__step:last-child::before { display: none; }
.tp-timeline__mark {
  width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid var(--tp-line);
  background: var(--tp-white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--tp-font-mono); font-size: 10px; color: var(--tp-slate);
  z-index: 1;
}
.tp-timeline__step.is-done .tp-timeline__mark { background: var(--tp-midnight); border-color: var(--tp-midnight); color: var(--tp-gold); }
.tp-timeline__body { display: flex; flex-direction: column; gap: 3px; padding-top: 3px; }
.tp-timeline__title { font-size: 14px; font-weight: 600; }
.tp-timeline__meta { font-size: 12px; color: var(--tp-slate); }

/* Ledger rows (money breakdown) */
.tp-ledger { display: flex; flex-direction: column; }
.tp-ledger__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--tp-4);
  padding: 13px 0;
  border-bottom: 1px solid var(--tp-line);
  font-size: 14px;
}
.tp-ledger__row:last-child { border-bottom: 0; }
.tp-ledger__row--total {
  border-top: 1px solid var(--tp-midnight);
  border-bottom: 0;
  margin-top: 6px;
  padding-top: 15px;
  font-family: var(--tp-font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.tp-ledger__row--credit { color: var(--tp-sage); }
.tp-ledger__val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.tp-card--dark .tp-ledger__row { border-color: var(--tp-line-dark); }
.tp-card--dark .tp-ledger__row--total { border-top-color: var(--tp-gold); }

/* Program economics bar. The editable variant is the control itself. */
.tp-split {
  position: relative;
  display: flex;
  height: 44px;
  border-radius: var(--tp-r-input);
  overflow: hidden;
  border: 1px solid var(--tp-line);
  user-select: none;
}
.tp-split__seg {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--tp-font-mono); font-size: 10px; letter-spacing: 0.1em;
  min-width: 0; overflow: hidden; white-space: nowrap;
  transition: width 120ms linear;
}
.tp-split__seg--client { background: var(--tp-midnight); color: var(--tp-cream); }
.tp-split__seg--pro { background: var(--tp-gold); color: var(--tp-midnight); }
.tp-split__seg--tp { background: var(--tp-slate); color: var(--tp-cream); }
/* The pool a delegated programme hands to its professionals. */
.tp-split__seg--pool {
  background: linear-gradient(90deg, var(--tp-midnight) 0%, var(--tp-gold) 100%);
  color: var(--tp-cream);
}
.tp-split__seg--locked { background: repeating-linear-gradient(135deg, var(--tp-slate) 0 5px, #61697a 5px 10px); }

.tp-split--editable { height: 56px; cursor: ew-resize; border-color: var(--tp-midnight); }
.tp-split--editable .tp-split__seg { pointer-events: none; }

.tp-split__handle {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 22px;
  margin-left: -11px;
  display: flex; align-items: center; justify-content: center;
  cursor: ew-resize;
  transition: left 120ms linear;
}
.tp-split__grip {
  width: 8px;
  height: 100%;
  border-radius: 999px;
  background: var(--tp-cream);
  border: 1px solid var(--tp-midnight);
  box-shadow: 0 2px 6px rgba(11, 19, 32, 0.28);
  transition: background var(--tp-ease), transform var(--tp-ease);
}
.tp-split__handle:hover .tp-split__grip,
.tp-split__handle:focus-visible .tp-split__grip { background: var(--tp-gold); transform: scaleX(1.25); }
.tp-split__handle:focus-visible { outline: none; }

body.tp-dragging { cursor: ew-resize; user-select: none; }
body.tp-dragging .tp-split__seg,
body.tp-dragging .tp-split__handle { transition: none; }

.tp-split__caption { font-size: 12.5px; line-height: 1.6; color: var(--tp-slate); }
.tp-split__caption b { color: var(--tp-midnight); font-weight: 600; }

/* Total economics stepper. The total is a discrete decision, so it gets
   buttons rather than sharing the bar with the split drag. */
.tp-stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--tp-2);
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-input);
  padding: 4px;
  background: var(--tp-white);
  align-self: flex-start;
}
.tp-stepper__btn {
  appearance: none;
  width: 34px; height: 34px;
  border: 0; border-radius: 4px;
  background: var(--tp-cream);
  color: var(--tp-midnight);
  font-size: 17px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--tp-ease), color var(--tp-ease);
}
.tp-stepper__btn:hover:not(:disabled) { background: var(--tp-midnight); color: var(--tp-cream); }
.tp-stepper__btn:disabled { opacity: 0.3; cursor: not-allowed; }
.tp-stepper__value {
  font-family: var(--tp-font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  min-width: 74px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Read-only figures beneath the bar, in place of separate sliders. */
.tp-readout {
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-input);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--tp-white);
}
.tp-readout--locked { background: var(--tp-cream); }
.tp-readout__top { display: flex; align-items: center; justify-content: space-between; gap: var(--tp-2); }
.tp-readout__lock {
  font-family: var(--tp-font-mono); font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--tp-slate);
  border: 1px solid var(--tp-line); border-radius: var(--tp-r-pill); padding: 2px 8px;
}
.tp-readout__value {
  font-family: var(--tp-font-display); font-size: 26px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1;
}
.tp-readout__hint { font-size: 12px; line-height: 1.5; color: var(--tp-slate); }

/* Who-controls-the-split selector */
.tp-mode {
  display: flex; align-items: flex-start; gap: 11px;
  text-align: left; width: 100%;
  background: var(--tp-white);
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-input);
  padding: 15px 16px;
  cursor: pointer;
  transition: border-color var(--tp-ease), background var(--tp-ease);
}
.tp-mode:hover { border-color: var(--tp-slate); }
.tp-mode.is-active { border-color: var(--tp-midnight); background: var(--tp-cream); }
.tp-mode__tick {
  width: 18px; height: 18px; border-radius: 999px; flex: none; margin-top: 1px;
  border: 1px solid var(--tp-line); background: var(--tp-white);
  display: flex; align-items: center; justify-content: center;
  color: var(--tp-cream);
  transition: background var(--tp-ease), border-color var(--tp-ease);
}
.tp-mode.is-active .tp-mode__tick { background: var(--tp-midnight); border-color: var(--tp-midnight); }
.tp-mode__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tp-mode__title { font-family: var(--tp-font-display); font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.tp-mode__detail { font-size: 12.5px; line-height: 1.5; color: var(--tp-slate); }

/* ------------------------------------------------------------
   Pass card (the hero object — the only element with a shadow)
   ------------------------------------------------------------ */

.tp-pass {
  width: 320px;
  background: var(--tp-midnight);
  border-radius: var(--tp-r-pass);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: var(--tp-shadow-pass);
  color: var(--tp-cream);
}
.tp-pass__top { display: flex; justify-content: space-between; align-items: center; gap: var(--tp-3); }
.tp-pass__brand { display: flex; align-items: center; gap: 10px; }
.tp-pass__brand .tp-wordmark { font-size: 16px; color: var(--tp-cream); }
.tp-pass__status {
  display: flex; align-items: center; gap: 6px;
  background: rgba(46, 125, 100, 0.16);
  border-radius: 999px; padding: 5px 10px;
  font-size: 11px; font-weight: 600; color: var(--tp-sage-bright);
}
.tp-pass__status::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--tp-sage); }
.tp-pass__titles { display: flex; flex-direction: column; gap: 6px; }
.tp-pass__project { font-family: var(--tp-font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.025em; color: var(--tp-cream); line-height: 1.15; }
.tp-pass__via { font-size: 13px; color: var(--tp-slate-dark); }
.tp-pass__qr {
  background: var(--tp-cream);
  border-radius: var(--tp-r-card);
  min-height: 168px;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.tp-pass__qr svg { display: block; width: 132px; height: 132px; }
.tp-pass__foot {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-top: 1px solid var(--tp-line-dark);
  padding-top: 16px;
}
.tp-pass__fcol { display: flex; flex-direction: column; gap: 4px; }
.tp-pass__fcol--right { text-align: right; }
.tp-pass__flabel { font-family: var(--tp-font-mono); font-size: 9.5px; letter-spacing: 0.16em; color: var(--tp-slate); text-transform: uppercase; }
.tp-pass__fval { font-family: var(--tp-font-mono); font-size: 13px; color: var(--tp-cream); }
.tp-pass__fval--gold { color: var(--tp-gold); }

/* ------------------------------------------------------------
   Client wallet screen

   One pass, presented the way a phone wallet presents one. The
   surround is a deep neutral rather than Midnight so the pass card
   still reads as a separate object sitting on top of it.
   ------------------------------------------------------------ */

.tp-wallet {
  min-height: calc(100vh - var(--tp-topbar));
  background: #171A20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--tp-12) var(--tp-6);
}

.tp-wallet__phone {
  width: 380px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--tp-6);
}

.tp-wallet__status {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--tp-font-mono);
  font-size: 11px;
  color: rgba(247, 245, 240, 0.55);
  padding: 0 var(--tp-2);
}

.tp-wallet__stage { display: flex; justify-content: center; }

.tp-wallet__meta {
  text-align: center;
  font-size: 13px;
  color: rgba(247, 245, 240, 0.55);
}
.tp-wallet__meta b { color: var(--tp-cream); font-weight: 600; }

.tp-wallet__buttons { display: flex; flex-direction: column; gap: 10px; }

/* Simulated "add to wallet" badges. */
.tp-walletbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  height: 52px;
  width: 100%;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  cursor: pointer;
  font-family: var(--tp-font-body);
  transition: background var(--tp-ease), border-color var(--tp-ease);
}
.tp-walletbtn:hover { background: #14161a; border-color: rgba(255, 255, 255, 0.4); }
.tp-walletbtn__mark { flex: none; display: block; }
.tp-walletbtn__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.12; }
.tp-walletbtn__small { font-size: 10px; font-weight: 500; letter-spacing: 0.01em; opacity: 0.82; }
.tp-walletbtn__big { font-size: 15.5px; font-weight: 600; letter-spacing: -0.012em; }

.tp-wallet__others {
  border-top: 1px solid rgba(247, 245, 240, 0.12);
  padding-top: var(--tp-4);
  display: flex; flex-direction: column; gap: 10px;
}
.tp-wallet__otherslabel {
  font-family: var(--tp-font-mono); font-size: 9.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(247, 245, 240, 0.45);
}
.tp-wallet__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-wallet__pill {
  background: transparent;
  border: 1px solid rgba(247, 245, 240, 0.22);
  color: var(--tp-cream);
  border-radius: var(--tp-r-pill);
  padding: 7px 14px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--tp-ease), border-color var(--tp-ease);
}
.tp-wallet__pill:hover { background: rgba(247, 245, 240, 0.10); border-color: rgba(247, 245, 240, 0.4); }

/* The pass fills the wallet screen's width and leads with the code.
   A hairline keeps the Midnight card distinct from the dark surround,
   which the pass card's shadow alone cannot do. */
.tp-pass--wallet {
  width: 100%;
  border: 1px solid rgba(247, 245, 240, 0.09);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}
.tp-pass--wallet .tp-pass__qr { min-height: 232px; padding: 22px; }
.tp-pass--wallet .tp-pass__qr svg { width: 188px; height: 188px; }

/* Store-scan / checkout stage (full-bleed dark band) */
.tp-stage {
  min-height: calc(100vh - var(--tp-topbar));
  background: var(--tp-midnight);
  color: var(--tp-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--tp-12) var(--tp-6);
}
.tp-stage__inner { width: 100%; max-width: 940px; }
.tp-stage__eyebrow { font-family: var(--tp-font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--tp-gold); text-transform: uppercase; }
.tp-stage h1 { color: var(--tp-cream); }
.tp-stage .tp-muted { color: var(--tp-slate-dark); }
.tp-stage__panel {
  background: rgba(247, 245, 240, 0.04);
  border: 1px solid var(--tp-line-dark);
  border-radius: var(--tp-r-card);
  padding: var(--tp-6);
}
.tp-stage__panel--light { background: var(--tp-cream); color: var(--tp-midnight); border-color: var(--tp-cream); }

.tp-cartrow {
  display: flex; align-items: center; justify-content: space-between; gap: var(--tp-4);
  padding: 14px 0;
  border-bottom: 1px solid var(--tp-line-dark);
}
.tp-cartrow:last-of-type { border-bottom: 0; }
.tp-cartrow__main { display: flex; flex-direction: column; gap: 2px; }
.tp-cartrow__name { font-size: 14px; font-weight: 600; }
.tp-cartrow__meta { font-family: var(--tp-font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--tp-slate); text-transform: uppercase; }
.tp-cartrow__price { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* Attribution success */
.tp-success { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--tp-6); }
.tp-success__ring { margin-bottom: var(--tp-2); }
.tp-outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--tp-4); width: 100%; }
.tp-outcome {
  border: 1px solid var(--tp-line-dark);
  border-radius: var(--tp-r-card);
  padding: var(--tp-6);
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
}
.tp-outcome__who { font-family: var(--tp-font-mono); font-size: 9.5px; letter-spacing: 0.16em; color: var(--tp-gold); text-transform: uppercase; }
.tp-outcome__value { font-family: var(--tp-font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: var(--tp-cream); line-height: 1.05; }
.tp-outcome__note { font-size: 13px; color: var(--tp-slate-dark); line-height: 1.5; }

/* ------------------------------------------------------------
   Modal
   ------------------------------------------------------------ */

.tp-modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11, 19, 32, 0.42);
  display: flex; align-items: flex-start; justify-content: center;
  padding: var(--tp-12) var(--tp-6);
  overflow-y: auto;
  animation: tp-fade 160ms ease-out both;
}
@keyframes tp-fade { from { opacity: 0; } to { opacity: 1; } }

.tp-modal {
  background: var(--tp-white);
  border-radius: var(--tp-r-card);
  width: 100%;
  max-width: 560px;
  animation: tp-rise 240ms ease-out both;
  overflow: hidden;
}
.tp-modal--wide { max-width: 720px; }
.tp-modal__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--tp-4);
  padding: var(--tp-6) var(--tp-6) var(--tp-4);
  border-bottom: 1px solid var(--tp-line);
}
.tp-modal__body { padding: var(--tp-6); display: flex; flex-direction: column; gap: var(--tp-4); }
.tp-modal__foot {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--tp-3);
  padding: var(--tp-4) var(--tp-6) var(--tp-6);
  flex-wrap: wrap;
}
.tp-modal__x {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--tp-slate); padding: 4px; line-height: 0; border-radius: 4px;
  transition: color var(--tp-ease), background var(--tp-ease);
}
.tp-modal__x:hover { color: var(--tp-midnight); background: var(--tp-midnight-soft); }

/* ------------------------------------------------------------
   Toasts
   ------------------------------------------------------------ */

.tp-toasts {
  position: fixed; z-index: 200;
  bottom: var(--tp-6); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.tp-toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--tp-midnight);
  color: var(--tp-cream);
  border-radius: var(--tp-r-input);
  padding: 13px 18px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(11, 19, 32, 0.22);
  animation: tp-rise 240ms ease-out both;
  max-width: 460px;
}
.tp-toast--out { animation: tp-fade 160ms ease-out reverse both; }
.tp-toast__dot { width: 6px; height: 6px; border-radius: 999px; background: var(--tp-sage); flex: none; }
.tp-toast__dot--gold { background: var(--tp-gold); }

/* ------------------------------------------------------------
   Presenter controls
   ------------------------------------------------------------ */

.tp-controls { position: fixed; right: var(--tp-6); bottom: var(--tp-6); z-index: 150; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

.tp-controls__fab {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--tp-midnight); color: var(--tp-cream);
  border: 0; border-radius: var(--tp-r-pill);
  padding: 11px 18px 11px 14px;
  font-family: var(--tp-font-display); font-size: 13px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(11, 19, 32, 0.20);
  transition: background var(--tp-ease);
}
.tp-controls__fab:hover { background: var(--tp-midnight-hover); }

.tp-controls__panel {
  background: var(--tp-white);
  border: 1px solid var(--tp-line);
  border-radius: var(--tp-r-card);
  width: 268px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(11, 19, 32, 0.16);
  animation: tp-rise 160ms ease-out both;
}
.tp-controls__group { padding: var(--tp-3) 0; border-bottom: 1px solid var(--tp-line); }
.tp-controls__group:last-child { border-bottom: 0; }
.tp-controls__title { font-family: var(--tp-font-mono); font-size: 9px; letter-spacing: 0.16em; color: var(--tp-slate); text-transform: uppercase; padding: 4px 16px 8px; }
.tp-controls__action {
  display: flex; align-items: center; justify-content: space-between; gap: var(--tp-3);
  width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer;
  padding: 9px 16px;
  font-size: 13.5px; font-weight: 500;
  transition: background var(--tp-ease);
}
.tp-controls__action:hover { background: var(--tp-cream); }
.tp-controls__action kbd {
  font-family: var(--tp-font-mono); font-size: 10px; color: var(--tp-slate);
  border: 1px solid var(--tp-line); border-radius: 4px; padding: 2px 5px; background: var(--tp-cream);
}
.tp-controls__action--danger { color: var(--tp-clay); }

/* Guided demo bar */
.tp-guide {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: var(--tp-6); z-index: 150;
  background: var(--tp-midnight); color: var(--tp-cream);
  border-radius: var(--tp-r-pill);
  padding: 8px 8px 8px 20px;
  display: flex; align-items: center; gap: var(--tp-4);
  box-shadow: 0 14px 36px rgba(11, 19, 32, 0.26);
  max-width: calc(100vw - 48px);
}
.tp-guide__step { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tp-guide__eyebrow { font-family: var(--tp-font-mono); font-size: 9px; letter-spacing: 0.16em; color: var(--tp-gold); text-transform: uppercase; }
.tp-guide__title { font-family: var(--tp-font-display); font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-guide__dots { display: flex; gap: 5px; align-items: center; flex: none; }
.tp-guide__dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(138,148,166,0.45); cursor: pointer; border: 0; padding: 0; transition: background var(--tp-ease); }
.tp-guide__dot.is-done { background: var(--tp-slate-dark); }
.tp-guide__dot.is-active { background: var(--tp-gold); width: 18px; }
.tp-guide__btns { display: flex; align-items: center; gap: 6px; flex: none; }
.tp-guide__btn {
  appearance: none; border: 0; cursor: pointer;
  border-radius: var(--tp-r-pill); padding: 9px 16px;
  font-family: var(--tp-font-display); font-size: 13px; font-weight: 700;
  background: rgba(247,245,240,0.10); color: var(--tp-cream);
  transition: background var(--tp-ease);
}
.tp-guide__btn:hover { background: rgba(247,245,240,0.18); }
.tp-guide__btn--primary { background: var(--tp-gold); color: var(--tp-midnight); }
.tp-guide__btn--primary:hover { background: var(--tp-gold-hover); }
.tp-guide__btn--icon { padding: 9px 11px; line-height: 0; }

/* ------------------------------------------------------------
   Utility
   ------------------------------------------------------------ */

.tp-stack { display: flex; flex-direction: column; }
.tp-stack--1 { gap: var(--tp-1); }
.tp-stack--2 { gap: var(--tp-2); }
.tp-stack--3 { gap: var(--tp-3); }
.tp-stack--4 { gap: var(--tp-4); }
.tp-stack--6 { gap: var(--tp-6); }
.tp-stack--8 { gap: var(--tp-8); }
.tp-row { display: flex; align-items: center; gap: var(--tp-3); flex-wrap: wrap; }
.tp-row--between { justify-content: space-between; }
.tp-row--tight { gap: var(--tp-2); }
.tp-row--top { align-items: flex-start; }
.tp-spacer { flex: 1; }
.tp-hairline { height: 1px; background: var(--tp-line); border: 0; margin: 0; }
.tp-nowrap { white-space: nowrap; }
.tp-center { text-align: center; }
.tp-right { text-align: right; }
.tp-hide { display: none !important; }

.tp-note {
  border-left: 2px solid var(--tp-gold);
  padding: 2px 0 2px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--tp-slate);
}
.tp-note strong { color: var(--tp-midnight); font-weight: 600; }

.tp-checklist { display: flex; flex-direction: column; gap: 0; }
.tp-checkitem {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--tp-line);
  font-size: 14px;
}
.tp-checkitem:last-child { border-bottom: 0; }
.tp-checkitem__tick {
  width: 20px; height: 20px; border-radius: 999px;
  background: var(--tp-sage-soft); color: var(--tp-sage);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.tp-checkitem__meta { margin-left: auto; font-size: 12px; color: var(--tp-slate); }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 1180px) {
  .tp-main { padding: var(--tp-6) var(--tp-8) var(--tp-24); }
  .tp-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tp-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-grid--sidebar { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --tp-sidebar: 0px; }
  .tp-body { grid-template-columns: minmax(0, 1fr); }
  .tp-sidebar {
    position: sticky; top: var(--tp-topbar); z-index: 30;
    padding: var(--tp-4) var(--tp-4);
    gap: var(--tp-4);
    height: auto;
    align-self: stretch;
    overflow-y: visible;
  }
  .tp-sidebar__who { display: none; }
  .tp-sidebar__foot { display: none; }
  .tp-nav { flex-direction: row; overflow-x: auto; gap: 6px; }
  .tp-nav__item { white-space: nowrap; width: auto; }
  .tp-main { padding: var(--tp-6) var(--tp-4) var(--tp-24); }
  .tp-topbar { padding: 0 var(--tp-4); gap: var(--tp-3); }
  .tp-topbar__env { display: none; }
  .tp-grid--3, .tp-grid--6, .tp-grid--4, .tp-grid--2, .tp-grid--halves { grid-template-columns: minmax(0, 1fr); }
  .tp-outcomes { grid-template-columns: minmax(0, 1fr); }
  .tp-persona { display: none; }
  .tp-persona-select { display: block; }
  .tp-page__head { align-items: flex-start; flex-direction: column; }
  .tp-guide { padding-left: 14px; gap: var(--tp-3); }
  .tp-guide__dots { display: none; }
  .tp-wallet { padding: var(--tp-6) var(--tp-4) var(--tp-12); }
  .tp-split--editable { height: 64px; }
  .tp-readout__value { font-size: 22px; }
}

@media (max-width: 560px) {
  .tp-persona-select { min-width: 0; max-width: 190px; font-size: 13px; padding-left: 11px; }
  .tp-controls { right: var(--tp-4); bottom: var(--tp-4); }
  .tp-stage { padding: var(--tp-6) var(--tp-4); }
}
