/* The Testing Academy — Playwright Practice
   Shared theme: ChatGPT-inspired neutral workspace, light + dark, plus the
   collapsible sidebar shell used on every page.
   ----------------------------------------------------------------
   NOTE: Google Fonts are loaded via <link rel="stylesheet"> in each
   page's <head> (with preconnect) — not via @import here — so the
   font request doesn't block CSS parsing in a 3-deep chain. */

:root {
  --bg: #ffffff;
  --bg-2: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #ececf1;
  --ink: #202123;
  --ink-soft: #343541;
  --muted: #6e6e80;
  --muted-2: #8e8ea0;
  --accent: #10a37f;
  --accent-strong: #0e8f70;
  --accent-soft: #d8f3ea;
  --accent-ghost: #ecf8f4;
  --border: #e5e5e5;
  --border-strong: #d9d9e3;
  --code-bg: #f1f1f3;
  --code-ink: #0f766e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.11);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --sidebar-w: 280px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 60px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #212121;
  --bg-2: #171717;
  --surface: #2f2f2f;
  --surface-2: #171717;
  --surface-3: #3a3a3a;
  --ink: #ececf1;
  --ink-soft: #d9d9e3;
  --muted: #b4b4b4;
  --muted-2: #8e8ea0;
  --accent: #19c37d;
  --accent-strong: #2dd4a0;
  --accent-soft: #12382d;
  --accent-ghost: #183c32;
  --border: #3a3a3a;
  --border-strong: #565869;
  --code-bg: #171717;
  --code-ink: #8be9d0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ---------- Shell layout ---------- */

.tta-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.24s ease;
}

.tta-shell[data-sidebar-collapsed="true"] {
  grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr);
}

/* ---------- Sidebar ---------- */

.tta-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition: width 0.24s ease;
}

.tta-sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
}

.tta-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.tta-brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.2);
}

.tta-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.tta-brand-text strong {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tta-brand-text span {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tta-icon-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.16s ease;
}

.tta-icon-btn:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
}

.tta-icon-btn svg {
  width: 18px;
  height: 18px;
}

.tta-sidebar-search {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.tta-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  transition: 0.16s ease;
}

.tta-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ghost);
}

.tta-search-wrap svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.tta-search-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
}

.tta-search-wrap input::placeholder {
  color: var(--muted-2);
}

.tta-search-wrap kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tta-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px 16px;
}

.tta-nav-section {
  margin-bottom: 18px;
}

.tta-nav-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  transition: background 0.14s ease, color 0.14s ease;
}

.tta-nav-section-title:hover {
  background: var(--accent-ghost);
  color: var(--accent-strong);
}

.tta-nav-section-title svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.tta-nav-section-title .section-chevron {
  margin-left: auto;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  opacity: 0.7;
  transition: transform 0.18s ease;
}

.tta-nav-section[data-collapsed="true"] .section-chevron {
  transform: rotate(-90deg);
}

.tta-nav-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 1600px;
  overflow: hidden;
  transition: max-height 0.22s ease;
}

.tta-nav-section[data-collapsed="true"] .tta-nav-list {
  max-height: 0;
}

.tta-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: 0.14s ease;
}

.tta-nav-link:hover {
  background: var(--surface);
  color: var(--ink);
}

.tta-nav-link[aria-current="page"],
.tta-nav-link.is-active {
  color: var(--accent-strong);
  background: var(--accent-ghost);
  font-weight: 600;
}

[data-theme="dark"] .tta-nav-link[aria-current="page"],
[data-theme="dark"] .tta-nav-link.is-active {
  color: var(--accent-strong);
}

.tta-nav-link .nav-dot {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted);
  transition: color 0.14s ease;
}

.tta-nav-link .nav-dot svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.tta-nav-link:hover .nav-dot {
  color: var(--ink);
}

.tta-nav-link[aria-current="page"] .nav-dot,
.tta-nav-link.is-active .nav-dot {
  color: var(--accent);
}

.tta-nav-link.is-disabled {
  color: var(--muted-2);
  cursor: not-allowed;
  pointer-events: none;
}

