/* tc-tour.css — Onboarding tour overlay styles.
 * Built 2026-05-25. All colors via tc-shell.css design tokens per CLAUDE.md §2.24.
 */

/* ── Help (?) button in topbar ─────────────────────────────────────────── */
.tc-help-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--r-pill, 999px);
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  font-weight: 700; font-size: 1rem; line-height: 1;
  cursor: pointer; margin-left: 8px;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.tc-help-btn:hover { border-color: var(--teal, #0061D4); color: var(--teal, #0061D4); }
.tc-help-btn:active { transform: scale(.95); }
.tc-help-btn:focus-visible { outline: 2px solid var(--teal, #0061D4); outline-offset: 2px; }

/* When the topbar is missing, float bottom-right. */
.tc-help-btn:not(header.topbar .tc-help-btn) {
  position: fixed; right: 18px; bottom: 18px; z-index: 9990;
  box-shadow: var(--shadow-elevated, 0 8px 22px rgba(20,32,54,.18));
}

/* ── Overlay with cutout around target ─────────────────────────────────── */
.tc-tour-overlay {
  position: fixed; inset: 0; z-index: 9995;
  /* Two layers: a full-screen dim, with a transparent cutout positioned by JS */
  background:
    linear-gradient(rgba(20,32,54,.55), rgba(20,32,54,.55));
  /* The cutout: subtract a rectangle using clip-path. */
  --cut-t: 0px; --cut-l: 0px; --cut-w: 0px; --cut-h: 0px;
  clip-path: polygon(
    0 0, 100% 0, 100% 100%, 0 100%, 0 0,
    var(--cut-l) var(--cut-t),
    var(--cut-l) calc(var(--cut-t) + var(--cut-h)),
    calc(var(--cut-l) + var(--cut-w)) calc(var(--cut-t) + var(--cut-h)),
    calc(var(--cut-l) + var(--cut-w)) var(--cut-t),
    var(--cut-l) var(--cut-t)
  );
  animation: tc-tour-fade-in .18s ease;
  cursor: pointer;
}
@keyframes tc-tour-fade-in { from { opacity: 0; } to { opacity: 1; } }

.tc-tour-target {
  position: relative;
  z-index: 9996;
  box-shadow: 0 0 0 4px var(--teal, #0061D4), 0 8px 24px rgba(20,32,54,.25);
  border-radius: var(--r-md, 10px);
  transition: box-shadow .2s;
}

/* ── Popover card ──────────────────────────────────────────────────────── */
.tc-tour-popover {
  position: fixed; z-index: 10000;
  width: min(360px, calc(100vw - 32px));
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  border: 1px solid var(--border-soft, #eee);
  border-radius: var(--r-lg, 14px);
  box-shadow: var(--shadow-elevated, 0 12px 32px rgba(20,32,54,.18));
  padding: 18px 18px 14px;
  animation: tc-tour-pop-in .18s ease;
}
@keyframes tc-tour-pop-in {
  from { opacity: 0; transform: translateY(4px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.tc-tour-arrow {
  position: absolute;
  width: 14px; height: 14px;
  background: var(--surface, #fff);
  border: 1px solid var(--border-soft, #eee);
  transform: rotate(45deg);
  z-index: -1;
}
.tc-tour-popover[data-arrow="top"]    .tc-tour-arrow { top: -7px;   border-right: 0; border-bottom: 0; }
.tc-tour-popover[data-arrow="bottom"] .tc-tour-arrow { bottom: -7px;border-left:  0; border-top:    0; }
.tc-tour-popover[data-arrow="left"]   .tc-tour-arrow { left: -7px;  border-right: 0; border-top:    0; }
.tc-tour-popover[data-arrow="right"]  .tc-tour-arrow { right: -7px; border-left:  0; border-bottom: 0; }
.tc-tour-popover[data-arrow="none"]   .tc-tour-arrow { display: none; }

.tc-tour-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.tc-tour-title {
  font-size: var(--h3-size, 1.05rem);
  font-weight: var(--weight-semibold, 600);
  color: var(--text, #1a1a1a);
  letter-spacing: var(--tracking-tight, -.01em);
  line-height: 1.3;
}
.tc-tour-counter {
  font-size: var(--small-size, .8rem);
  color: var(--muted, #888);
  font-weight: var(--weight-medium, 500);
  white-space: nowrap;
}
.tc-tour-body {
  font-size: var(--body-size, .94rem);
  color: var(--text, #1a1a1a);
  line-height: 1.5;
  margin-bottom: 16px;
}

.tc-tour-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.tc-tour-btn {
  font-family: inherit; cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--r-md, 10px);
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  font-size: var(--small-size, .85rem);
  font-weight: var(--weight-semibold, 600);
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.tc-tour-btn:hover { border-color: var(--teal, #0061D4); color: var(--teal, #0061D4); }
.tc-tour-btn:active { transform: scale(.97); }
.tc-tour-btn-primary {
  background: var(--teal, #0061D4);
  color: #fff;
  border-color: var(--teal, #0061D4);
}
.tc-tour-btn-primary:hover {
  background: var(--teal2, #004FA6);
  border-color: var(--teal2, #004FA6);
  color: #fff;
}
.tc-tour-btn-ghost { background: transparent; }

.tc-tour-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft, #eee);
  display: flex; justify-content: space-between; gap: 12px;
}
.tc-tour-foot-link {
  background: none; border: 0; padding: 0;
  font-family: inherit;
  font-size: var(--caption-size, .78rem);
  color: var(--muted, #888);
  cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.tc-tour-foot-link:hover { color: var(--text, #1a1a1a); }

/* ── Help menu dropdown ────────────────────────────────────────────────── */
.tc-tour-menu {
  position: fixed; z-index: 10010;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 100px);
  overflow: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--border-soft, #eee);
  border-radius: var(--r-lg, 14px);
  box-shadow: var(--shadow-elevated, 0 12px 32px rgba(20,32,54,.18));
  padding: 8px 0;
  animation: tc-tour-pop-in .15s ease;
}
.tc-tour-menu-head {
  padding: 8px 16px 6px;
  font-size: var(--caption-size, .75rem);
  font-weight: var(--weight-bold, 700);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide, .08em);
  color: var(--muted, #888);
}
.tc-tour-menu-row {
  position: relative;
  padding: 10px 16px;
  border-top: 1px solid var(--border-soft, #eee);
}
.tc-tour-menu-row:first-of-type { border-top: 0; }
.tc-tour-menu-title {
  font-size: var(--body-size, .94rem);
  font-weight: var(--weight-semibold, 600);
  color: var(--text, #1a1a1a);
  margin-bottom: 2px;
}
.tc-tour-menu-desc {
  font-size: var(--small-size, .82rem);
  color: var(--subtext, #555);
  line-height: 1.35;
  margin-bottom: 8px;
}
.tc-tour-menu-actions {
  display: flex; gap: 6px;
}
.tc-tour-mini-btn {
  font-family: inherit; cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--r-sm, 6px);
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  font-size: var(--caption-size, .78rem);
  font-weight: var(--weight-semibold, 600);
}
.tc-tour-mini-btn:hover { border-color: var(--teal, #0061D4); color: var(--teal, #0061D4); }
.tc-tour-mini-primary {
  background: var(--teal, #0061D4);
  color: #fff;
  border-color: var(--teal, #0061D4);
}
.tc-tour-mini-primary:hover {
  background: var(--teal2, #004FA6);
  border-color: var(--teal2, #004FA6);
  color: #fff;
}
.tc-tour-menu-status {
  position: absolute; top: 10px; right: 16px;
  font-size: var(--caption-size, .72rem);
  color: var(--muted, #888);
  font-weight: var(--weight-medium, 500);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide, .06em);
}
.tc-tour-menu-row[data-status="completed"] .tc-tour-menu-status { color: var(--success, #10B981); }
.tc-tour-menu-row[data-status="dismissed"] .tc-tour-menu-status { color: var(--muted, #888); }
.tc-tour-menu-row[data-status="in_progress"] .tc-tour-menu-status { color: var(--teal, #0061D4); }

.tc-tour-menu-resetall {
  display: block;
  width: calc(100% - 24px);
  margin: 6px 12px 8px;
  padding: 8px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: var(--caption-size, .78rem);
  color: var(--muted, #888);
  cursor: pointer;
  text-align: center;
  border-radius: var(--r-sm, 6px);
}
.tc-tour-menu-resetall:hover { color: var(--danger, #EF4444); background: rgba(239,68,68,.06); }

/* ── Tutorials section card (account.html) ─────────────────────────────── */
.tutorials-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--r-md, 10px);
  background: var(--surface, #fff);
}
.tutorials-row + .tutorials-row { margin-top: 8px; }
.tutorials-row .tutorials-meta { flex: 1; min-width: 0; }
.tutorials-row .tutorials-name {
  font-weight: var(--weight-semibold, 600);
  color: var(--text, #1a1a1a);
  font-size: var(--body-size, .94rem);
}
.tutorials-row .tutorials-desc {
  font-size: var(--small-size, .82rem);
  color: var(--subtext, #555);
  line-height: 1.35;
}
.tutorials-row .tutorials-status {
  font-size: var(--caption-size, .72rem);
  font-weight: var(--weight-semibold, 600);
  padding: 3px 8px;
  border-radius: var(--r-pill, 999px);
  background: var(--bg, #f5f5f5);
  color: var(--muted, #888);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide, .06em);
  white-space: nowrap;
}
.tutorials-row[data-status="completed"] .tutorials-status { background: rgba(16,185,129,.12); color: var(--success, #10B981); }
.tutorials-row[data-status="in_progress"] .tutorials-status { background: rgba(0,97,212,.12);  color: var(--teal,    #0061D4); }
.tutorials-row[data-status="dismissed"]  .tutorials-status { background: rgba(136,136,136,.10); color: var(--muted,  #888);    }

/* ── Dock chip "Tour me" ───────────────────────────────────────────────── */
.cl-chip.cl-chip-tour {
  border-style: dashed;
  color: var(--teal, #0061D4);
  border-color: var(--teal, #0061D4);
}
.cl-chip.cl-chip-tour:hover { background: rgba(0,97,212,.06); }

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .tc-tour-popover { width: calc(100vw - 24px); left: 12px !important; right: 12px; }
  .tc-tour-arrow { display: none !important; }
  .tc-tour-menu  { width: calc(100vw - 24px); right: 12px !important; left: 12px; }
}

/* Tour welcome graphic (2026-08-02) — the getting-started flow. */
.tc-tour-graphic{margin:2px 0 12px}
.tc-tg-flow{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px}
.tc-tg-step{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:58px}
.tc-tg-ic{width:40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:20px;background:rgba(0,97,212,.10);border:1px solid rgba(0,97,212,.18)}
.tc-tg-lbl{font-size:.66rem;font-weight:700;color:var(--subtext,#6B7A8D);text-align:center;line-height:1.1}
.tc-tg-arrow{color:var(--teal,#0061D4);font-weight:900;font-size:1rem;opacity:.7}

/* ══ 2026-10-06 phase 2 — one visual standard for EVERY tour step ═════════
   Target: thick YELLOW ring + soft amber glow + gentle pulse (separate
   .tc-tour-ring element above the dim layer). Everything else: dimmed AND
   grayed out (backdrop-filter on the overlay, cut out around the target).
   Card: icon circle, tour eyebrow, "Step n of N" + thin progress bar, Back /
   Repeat step / Next, 5-language switcher and an always-visible Exit. */
.tc-tour-overlay {
  background: linear-gradient(rgba(15,23,42,.58), rgba(15,23,42,.58));
  -webkit-backdrop-filter: grayscale(.9) blur(1px);
  backdrop-filter: grayscale(.9) blur(1px);
}
.tc-tour-target { box-shadow: none; }
.tc-tour-ring {
  position: fixed; z-index: 9997; pointer-events: none;
  border: 4px solid var(--tour-yellow, #FACC15);
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(250,204,21,.35), 0 0 26px 8px rgba(245,158,11,.55), inset 0 0 0 1px rgba(255,255,255,.6);
  animation: tc-tour-ring-pulse 1.6s ease-in-out infinite;
  transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease;
}
@keyframes tc-tour-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(250,204,21,.35), 0 0 22px 6px rgba(245,158,11,.45), inset 0 0 0 1px rgba(255,255,255,.6); }
  50%      { box-shadow: 0 0 0 8px rgba(250,204,21,.22), 0 0 34px 12px rgba(245,158,11,.62), inset 0 0 0 1px rgba(255,255,255,.6); }
}
@media (prefers-reduced-motion: reduce) { .tc-tour-ring { animation: none; } }

.tc-tour-popover { width: min(380px, calc(100vw - 24px)); padding: 16px 16px 12px; border-top: 4px solid var(--tour-yellow, #FACC15); }
.tc-tour-x {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: transparent; color: var(--subtext, #5a6781); font-size: 1.35rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.tc-tour-x:hover { background: rgba(15,23,42,.06); color: var(--text, #1a1a1a); }
.tc-tour-head { justify-content: flex-start; align-items: center; gap: 12px; margin: 0 28px 10px 0; }
.tc-tour-icon {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0,97,212,.10); border: 1px solid rgba(0,97,212,.18);
  color: var(--teal, #0061D4); display: flex; align-items: center; justify-content: center;
}
.tc-tour-icon svg { width: 22px; height: 22px; }
.tc-tour-head-txt { min-width: 0; }
.tc-tour-eyebrow {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--subtext, #5a6781); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-tour-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tc-tour-progress .tc-tour-counter { font-size: .75rem; font-weight: 700; color: var(--subtext, #5a6781); }
.tc-tour-bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(15,23,42,.08); overflow: hidden; }
.tc-tour-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--tour-amber, #F59E0B), var(--tour-yellow, #FACC15)); transition: width .25s ease; }
.tc-tour-body { margin-bottom: 12px; }
.tc-tour-list { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: .88rem; }
.tc-tour-example {
  margin-top: 10px; padding: 9px 11px; border-radius: 10px;
  background: rgba(250,204,21,.12); border: 1px solid rgba(245,158,11,.35); font-size: .85rem; line-height: 1.45;
}
.tc-tour-example-h { font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--warning-text, #92400E); margin-bottom: 3px; }
.tc-tour-allow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 12px; padding: 7px 10px;
  border-radius: 10px; font-size: .8rem; font-weight: 700;
  background: rgba(0,97,212,.08); color: var(--teal, #0061D4); border: 1px solid rgba(0,97,212,.18);
}
.tc-tour-allow-over { background: rgba(245,158,11,.12); color: var(--warning-text, #92400E); border-color: rgba(245,158,11,.4); }
.tc-tour-allow-cta { margin-left: auto; font-weight: 800; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tc-tour-hint { margin: -4px 0 12px; font-size: .8rem; font-weight: 700; color: var(--teal, #0061D4); }
.tc-tour-actions { flex-wrap: wrap; }
.tc-tour-btn-repeat { margin-right: auto; padding-left: 10px; padding-right: 10px; }
.tc-tour-foot { align-items: center; }
.tc-tour-langs { display: inline-flex; gap: 2px; padding: 2px; border-radius: 50px; border: 1px solid var(--border, #e5e7eb); }
.tc-tour-lang {
  border: 0; background: transparent; cursor: pointer; font: inherit; font-size: .68rem; font-weight: 800;
  color: var(--subtext, #5a6781); padding: 3px 7px; border-radius: 50px;
}
.tc-tour-lang.on { background: var(--teal, #0061D4); color: #fff; }
.tc-tour-exit { font-weight: 700; color: var(--subtext, #5a6781); }
@media (max-width: 520px) {
  .tc-tour-popover { max-height: calc(100vh - 24px); overflow-y: auto; }
  .tc-tour-btn { padding: 8px 12px; }
}

/* 2026-10-06 phase 4: step groups ("Menú 3 de 11" + skip the group) */
.tc-tour-subcount {
  display: inline-block; margin: 2px 0 8px; padding: 3px 9px; border-radius: 99px;
  font-size: .72rem; font-weight: 800; letter-spacing: .02em;
  color: #713F12; background: rgba(250, 204, 21, .22); border: 1px solid rgba(234, 179, 8, .45);
}
.tc-tour-skiprow { display: flex; justify-content: flex-end; margin-top: 6px; }
.tc-tour-skipgrp { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* 2026-10-07 phase 4b: plan chip second line (packs / renewal) + pack prices under AI-plan steps */
.tc-tour-allow-sub { flex-basis: 100%; margin-top: 4px; font-size: .74rem; font-weight: 600; opacity: .9; }
.tc-tour-packs { margin-top: 8px; padding: 7px 10px; border-radius: 10px; font-size: .78rem; line-height: 1.45;
  color: var(--text, #1a1a1a); background: rgba(0, 97, 212, .06); border: 1px solid rgba(0, 97, 212, .18); }

.tc-tour-allows { display: flex; flex-direction: column; gap: 6px; margin: -2px 0 12px; }
.tc-tour-allows > .tc-tour-allow { margin: 0; }

/* 2026-10-07 phase 4d: the tour HUB card ("¿Qué quieres aprender ahora?").
   One component, same look on every open; 2 columns on desktop, 1 on phones. */
.tc-tour-hub-ov {
  position: fixed; inset: 0; z-index: 10005; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(15, 23, 42, .55); overflow-y: auto;
}
.tc-tour-hub {
  position: relative; width: min(720px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--surface, #fff); color: var(--text, #1a1a1a);
  border: 1px solid var(--border-soft, #eee); border-top: 4px solid var(--tour-yellow, #FACC15);
  border-radius: var(--r-lg, 14px); box-shadow: var(--shadow-elevated, 0 12px 32px rgba(20,32,54,.18));
  padding: 18px 18px 14px; animation: tc-tour-pop-in .18s ease;
}
.tc-tour-hub-x {
  position: absolute; top: 10px; right: 12px; border: none; background: transparent; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: var(--muted, #8B92A5); padding: 4px 6px;
}
.tc-tour-hub-head { display: flex; align-items: center; gap: 12px; padding-right: 28px; }
.tc-tour-hub-kicker { font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--subtext, #6B7A8D); }
.tc-tour-hub-title { margin: 2px 0 0; font-size: 1.25rem; font-weight: 800; line-height: 1.2; color: var(--text, #1a1a1a); }
.tc-tour-hub-sub { margin: 10px 0 12px; font-size: .92rem; line-height: 1.5; color: var(--text, #1a1a1a); }
.tc-tour-hub-count { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: .8rem; font-weight: 700; color: var(--subtext, #6B7A8D); }
.tc-tour-hub-bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(0, 97, 212, .12); overflow: hidden; }
.tc-tour-hub-bar > i { display: block; height: 100%; background: var(--teal, #0061D4); border-radius: 99px; }
.tc-tour-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tc-tour-hub-tile {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; cursor: pointer; font-family: inherit;
  padding: 10px 12px; border-radius: 12px; background: var(--surface, #fff); color: var(--text, #1a1a1a);
  border: 1px solid var(--border, #D7E5F8); transition: border-color .15s, box-shadow .15s;
}
.tc-tour-hub-tile:hover, .tc-tour-hub-tile:focus-visible { border-color: var(--teal, #0061D4); box-shadow: 0 0 0 3px rgba(0, 97, 212, .15); outline: none; }
.tc-tour-hub-tile.is-done { background: rgba(22, 163, 74, .06); border-color: rgba(22, 163, 74, .35); }
.tc-tour-hub-tic {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 97, 212, .10); color: var(--teal, #0061D4);
}
.tc-tour-hub-tic svg { width: 18px; height: 18px; }
.tc-tour-hub-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-tour-hub-tt { font-weight: 800; font-size: .9rem; line-height: 1.25; }
.tc-tour-hub-tp { font-size: .78rem; line-height: 1.35; color: var(--subtext, #6B7A8D); }
.tc-tour-hub-tm { font-size: .72rem; font-weight: 600; color: var(--muted, #8B92A5); }
.tc-tour-hub-st { flex: 0 0 auto; align-self: center; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.tc-tour-hub-st.go { color: #fff; background: var(--teal, #0061D4); padding: 6px 10px; border-radius: 9px; }
.tc-tour-hub-st.done { color: var(--success-text, #15803D); white-space: normal; max-width: 92px; text-align: right; }
.tc-tour-hub-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft, #eee); }
body.tc-tour-hub-on { overflow: hidden; }
@media (max-width: 640px) {
  .tc-tour-hub-ov { padding: 10px; align-items: flex-start; }
  .tc-tour-hub { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); padding: 14px 14px 12px; }
  .tc-tour-hub-grid { grid-template-columns: 1fr; }
  .tc-tour-hub-title { font-size: 1.1rem; }
  .tc-tour-hub-foot .tc-tour-hub-finish { width: 100%; }
}

/* 4e: suggested path — first four tiles */
.tc-tour-hub-tile.is-sug { border-color: rgba(0, 97, 212, .45); background: rgba(0, 97, 212, .04); padding: 12px 12px; }
.tc-tour-hub-tile.is-sug.is-done { background: rgba(22, 163, 74, .06); border-color: rgba(22, 163, 74, .35); }
.tc-tour-hub-sug { display: inline-block; vertical-align: 1px; margin-left: 4px; padding: 1px 7px; border-radius: 99px; font-size: .64rem; font-weight: 800;
  letter-spacing: .03em; text-transform: uppercase; color: var(--warning-text, #92400E); background: rgba(250, 204, 21, .28); border: 1px solid rgba(234, 179, 8, .45); }

/* ── 2026-10-07 tour-fix pass ──────────────────────────────────────────── */
/* H8: on phones the card never takes more than half the screen, so the ring
   (and the control it points at) stays visible in the other half. */
@media (max-width: 519px) {
  .tc-tour-popover { max-height: min(46vh, calc(100vh - 24px)); overflow-y: auto; }
}
/* H5: the "?" menu is the catalog: compact rows, grouped by area, link to tours.html */
.tc-tour-menu { width: min(360px, calc(100vw - 32px)); }
.tc-tour-menu-link {
  display: block; margin: 0 12px 4px; padding: 9px 12px;
  border-radius: var(--r-sm, 8px); text-decoration: none;
  font-size: var(--small-size, .86rem); font-weight: var(--weight-bold, 700);
  color: #422006; background: rgba(250, 204, 21, .22); border: 1px solid rgba(250, 204, 21, .55);
}
.tc-tour-menu-link:hover { background: rgba(250, 204, 21, .34); }
.tc-tour-menu-area {
  padding: 10px 16px 4px;
  font-size: .66rem; font-weight: var(--weight-bold, 800); letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted, #888);
}
a.tc-tour-menu-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px; border-top: 0; text-decoration: none; color: inherit;
}
a.tc-tour-menu-row:hover { background: rgba(0, 97, 212, .06); }
a.tc-tour-menu-row .tc-tour-menu-title { margin: 0; font-size: var(--small-size, .86rem); flex: 1; min-width: 0; }
a.tc-tour-menu-row .tc-tour-menu-status { position: static; flex: 0 0 auto; text-transform: none; letter-spacing: 0; }
.tc-tour-menu-ic { display: inline-flex; width: 22px; height: 22px; flex: 0 0 auto; color: var(--teal, #0061D4); }
.tc-tour-menu-ic svg { width: 22px; height: 22px; }
a.tc-tour-menu-resetall { text-decoration: none; color: var(--teal, #0061D4); font-weight: var(--weight-bold, 700); }
a.tc-tour-menu-resetall:hover { color: var(--teal2, #004FA6); background: rgba(0, 97, 212, .06); }
/* Hub: sized by tc-tour.js hubFit() to the visual viewport (inline styles) */

/* ── 2026-10-09: scrollable card, pinned buttons, "More below" cue ──────────
   Daniel: "give these modals the chance to scroll, make it clear there is more
   content and buttons below; consider people with bad eyesight". The card is
   capped to the visible screen; head + progress + actions + footer stay pinned,
   only .tc-tour-scroll scrolls. The popover itself no longer scrolls (the old
   phone rules set overflow-y:auto on it, which hid the buttons). */
.tc-tour-popover {
  display: flex; flex-direction: column;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: visible;
}
.tc-tour-popover > * { flex: 0 0 auto; }
.tc-tour-popover > .tc-tour-arrow { flex: none; }
.tc-tour-scrollwrap { position: relative; flex: 1 1 auto; min-height: 72px; display: flex; flex-direction: column; }
.tc-tour-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin-right: -8px; padding-right: 8px;          /* scrollbar sits in the card gutter */
  scrollbar-width: auto; scrollbar-color: var(--teal, #0061D4) rgba(0, 97, 212, .12);
}
.tc-tour-scroll:focus-visible { outline: 3px solid var(--tour-yellow, #FACC15); outline-offset: 2px; border-radius: 6px; }
.tc-tour-scroll::-webkit-scrollbar { width: 10px; }
.tc-tour-scroll::-webkit-scrollbar-track { background: rgba(0, 97, 212, .10); border-radius: 10px; }
.tc-tour-scroll::-webkit-scrollbar-thumb { background: var(--teal, #0061D4); border-radius: 10px; border: 2px solid var(--surface, #fff); }
.tc-tour-scroll > :last-child:not(.tc-tour-body) { margin-bottom: 4px; }
/* Fade over the last lines while more is hidden below */
.tc-tour-scrollwrap::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--surface, #fff) 78%);
  opacity: 0; transition: opacity .2s;
}
.tc-tour-scrollwrap.has-more::after { opacity: 1; }
/* "More below ↓" pill: large, high-contrast, tappable */
.tc-tour-more {
  position: absolute; left: 50%; bottom: 8px; z-index: 2; transform: translateX(-50%);
  display: none; align-items: center; gap: 6px;
  min-height: 40px; padding: 8px 16px 8px 18px; border-radius: 99px;
  border: 2px solid #fff; background: var(--navy, #0B3F82); color: #fff;
  font: inherit; font-size: 1rem; font-weight: 800; line-height: 1; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(11, 31, 58, .35); cursor: pointer;
  animation: tc-tour-more-bob 1.6s ease-in-out infinite;
}
.tc-tour-more:hover { background: var(--teal, #0061D4); }
.tc-tour-more:focus-visible { outline: 3px solid var(--tour-yellow, #FACC15); outline-offset: 2px; }
.tc-tour-scrollwrap.has-more .tc-tour-more { display: inline-flex; }
@keyframes tc-tour-more-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 4px); } }
@media (prefers-reduced-motion: reduce) { .tc-tour-more { animation: none; } }
/* Pinned action row reads as separate from the text once anything scrolls */
.tc-tour-scrollwrap.has-more + .tc-tour-actions,
.tc-tour-scrollwrap.is-scrolled + .tc-tour-actions { border-top: 1px solid var(--border, #e5e7eb); padding-top: 10px; }
.tc-tour-scrollwrap + .tc-tour-actions { margin-top: 2px; }
@media (max-width: 519px) {
  .tc-tour-popover { max-height: min(46vh, calc(100vh - 24px)); max-height: min(46dvh, calc(100dvh - 24px)); overflow: visible; }
  .tc-tour-more { font-size: .95rem; min-height: 38px; }
}
/* Dark mode: fade into the dark card, keep the pill bright */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .tc-tour-scroll::-webkit-scrollbar-thumb { border-color: var(--surface, #111827); }
}
/* Phones: a centered card (intro / whole-page step) points at nothing, so it may
   use most of the screen; target steps keep the half-screen cap (H8). */
@media (max-width: 519px) {
  .tc-tour-popover.tc-tour-centered { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
}

/* 2026-10-10 audit fixes.
   H1: on phones / short or zoomed screens the pinned rows could spill below the
   card (Next off-screen at 200% text). There the card itself may scroll as a last
   resort, and Back/Next stay stuck to its bottom edge so they are always visible. */
@media (max-width: 519px), (max-height: 560px) {
  .tc-tour-popover { overflow-y: auto; overscroll-behavior: contain; }
  .tc-tour-popover .tc-tour-arrow { display: none; }
  .tc-tour-scrollwrap { min-height: 48px; }
  .tc-tour-actions {
    position: sticky; bottom: 0; z-index: 3;
    background: var(--surface, #fff); padding-bottom: 6px; margin-bottom: -6px;
  }
}
/* L12: a short text area gets a smaller fade and pill so the text stays readable */
.tc-tour-scrollwrap.is-short::after { height: 30px; }
.tc-tour-scrollwrap.is-short .tc-tour-more { min-height: 32px; padding: 5px 12px 5px 14px; font-size: .9rem; bottom: 2px; }
/* the click-to-continue hint now sits pinned under the scroll area */
.tc-tour-actions > .tc-tour-hint { flex: 1 0 100%; margin: 0 0 4px; font-size: .95rem; }
/* Very short screens (200% zoom / large text on a phone): the half-screen cap
   would leave no room for the text, so the card may use the full height. */
@media (max-height: 440px) {
  .tc-tour-popover, .tc-tour-popover.tc-tour-centered { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
}
