/* ==========================================================================
   Z English — Apple-inspired design system
   Clean surfaces, generous whitespace, quiet typography, restrained colour.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --surface-3: #fafafc;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);

  /* Text */
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;

  /* Accent + states */
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-2: #7c5cff;
  --ink: #101826;
  --ink-hover: #1a2440;
  --gold: #b8902e;
  --gold-soft: #faf3e0;
  --teal: #2f6f63;
  --teal-soft: #e2efec;
  --rust: #b23b2e;
  --rust-soft: #f7e6e3;

  /* Shape */
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10), 0 24px 60px rgba(0, 0, 0, 0.12);

  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "IBM Plex Mono", "Menlo", "Courier New", monospace;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: 2.5rem; line-height: 1.08; letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; line-height: 1.2; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 0.6em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   Layout shells
   ========================================================================== */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}
.container.narrow { max-width: 640px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 251, 253, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header .brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.site-header .brand .mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header .brand .tag {
  font-size: 0.78rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clock {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--rust);
  border: 1px solid var(--rust);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  min-width: 92px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.clock.low-time {
  background: var(--rust);
  border-color: var(--rust);
  color: #fff;
  animation: clockPulse 0.9s ease-in-out infinite;
}

@keyframes clockPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.97); }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}
.card + .card { margin-top: 20px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.08s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-hover); }
.btn-primary:disabled { background: #c7c7cc; cursor: not-allowed; }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spinnerSpin 0.75s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spinnerSpin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Forms
   ========================================================================== */
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}
textarea { resize: vertical; min-height: 64px; }
textarea.tall { min-height: 200px; line-height: 1.6; }
.field { margin-bottom: 18px; }