.tta-nav-link.is-disabled .nav-dot {
  color: var(--muted-2);
  opacity: 0.7;
}

/* Fallback: if JS hasn't hydrated the dot yet, show a 6px circle so the layout
   doesn't shift. Once shell.js injects an <svg>, the icon takes over. */
.tta-nav-link .nav-dot:empty::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tta-nav-link .nav-tag {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tta-nav-link .nav-tag.is-soon {
  background: var(--surface-2);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}


.tta-sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.74rem;
}

.tta-sidebar-foot small {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tta-theme-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: 0.16s ease;
}

.tta-theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.tta-theme-toggle svg {
  width: 16px;
  height: 16px;
}

.tta-theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .tta-theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .tta-theme-toggle .icon-moon {
  display: none;
}

/* Collapsed sidebar — desktop only */
@media (min-width: 1024px) {
  .tta-shell[data-sidebar-collapsed="true"] .tta-sidebar {
    width: var(--sidebar-w-collapsed);
  }

  .tta-shell[data-sidebar-collapsed="true"] .tta-brand-text,
  .tta-shell[data-sidebar-collapsed="true"] .tta-sidebar-search,
  .tta-shell[data-sidebar-collapsed="true"] .tta-nav-section-title span,
  .tta-shell[data-sidebar-collapsed="true"] .tta-nav-link span:not(.nav-dot),
  .tta-shell[data-sidebar-collapsed="true"] .tta-nav-link .nav-tag,
  .tta-shell[data-sidebar-collapsed="true"] .tta-sidebar-foot small {
    display: none;
  }

  .tta-shell[data-sidebar-collapsed="true"] .tta-sidebar-head,
  .tta-shell[data-sidebar-collapsed="true"] .tta-sidebar-foot {
    justify-content: center;
  }

  .tta-shell[data-sidebar-collapsed="true"] .tta-nav-link {
    justify-content: center;
    padding: 0;
  }
}

/* ---------- Topbar ---------- */

.tta-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 clamp(14px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.tta-mobile-toggle {
  display: grid;
  margin-right: 4px;
}

.tta-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.tta-breadcrumb strong {
  color: var(--ink);
  font-weight: 600;
}

.tta-breadcrumb svg {
  width: 14px;
  height: 14px;
}

.tta-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Main content area ---------- */

.tta-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.tta-content {
  flex: 1;
  padding: 32px clamp(18px, 4vw, 48px) 64px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Common utility classes ---------- */

.tta-display {
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

.tta-mono {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.tta-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tta-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.tta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tta-pill.is-accent {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-strong);
  background: var(--accent-ghost);
}

.tta-pill.is-mint {
  border-color: rgba(22, 185, 129, 0.3);
  color: #15795c;
  background: rgba(22, 185, 129, 0.1);
}

[data-theme="dark"] .tta-pill.is-mint {
  color: #5dd9b3;
  background: rgba(22, 185, 129, 0.16);
}

.tta-pill.is-amber {
  border-color: rgba(217, 138, 73, 0.32);
  color: #a35316;
  background: rgba(217, 138, 73, 0.12);
}

[data-theme="dark"] .tta-pill.is-amber {
  color: #f5b888;
  background: rgba(217, 138, 73, 0.18);
}

.tta-pill.is-rose {
  border-color: rgba(217, 84, 89, 0.3);
  color: #b3343b;
  background: rgba(217, 84, 89, 0.12);
}

[data-theme="dark"] .tta-pill.is-rose {
  color: #f0a0a4;
  background: rgba(217, 84, 89, 0.18);
}

.tta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: 0.16s ease;
  box-shadow: 0 1px 2px rgba(16, 163, 127, 0.18);
}

.tta-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 163, 127, 0.22);
}

.tta-button.is-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
  box-shadow: none;
}

.tta-button.is-secondary:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.tta-button.is-ghost {
  background: transparent;
  color: var(--accent-strong);
  box-shadow: none;
}

.tta-button.is-ghost:hover {
  background: var(--accent-ghost);
}

.tta-button svg {
  width: 16px;
  height: 16px;
}

