/*
 * 14-day challenge (Phase 3, session B4): sidebar widget, banner, Home, "Connect your audience" checklist.
 * Values from the approved B2B prototype (workspace docs/plans/platform_refactor/b2b_prototype/), on top of tn-tokens.css.
 * Loaded by _SidebarLayout because the widget renders on every page.
 */

/* ---------- Sidebar widget ---------- */
.tn-cw {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  background: var(--tn-widget);
  border: 1px solid rgba(91,193,234,0.25);
  border-radius: 14px;
  color: var(--tn-fg-1);
  text-decoration: none;
  font-family: var(--tn-font);
}
.tn-cw:hover { border-color: rgba(91,193,234,0.5); color: var(--tn-fg-1); }
.tn-cw__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tn-cw__eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; color: var(--tn-sky); }
.tn-cw__day { font-size: 11px; color: rgba(255,255,255,0.6); white-space: nowrap; }
.tn-cw__meta { display: flex; flex-direction: column; gap: 3px; }
.tn-cw__label { font-size: 11px; color: rgba(255,255,255,0.55); }
.tn-cw__step { font-size: 13px; font-weight: 600; line-height: 1.3; }
.tn-cw__next { font-size: 12px; line-height: 1.4; color: rgba(255,255,255,0.65); }
.tn-cw__disc { display: flex; flex-direction: column; gap: 5px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); }
.tn-cw__disc-row { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,0.6); }
.tn-cw__disc-row b { color: #fff; font-weight: 600; }
.tn-cw__cta { font-size: 13px; font-weight: 600; color: var(--tn-sky); }

/* 4-segment step bar (widget, banner) */
.tn-segs { display: flex; gap: 4px; }
.tn-segs > span { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); }
.tn-segs > span.is-done { background: var(--tn-leaf); }
.tn-segs > span.is-current { background: var(--tn-sky); }

/* Thin bar with a coloured fill */
.tn-meter { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.1); overflow: hidden; }
.tn-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--tn-sky); transition: width .4s; }
.tn-meter--8 { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); }
.tn-meter--10 { height: 10px; border-radius: 5px; background: rgba(255,255,255,0.08); }
.tn-meter--6 { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); }
.tn-meter--5 { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.08); }
.tn-meter > span.is-leaf { background: var(--tn-leaf); }
.tn-meter > span.is-mustard { background: var(--tn-mustard); }

/* ---------- Global banner ---------- */
.tn-cbanner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; border-radius: 12px;
  background: rgba(91,193,234,0.07); border: 1px solid rgba(91,193,234,0.22);
  font-family: var(--tn-font); font-size: 13px; color: var(--tn-fg-1);
}
.tn-cbanner__eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; color: var(--tn-sky); }
.tn-cbanner__step { color: rgba(255,255,255,0.85); }
.tn-cbanner .tn-segs { width: 120px; }
.tn-cbanner__spacer { flex: 1; }
.tn-cbanner__link { color: var(--tn-sky); font-weight: 600; text-decoration: none; }
.tn-cbanner__link:hover { color: var(--tn-sky-soft); }

/* ---------- Shared page pieces ---------- */
.tn-section-title { font-size: 17px; font-weight: 600; margin: 0; }
.tn-muted { color: rgba(255,255,255,0.6); }
.tn-kpi-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; color: rgba(255,255,255,0.55); text-transform: uppercase; }
.tn-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.tn-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.tn-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.tn-stack { display: flex; flex-direction: column; gap: 12px; }
.tn-box { background: var(--tn-card); border: 1px solid rgba(255,255,255,0.08); border-radius: 18px; color: var(--tn-fg-1); }
.tn-kpi { padding: 18px 20px; border-radius: 16px; display: flex; flex-direction: column; gap: 6px; }
.tn-kpi__value { font-size: 28px; font-weight: 700; }
.tn-kpi__value--sky { color: var(--tn-sky); }
.tn-kpi__note { font-size: 12px; line-height: 1.4; color: rgba(255,255,255,0.6); }