input.free-input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 13px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  margin-top: 6px;
}
input.free-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.word-counter {
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: right;
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Landing page — hero
   ========================================================================== */
.landing-page { width: 100%; }

.hero {
  padding: 80px 24px 64px;
  text-align: center;
  background:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(0, 113, 227, 0.06), transparent 60%),
    var(--bg);
}
.hero-content {
  max-width: 780px;
  margin: 0 auto;
}
.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-title-personal {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.hero-name {
  background-image: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.hero-desc {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 40px;
  font-weight: 400;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}
.stat-lbl {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  font-weight: 500;
}


.stat-sub {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.progress-stat .stat-sub {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.hero-cta-row {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}
.hero-view-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, box-shadow 0.2s ease, transform 0.08s ease;
  cursor: pointer;
}
.hero-view-more:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}
.hero-view-more:active {
  transform: scale(0.98);
}
.hero-view-more svg {
  transition: transform 0.15s ease;
}
.hero-view-more:hover svg {
  transform: translateX(3px);
}

/* ==========================================================================
   Account bar
   ========================================================================== */
.account-bar {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.account-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
.account-name {
  color: var(--text-2);
}
.account-link {
  color: var(--text-2);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  font-size: 0.88rem;
}
.account-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.account-cta {
  background: var(--ink);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.account-cta:hover { background: var(--ink-hover); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px !important;
  color: var(--text-2);
}
.theme-toggle:hover {
  color: var(--text);
}

/* ==========================================================================
   Landing page — category nav
   ========================================================================== */
.cat-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.cat-nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.cat-tab:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.cat-tab.active { background: var(--ink); color: #fff; }

/* ==========================================================================
   Landing page — sections and cards
   ========================================================================== */
.tests-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 24px 100px;
}
.test-section {
  padding-top: 40px;
  scroll-margin-top: 80px;
}
.test-section + .test-section { margin-top: 40px; }
.section-head {
  margin-bottom: 24px;
}
.section-head h2 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}
.section-head p {
  font-size: 0.98rem;
  color: var(--text-2);
  margin: 0;
}

.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.test-grid-featured {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.test-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.22s ease;
}
.test-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.test-card.featured {
  background: linear-gradient(180deg, #16213e 0%, #0d1526 100%);
  border-color: transparent;
  color: #f5f5f7;
}
.test-card.featured .test-card-title { color: #f5f5f7; }
.test-card.featured .test-card-sub { color: #9ea8c4; }
.test-card.featured .test-card-desc { color: #b8c0d6; }
.test-card.featured .test-pill { background: rgba(255,255,255,0.12); color: #f5f5f7; }
.test-card.featured .test-time { color: #9ea8c4; }
.test-card.featured .test-card-meta { color: #9ea8c4; }
.test-card.featured .test-card-btn { background: #fff; color: var(--ink); }
.test-card.featured .test-card-btn:hover { background: #f0f0f2; }

.test-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.test-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
}
.test-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 500;
}

.test-card-title {
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.25;
  margin-bottom: 6px;
}
.test-card-sub {
  font-size: 0.86rem;
  color: var(--text-2);
  margin: 0 0 12px;
  font-weight: 500;
}
.test-card-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0 0 24px;
  flex: 1;
}

.test-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}
.test-card-meta {
  font-size: 0.78rem;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.test-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  transition: background 0.15s ease, transform 0.08s ease;
}
.test-card-btn:hover { background: var(--ink-hover); }
.test-card-btn:active { transform: scale(0.98); }

.landing-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 48px;
  text-align: center;
  color: var(--text-3);
  font-size: 0.82rem;
}

/* ==========================================================================
   Family picker — bottom sheet
   ========================================================================== */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.2s ease;
}
@media (min-width: 640px) {
  .sheet-overlay { align-items: center; padding: 24px; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (min-width: 640px) {
  .sheet { border-radius: var(--r-lg); max-height: 82vh; }
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.sheet-head h2 {
  font-size: 1.25rem;
  margin-bottom: 2px;
}
.sheet-head p {
  font-size: 0.85rem;
  color: var(--text-2);
  margin: 0;
}
.sheet-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-2);
  transition: background 0.15s ease;
}
.sheet-close:hover { background: #e5e5ea; color: var(--text); }

.sheet-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-md);
  text-align: left;
  transition: background 0.12s ease;
}
.sheet-row:hover { background: var(--surface-2); }
.sheet-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-3);
  flex-shrink: 0;
  min-width: 22px;
}
.sheet-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sheet-title {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-hint {
  font-size: 0.8rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-arrow {
  flex-shrink: 0;
  color: var(--text-3);
  display: flex;
}

/* ==========================================================================
   Auth modal + generic modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal.wide { max-width: 720px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 12px;
  gap: 16px;
}
.modal-head h2 { font-size: 1.3rem; margin-bottom: 2px; }
.modal-head p { font-size: 0.88rem; color: var(--text-2); margin: 0; }
.modal-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-2);
  transition: background 0.15s ease;
}
.modal-close:hover { background: #e5e5ea; color: var(--text); }
.modal-body {
  padding: 12px 24px 24px;
  overflow-y: auto;
}
.auth-submit {
  width: 100%;
  margin-top: 4px;
}
.auth-error {
  color: var(--rust);
  font-size: 0.88rem;
  margin: 0 0 8px;
  background: var(--rust-soft);
  padding: 10px 12px;
  border-radius: var(--r-sm);
}
.auth-switch {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-2);
  margin: 16px 0 0;
}

/* ==========================================================================
   Progress page
   ========================================================================== */
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.progress-header h2 { font-size: 1.15rem; margin: 0; }
.progress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.progress-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
}
.progress-stat .num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}
.progress-stat .lbl {
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 6px;
}
.progress-empty {
  text-align: center;
  padding: 60px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  color: var(--text-2);
}

/* Skill breakdown */
.skill-row + .skill-row { margin-top: 18px; }
.skill-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.skill-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}
.skill-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  vertical-align: middle;
}
.skill-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.skill-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==========================================================================
   Test-taking screen
   ========================================================================== */
.progress-track {
  height: 3px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 32px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.instructions {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 12px 0 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.item {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.item .item-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.item .prompt {
  font-size: 1.02rem;
  line-height: 1.55;
  margin-bottom: 14px;
  white-space: pre-line;
  color: var(--text);
}

.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--surface);
}
.option:hover { border-color: var(--ink); }
.option.selected {
  border-color: var(--accent);
  background: rgba(0, 113, 227, 0.05);
}
.option input {
  margin: 4px 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.option span { line-height: 1.5; }

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.nav-row .btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.optional-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  margin-left: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

/* ==========================================================================
   Results
   ========================================================================== */
.band-seal {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-3) 100%);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.band-seal .num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.band-seal .lbl {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 6px;
}
.result-summary { text-align: center; }
.result-summary h2 { margin-bottom: 6px; letter-spacing: -0.02em; }
.disclaimer {
  font-size: 0.84rem;
  color: var(--text-2);
  text-align: center;
  max-width: 46ch;
  margin: 16px auto 24px;
  line-height: 1.5;
}
.examiner-comment {
  text-align: left;
  margin: 20px 0 24px;
  font-size: 0.95rem;
}
.examiner-comment strong { color: var(--text); display: block; margin-bottom: 6px; }

.review-item .your-answer,
.review-item .ai-comment {
  font-size: 0.92rem;
  padding: 12px 14px;
  border-radius: var(--r-md);
  margin-top: 10px;
  line-height: 1.55;
}
.review-item .your-answer {
  background: var(--surface-2);
  color: var(--text);
}
.review-item .ai-comment {
  border-left: 3px solid var(--accent);
  background: rgba(0, 113, 227, 0.04);
  color: var(--text);
}

.overall-feedback {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: rgba(0, 113, 227, 0.06);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin: 14px 0 4px;
  font-weight: 500;
}
[data-theme="dark"] .overall-feedback {
  background: rgba(59, 158, 255, 0.10);
}

.score-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  margin-left: 8px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.score-pill.full { background: var(--teal-soft); color: var(--teal); }
.score-pill.partial { background: var(--gold-soft); color: #8a6a1f; }
.score-pill.none { background: var(--rust-soft); color: var(--rust); }

/* ==========================================================================
   Resume banner
   ========================================================================== */
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 14px 20px;
  border-radius: var(--r-md);
  margin-bottom: 20px;
  font-size: 0.92rem;
}

/* ==========================================================================
   Listening-specific
   ========================================================================== */
.audio-player audio {
  width: 100%;
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 8px;
  margin-bottom: 20px;
}

.listening-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.listening-questions { flex: 1; min-width: 0; }
.sticky-image-container {
  flex: 0 0 320px;
  position: sticky;
  top: 88px;
  z-index: 10;
  background: var(--surface);
  padding: 14px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.sticky-map-image {
  width: 100%;
  height: auto;
  border-radius: var(--r-sm);
  display: block;
}
@media (max-width: 768px) {
  .listening-layout { flex-direction: column; }
  .sticky-image-container {
    flex: none;
    position: relative;
    top: 0;
    max-height: none;
    overflow-y: visible;
    padding: 10px;
    margin-bottom: 20px;
  }
}

/* ==========================================================================
   Admin
   ========================================================================== */
.admin-login { max-width: 400px; margin: 72px auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.admin-table thead tr:first-child th:first-child { border-top-left-radius: var(--r-lg); }
.admin-table thead tr:first-child th:last-child  { border-top-right-radius: var(--r-lg); }
.admin-table tbody tr:last-child td:first-child  { border-bottom-left-radius: var(--r-lg); }
.admin-table tbody tr:last-child td:last-child   { border-bottom-right-radius: var(--r-lg); }

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  background: var(--surface-2);
}
.small-muted { color: var(--text-2); font-size: 0.85rem; }

.action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 0 24px;
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.admin-tab {
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  background: none;
  position: relative;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ==========================================================================
   Footer
   ========================================================================== */
footer.site-footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-3);
  font-size: 0.8rem;
}
footer.site-footer a { color: var(--text-3); }

/* ==========================================================================
   Dark mode
   ========================================================================== */
[data-theme="dark"] {
  --bg: #0a0a0c;
  --surface: #15151a;
  --surface-2: #1e1e24;
  --surface-3: #18181d;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f5f5f7;
  --text-2: #a1a1a8;
  --text-3: #7a7a82;

  --accent: #3b9eff;
  --accent-hover: #5cabff;
  --accent-2: #a78bff;

  --ink: #f5f5f7;
  --ink-hover: #e8e8ec;

  --gold: #d4af5a;
  --gold-soft: #2a2417;
  --teal: #4ec4a6;
  --teal-soft: #10241f;
  --rust: #f07969;
  --rust-soft: #2c1614;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.55), 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6), 0 24px 60px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .cat-nav,
[data-theme="dark"] .progress-header,
[data-theme="dark"] .admin-tabs {
  background: rgba(10, 10, 12, 0.78);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .test-card-btn,
[data-theme="dark"] .test-card-btn:hover,
[data-theme="dark"] .account-cta,
[data-theme="dark"] .account-cta:hover,
[data-theme="dark"] .cat-tab.active {
  color: #101014;
}

[data-theme="dark"] .btn-primary:disabled {
  background: #3a3a40;
  color: #8a8a90;
}

[data-theme="dark"] .test-card.featured {
  background: linear-gradient(180deg, #1c2745 0%, #0d1626 100%);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sheet-close:hover,
[data-theme="dark"] .modal-close:hover {
  background: #2a2a30;
}

[data-theme="dark"] .option.selected {
  background: rgba(59, 158, 255, 0.14);
}
[data-theme="dark"] .review-item .ai-comment {
  background: rgba(59, 158, 255, 0.08);
}

[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(59, 158, 255, 0.10), transparent 60%),
    var(--bg);
}

/* ==========================================================================
   Coach report card
   ========================================================================== */
.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.coach-report {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px 24px;
  margin-top: 4px;
}
[data-theme="dark"] .coach-report {
  background: #17171c;
}

.coach-report-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.coach-report-header h4 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}
.coach-report-header .meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

.report-section + .report-section { margin-top: 18px; }

.report-section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.report-section p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text);
}

.report-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
}
.report-bullets li {
  position: relative;
  padding-left: 18px;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text);
}
.report-bullets li + li { margin-top: 6px; }
.report-bullets li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.report-focus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: focus;
}
.report-focus-list li {
  counter-increment: focus;
  position: relative;
  padding-left: 30px;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text);
}
.report-focus-list li + li { margin-top: 8px; }
.report-focus-list li::before {
  content: counter(focus);
  position: absolute;
  left: 0;
  top: 0.08em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Teacher-comments prompt
   ========================================================================== */
.teacher-comments-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* ==========================================================================
   Student notification banner
   ========================================================================== */
.student-notification {
  max-width: 980px;
  margin: 16px auto 0;
  padding: 0 24px;
}
.student-notification-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.06), rgba(0, 113, 227, 0.02));
  border: 1px solid rgba(0, 113, 227, 0.22);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .student-notification-inner {
  background: linear-gradient(180deg, rgba(59, 158, 255, 0.12), rgba(59, 158, 255, 0.04));
  border-color: rgba(59, 158, 255, 0.30);
}
.student-notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.student-notification-body { flex: 1; min-width: 0; }
.student-notification-title {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.student-notification-sub {
  font-size: 0.84rem;
  color: var(--text-2);
  margin-top: 2px;
}
.student-notification-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.08s ease;
}
.student-notification-btn:hover { background: var(--ink-hover); }
.student-notification-btn:active { transform: scale(0.98); }
[data-theme="dark"] .student-notification-btn { color: #101014; }

.student-notification-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.student-notification-close:hover { background: var(--surface-2); color: var(--text); }

/* ==========================================================================
   Parent view page
   ========================================================================== */
.parent-header {
  margin-bottom: 28px;
}
.parent-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 6px;
}
.parent-sub {
  font-size: 1rem;
  color: var(--text-2);
  margin: 0;
  max-width: 62ch;
  line-height: 1.5;
}