.tta-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: 0.18s ease;
}

.tta-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

code,
.tta-code-inline {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.86em;
  font-weight: 500;
  padding: 0.1em 0.36em;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-ink);
}

/* ---------- Locator markings ----------
   Tiny inline chips that show students the test-relevant attributes
   (id, name, data-testid, role, etc.) next to each interactive element.
   Keep them subtle so they don't fight with the practice UI.        */

.tta-mark {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
}

.tta-mark .tta-mark-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.tta-mark .tta-mark-chip b {
  color: var(--accent-strong);
  font-weight: 600;
}

.tta-mark .tta-mark-chip.is-id b {
  color: #357a8a;
}

[data-theme="dark"] .tta-mark .tta-mark-chip.is-id b {
  color: #75c4d4;
}

.tta-mark .tta-mark-chip.is-name b {
  color: #6a4ba2;
}

[data-theme="dark"] .tta-mark .tta-mark-chip.is-name b {
  color: #b39bdf;
}

.tta-mark .tta-mark-chip.is-test b {
  color: var(--accent-strong);
}

.tta-mark-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tta-mark-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.14s ease;
}

.tta-mark-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.tta-mark-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

body[data-marks="off"] .tta-mark {
  display: none;
}

/* ---------- Collapsible solution block ----------
   Use a native <details> with class="tta-solution" so the solution
   stays hidden until the student clicks the toggle. Keeps the page
   focused on the problem, not the answer.                        */

.tta-solution {
  margin: 18px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  overflow: hidden;
  transition: 0.18s ease;
}

.tta-solution[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.tta-solution > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  transition: 0.14s ease;
  user-select: none;
}

.tta-solution > summary::-webkit-details-marker {
  display: none;
}

.tta-solution > summary:hover {
  background: var(--surface);
}

.tta-solution > summary .tta-solution-chevron {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-ghost);
  color: var(--accent-strong);
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}

.tta-solution > summary .tta-solution-chevron svg {
  width: 14px;
  height: 14px;
}

.tta-solution[open] > summary .tta-solution-chevron {
  transform: rotate(90deg);
}

.tta-solution > summary .tta-solution-label {
  flex: 1;
  min-width: 0;
}

.tta-solution > summary .tta-solution-label small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.tta-solution > summary .tta-solution-hint {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tta-solution[open] > summary .tta-solution-hint {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--accent-ghost);
  color: var(--accent-strong);
}

.tta-solution-body {
  border-top: 1px solid var(--border);
  background: #0d1b2a;
}

[data-theme="dark"] .tta-solution-body {
  background: #14130f;
}

.tta-solution-body pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  color: #d7efff;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  font-weight: 500;
}

.tta-solution-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.tta-solution-body .token-comment {
  color: #7dd3fc;
}

.tta-solution-body .token-string {
  color: #fcd34d;
}

.tta-solution-body .token-keyword {
  color: #c4b5fd;
}

.tta-solution-body .token-method {
  color: #86efac;
}

.tta-solution-body .token-builtin {
  color: #fda4af;
}

/* ---------- Mobile drawer ---------- */

.tta-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(20, 18, 14, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

@media (max-width: 1023px) {
  .tta-shell {
    grid-template-columns: 1fr;
  }

  .tta-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }

  .tta-shell[data-mobile-open="true"] .tta-sidebar {
    transform: translateX(0);
  }

  .tta-shell[data-mobile-open="true"] .tta-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 640px) {
  .tta-content {
    padding: 22px 14px 48px;
  }
}

/* ---------- Tab strip (Page / Practice / Solution) ---------- */

.tta-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.tta-tabs::-webkit-scrollbar { display: none; }

.tta-tabs > button {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.14s ease;
}
.tta-tabs > button:hover { color: var(--accent-strong); }
.tta-tabs > button[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent-strong);
  box-shadow: var(--shadow-sm);
}
.tta-tabs > button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ghost);
}
.tta-tabs > button .tab-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
}
.tta-tabs > button[aria-selected="true"] .tab-count {
  background: var(--accent-ghost);
  color: var(--accent-strong);
}