/* ---------- Home ---------- */
.tn-ch-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.tn-ch-head__welcome { font-size: 13px; color: rgba(255,255,255,0.6); }
.tn-ch-head__title { font-size: 32px; font-weight: 700; letter-spacing: -0.006em; margin: 0; }
.tn-ch-head__day { font-size: 13px; color: rgba(255,255,255,0.7); text-align: right; }
.tn-ch-head__day b { color: #fff; font-weight: 600; }
.tn-ticks { display: flex; gap: 3px; }
.tn-ticks > span { width: 14px; height: 6px; border-radius: 2px; background: rgba(255,255,255,0.12); }
.tn-ticks > span.is-done { background: var(--tn-leaf); }
.tn-ticks > span.is-current { background: var(--tn-sky); }

.tn-hero {
  display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr);
  background: linear-gradient(135deg, #12303f 0%, #101c25 60%);
  border: 1px solid rgba(91,193,234,0.28); border-radius: 20px; overflow: hidden;
}
.tn-hero__main { padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.tn-hero__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; color: var(--tn-sky); }
.tn-hero__title { font-size: 28px; font-weight: 700; line-height: 1.15; max-width: 600px; margin: 0; }
.tn-hero__body { font-size: 15px; line-height: 1.55; color: rgba(255,255,255,0.72); max-width: 580px; margin: 0; }
.tn-hero__actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.tn-hero__side { padding: 28px; display: flex; flex-direction: column; gap: 14px; justify-content: center; background: rgba(10,20,26,0.55); border-left: 1px solid rgba(255,255,255,0.06); }
.tn-hero__k { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; }
.tn-hero__k--have { color: #6fd16f; }
.tn-hero__k--unknown { color: var(--tn-amber); }
.tn-hero__v { font-size: 14px; line-height: 1.45; }
.tn-hero__rule { height: 1px; background: rgba(255,255,255,0.08); }

.tn-journey { padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.tn-journey__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tn-journey__sub { font-size: 12px; color: rgba(255,255,255,0.55); }
.tn-step {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08); color: var(--tn-fg-1); text-decoration: none; opacity: 0.7;
}
a.tn-step:hover { color: var(--tn-fg-1); border-color: rgba(91,193,234,0.4); }
.tn-step.is-done, .tn-step.is-current { opacity: 1; }
.tn-step.is-current { background: rgba(91,193,234,0.08); border-color: rgba(91,193,234,0.4); }
.tn-step__head { display: flex; align-items: center; gap: 10px; }
.tn-step__ring {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  border: 2px solid rgba(255,255,255,0.28); color: rgba(255,255,255,0.55);
}
.tn-step.is-done .tn-step__ring { background: var(--tn-leaf); border-color: var(--tn-leaf); color: #fff; }
.tn-step.is-current .tn-step__ring { background: rgba(91,193,234,0.15); border-color: var(--tn-sky); color: var(--tn-sky); }
.tn-step__name { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.tn-step__status { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.28); }
.tn-step.is-done .tn-step__status { color: var(--tn-leaf); }
.tn-step.is-current .tn-step__status { color: var(--tn-sky); }
.tn-step__text { font-size: 13px; line-height: 1.45; color: rgba(255,255,255,0.75); }

.tn-target { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.tn-target__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tn-target__tag { font-size: 12px; font-weight: 600; color: var(--tn-sky); }
.tn-target__tag.is-leaf { color: var(--tn-leaf); }
.tn-target__tag.is-mustard { color: var(--tn-mustard); }
.tn-target__big { display: flex; align-items: baseline; gap: 8px; }
.tn-target__big b { font-size: 32px; font-weight: 700; }
.tn-target__big span { font-size: 15px; color: rgba(255,255,255,0.6); }
.tn-target__note { font-size: 13px; line-height: 1.45; color: rgba(255,255,255,0.7); }
.tn-tiers-bar { position: relative; margin-top: 4px; }
.tn-tiers-bar__ticks { position: absolute; inset: -3px 0; display: grid; pointer-events: none; }
.tn-tiers-bar__ticks > span { border-right: 2px solid rgba(255,255,255,0.25); }
.tn-tiers-bar__ticks > span.is-reached { border-right-color: var(--tn-page); }
.tn-tiers { display: grid; }
.tn-tier { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.tn-tier__off { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.85); }
.tn-tier__n { font-size: 11px; color: rgba(255,255,255,0.5); }
.tn-tier.is-past .tn-tier__off { color: rgba(255,255,255,0.6); }
.tn-tier.is-current .tn-tier__off { font-size: 18px; color: #6fd16f; }
.tn-tier.is-current .tn-tier__n { color: #6fd16f; }
.tn-footnote { font-size: 12px; color: rgba(255,255,255,0.5); }

.tn-plain { border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.tn-plain__title { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.85); }
.tn-plain__row { display: flex; gap: 28px; row-gap: 8px; font-size: 13px; color: rgba(255,255,255,0.65); flex-wrap: wrap; }
.tn-plain__row b { color: #fff; font-weight: 600; }
.tn-plain__row b.is-amber { color: var(--tn-amber); }
.tn-plain__row b.is-sky { color: var(--tn-sky); }
.tn-plain__body { font-size: 13px; line-height: 1.45; color: rgba(255,255,255,0.65); }

/* Trial complete (stage 6) */
.tn-complete__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; color: #6fd16f; }
.tn-complete__closing { padding: 28px 32px; border-radius: 20px; background: linear-gradient(135deg, #12303f 0%, #101c25 60%); border: 1px solid rgba(91,193,234,0.28); display: flex; flex-direction: column; gap: 8px; }

/* ---------- Connect your audience (B13: invitation kit + fixed checklist) ---------- */
.tn-kit { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.tn-kit__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tn-kit__body { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.7); max-width: 640px; }
.tn-kit__surfaces { display: flex; flex-direction: column; gap: 10px; }
.tn-kit__surfaces[hidden] { display: none; }
.tn-kit__label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.tn-kit__qr { display: flex; align-items: flex-end; gap: 16px; }

.tn-checklist { overflow: hidden; }
.tn-checklist__head { padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.tn-checklist__sub { font-size: 13px; color: rgba(255,255,255,0.6); }
.tn-checklist__progress { display: flex; align-items: center; gap: 14px; }
.tn-checklist__progress .tn-meter { flex: 1; }
.tn-checklist__pct { font-size: 13px; white-space: nowrap; }
.tn-task {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 16px; align-items: center;
  padding: 14px 24px; border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer;
}
.tn-task:last-child { border-bottom: 0; }
.tn-task.is-on { background: rgba(60,163,60,0.05); }
.tn-task input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--tn-leaf); cursor: pointer; margin: 0; }
.tn-task input[type=checkbox]:disabled { cursor: default; }
.tn-task__text { font-size: 14px; line-height: 1.4; }
.tn-task__pct { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.75); min-width: 3.5em; text-align: right; }
.tn-task.is-on .tn-task__pct { color: #6fd16f; }
.tn-task__error { grid-column: 2 / 4; font-size: 12px; color: var(--tn-coral); }
.tn-task__error[hidden] { display: none; }
.tn-ch-btn {
  color: #fff; border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; white-space: nowrap; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.16);
}
.tn-ch-btn:hover { filter: brightness(1.15); }
.tn-ch-btn[disabled] { opacity: .6; cursor: progress; }
.tn-ch-copy { display: flex; gap: 8px; align-items: stretch; max-width: 640px; }
.tn-ch-copy input, .tn-ch-copy textarea {
  flex: 1; min-width: 0; background: var(--tn-page); color: #fff; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.tn-ch-copy textarea { min-height: 84px; resize: vertical; }
.tn-ch-qr { width: 132px; height: 132px; border-radius: 10px; background: #fff; padding: 6px; }
.tn-ch-error { font-size: 12px; color: var(--tn-coral); }
.tn-center-note { font-size: 12px; color: rgba(255,255,255,0.55); text-align: center; }

@media (max-width: 1100px) {
  .tn-grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 768px) {
  .tn-hero, .tn-grid-2, .tn-grid-3, .tn-grid-4 { grid-template-columns: minmax(0,1fr); }
  .tn-hero__side { border-left: 0; border-top: 1px solid rgba(255,255,255,0.06); }
  .tn-task { padding: 12px 16px; gap: 12px; }
  .tn-kit, .tn-checklist__head { padding: 16px; }
}

/* Checklist after the window ended (stage 6): read-only notice above the rows */
.tn-ch-ended { padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,0.06); color: var(--tn-fg-2, rgba(255,255,255,0.7)); font-size: 13px; margin-bottom: 10px; }

/* ---------- Trial UI refinement (UI review 2026-10-19) ---------- */

/* Status row at the top of every business Home: state · Founding member · type · joined */
.tn-status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tn-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: var(--tn-r-pill); padding: 5px 11px;
}
.tn-status-pill--pre { background: rgba(237,166,66,0.15); color: var(--tn-amber); }
.tn-status-pill--challenge { background: rgba(91,193,234,0.15); color: var(--tn-sky); }
.tn-status-pill--finished { background: rgba(255,255,255,0.1); color: #fff; }
.tn-status-pill--member { background: rgba(60,163,60,0.18); color: #6fd16f; }
.tn-status-pill--type { background: transparent; border: 1px solid rgba(255,255,255,0.16); color: rgba(255,255,255,0.8); letter-spacing: 0.04em; text-transform: none; font-weight: 600; }
.tn-status-row__meta { font-size: 13px; color: rgba(255,255,255,0.55); }

/* Founding member = lifetime membership: gold, in the sidebar and the status row */
.tn-founding {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content;
  font-family: var(--tn-font); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #D9B44A; background: rgba(217,180,74,0.12); border: 1px solid rgba(217,180,74,0.45);
  border-radius: var(--tn-r-pill); padding: 4px 10px;
}
.sidebar-founding { margin-top: 12px; }

/* Sidebar badges on the challenge steps: "12/40" while collecting, "Locked" until they open */
/* The 272 px sidebar leaves ~220 px per item: the badge keeps its size (prototype: 10 px, 0.06em, 2px 7px → tighter here)
   and a long label gives way instead of pushing the badge past the item's edge. */
.sidebar-badge { margin-left: auto; flex-shrink: 0; letter-spacing: 0.04em; padding: 2px 6px; }
.sidebar-nav-item .sidebar-nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sidebar-badge--count { color: var(--tn-sky); border-color: rgba(91,193,234,0.4); letter-spacing: 0.02em; }
.sidebar-badge--locked { color: rgba(255,255,255,0.55); border-color: rgba(255,255,255,0.16); background: rgba(255,255,255,0.04); }

/* Pre-trial Home: the onboarding card */
.tn-pretrial { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); overflow: hidden; }
.tn-pretrial__main { padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.tn-pretrial__side { padding: 28px; display: flex; flex-direction: column; gap: 14px; background: rgba(10,20,26,0.55); border-left: 1px solid rgba(255,255,255,0.06); }
.tn-slots { display: flex; gap: 10px; flex-wrap: wrap; }
.tn-slot {
  display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none;
}
a.tn-slot:hover { border-color: var(--tn-sky); background: rgba(91,193,234,0.12); color: #fff; }
.tn-oncall { margin: 0; padding: 0; list-style: none; counter-reset: oncall; display: flex; flex-direction: column; gap: 12px; }
.tn-oncall li { counter-increment: oncall; position: relative; padding-left: 32px; font-size: 14px; line-height: 1.45; color: rgba(255,255,255,0.85); }
.tn-oncall li::before {
  content: counter(oncall); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(91,193,234,0.15); color: var(--tn-sky); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tn-levels { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }

/* Member Home: next best actions */
.tn-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; text-decoration: none; }
.tn-action:hover { border-color: rgba(91,193,234,0.4); color: #fff; }
.tn-action__body { display: flex; flex-direction: column; gap: 4px; }
.tn-action__title { font-size: 15px; font-weight: 600; }
.tn-action__text { font-size: 13px; color: rgba(255,255,255,0.6); }
.tn-action__cta { font-size: 13px; font-weight: 600; color: var(--tn-sky); white-space: nowrap; }

/* TravelNet Updates: last on Home, lighter than Account */
.tn-updates { border-style: dashed; }

/* Toast (Offers: "+ New Offer" greyed out) */
.tn-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 1100; max-width: 360px;
  background: #0f1f2a; border: 1px solid rgba(91,193,234,0.35); border-radius: 12px;
  padding: 12px 16px; font-size: 14px; line-height: 1.4; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.tn-toast[hidden] { display: none; }

@media (max-width: 768px) {
  .tn-pretrial { grid-template-columns: minmax(0,1fr); }
  .tn-pretrial__side { border-left: 0; border-top: 1px solid rgba(255,255,255,0.06); }
}