/* ==========================================================================
   New submission toast
   ========================================================================== */
.new-submission-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.new-submission-banner.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.new-submission-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
}
[data-theme="dark"] .new-submission-inner {
  background: #1e1e24;
  border-color: rgba(255, 255, 255, 0.12);
}
.new-submission-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.55);
  animation: newSubPulse 1.6s ease-in-out infinite;
}
@keyframes newSubPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(0, 113, 227, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0); }
}
[data-theme="dark"] .new-submission-dot {
  background: #3b9eff;
  animation: newSubPulseDark 1.6s ease-in-out infinite;
}
@keyframes newSubPulseDark {
  0%   { box-shadow: 0 0 0 0 rgba(59, 158, 255, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(59, 158, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 158, 255, 0); }
}
.new-submission-text {
  color: var(--text);
  white-space: nowrap;
}
.new-submission-text strong {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.new-submission-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.08s ease;
}
.new-submission-btn:hover { background: var(--ink-hover); }
.new-submission-btn:active { transform: scale(0.98); }
[data-theme="dark"] .new-submission-btn { color: #101014; }
.new-submission-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.new-submission-close:hover { background: var(--surface-2); color: var(--text); }

/* ==========================================================================
   Just-arrived card highlight
   ========================================================================== */
@keyframes submissionFlashLight {
  0%, 100% { background-color: rgba(0, 113, 227, 0.08); }
  50%      { background-color: rgba(0, 113, 227, 0.55); }
}
@keyframes submissionFlashDark {
  0%, 100% { background-color: rgba(59, 158, 255, 0.10); }
  50%      { background-color: rgba(59, 158, 255, 0.60); }
}

.sub-card.just-arrived {
  animation: submissionFlashLight 0.9s ease-in-out 4 !important;
  box-shadow: inset 3px 0 0 0 var(--accent), var(--shadow-sm);
}
[data-theme="dark"] .sub-card.just-arrived {
  animation: submissionFlashDark 0.9s ease-in-out 4 !important;
  box-shadow: inset 3px 0 0 0 #3b9eff, var(--shadow-sm);
}

@media (prefers-reduced-motion: reduce) {
  .sub-card.just-arrived {
    animation-duration: 0.9s !important;
    animation-iteration-count: 4 !important;
    animation-timing-function: ease-in-out !important;
  }
}

/* ==========================================================================
   Submissions tab badge
   ========================================================================== */
.tab-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  animation: badgePop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
  transform-origin: center;
}

@keyframes badgePop {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

[data-theme="dark"] .tab-badge {
  background: #ff453a;
}

/* ==========================================================================
   Loading panel with spinner + status text
   ========================================================================== */
.loading-panel {
  text-align: center;
  padding: 96px 20px;
}
.loading-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loadingSpin 0.9s linear infinite;
}
@keyframes loadingSpin {
  to { transform: rotate(360deg); }
}
.loading-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.loading-sub {
  font-size: 0.85rem;
  color: var(--text-2);
  min-height: 1.2em;
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation-duration: 1.8s !important;
    animation-iteration-count: infinite !important;
    animation-timing-function: linear !important;
  }
}

/* ==========================================================================
   Check-in card (student side)
   ========================================================================== */
.checkin-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 28px auto 0;
  padding: 18px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  min-width: 240px;
}

#checkinSlot {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.checkin-card.reached {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.checkin-card-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  font-weight: 500;
}
.checkin-card-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.checkin-card-num span { color: var(--text-3); font-weight: 400; }
.checkin-card-note {
  font-size: 0.78rem;
  color: #8a6a1f;
  font-weight: 500;
  margin-top: 4px;
  max-width: 220px;
}