.tta-tabpanel { display: block; }
.tta-tabpanel[hidden] { display: none; }

.tta-tab-empty {
  padding: 18px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.tta-tabpanel > .tta-solution-body,
.tta-tabpanel > .tta-practice-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tta-tabpanel > .tta-practice-card {
  background: var(--surface);
  padding: 22px 24px;
}
.tta-tabpanel > .tta-practice-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.tta-tabpanel > .tta-practice-card .practice-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}
.tta-tabpanel > .tta-practice-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.tta-tabpanel > .tta-practice-card ul li {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}
.tta-tabpanel > .tta-practice-card ul li b {
  color: var(--accent-strong);
}
.tta-tabpanel > .tta-practice-card ol.q-list {
  margin: 12px 0 0;
  padding: 0 0 0 22px;
  display: grid;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.65;
}
.tta-tabpanel > .tta-practice-card ol.q-list li::marker { color: var(--accent-strong); font-weight: 700; }

/* ----------------------------------------------------------------
   Global promo banner (AI Tester Blueprint launch)
   Injected by shell.js on every practice page. Persists dismissal
   in localStorage as tta-promo-banner-dismissed.
   ---------------------------------------------------------------- */
:root { --banner-h: 0px; }
body[data-banner="on"] { --banner-h: 48px; }
body[data-banner="on"] .tta-sidebar { top: var(--banner-h); height: calc(100vh - var(--banner-h)); }
body[data-banner="on"] .tta-topbar { top: var(--banner-h); }
body[data-banner="on"] .tta-sidebar.is-collapsed,
body[data-banner="on"] .side-rail { top: calc(var(--banner-h) + 18px); }

.tta-promo-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 44px 10px 16px;
  height: 48px;
  background: linear-gradient(90deg, #6d28d9, #7c3aed, #4f46e5);
  color: #fff;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: 0 2px 12px rgba(76, 29, 149, 0.25);
}

.tta-promo-banner .promo-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background: rgba(239, 68, 68, 0.95);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: tta-promo-pulse 1.6s ease-in-out infinite;
}
.tta-promo-banner .promo-live .promo-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff;
}
@keyframes tta-promo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50%      { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}

.tta-promo-banner .promo-title { font-weight: 700; }
.tta-promo-banner .promo-badge {
  padding: 2px 8px;
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
}
.tta-promo-banner .promo-sep { opacity: 0.4; }
.tta-promo-banner .promo-price s { opacity: 0.55; margin-right: 4px; font-size: 0.74rem; }
.tta-promo-banner .promo-price b { font-weight: 700; }
.tta-promo-banner .promo-price em {
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(34, 197, 94, 0.3);
  color: #bbf7d0;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  font-style: normal;
}
.tta-promo-banner .promo-coupon code {
  padding: 1px 6px;
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
  border-radius: 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  font-weight: 700;
}
.tta-promo-banner .promo-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: #fff;
  color: #6d28d9;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.14s ease;
}
.tta-promo-banner .promo-cta:hover { transform: translateY(-1px); }
.tta-promo-banner .promo-wa {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  background: #22c55e;
  border-radius: 8px;
  color: #fff;
  font-size: 0.92rem;
  text-decoration: none;
}
.tta-promo-banner .promo-wa:hover { background: #16a34a; }
.tta-promo-banner .promo-close {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font: inherit; font-size: 0.95rem;
  line-height: 1;
}
.tta-promo-banner .promo-close:hover { background: rgba(255, 255, 255, 0.22); }

@media (max-width: 900px) {
  body[data-banner="on"] { --banner-h: 60px; }
  .tta-promo-banner { height: auto; padding: 8px 40px 8px 12px; gap: 6px; font-size: 0.78rem; }
  .tta-promo-banner .promo-sep,
  .tta-promo-banner .promo-badge,
  .tta-promo-banner .promo-price s { display: none; }
}
@media (max-width: 640px) {
  body[data-banner="on"] { --banner-h: 80px; }
  .tta-promo-banner .promo-coupon { display: none; }
}