.checkin-view-pay {
  margin-top: 8px;
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* Clickable check-in card (opens class history) */
.checkin-card[role="button"] {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.08s ease, border-color 0.15s ease;
}
.checkin-card[role="button"]:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.checkin-card[role="button"]:active {
  transform: scale(0.99);
}
.checkin-card[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Class history modal blocks */
.checkin-cycle {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.checkin-cycle:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.checkin-cycle-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.checkin-cycle-range {
  font-size: 0.88rem;
  color: var(--text-2);
  font-weight: 500;
}
.checkin-cycle-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.checkin-cycle-badge.current {
  background: rgba(0, 113, 227, 0.10);
  color: var(--accent);
}
.checkin-cycle-badge.past {
  background: var(--surface-2);
  color: var(--text-2);
}
[data-theme="dark"] .checkin-cycle-badge.current {
  background: rgba(59, 158, 255, 0.14);
}

.checkin-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.checkin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}
.checkin-row.past { color: var(--text-2); }
.checkin-row:last-child { border-bottom: none; }

.card-number-display {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 20px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  color: var(--text);
  user-select: all;
}

[data-theme="dark"] .checkin-card.reached {
  background: rgba(212, 175, 90, 0.08);
  border-color: rgba(212, 175, 90, 0.4);
}
[data-theme="dark"] .checkin-card-note {
  color: #f0cb76;
}

/* ==========================================================================
   v6 — Card-only admin layout, selection mode, report bar
   ========================================================================== */

/* ---------- Submissions head + select toolbar ---------- */
.submissions-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding: 0 2px;
}
.submissions-head .small-muted { font-size: 0.88rem; }

.selection-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  position: sticky;
  top: 116px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}
.selection-count {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}
.selection-actions {
  display: flex;
  gap: 8px;
}

/* ---------- Submission cards ---------- */
.submissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.sub-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.sub-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.sub-card:active { transform: scale(0.995); }
.sub-card.loading { opacity: 0.6; }
.sub-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.sub-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.sub-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.sub-card-score {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.sub-card-score-sep {
  color: var(--text-3);
  font-weight: 400;
  font-size: 1.1rem;
  margin: 0 2px;
}

.sub-card-test {
  font-size: 0.88rem;
  color: var(--text-2);
  margin-bottom: 10px;
  line-height: 1.35;
}

.sub-card-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.sub-band { color: var(--text); font-weight: 600; }
.sub-sep { color: var(--text-3); }

.sub-card-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sub-card-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.sub-card-ago {
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 500;
}
.sub-card-date {
  font-size: 0.75rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub-card-foot .regrade-btn {
  padding: 6px 12px !important;
  font-size: 0.78rem !important;
  border-color: var(--rust);
  color: var(--rust);
  flex-shrink: 0;
}

/* Selection indicator overlay (top-right corner) */
.sub-select-indicator {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}
.sub-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sub-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}
/* Reserve space for the checkmark only in selection mode */
.submissions-grid.selection-mode .sub-card-head { padding-right: 34px; }

/* ---------- Student cards ---------- */
.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.student-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.student-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.student-card:active { transform: scale(0.995); }

.student-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  min-width: 0;
}
.student-card-name {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.student-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-2);
  margin-bottom: 8px;
}
.student-card-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.student-card-classes { color: var(--text-2); }

.student-card-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.student-card-foot > .btn {
  width: 100%;
  justify-content: center;
  padding: 10px 14px !important;
  font-size: 0.85rem !important;
}
.student-card-foot > .row-menu-wrap {
  width: 100%;
  position: relative;
  display: flex;
}

/* Online/offline status dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online {
  background: #34c759;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.20);
}
.status-dot.offline {
  background: var(--text-3);
}

/* "New" pill */
.new-student-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}

.cefr-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ---------- Row menu (3-dot) ---------- */
.row-menu-wrap { position: relative; }

.row-menu-btn {
  width: 100%;
  height: 40px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid var(--border);
  transition: background 0.15s ease;
  font-family: inherit;
}
.row-menu-btn:hover { background: var(--surface-3); }
.row-menu-btn svg { width: 14px; height: 14px; }
.row-menu-btn-label {
  display: inline;
  font-size: 0.85rem;
  font-weight: 500;
}

.row-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 190px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  animation: menuPop 0.14s ease;
}
.row-menu[hidden] { display: none; }

.row-menu.opens-up {
  top: auto;
  bottom: calc(100% + 6px);
  animation: menuPopUp 0.14s ease;
}
@keyframes menuPop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes menuPopUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.row-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
  transition: background 0.12s ease, color 0.12s ease;
  font-family: inherit;
  background: none;
}
.row-menu-item:hover { background: var(--surface-2); }
.row-menu-item.danger { color: var(--rust); }
.row-menu-item.danger:hover { background: var(--rust-soft); }

[data-theme="dark"] .row-menu {
  background: #1e1e24;
  border-color: rgba(255, 255, 255, 0.10);
}

/* ---------- Progress report bar (admin student modal) ---------- */
.progress-report-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 16px;
}
.progress-report-bar.recent {
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.08), rgba(0, 113, 227, 0.03));
  border-color: rgba(0, 113, 227, 0.30);
}
[data-theme="dark"] .progress-report-bar.recent {
  background: linear-gradient(180deg, rgba(59, 158, 255, 0.14), rgba(59, 158, 255, 0.05));
  border-color: rgba(59, 158, 255, 0.32);
}

.progress-report-bar-info { flex: 1; min-width: 0; }
.progress-report-bar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.recent-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  animation: recentPulse 2s ease-in-out infinite;
}
@keyframes recentPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}
.progress-report-bar-meta {
  font-size: 0.78rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.seen-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-2);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
}
.progress-report-bar .btn {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ---------- Confirm modal ---------- */
.confirm-modal { max-width: 400px; }
.confirm-modal .modal-body { padding: 24px 24px 20px; }
.confirm-modal h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}
.confirm-body { font-size: 0.94rem; color: var(--text-2); line-height: 1.5; }
.confirm-body p { margin: 0 0 8px; }
.confirm-body p:last-child { margin-bottom: 0; }
.confirm-body strong { color: var(--text); }
.confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: flex-end;
}
.confirm-actions .btn { min-width: 90px; }

.btn-danger {
  background: var(--rust);
  color: #fff;
}
.btn-danger:hover { background: #9d3527; }

/* ---------- Details modal grid ---------- */
.details-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.details-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.details-row:last-child { border-bottom: none; }
.details-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.details-value {
  font-size: 0.92rem;
  color: var(--text);
  text-align: right;
  word-break: break-word;
}

/* ---------- Report v2 (per-submission) ---------- */
.report-v2 {
  font-family: var(--font-sans);
  color: var(--text);
}

.report-score {
  text-align: center;
  padding: 22px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  margin-bottom: 12px;
}
.report-score-num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.report-score-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-top: 8px;
  font-weight: 500;
}
.report-score-sub {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-2);
  font-family: var(--font-mono);
}

.report-meta-line {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-3);
  margin: 0 0 28px;
}

.report-block {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.report-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.report-block-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.report-score-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
}

.report-v2 .report-section {
  margin-top: 16px;
  padding-bottom: 0;
  border-bottom: none;
}
.report-v2 .report-section:first-child { margin-top: 0; }

.report-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 8px;
}
.report-text {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}
.report-response {
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface-2);
  padding: 14px 16px;
  border-radius: var(--r-md);
  white-space: pre-wrap;
  word-break: break-word;
}

/* MCQ report rows */
.report-q {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.report-q:last-child { border-bottom: none; }
.report-q-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.report-q-prompt {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 12px;
  white-space: pre-line;
}
.report-q-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.report-q-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  min-width: 64px;
  flex-shrink: 0;
}
.report-q-val {
  color: var(--text);
  word-break: break-word;
}
.report-q-val.ok { color: #2f7d32; }
.report-q-val.bad { color: var(--rust); }
[data-theme="dark"] .report-q-val.ok { color: #6dd47e; }

/* ---------- Parent check-in card ---------- */
#parentCheckinSlot {
  display: flex;
  justify-content: center;
  margin: 0 auto 24px;
  padding: 0 24px;
}

.parent-checkin-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  min-width: 240px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.parent-checkin-card.reached {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.parent-checkin-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  font-weight: 500;
}
.parent-checkin-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.parent-checkin-num span { color: var(--text-3); font-weight: 400; }
.parent-checkin-note {
  font-size: 0.8rem;
  color: #8a6a1f;
  font-weight: 500;
  margin-top: 4px;
}
.parent-see-pay-btn {
  margin-top: 8px;
  padding: 8px 18px;
  font-size: 0.85rem;
}
[data-theme="dark"] .parent-checkin-card.reached {
  background: rgba(212, 175, 90, 0.08);
  border-color: rgba(212, 175, 90, 0.4);
}
[data-theme="dark"] .parent-checkin-note { color: #f0cb76; }

/* ---------- Student page report bar ---------- */
.student-report-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.student-report-bar.recent {
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.06), rgba(0, 113, 227, 0.02));
  border-color: rgba(0, 113, 227, 0.28);
}
[data-theme="dark"] .student-report-bar.recent {
  background: linear-gradient(180deg, rgba(59, 158, 255, 0.12), rgba(59, 158, 255, 0.04));
  border-color: rgba(59, 158, 255, 0.32);
}
.student-report-bar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.student-report-bar-meta {
  font-size: 0.8rem;
  color: var(--text-3);
}

/* ==========================================================================
   Responsive — one consolidated block
   ========================================================================== */
@media (max-width: 720px) {
  /* Layout */
  .hero { padding: 64px 20px 48px; }
  .hero-stats { gap: 32px; }
  .hero-title-personal { font-size: 1.85rem; }
  .tests-main { padding: 32px 20px 80px; }
  .test-grid,
  .test-grid-featured { grid-template-columns: 1fr; }
  .card { padding: 24px 20px; }
  .container { padding: 24px 16px 80px; }
  .site-header { padding: 10px 14px; }
  .site-header .brand .tag { max-width: 160px; }
  .site-header .btn { padding: 8px 12px !important; font-size: 0.82rem !important; }
  .account-bar { padding: 16px 16px 0; }
  .account-name { display: none; }
  .admin-tabs { padding: 0 12px; }
  .admin-tab { padding: 12px 10px; font-size: 0.85rem; }

  /* Progress stats: 3 across, compact */
  .progress-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .progress-stat { padding: 12px 12px; }
  .progress-stat .num { font-size: 1.4rem; }
  .progress-stat .lbl { font-size: 0.66rem; letter-spacing: 0.05em; }

  /* Admin card grids */
  .submissions-grid,
  .students-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sub-card, .student-card { padding: 16px; }
  .sub-card-score { font-size: 1.35rem; }

  /* Student card: stack the two footer buttons */
  .student-card-foot {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Sub card: stack time + regrade */
  .sub-card-foot {
    flex-wrap: wrap;
    gap: 10px;
  }
  .sub-card-foot .regrade-btn {
    width: 100%;
    justify-content: center;
  }

  /* Selection toolbar sticky offset */
  .selection-toolbar { top: 96px; }

  /* Progress report bar stacks */
  .progress-report-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .progress-report-bar .btn { width: 100%; }

  /* Student report bar stacks */
  .student-report-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .student-report-bar .btn { width: 100%; }

  /* Modals: full-width, snug to bottom */
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 92vh; }
  .modal-head { padding: 18px 18px 10px; }
  .modal-head h2 { font-size: 1.15rem; }
  .modal-body { padding: 8px 18px 20px; }

  /* Fixed close button on mobile for all modals */
  .modal > .modal-close {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    right: 14px;
    z-index: 1001;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.20);
    width: 40px;
    height: 40px;
  }
  .modal > .modal-close svg { width: 20px; height: 20px; }

  /* Row menu becomes bottom sheet on phones */
  .row-menu {
    position: fixed !important;
    left: 16px !important;
    right: 16px !important;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    border-radius: var(--r-lg) !important;
    padding: 10px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35) !important;
    animation: sheetRise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  }
  .row-menu.opens-up {
    top: auto !important;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .row-menu-item {
    padding: 14px 16px !important;
    font-size: 0.95rem !important;
    border-radius: 10px !important;
  }
  .row-menu-item + .row-menu-item { margin-top: 2px; }
  @keyframes sheetRise {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* Details rows stack */
  .details-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 0;
  }
  .details-value { text-align: left; }

  /* Parent check-in card full width */
  #parentCheckinSlot { padding: 0 16px; }
  .parent-checkin-card {
    min-width: 0;
    width: 100%;
    padding: 14px 20px;
  }

  /* Student notification banner wraps */
  .student-notification { padding: 0 16px; }
  .student-notification-inner { flex-wrap: wrap; }
  .student-notification-btn { width: 100%; text-align: center; }

  /* Report v2 adjustments */
  .report-score-num { font-size: 2.2rem; }
  .report-response { padding: 12px 14px; font-size: 0.9rem; }
  .report-q-label { min-width: 52px; font-size: 0.66rem; }

  /* Toast: full-width */
  .new-submission-banner { left: 16px; right: 16px; bottom: 16px; }

  /* Check-in card (student) mobile */
  .checkin-card { min-width: 0; width: 100%; padding: 14px 20px; }
}

/* Legacy support: checkin-banner-wrap still exists in old markup */
.checkin-banner-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 24px 0;
  display: flex;
  justify-content: center;
}
@media (max-width: 720px) {
  .checkin-banner-wrap { padding: 12px 16px 0; }
}

/* ==========================================================================
   v7 fixes — mobile menu sheet + modal z-index above Netlify widget
   ========================================================================== */

/* 1. Make sure no third-party overlay (Netlify deploy widget, etc.)
      can sit on top of our modals. */
.modal-overlay,
.sheet-overlay {
  z-index: 2147483647;
}

/* 2. On mobile: center align confirm-style modals so the bottom-right
      viewport corner (where Netlify's deploy widget lives) is free. */
@media (max-width: 720px) {
  .modal-overlay {
    align-items: center;
    padding: 16px;
  }
  .modal.confirm-modal {
    max-width: 100%;
    margin: auto;
  }
  /* Wide modals (student detail, reports, class history) still slide up from
     the bottom — but only if they don't sit near the bottom-right corner. */
  .modal.wide {
    align-self: flex-end;
  }
}

/* 3. Mobile row-menu as a dedicated bottom sheet that lives on <body>. */
.row-menu-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2147483646;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.18s ease;
}
.row-menu-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  animation: sheetRise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-theme="dark"] .row-menu-sheet {
  background: #1e1e24;
  border-color: rgba(255, 255, 255, 0.10);
}
.row-menu-sheet .row-menu-item {
  padding: 16px 18px;
  font-size: 1rem;
  border-radius: 12px;
}
.row-menu-sheet .row-menu-item + .row-menu-item {
  margin-top: 2px;
}
.row-menu-sheet-cancel {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  text-align: center;
}
.row-menu-sheet-cancel:hover { background: var(--surface-3); }

/* Hide the inline .row-menu on mobile — the sheet overlay replaces it */
@media (max-width: 720px) {
  .row-menu {
    display: none !important;
  }
}

@keyframes sheetRise {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
/* ==========================================================================
   Speaking — recorder UI
   ========================================================================== */
.speaking-cue-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.speaking-cue-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  color: var(--text);
}
.speaking-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
}
.speaking-bullets li {
  position: relative;
  padding-left: 18px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}
.speaking-bullets li + li { margin-top: 6px; }
.speaking-bullets li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.speaking-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 20px 8px;
}
.speaking-status {
  font-size: 0.92rem;
  color: var(--text-2);
  text-align: center;
  max-width: 46ch;
  min-height: 1.3em;
}
.speaking-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.speaking-timer-num {
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
}
.speaking-timer-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.speaking-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.speaking-playback {
  width: 100%;
  max-width: 480px;
  margin-top: 4px;
}
/* ==========================================================================
   Speaking — Stage 6 polish
   ========================================================================== */

/* Recording indicator dot (pulses red while recording) */
.speaking-recording-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b30;
  margin-right: 8px;
  vertical-align: middle;
  animation: speakingRecPulse 1.2s ease-in-out infinite;
}
@keyframes speakingRecPulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6); }
  50%      { opacity: 0.6; transform: scale(0.9); box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
}

/* Bigger, clearer timer */
.speaking-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.speaking-timer-num {
  font-family: var(--font-mono);
  font-size: 3.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
  transition: color 0.2s ease, transform 0.2s ease;
}
.speaking-timer.recording .speaking-timer-num {
  color: #ff3b30;
  transform: scale(1.02);
}
.speaking-timer.warning .speaking-timer-num {
  color: #b8902e;
  animation: speakingTimerWarn 0.8s ease-in-out infinite;
}
@keyframes speakingTimerWarn {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.65; }
}
.speaking-timer-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Question fade-in when it changes */
.speaking-question-prompt {
  animation: speakingQfade 0.32s ease;
}
@keyframes speakingQfade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Question counter — make it feel more like an exam */
.speaking-question-counter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

/* Bigger prompt text for the current question */
.speaking-question-prompt {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 24px;
  min-height: 3.2em;
}

/* Start recording button — with mic icon */
.speaking-record-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  transition: background 0.15s ease, transform 0.08s ease;
}
.speaking-record-btn:hover { background: var(--ink-hover); }
.speaking-record-btn:active { transform: scale(0.98); }
.speaking-record-btn svg { width: 16px; height: 16px; }

/* Section counter label — Part N of 3 */
.section-eyebrow.speaking-part-label {
  color: var(--accent);
}

/* ==========================================================================
   Dark mode button contrast fix — 2026-09-25
   ========================================================================== */

/* Featured test cards (the blue cards on the home screen) */
[data-theme="dark"] .test-card.featured .test-card-btn {
  background: #f5f5f7;
  color: #101014;
}
[data-theme="dark"] .test-card.featured .test-card-btn:hover {
  background: #e0e0e5;
  color: #101014;
}

/* Other primary / CTA buttons that may have the same issue */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus,
[data-theme="dark"] .account-cta,
[data-theme="dark"] .account-cta:hover,
[data-theme="dark"] .test-card-btn,
[data-theme="dark"] .test-card-btn:hover,
[data-theme="dark"] .student-notification-btn,
[data-theme="dark"] .new-submission-btn,
[data-theme="dark"] .cat-tab.active {
  color: #101014;
}

/* Disabled primary buttons should look clearly disabled */
[data-theme="dark"] .btn-primary:disabled {
  background: #2a2a30;
  color: #b0b0b8;
}

/* Danger buttons keep light text on the red background */
[data-theme="dark"] .btn-danger {
  background: var(--rust);
  color: #f5f5f7;
}

/* ==========================================================================
   Dark mode — speaking recorder buttons (bulletproof)
   ========================================================================== */
html[data-theme="dark"] body .btn.btn-primary,
html[data-theme="dark"] body .btn.btn-primary:hover,
html[data-theme="dark"] body .btn.btn-primary:focus,
html[data-theme="dark"] body .btn.btn-primary:active {
  background: #f5f5f7 !important;
  color: #101014 !important;
  border-color: #f5f5f7 !important;
}

/* Ghost buttons on the recorder (Skip, Re-record) */
html[data-theme="dark"] body .speaking-panel .btn.btn-ghost {
  background: #1e1e24 !important;
  color: #f5f5f7 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}
html[data-theme="dark"] body .speaking-panel .btn.btn-ghost:hover {
  background: #2a2a30 !important;
}

/* ==========================================================================
   Dark mode — speaking record button (correct class)
   ========================================================================== */
[data-theme="dark"] .speaking-record-btn {
  background: #f5f5f7;
  color: #101014;
  border-color: #f5f5f7;
}
[data-theme="dark"] .speaking-record-btn:hover {
  background: #e0e0e5;
  color: #101014;
}
[data-theme="dark"] .speaking-record-btn svg {
  stroke: #101014;
}
[data-theme="dark"] .speaking-record-btn:disabled {
  background: #2a2a30;
  color: #b0b0b8;
  border-color: #2a2a30;
}
[data-theme="dark"] .speaking-record-btn:disabled svg {
  stroke: #b0b0b8;
}
/* ==========================================================================
   Typography upgrade — bolder & bigger (2026-09-25)
   ========================================================================== */

/* ---- Hero ---- */
.hero-eyebrow {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}

.hero-title-personal {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
}

.hero-name {
  font-weight: 800;
}

.hero-desc {
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  line-height: 1.55;
  font-weight: 400;
  max-width: 620px;
  margin: 0 auto 44px;
}

.hero-stats {
  gap: 64px;
}

.stat-num {
  font-size: clamp(2rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.stat-lbl {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.stat-sub {
  font-size: 0.78rem;
  font-weight: 500;
}

.hero-cta-row {
  margin-top: 40px;
}

.hero-view-more {
  font-size: 1.02rem;
  font-weight: 600;
  padding: 14px 28px;
}

/* ---- Marketing sections (.lp-*) ---- */
.lp-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 20px;
}

.lp-h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.lp-h3 {
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.lp-trust-lead {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin-bottom: 32px;
}

.lp-trust-num {
  font-size: clamp(2.2rem, 3.5vw, 2.8rem);
  font-weight: 700;
}

.lp-trust-lbl {
  font-size: 0.9rem;
  font-weight: 500;
}

.lp-step p,
.lp-feature p,
.lp-faq-item p {
  font-size: 1.05rem;
  line-height: 1.7;
}

.lp-step-num {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}

.lp-library-head .lp-h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
}

.lp-library-sub {
  font-size: 1.05rem;
  font-weight: 400;
}

.lp-cta-sub {
  font-size: 1.15rem;
  line-height: 1.6;
}

.lp-cta-btn {
  font-size: 1.05rem;
  font-weight: 700;
  padding: 16px 32px;
}

/* ---- Section heads (test groups) ---- */
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-head p {
  font-size: 1.02rem;
  line-height: 1.55;
}

.test-card-title {
  font-size: 1.28rem;
  font-weight: 700;
}

.test-card-sub {
  font-size: 0.92rem;
  font-weight: 500;
}

.test-card-desc {
  font-size: 0.96rem;
  line-height: 1.55;
}

.test-card-btn {
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 22px;
}

.test-pill {
  font-size: 0.72rem;
  font-weight: 700;
}

.test-card-meta,
.test-time {
  font-size: 0.8rem;
  font-weight: 500;
}

/* ---- Account bar / nav ---- */
.account-brand,
.site-header .brand .mark {
  font-size: 1.05rem;
  font-weight: 700;
}

.cat-tab {
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 18px;
}

.account-link,
.account-cta {
  font-size: 0.92rem;
  font-weight: 600;
}

/* ==========================================================================
   Mobile tuning — 720px and below
   ========================================================================== */
@media (max-width: 720px) {
  /* Hero */
  .hero {
    padding: 56px 20px 44px;
  }
  .hero-title {
    font-size: clamp(2rem, 9vw, 2.6rem);
    line-height: 1.05;
    margin-bottom: 20px;
  }
  .hero-title-personal {
    font-size: clamp(1.75rem, 7.5vw, 2.2rem);
  }
  .hero-eyebrow {
    font-size: 0.74rem;
    margin-bottom: 14px;
  }
  .hero-desc {
    font-size: 1.05rem;
    line-height: 1.55;
    margin-bottom: 32px;
  }
  .hero-stats {
    gap: 28px;
    row-gap: 22px;
  }
  .stat-num { font-size: 1.7rem; }
  .stat-lbl { font-size: 0.72rem; }
  .stat-sub { font-size: 0.68rem; }
  .hero-cta-row {
    margin-top: 28px;
    padding: 0 4px;
  }
  .hero-view-more {
    font-size: 0.98rem;
    font-weight: 600;
    padding: 13px 24px;
    width: 100%;
    justify-content: center;
  }

  /* Marketing sections */
  .lp-container { padding: 0 20px; }
  .lp-eyebrow { font-size: 0.74rem; margin-bottom: 12px; }
  .lp-h2 {
    font-size: clamp(1.6rem, 7.5vw, 2.1rem);
    margin-bottom: 12px;
    line-height: 1.18;
  }
  .lp-h3 { font-size: 1.15rem; }

  .lp-how,
  .lp-features,
  .lp-faq,
  .lp-cta {
    padding: 48px 0;
  }

  .lp-trust { padding: 32px 0; }
  .lp-trust-lead { font-size: 0.76rem; margin-bottom: 22px; }
  .lp-trust-num { font-size: 1.85rem; }
  .lp-trust-lbl { font-size: 0.8rem; }
  .lp-trust-grid { gap: 24px 12px; }

  .lp-steps { gap: 32px; }
  .lp-how .lp-h2,
  .lp-features .lp-h2 { margin-bottom: 32px; }

  .lp-step p,
  .lp-feature p,
  .lp-faq-item p {
    font-size: 1rem;
    line-height: 1.65;
  }

  .lp-feature { padding: 22px 0; }

  .lp-faq-item summary {
    font-size: 1rem;
    font-weight: 600;
    padding: 18px 40px 18px 0;
  }
  .lp-faq .lp-h2 { margin-bottom: 24px; }

  .lp-cta-sub {
    font-size: 1.02rem;
    margin-bottom: 22px;
  }
  .lp-cta-btn {
    font-size: 1rem;
    font-weight: 700;
    padding: 15px 26px;
    width: 100%;
    justify-content: center;
  }

  .lp-library-head { padding: 40px 20px 4px; }
  .lp-library-sub { font-size: 0.98rem; }

  /* Footer */
  .lp-footer { padding: 40px 0 24px; }
  .lp-footer-grid { gap: 32px; margin-bottom: 32px; }
  .lp-footer-logo { font-size: 1.15rem; }
  .lp-footer-tag { font-size: 0.92rem; }
  .lp-footer-head { font-size: 0.72rem; margin-bottom: 12px; }
  .lp-footer-col a { font-size: 0.94rem; padding: 8px 0; }
  .lp-footer-bottom p { font-size: 0.78rem; }

  /* Section heads (test library) */
  .section-head h2 { font-size: 1.5rem; }
  .section-head p { font-size: 0.98rem; }

  .test-card-title { font-size: 1.18rem; }
  .test-card-desc { font-size: 0.94rem; }
  .test-card-btn { font-size: 0.9rem; padding: 11px 20px; }

  /* Nav & account bar */
  .cat-tab { font-size: 0.88rem; padding: 8px 15px; }
  .account-brand { font-size: 1rem; }
}

/* ---- Very narrow phones (iPhone SE, older Android) ---- */
@media (max-width: 380px) {
  .hero { padding: 48px 16px 36px; }
  .hero-title { font-size: 1.85rem; }
  .hero-title-personal { font-size: 1.6rem; }
  .hero-desc { font-size: 1rem; }
  .lp-h2 { font-size: 1.5rem; }
  .lp-trust-num { font-size: 1.6rem; }
  .lp-trust-lbl { font-size: 0.74rem; }
  .lp-container { padding: 0 16px; }
}

/* ==========================================================================
   Hero — single CTA button
   ========================================================================== */
.hero-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 15px 32px;
  box-shadow: var(--shadow-md);
}
.hero-primary:hover {
  background: var(--ink-hover);
  border-color: var(--ink-hover);
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .hero-primary {
  background: #f5f5f7;
  color: #101014;
  border-color: #f5f5f7;
}
[data-theme="dark"] .hero-primary:hover {
  background: #e0e0e5;
  border-color: #e0e0e5;
}

.hero-microcopy {
  font-size: 0.88rem;
  color: var(--text-3);
  margin: 18px 0 0;
  letter-spacing: 0.01em;
}

@media (max-width: 720px) {
  .hero-primary {
    font-size: 1rem;
    padding: 14px 24px;
    width: 100%;
    justify-content: center;
  }
  .hero-microcopy {
    font-size: 0.82rem;
    margin-top: 14px;
  }
}

/* ==========================================================================
   Socials section
   ========================================================================== */
.lp-socials {
  padding: 80px 0 72px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.lp-socials-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}
.lp-socials-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.lp-socials-heading {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0 0 10px;
}
.lp-socials-sub {
  font-size: 1rem;
  color: var(--text-2);
  margin: 0 0 40px;
  line-height: 1.55;
}
.lp-socials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: left;
}
.lp-social-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.18s ease,
              border-color 0.18s ease;
}
.lp-social-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  text-decoration: none;
}
.lp-social-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lp-social-body {
  min-width: 0;
}
.lp-social-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: var(--text);
}
.lp-social-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-2);
  margin-bottom: 8px;
}
.lp-social-handle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

@media (max-width: 720px) {
  .lp-socials { padding: 56px 0; }
  .lp-socials-inner { padding: 0 20px; }
  .lp-socials-heading { margin-bottom: 8px; }
  .lp-socials-sub { font-size: 0.94rem; margin-bottom: 28px; }
  .lp-socials-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .lp-social-card { padding: 18px 20px; }
  .lp-social-icon { width: 40px; height: 40px; }
  .lp-social-name { font-size: 0.96rem; }
  .lp-social-desc { font-size: 0.86rem; }
  .lp-social-handle { font-size: 0.78rem; }
}

/* ==========================================================================
   Socials — brand colours
   ========================================================================== */

/* Instagram: brand gradient on the icon tile */
.lp-social-card--ig .lp-social-icon {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
  color: #ffffff;
}

/* TikTok: black tile, white glyph (matches the app icon) */
.lp-social-card--tt .lp-social-icon {
  background: #000000;
  color: #ffffff;
}

/* Keep the same look in dark mode — brand colours don't change */
[data-theme="dark"] .lp-social-card--ig .lp-social-icon {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
  color: #ffffff;
}
[data-theme="dark"] .lp-social-card--tt .lp-social-icon {
  background: #000000;
  color: #ffffff;
}

/* Tighten the top spacing now that the sub-line is gone */
.lp-socials-sub { display: none; }
.lp-socials-grid { margin-top: 8px; }

/* ==========================================================================
   Socials — YouTube brand
   ========================================================================== */
.lp-social-card--yt .lp-social-icon {
  background: #ff0000;
  color: #ffffff;
}
[data-theme="dark"] .lp-social-card--yt .lp-social-icon {
  background: #ff0000;
  color: #ffffff;
}

/* ==========================================================================
   Socials — grid layout for 3 cards
   ========================================================================== */
.lp-socials-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* ==========================================================================
   Socials — full brand-colour cards, 3 in a row
   ========================================================================== */

/* Force exactly 3 columns on desktop */
.lp-socials-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* Base look for all brand cards: white text, no border, subtle lift */
.lp-social-card {
  color: #ffffff;
  border-color: transparent;
  padding: 22px 22px 20px;
}

/* White icon tile on the coloured background */
.lp-social-card .lp-social-icon {
  background: rgba(255, 255, 255, 0.20);
  color: #ffffff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Text colours on the coloured cards */
.lp-social-card .lp-social-name {
  color: #ffffff;
}
.lp-social-card .lp-social-desc {
  color: rgba(255, 255, 255, 0.88);
}
.lp-social-card .lp-social-handle {
  color: rgba(255, 255, 255, 0.95);
}

/* Hover — lift without changing colour */
.lp-social-card:hover {
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.lp-social-card--tt:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.lp-social-card--ig:hover {
  box-shadow: 0 8px 28px rgba(220, 39, 67, 0.35);
}
.lp-social-card--yt:hover {
  box-shadow: 0 8px 28px rgba(255, 0, 0, 0.30);
}

/* Instagram — full-bleed gradient */
.lp-social-card--ig {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
}

/* TikTok — solid black */
.lp-social-card--tt {
  background: #000000;
}

/* YouTube — solid red */
.lp-social-card--yt {
  background: #ff0000;
}

/* Same look in dark mode — brand colours don't change */
[data-theme="dark"] .lp-social-card--ig {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
}
[data-theme="dark"] .lp-social-card--tt { background: #000000; }
[data-theme="dark"] .lp-social-card--yt { background: #ff0000; }

/* Cards are slightly tighter when 3 across */
@media (min-width: 721px) {
  .lp-socials-inner { max-width: 900px; }
  .lp-social-card {
    padding: 20px 20px 18px;
    gap: 14px;
  }
  .lp-social-card .lp-social-icon {
    width: 40px;
    height: 40px;
  }
  .lp-social-card .lp-social-name { font-size: 0.98rem; }
  .lp-social-card .lp-social-desc { font-size: 0.86rem; }
  .lp-social-card .lp-social-handle { font-size: 0.78rem; }
}

/* On phones, stack in one column (overrides the 3-across) */
@media (max-width: 720px) {
  .lp-socials-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .lp-social-card {
    padding: 18px 20px;
  }
  .lp-social-card .lp-social-icon {
    width: 40px;
    height: 40px;
  }
}

/* ==========================================================================
   Socials — WhatsApp brand + 4-up grid
   ========================================================================== */
.lp-social-card--wa {
  background: #25D366;
}
[data-theme="dark"] .lp-social-card--wa {
  background: #25D366;
}

.lp-social-card--wa:hover {
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.35);
}

/* Widen the container so 4 cards sit comfortably in one row on desktop */
.lp-socials-inner { max-width: 1080px; }

.lp-socials-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

@media (min-width: 721px) {
  .lp-social-card {
    padding: 18px 18px 16px;
    gap: 12px;
  }
  .lp-social-card .lp-social-icon {
    width: 38px;
    height: 38px;
  }
  .lp-social-card .lp-social-name { font-size: 0.94rem; }
  .lp-social-card .lp-social-desc { font-size: 0.82rem; line-height: 1.45; }
  .lp-social-card .lp-social-handle { font-size: 0.74rem; }
}