:root {
  /* Calvin design system — editorial magazine */
  --bg: #eff0f0;
  --bg-alt: #e0e0e0;
  --surface: #ffffff;
  --ink: #282828;
  --muted: #929393;
  --brand: #0A369D;
  --brand-2: #0D47CE;
  --brand-deep: #07266E;
  --accent: #C1292E;
  --accent-soft: #D8464B;
  --accent-deep: #972024;
  --gold: #C9A227;
  --gold-soft: #fff099;
  --sky: #1E5DF1;
  --mint: #5B7FE8;
  --danger: #C1292E;
  --ok: #515C33;
  --warn: #d97706;
  --line: #eeeeee;
  --radius: 0;
  --radius-sm: 4px;
  --shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  --shadow-hover: none;
  --font: "Inter", "Segoe UI", sans-serif;
  --display: "DM Serif Text", Georgia, serif;
  --serif: "DM Serif Display", "DM Serif Text", Georgia, serif;
  --focus-ring: transparent;
  --ease: all 0.3s ease-in-out;
  --btn-bg: #d0d1d1;
  --btn-text: #000000;
  --btn-hover-bg: #000000;
  --btn-hover-text: #ffffff;
  --btn-primary-bg: #000000;
  --btn-primary-hover: #282828;
  --admin-sidebar-from: #0a0a0a;
  --admin-sidebar-mid: #151515;
  --admin-sidebar-to: #222222;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

/* Education watermark: icons + words — very faint */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='280' viewBox='0 0 360 280'%3E%3Cg fill='none' stroke='%23282828' stroke-width='1.4'%3E%3Cpath d='M40 70h70v90H40z'/%3E%3Cpath d='M50 90h50M50 110h50M50 130h35'/%3E%3Cpath d='M160 55l40-18 40 18v55l-40 18-40-18z'/%3E%3Cpath d='M200 37v55'/%3E%3Ccircle cx='290' cy='95' r='28'/%3E%3Cpath d='M290 75v40M270 95h40'/%3E%3Cpath d='M55 210c20-18 50-18 70 0'/%3E%3Cpath d='M70 210v35h40'/%3E%3Cpath d='M250 200l18 45 18-45h-36z'/%3E%3Cpath d='M268 200v-22'/%3E%3C/g%3E%3Ctext x='24' y='268' fill='%23282828' font-family='Arial,sans-serif' font-size='13'%3EImtahan%3C/text%3E%3Ctext x='130' y='268' fill='%23C1292E' font-family='Arial,sans-serif' font-size='13'%3EBilik%3C/text%3E%3Ctext x='220' y='268' fill='%23C1292E' font-family='Arial,sans-serif' font-size='13'%3EeSinaq%3C/text%3E%3Ctext x='300' y='200' fill='%23282828' font-family='Arial,sans-serif' font-size='12'%3EA%2BB%3C/text%3E%3C/svg%3E");
  background-size: 360px 280px;
  background-repeat: repeat;
}
body > * { position: relative; z-index: 1; }

body, .site-body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}
a {
  color: var(--brand);
  text-decoration: none;
  transition: var(--ease);
}
a:hover, a:focus, a:active {
  color: var(--accent);
  text-decoration: none;
  outline: 0;
}
img { max-width: 100%; }
code {
  font-family: Consolas, "Andale Mono", Courier, monospace; font-size: 0.9em;
  background: var(--bg-alt); padding: 2px 6px; border-radius: 3px; color: var(--ink);
}
h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--ink);
}
h6 {
  font-family: var(--font);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .2em;
}

.container { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(720px, 100%); }
.center { text-align: center; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.inline-form { display: inline; }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.link-btn.danger { color: var(--danger); }

.ico {
  width: 1.15em; height: 1.15em; fill: currentColor; flex-shrink: 0;
  display: inline-block; vertical-align: -0.15em;
}
.ico-sm { width: 1em; height: 1em; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; gap: 12px; position: relative;
}
.brand {
  font-family: var(--serif);
  font-size: 1.55rem; font-weight: 400; letter-spacing: -.02em;
  text-decoration: none; color: var(--ink); z-index: 2;
  display: inline-flex; align-items: baseline; gap: 0;
  transition: var(--ease);
}
.brand:hover { text-decoration: none; transform: none; color: var(--ink); }
.brand-lockup { display: inline-flex; align-items: baseline; white-space: nowrap; }
.brand .brand-e, .brand-e {
  color: var(--accent); font-style: normal; font-weight: 400;
}
.brand .brand-name, .brand-name {
  color: var(--ink); font-weight: 400;
}
.brand .brand-tld, .brand-tld {
  color: var(--muted); font-weight: 400; font-size: .9em;
  letter-spacing: 0;
}
.brand-admin {
  margin-left: 8px; font-family: var(--font); font-size: .65em;
  font-weight: 600; color: var(--muted); letter-spacing: .12em;
  text-transform: uppercase;
}
.nav { display: flex; gap: 20px; align-items: center; }
.nav-link, .nav a {
  font-family: var(--font);
  font-weight: 600; font-size: .95rem; color: var(--ink);
  transition: var(--ease);
}
.nav-link:hover, .nav a:hover { color: var(--accent); text-decoration: none; transform: none; }
.nav-quiet { color: var(--muted); font-weight: 500; }
/* Header CTA — Calvin primary black button */
.site-header .nav .btn {
  background: var(--btn-primary-bg);
  color: #fff !important;
  border: 0.2rem solid var(--btn-primary-bg);
  box-shadow: none;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-weight: 400;
  font-size: 11px;
  padding: 10px 18px;
}
.site-header .nav .btn:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: #fff !important;
  filter: none;
  box-shadow: none;
  transform: none;
}
.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  border-radius: 0; background: #fff; cursor: pointer; padding: 10px;
  flex-direction: column; justify-content: space-between; z-index: 2;
  transition: var(--ease);
}
.nav-toggle span {
  display: block; height: 2px; background: var(--ink); border-radius: 0;
  transition: transform .2s, opacity .2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--btn-primary-bg);
  color: #fff;
  border: 0.2rem solid var(--btn-primary-bg);
  border-radius: 0;
  padding: 12px 28px;
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .32em;
  cursor: pointer;
  text-decoration: none;
  transition: all .3s;
  box-shadow: none;
  font-family: var(--font);
}
.btn:hover, .btn:focus {
  text-decoration: none;
  transform: none;
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: #fff;
  box-shadow: none;
  filter: none;
  outline: 0;
}
.btn:active { transform: none; }
.btn-ghost {
  background: transparent !important;
  color: #fff;
  border: 0.2rem solid rgba(255,255,255,.85);
  box-shadow: none;
}
.btn-ghost:hover, .btn-ghost:focus {
  background: #fff !important;
  color: #000 !important;
  border-color: #fff;
  filter: none;
  box-shadow: none;
  transform: none;
}
.auth-wrap .btn-ghost, .form-card .btn-ghost, .page .btn-ghost, .exam-hub .btn-ghost {
  color: #000;
  border-color: #000;
  background: transparent !important;
}
.auth-wrap .btn-ghost:hover, .form-card .btn-ghost:hover, .page .btn-ghost:hover, .exam-hub .btn-ghost:hover {
  background: #000 !important;
  color: #fff !important;
  border-color: #000;
}
.btn-danger {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}
.btn-danger:hover, .btn-danger:focus {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  filter: none;
  transform: none;
}
.btn-sm { padding: 8px 16px; font-size: 11px; letter-spacing: .28em; box-shadow: none; }
.btn-lg { padding: 16px 34px; font-size: 12px; }
.btn-block { width: 100%; }

.flash { margin: 16px auto; padding: 12px 16px; border-radius: var(--radius-sm); width: min(1080px, calc(100% - 32px)); }
.flash-success { background: #c8e675; color: var(--ok); }
.flash-error { background: #ffd1d2; color: var(--danger); }

/* Hero — Calvin dark editorial */
.hero {
  position: relative; min-height: min(92vh, 820px);
  display: flex; align-items: center; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; }
.hero-wash {
  position: absolute; inset: 0;
  background: #151515;
}
.hero-grain {
  position: absolute; inset: 0; opacity: .04; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .22;
  animation: float 14s ease-in-out infinite;
}
.hero-orb-1 {
  width: 460px; height: 460px; top: -120px; right: -60px;
  background: radial-gradient(circle, #0A369D, transparent 70%);
}
.hero-orb-2 {
  width: 360px; height: 360px; bottom: -100px; left: -80px;
  background: radial-gradient(circle, #C1292E, transparent 70%);
  animation-delay: -5s;
}
.hero-content {
  position: relative; z-index: 1; color: #fff;
  padding: 80px 0 100px; max-width: 760px;
  animation: calvinFadeUp 1s cubic-bezier(0, 0.55, 0.45, 1) both;
}
.brand-mark {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 10vw, 5.4rem);
  font-weight: 400;
  margin: 0 0 22px;
  letter-spacing: -.01em;
  line-height: .95;
  color: #fff;
  text-shadow: 0 4px 8px rgba(0,0,0,.1);
}
.brand-mark .brand-lockup-hero { display: inline-flex; align-items: baseline; flex-wrap: wrap; }
.brand-mark .brand-e {
  font-style: normal; font-weight: 400;
  color: #C1292E;
}
.brand-mark .brand-name { color: #fff; font-weight: 400; }
.brand-mark .brand-tld {
  color: rgba(255,255,255,.55); font-weight: 400; font-size: .78em;
  margin-left: .02em;
}
.hero-headline {
  font-family: var(--display);
  font-size: clamp(1.35rem, 3.2vw, 1.95rem);
  font-weight: 400;
  font-style: normal;
  margin: 0 0 16px;
  max-width: 28ch;
  line-height: 1.35;
  color: #fff;
  letter-spacing: -.01em;
}
.hero-lead {
  font-size: 1.05rem; max-width: 44ch; margin: 0 0 16px;
  color: rgba(255,255,255,.72); font-weight: 300;
  letter-spacing: 0;
  line-height: 1.7;
  font-family: var(--font);
}
.hero-ticker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  padding: 10px 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  font-weight: 500;
  max-width: 100%;
  backdrop-filter: none;
}
.hero-ticker-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #C1292E;
  box-shadow: none;
  animation: none;
  flex-shrink: 0;
}
[data-home-ticker-text] { transition: opacity .3s ease-in-out; }
@keyframes tickerPulse {
  0%, 100% { opacity: 1; }
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn:not(.btn-ghost) {
  background: #fff;
  color: #000;
  border: 0.2rem solid #fff;
  box-shadow: none;
}
.hero .btn:not(.btn-ghost):hover {
  background: transparent;
  color: #fff;
  border-color: #fff;
  transform: none;
}
.hero .btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,.85);
  text-shadow: none;
  background: transparent !important;
}
.hero .btn-ghost:hover {
  background: #fff !important;
  color: #000 !important;
  border-color: #fff;
}
.hero-scroll {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 56px;
  color: rgba(255,255,255,.78); font-size: 12px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  animation: bounce 2.4s ease-in-out infinite;
}
.hero-scroll:hover { color: #fff; text-decoration: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.section { padding: 88px 0; position: relative; }
.section-alt {
  background:
    linear-gradient(180deg, rgba(239, 246, 255, .95), rgba(255, 247, 237, .85));
  border-block: 1px solid rgba(219, 227, 240, .85);
}
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head::after {
  content: ""; display: block; width: 56px; height: 4px; margin-top: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--gold), var(--accent));
}
.section h2 {
  margin: 0 0 12px; font-family: var(--display);
  font-size: clamp(1.7rem, 3.4vw, 2.35rem); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.2; color: var(--brand-deep);
}
.section-lead { color: var(--muted); margin: 0; font-size: 1.05rem; max-width: 48ch; font-weight: 500; }
.eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}

.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.why-card {
  background: linear-gradient(165deg, #ffffff 0%, #eff0f0 100%);
  border: 1px solid var(--line);
  border-radius: 18px; padding: 34px 30px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.why-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(151, 32, 36, .35);
}
.why-card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--gold), var(--accent));
}
.icon-badge {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; margin-bottom: 18px;
  background: linear-gradient(145deg, #d7ecfb, #93c5fd);
  color: var(--brand-deep);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  transition: transform .25s ease;
}
.why-card:hover .icon-badge { transform: scale(1.08) rotate(-3deg); }
.icon-badge .ico { width: 24px; height: 24px; }
.icon-badge-alt {
  background: linear-gradient(145deg, #fde8e9, #F0A8AB);
  color: var(--accent-deep);
}
.why-card h3 {
  margin: 0 0 10px; font-family: var(--display);
  font-size: 1.35rem; font-weight: 700; color: var(--brand-deep); letter-spacing: -.02em;
}
.why-card > p { color: var(--muted); margin: 0 0 18px; }
.why-list { margin: 0; padding: 0; list-style: none; }
.why-list li {
  position: relative; margin-bottom: 12px; padding-left: 1.55em;
  color: var(--ink); font-weight: 500;
}
.why-list li::before {
  content: ""; position: absolute; left: 0; top: .45em;
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--gold));
  box-shadow: 0 0 0 3px rgba(234, 179, 8, .18);
}

.seo-learning-section {
  padding-top: 72px;
  background:
    radial-gradient(ellipse 45% 60% at 100% 20%, rgba(193, 41, 46, .1), transparent 65%),
    radial-gradient(ellipse 45% 60% at 0% 80%, rgba(37, 99, 235, .1), transparent 65%);
}
.seo-learning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.seo-learning-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.seo-learning-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-2), var(--gold), var(--accent));
}
.seo-learning-card:hover {
  transform: translateY(-4px);
  border-color: #93c5fd;
  box-shadow: 0 18px 38px rgba(29, 78, 216, .12);
}
.seo-learning-card h3 {
  margin: 0 0 8px;
  color: var(--brand-deep);
  font-family: var(--display);
  font-size: 1.08rem;
  letter-spacing: -.02em;
}
.seo-learning-card p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
}

.steps-modern {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  isolation: isolate;
}
.step-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 28px 22px; transition: border-color .25s, transform .25s, box-shadow .25s;
  box-shadow: 0 10px 28px rgba(29, 78, 216, .06);
  position: relative;
  --journey-delay: 0s;
  animation: step-journey-glow 9s ease-in-out infinite;
  animation-delay: var(--journey-delay);
}
.step-card:nth-child(2) { --journey-delay: 3s; }
.step-card:nth-child(3) { --journey-delay: 6s; }
.step-card:not(:last-child)::after {
  content: "→";
  position: absolute;
  z-index: 3;
  top: 50%;
  right: -22px;
  width: 24px;
  transform: translateY(-50%);
  color: #93c5fd;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  opacity: .45;
  pointer-events: none;
  animation: step-arrow-flow 9s ease-in-out infinite;
  animation-delay: calc(var(--journey-delay) + 1.35s);
}
.step-card:hover {
  border-color: #93c5fd; transform: translateY(-5px);
  box-shadow: 0 20px 44px rgba(29, 78, 216, .12);
  animation: none;
}
.step-icon {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #d7ecfb, #93c5fd); color: var(--brand);
  transition: transform .25s ease, background .25s ease;
  animation: step-icon-glow 9s ease-in-out infinite;
  animation-delay: var(--journey-delay);
}
.step-card:hover .step-icon {
  transform: translateY(-2px);
  background: linear-gradient(145deg, #fde8e9, #F0A8AB);
  color: var(--accent-deep);
  animation: none;
}
.step-icon .ico { width: 22px; height: 22px; }
.step-num {
  display: block; font-family: var(--display); font-size: 1.5rem;
  font-style: normal; font-weight: 700; color: var(--accent); margin-bottom: 8px;
  letter-spacing: -.02em;
}
.step-card h3 { margin: 0 0 8px; font-family: var(--display); font-size: 1.15rem; color: var(--brand-deep); letter-spacing: -.02em; }
.step-card p { margin: 0; color: var(--muted); font-size: 15px; }

.subject-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.subject-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line);
  padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: border-color .22s, background .22s, transform .22s, box-shadow .22s, color .22s;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(29, 78, 216, .05);
  --subject-delay: 0s;
  animation: subject-cascade 9.6s ease-in-out infinite;
  animation-delay: var(--subject-delay);
}
.subject-chip:nth-child(2) { --subject-delay: 1.2s; }
.subject-chip:nth-child(3) { --subject-delay: 2.4s; }
.subject-chip:nth-child(4) { --subject-delay: 3.6s; }
.subject-chip:nth-child(5) { --subject-delay: 4.8s; }
.subject-chip:nth-child(6) { --subject-delay: 6s; }
.subject-chip:nth-child(7) { --subject-delay: 7.2s; }
.subject-chip:nth-child(8) { --subject-delay: 8.4s; }
.subject-chip .ico { color: var(--brand); transition: color .22s, transform .22s; }
.subject-chip:hover {
  background: linear-gradient(135deg, #e8eef8, #FDF2F2);
  border-color: #fbbf24;
  color: var(--brand-deep);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 28px rgba(151, 32, 36, .16);
  animation: none;
}
.subject-chip:hover .ico { color: var(--accent); transform: scale(1.12); }

@keyframes step-journey-glow {
  0%, 12% {
    background: #f0f7ff;
    border-color: #60a5fa;
    box-shadow: 0 18px 42px rgba(29, 78, 216, .2), 0 0 0 3px rgba(147, 197, 253, .25);
  }
  20%, 100% {
    background: #fff;
    border-color: var(--line);
    box-shadow: 0 10px 28px rgba(29, 78, 216, .06);
  }
}
@keyframes step-icon-glow {
  0%, 12% {
    color: var(--accent-deep);
    filter: saturate(1.35) brightness(1.04);
  }
  20%, 100% {
    color: var(--brand);
    filter: saturate(1);
  }
}
@keyframes step-arrow-flow {
  0%, 10% {
    color: var(--accent);
    opacity: 1;
    transform: translate(3px, -50%);
    text-shadow: 0 0 12px rgba(151, 32, 36, .45);
  }
  18%, 100% {
    color: #93c5fd;
    opacity: .35;
    transform: translate(-5px, -50%);
  }
}
@keyframes step-arrow-flow-down {
  0%, 10% {
    color: var(--accent);
    opacity: 1;
    transform: translate(50%, 3px);
    text-shadow: 0 0 12px rgba(151, 32, 36, .45);
  }
  18%, 100% {
    color: #93c5fd;
    opacity: .35;
    transform: translate(50%, -5px);
  }
}
@keyframes subject-cascade {
  0%, 16%, 100% {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
    transform: translateY(0) scale(1);
    box-shadow: 0 6px 16px rgba(29, 78, 216, .05);
  }
  5%, 11% {
    background: #e8eef8;
    border-color: #60a5fa;
    color: var(--brand-deep);
    transform: translateY(-4px) scale(1.035);
    box-shadow: 0 15px 30px rgba(29, 78, 216, .18), 0 0 0 2px rgba(147, 197, 253, .22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-card,
  .step-icon,
  .step-card::after,
  .subject-chip {
    animation: none !important;
  }
}

.cta-band { padding: 12px 0 88px; background: transparent; }
.cta-panel {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap; padding: 42px 38px; border-radius: 20px; color: #fff;
  background:
    radial-gradient(ellipse 50% 80% at 90% 0%, rgba(151, 32, 36, .4), transparent 55%),
    linear-gradient(135deg, #04153E 0%, #07266E 45%, #0A369D 100%);
  box-shadow: 0 24px 56px rgba(15, 23, 42, .28);
  position: relative; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.cta-panel:hover { transform: translateY(-2px); box-shadow: 0 28px 64px rgba(29, 78, 216, .25); }
.cta-panel::after {
  content: ""; position: absolute; width: 280px; height: 280px; right: -60px; top: -80px;
  border-radius: 50%; background: radial-gradient(circle, rgba(216, 70, 75, .28), transparent 70%);
  pointer-events: none;
}
.cta-copy { display: flex; gap: 18px; align-items: flex-start; position: relative; z-index: 1; }
.cta-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.16); color: #fff;
}
.cta-icon .ico { width: 26px; height: 26px; }
.cta-panel h2 { margin: 0 0 8px; font-family: var(--display); font-size: 1.8rem; letter-spacing: -.02em; }
.cta-panel p { margin: 0; opacity: .92; max-width: 40ch; color: #FDF2F2; }
.cta-panel .btn { background: #fff; color: var(--brand-deep); position: relative; z-index: 1; }
.cta-panel .btn:hover { background: #FDF2F2; color: var(--accent-deep); }

.site-footer {
  border-top: 1px solid var(--line); padding: 40px 0 32px;
  color: var(--muted); font-size: 14px;
  background: #fff;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 20px;
}
.footer-brand { font-size: 1.25rem; margin-bottom: 6px; display: inline-block; font-family: var(--display); }
.footer-legal { text-align: right; line-height: 1.7; font-size: 13px; }

.page { max-width: 1100px; margin-left: auto; margin-right: auto; width: 100%; box-sizing: border-box; }
.page-actions { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.birth-fieldset {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px 16px; margin: 14px 0 0;
}
.birth-fieldset legend { padding: 0 6px; font-size: 14px; font-weight: 700; }
.admin-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 28px; }
.danger-zone { border-color: #f5c6cb; background: #fff8f8; }
.inline-reset { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.input-sm { width: 140px !important; padding: 7px 10px !important; font-size: 13px !important; margin: 0 !important; }

/* Auth */
.auth-body, .auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--bg);
}
.auth-card {
  width: min(440px, 100%); background: var(--surface); border-radius: 0;
  padding: 36px 32px; box-shadow: var(--shadow); border: 1px solid var(--line);
  animation: calvinFadeUp .7s cubic-bezier(0, 0.55, 0.45, 1) both;
}
.auth-card h1 { margin: 0 0 8px; font-size: 1.65rem; font-family: var(--display); font-weight: 400; letter-spacing: -.01em; }
.auth-card label, .form-card label {
  display: block; font-size: 13px; font-weight: 700; margin: 18px 0 0; color: #000;
}
.auth-card input, .form-card input, .form-card select, .form-card textarea,
.filter-bar select, .pick-row input[type=number] {
  width: 100%; margin-top: 6px; padding: 10px 0;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid #828484;
  font: inherit; background: transparent;
  transition: all .3s ease-in-out;
}
.auth-card input:focus, .form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: none;
  color: #000;
  border-bottom: 2px solid #000;
  box-shadow: none;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.auth-card .btn { margin-top: 22px; }

/* Panels */
.panel-body { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-mobile-bar { display: none; }
.admin-sidebar-overlay { display: none; }
.sidebar {
  background: linear-gradient(180deg, var(--admin-sidebar-from) 0%, var(--admin-sidebar-mid) 52%, var(--admin-sidebar-to) 100%);
  color: #fff; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.08);
}
.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-close-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar .brand,
.sidebar .brand .brand-name,
.sidebar .brand .brand-tld,
.sidebar .brand .brand-e {
  color: #fff;
}
.sidebar .brand .brand-e { color: #E17074; opacity: 1; font-weight: 700; }
.sidebar .brand .brand-tld { color: #F0A8AB; }
.sidebar .brand-admin { color: rgba(255,255,255,.7); }
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.sidebar nav a {
  color: rgba(255,255,255,.85); padding: 10px 12px; border-radius: 8px; font-weight: 600;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: background .25s ease, transform .25s cubic-bezier(.2,.8,.2,1),
    color .2s ease, box-shadow .25s ease, text-shadow .25s ease;
}
.sidebar nav a:hover, .sidebar nav a.active {
  background: rgba(255,255,255,.14); text-decoration: none; color: #fff;
  transform: translateX(6px) scale(1.015);
}
.sidebar nav a.sidebar-nav-home {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: 0;
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: none;
  border-radius: 10px;
}
.sidebar-nav-title {
  display: block;
  font-weight: 700;
  line-height: 1.2;
}
.sidebar-nav-hint {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(255,255,255,.68);
  white-space: normal;
}
.sidebar nav a.sidebar-nav-home:hover .sidebar-nav-hint {
  color: rgba(255,255,255,.9);
}
.sidebar-accent-cyan { --menu-rgb: 34, 211, 238; --menu-color: #67e8f9; }
.sidebar-accent-violet { --menu-rgb: 167, 139, 250; --menu-color: #c4b5fd; }
.sidebar-accent-orange { --menu-rgb: 251, 146, 60; --menu-color: #fdba74; }
.sidebar-accent-pink { --menu-rgb: 244, 114, 182; --menu-color: #f9a8d4; }
.sidebar-accent-green { --menu-rgb: 52, 211, 153; --menu-color: #6ee7b7; }
.sidebar-accent-yellow { --menu-rgb: 250, 204, 21; --menu-color: #fde047; }
.sidebar-accent-fuchsia { --menu-rgb: 232, 121, 249; --menu-color: #f0abfc; }
.sidebar-accent-sky { --menu-rgb: 56, 189, 248; --menu-color: #7dd3fc; }
.sidebar-accent-rose { --menu-rgb: 251, 113, 133; --menu-color: #fda4af; }
.sidebar nav > a.sidebar-accent::before,
.sidebar-group a::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  top: 17%;
  width: 3px;
  height: 66%;
  border-radius: 999px;
  background: var(--menu-color);
  box-shadow: 0 0 8px var(--menu-color), 0 0 18px rgba(var(--menu-rgb), .7);
  opacity: 0;
  transform: scaleY(.25);
  transition: opacity .2s ease, transform .3s cubic-bezier(.2,.9,.2,1);
}
.sidebar nav > a.sidebar-accent::after,
.sidebar-group a::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(105deg, transparent 12%, rgba(var(--menu-rgb), .12) 38%,
    rgba(var(--menu-rgb), .34) 52%, rgba(255,255,255,.14) 60%, transparent 82%);
  transform: translateX(-115%);
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
}
.sidebar nav > a.sidebar-accent:hover,
.sidebar nav > a.sidebar-accent.active,
.sidebar-group a:hover,
.sidebar-group a.active {
  background: linear-gradient(90deg, rgba(var(--menu-rgb), .24), rgba(var(--menu-rgb), .07));
  box-shadow: 0 8px 24px rgba(var(--menu-rgb), .16), inset 0 0 0 1px rgba(var(--menu-rgb), .24);
  text-shadow: 0 0 12px rgba(var(--menu-rgb), .85);
}
/* Aktiv menyu: sakit teal–amber parıltı */
.sidebar nav > a.sidebar-accent.active,
.sidebar-group a.active,
.sidebar nav > a.active {
  background:
    linear-gradient(90deg,
      rgba(30, 93, 241, .34) 0%,
      rgba(216, 70, 75, .28) 55%,
      rgba(13, 71, 206, .32) 100%);
  color: #fff;
  animation: sidebar-active-glow 2.4s ease-in-out infinite;
}
.sidebar nav > a.sidebar-accent.active::before,
.sidebar-group a.active::before {
  opacity: 1;
  transform: scaleY(1);
  background: linear-gradient(180deg, #5B7FE8, #D8464B, #0D47CE);
  box-shadow:
    0 0 10px #5B7FE8,
    0 0 16px #D8464B;
  animation: sidebar-active-bar 2.4s ease-in-out infinite;
}
@keyframes sidebar-active-glow {
  0%, 100% {
    background:
      linear-gradient(90deg,
        rgba(30, 93, 241, .22) 0%,
        rgba(216, 70, 75, .16) 55%,
        rgba(13, 71, 206, .2) 100%);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, .16),
      0 0 14px rgba(30, 93, 241, .28);
    text-shadow: 0 0 8px rgba(255, 255, 255, .3);
    filter: brightness(1);
  }
  50% {
    background:
      linear-gradient(90deg,
        rgba(30, 93, 241, .42) 0%,
        rgba(216, 70, 75, .34) 55%,
        rgba(13, 71, 206, .4) 100%);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, .28),
      0 0 20px rgba(30, 93, 241, .45),
      0 0 28px rgba(216, 70, 75, .28);
    text-shadow: 0 0 12px rgba(30, 93, 241, .55);
    filter: brightness(1.06);
  }
}
@keyframes sidebar-active-bar {
  0%, 100% {
    opacity: .55;
    box-shadow:
      0 0 6px rgba(52, 211, 153, .4),
      0 0 10px rgba(250, 204, 21, .3),
      0 0 14px rgba(56, 189, 248, .35);
  }
  50% {
    opacity: 1;
    box-shadow:
      0 0 12px #34d399,
      0 0 20px #facc15,
      0 0 28px #38bdf8;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar nav > a.sidebar-accent.active,
  .sidebar-group a.active,
  .sidebar nav > a.active,
  .sidebar nav > a.sidebar-accent.active::before,
  .sidebar-group a.active::before {
    animation: none;
  }
}
.sidebar nav > a.sidebar-accent:hover::before,
.sidebar nav > a.sidebar-accent.active::before,
.sidebar-group a:hover::before,
.sidebar-group a.active::before {
  opacity: 1;
  transform: scaleY(1);
}
.sidebar nav > a.sidebar-accent:hover::after,
.sidebar-group a:hover::after {
  transform: translateX(115%);
}
.sidebar nav a:focus-visible,
.sidebar-group-toggle:focus-visible {
  outline: 2px solid var(--menu-color, #fff);
  outline-offset: 2px;
}
.sidebar-group {
  margin: 4px 0;
  padding: 4px 6px 6px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  transition: border-color .3s ease, background .3s ease, box-shadow .3s ease,
    transform .3s cubic-bezier(.2,.8,.2,1);
}
.sidebar-group:hover,
.sidebar-group.is-open {
  border-color: rgba(var(--menu-rgb), .38);
  background: linear-gradient(135deg, rgba(var(--menu-rgb), .13), rgba(255,255,255,.045));
  box-shadow: 0 10px 28px rgba(var(--menu-rgb), .12), inset 0 0 18px rgba(var(--menu-rgb), .05);
}
.sidebar-group.is-open {
  border-color: rgba(255,255,255,.28);
  background:
    linear-gradient(135deg,
      rgba(250, 204, 21, .13),
      rgba(216, 70, 75, .13) 22%,
      rgba(244, 114, 182, .12) 42%,
      rgba(248, 113, 113, .11) 58%,
      rgba(52, 211, 153, .12) 78%,
      rgba(96, 165, 250, .15));
  box-shadow:
    0 12px 30px rgba(15, 23, 42, .2),
    inset 0 0 22px rgba(255,255,255,.055);
}
.sidebar-group.is-open > .sidebar-group-toggle {
  background: linear-gradient(90deg, rgba(216,70,75,.18), rgba(244,114,182,.12), rgba(96,165,250,.16));
  color: #fff;
}
.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,.92);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background .25s ease, color .25s ease, transform .25s ease,
    text-shadow .25s ease;
}
.sidebar-group-toggle:hover {
  background: linear-gradient(90deg, rgba(var(--menu-rgb), .24), rgba(var(--menu-rgb), .06));
  color: #fff;
  transform: translateX(3px);
  text-shadow: 0 0 13px rgba(var(--menu-rgb), .9);
}
.sidebar-group-toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,.22) 48%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
}
.sidebar-group-toggle > span {
  position: relative;
  z-index: 1;
}
.sidebar-group-toggle:hover::after {
  transform: translateX(120%);
}
.sidebar-group-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255,255,255,.7);
  border-bottom: 2px solid rgba(255,255,255,.7);
  transform: rotate(-45deg);
  transition: transform .2s ease, border-color .2s ease, filter .2s ease;
  flex-shrink: 0;
}
.sidebar-group.is-open .sidebar-group-chevron {
  transform: rotate(45deg);
  border-color: var(--menu-color);
  filter: drop-shadow(0 0 5px var(--menu-color));
}
.sidebar-group-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 2px;
}
.sidebar-group-links[hidden] {
  display: none;
}
@media (min-width: 961px) {
  .panel-body.panel-calvin .sidebar-group-links[hidden] {
    display: flex !important;
  }
}
.sidebar-group a {
  padding: 9px 12px;
  font-size: 0.9rem;
}

.math-ai-embed {
  margin: 28px 0 8px;
  padding-top: 22px;
  border-top: 1px dashed color-mix(in srgb, var(--line, #d1d5db) 80%, transparent);
}
.math-ai-embed-title {
  margin: 0 0 6px;
  font-family: var(--display, inherit);
  font-size: 1.15rem;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar nav a,
  .sidebar-group,
  .sidebar-group-toggle,
  .sidebar-group-toggle::after,
  .sidebar nav a::before,
  .sidebar nav a::after {
    transition-duration: .01ms !important;
  }
}
.sidebar-foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.16);
}
.sidebar-lang { margin: 0; }
.sidebar-logout { margin: 0; }
.sidebar-logout button {
  width: 100%; background: rgba(255,255,255,.1); color: #fff; border: none;
  padding: 10px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600;
  transition: background .2s ease, transform .2s ease;
}
.sidebar-logout button:hover { background: rgba(151, 32, 36, .4); transform: translateY(-1px); }
.panel-main {
  padding: 24px 28px 48px;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(13, 71, 206, .07), transparent 55%),
    radial-gradient(ellipse 45% 30% at 0% 100%, rgba(193, 41, 46, .05), transparent 50%),
    linear-gradient(180deg, #f7fbfb 0%, #eff0f0 100%);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Bütün admin səhifə məzmunu — İdarə paneli kimi mərkəzdə */
.panel-body .panel-main > .panel-top,
.panel-body .panel-main > .flash,
.panel-body .panel-main > .page,
.panel-body .panel-main > .import-report {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.panel-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,.78);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(18, 38, 58, .04);
}
.panel-top h1 { margin: 0; font-size: 1.45rem; font-family: var(--display); letter-spacing: -.02em; color: var(--brand-deep); }
.panel-top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.panel-top-meta { font-size: 0.9rem; }
.panel-top-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-top-logout { margin: 0; }
.panel-top-logout button {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.panel-top-logout button:hover { background: var(--accent-deep); }
.page-actions { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.continue-create-box { border-color: #86efac; background: #f0fdf4; }
.continue-create-heading {
  margin: 8px 0 14px;
  font-family: var(--display);
  font-size: 1.2rem;
}
.continue-create-links { margin: 10px 0 0; }

.dashboard-page {
  position: relative;
  isolation: isolate;
  min-height: auto;
  margin: 0 auto;
  padding: 0 18px 24px;
  overflow: hidden;
  border: 1px solid var(--line, #eee);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  width: 100%;
  max-width: 1100px;
  box-sizing: border-box;
}
/* Logo band in normal flow — never overlaps stats/table */
.dashboard-page::before {
  content: "";
  display: block;
  position: relative;
  z-index: 0;
  height: clamp(160px, 26vw, 260px);
  margin: 0 -18px 22px;
  background-image: url("../images/Loqo.png");
  background-color: #f3f4f4;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  border-bottom: 1px solid #eee;
}
.dashboard-page::after {
  display: none;
}
.dashboard-page .stat {
  position: relative;
  z-index: 1;
  background: #fff;
  border: 1px solid #eee;
  backdrop-filter: none;
  box-shadow: none;
  padding: 12px 11px;
  border-radius: 0;
}
.dashboard-page .stat-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.dashboard-page .stat-num {
  font-size: 1.3rem;
  line-height: 1.15;
}
.dashboard-page .stat-label {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.25;
}
.dashboard-page > h2 {
  display: inline-block;
  margin: 2px 0 9px;
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 10px;
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(7px);
  box-shadow: 0 7px 20px rgba(15, 23, 42, .1);
  font-size: 1rem;
}
.dashboard-page .table {
  background: rgba(255,255,255,.9);
  border-color: rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
}
.dashboard-page .table th {
  background: rgba(239,246,255,.91);
}
.dashboard-page .table th,
.dashboard-page .table td {
  padding: 8px 9px;
  font-size: 12px;
  line-height: 1.3;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(29, 78, 216, .12);
  border-color: rgba(234, 179, 8, .5);
}
.stat-tone-1 {
  background: linear-gradient(160deg, #e8eef8, #d7ecfb);
  border-color: #93c5fd;
}
.stat-tone-2 {
  background: linear-gradient(160deg, #FDF2F2, #fde8e9);
  border-color: #E17074;
}
.stat-tone-3 {
  background: linear-gradient(160deg, #ecfdf5, #d1fae5);
  border-color: #6ee7b7;
}
.stat-tone-4 {
  background: linear-gradient(160deg, #faf5ff, #ede9fe);
  border-color: #c4b5fd;
}
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--brand); font-family: var(--display); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 700; margin-top: 4px; line-height: 1.3; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.table th { background: linear-gradient(180deg, #e8eef8, #d7ecfb); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-deep); }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: #FDF2F2; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.upload-stats-lead { margin-bottom: 16px; }
.upload-stats-heading {
  margin: 8px 0 12px;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: -.02em;
}
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}
.status-running, .status-in_progress { background: #dcfce7; color: #166534; }
.status-scheduled { background: #d7ecfb; color: #0A369D; }
.status-finished, .status-submitted { background: #e0e7ff; color: #3730a3; }
.status-draft { background: #eef4f4; color: #475569; }
.status-cancelled, .status-timed_out, .status-abandoned { background: #fee2e2; color: #b91c1c; }
.sidebar .brand-admin { color: #E17074; }
.q-preview { max-width: 320px; }
.q-list-thumb {
  display: block; max-width: 120px; max-height: 72px; margin-top: 6px;
  border-radius: 6px; border: 1px solid var(--line); object-fit: contain; background: #fff;
}
.badge-image {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; background: #FDF2F2; color: #6D171A; margin-bottom: 4px;
}
.image-upload-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin: 16px 0 20px;
}
.image-mixed-list { display: flex; flex-direction: column; gap: 14px; margin: 18px 0 22px; }
.image-mixed-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: #fff;
}
.image-mixed-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px;
}
.image-mixed-body {
  display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 12px; align-items: start;
}
@media (max-width: 720px) {
  .image-mixed-body { grid-template-columns: 1fr; }
}
.image-upload-card-compact { margin: 0; }
.image-text-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.image-text-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.image-text-tools .btn { font-weight: 700; }
.image-text-field input, .image-text-field textarea {
  font: inherit; font-weight: 400; width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
}
.image-text-drop.is-drop-target {
  border-color: #972024 !important;
  box-shadow: 0 0 0 3px rgba(151, 32, 36, 0.2);
  background: #FDF2F2;
}
.image-upload-preview {
  cursor: grab;
}
.image-upload-preview.is-dragging,
.image-place-chip.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}
.image-place-board {
  margin-top: 8px;
  padding: 10px;
  border: 1.5px dashed #E17074;
  border-radius: 12px;
  background: linear-gradient(180deg, #FDF2F2, #fff);
}
.image-place-hint { margin: 0 0 8px; font-weight: 600; }
.image-place-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  min-height: 52px;
  line-height: 1.55;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}
.image-place-word {
  padding: 2px 0;
  white-space: pre-wrap;
}
.image-place-space {
  white-space: pre;
}
.image-place-gap {
  display: inline-flex;
  width: 8px;
  min-height: 1.4em;
  align-self: stretch;
  border-radius: 4px;
  transition: width .12s ease, background .12s ease;
}
.image-place-gap.is-drop-target,
.panel-body.is-img-dragging .image-place-gap:hover,
form.is-img-dragging .image-place-gap {
  width: 14px;
}
.image-place-gap.is-drop-target {
  background: rgba(151, 32, 36, 0.35);
  box-shadow: inset 0 0 0 1px #972024;
}
.image-place-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px 4px;
  padding: 3px;
  border: 2px solid #972024;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(151, 32, 36, 0.2);
  cursor: grab;
  vertical-align: middle;
  touch-action: none;
}
.image-place-chip img {
  display: block;
  width: auto;
  max-width: 88px;
  max-height: 56px;
  object-fit: contain;
  border-radius: 6px;
  pointer-events: none;
}
form.is-img-dragging .image-place-board {
  border-color: #972024;
  background: #FDF2F2;
}
.remove-image-check { display: flex; align-items: center; gap: 6px; font-weight: 500; margin-top: 6px; cursor: pointer; }
.image-upload-card {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border: 1px dashed var(--line); border-radius: var(--radius); background: #eff0f0;
  cursor: pointer;
}
.image-upload-label { font-size: 13px; font-weight: 600; color: var(--brand-deep); }
.image-upload-preview {
  width: 100%; max-height: 140px; object-fit: contain; border-radius: 6px;
  background: #fff; border: 1px solid var(--line);
}
.image-upload-preview.is-empty { display: none; }
.image-upload-input { font-size: 12px; }
.q-diagram, .q-content img, .option-math img, .option-review-list img {
  max-width: min(100%, 560px); height: auto; display: block; margin: 8px 0;
  border-radius: 8px; border: 1px solid var(--line);
  object-fit: contain;
}
.option-math .q-diagram, .option-review-list .q-diagram { max-width: min(100%, 320px); }
.q-content img.q-diagram-inline,
.option-math img.q-diagram-inline,
.option-review-list img.q-diagram-inline,
.q-diagram.q-diagram-inline {
  display: inline-block;
  vertical-align: middle;
  max-width: min(100%, 280px);
  max-height: 160px;
  margin: 0 0.35em;
  object-fit: contain;
}

/* Inline format: thin body text + clear thick / italic / underline */
.q-content,
.option-math,
.q-title.q-content,
.q-full-text {
  font-weight: 450;
}
.q-content strong,
.q-content b,
.option-math strong,
.option-math b,
.q-title strong,
.q-title b,
.q-full-text strong,
.q-full-text b {
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, transparent 62%, rgba(216, 70, 75, 0.35) 62%);
  border-radius: 2px;
  padding: 0 0.05em;
}
.q-content em,
.q-content i,
.option-math em,
.option-math i,
.q-full-text em,
.q-full-text i {
  font-style: italic;
  font-weight: 500;
  color: #0A369D;
}
.q-content u,
.option-math u,
.q-full-text u {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  text-decoration-color: #972024;
  font-weight: 600;
}
.form-card, .child-row, .exam-card, .empty-state, .info-strip, .hint-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.exam-card:hover, .child-row:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(151, 32, 36, .35);
}
.form-card .btn { margin-top: 16px; }
.hint, .hint-box { color: var(--muted); font-size: 14px; }
.hint-box { margin: 16px 0; background: #e8eef8; }
.hint-box ul { margin: 8px 0 0; padding-left: 18px; }
.import-report {
  margin: 0 0 18px; padding: 14px 16px; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; animation: rise .35s ease both;
}
.import-report-ok { border-color: #86efac; background: #f0fdf4; }
.import-report-warn { border-color: #E17074; background: #FDF2F2; }
.import-report strong { display: block; margin-bottom: 6px; color: var(--brand-deep); }
.import-report p { margin: 0 0 8px; }
.import-report-skipped-title { font-weight: 700; margin-top: 10px !important; }
.import-report-list { margin: 6px 0 0; padding-left: 18px; }
.import-report-list li { margin-bottom: 6px; line-height: 1.4; }
.grade-sector-alert {
  margin: 0 0 18px; padding: 14px 16px; border-radius: 12px;
  background: #FDF2F2; border: 2px solid #C9A227; color: #78350f;
  animation: rise .4s ease both;
}
.grade-sector-alert strong {
  display: block; font-size: 1.05rem; margin-bottom: 6px; color: #b45309;
}
.grade-sector-alert p { margin: 0; font-size: 0.95rem; line-height: 1.45; }
.register-notice {
  margin: 0 0 20px; padding: 14px 16px; border-radius: 12px;
  background: #e8eef8; border: 2px solid var(--brand);
  color: var(--brand-deep); animation: rise .4s ease both;
}
.register-notice strong {
  display: block; font-size: 1.02rem; margin-bottom: 6px; color: var(--brand);
}
.register-notice p {
  margin: 0; font-size: 0.98rem; line-height: 1.5; font-weight: 600;
}
.register-notice-prep {
  background: #FDF2F2;
  border-color: var(--accent);
}
.register-notice-prep strong { color: var(--accent-deep); }
.team-add-card { margin-bottom: 28px; }
.team-add-title { margin-top: 0; }
.phone-row {
  display: grid; grid-template-columns: auto 90px 1fr; gap: 8px; align-items: center; margin-top: 6px;
}
.phone-prefix {
  font-weight: 800; color: var(--brand-deep); padding: 10px 12px;
  background: #e8eef8; border: 1.5px solid var(--line); border-radius: 10px;
}
.phone-row select, .phone-row input { margin-top: 0 !important; }
.exam-link-box { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.exam-link-url { word-break: break-all; }
.search-input {
  flex: 1; min-width: 220px; padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); font: inherit;
}
.option-review-list { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; }
.option-review-list li {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #eff0f0;
}
.option-review-list li.is-correct { border-color: var(--brand-2); background: #e8f7ef; }
.option-review-list .correct-mark { margin-left: auto; color: var(--brand); font-size: 12px; }
.question-detail-card .q-title { margin-top: 0; }
.status-scheduled { background: #FDF2F2; color: #b45309; }

.child-list { display: flex; flex-direction: column; gap: 12px; }
.child-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.child-row h3 { margin: 0 0 4px; font-family: var(--display); }
.child-meta { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.score-badge {
  display: inline-flex; background: #e8eef8; color: var(--brand);
  font-weight: 800; padding: 6px 12px; border-radius: 999px;
}
.empty-state { text-align: center; padding: 48px 24px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-bar select { width: auto; min-width: 140px; }
.question-filter-bar .filter-search { flex: 1 1 220px; min-width: 200px; max-width: 360px; margin: 0; }
.question-filter-bar .filter-search input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}
.search-hint { margin: -8px 0 14px; font-size: 13px; }
.ai-upload-card { margin-bottom: 24px; border-color: #c4b5fd; background: #faf8ff; }
.ai-profile-fieldset {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #ddd6fe;
  border-radius: 12px;
  background: #fff;
}
.ai-profile-fieldset legend {
  padding: 0 6px;
  font-weight: 700;
  font-size: 0.95rem;
}
.ai-profile-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0;
  cursor: pointer;
}
.ai-profile-option input { margin-top: 4px; }
.ai-profile-option strong { display: block; }
.ai-profile-option em {
  display: block;
  font-style: normal;
  color: #6b7280;
  font-size: 0.85rem;
  margin-top: 2px;
}
.ai-upload-progress { margin: 16px 0; padding: 14px 16px; border-radius: 10px; background: #fff; border: 1px solid #ddd6fe; }
.ai-upload-progress-phase + .ai-upload-progress-phase { margin-top: 14px; }
.ai-upload-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-weight: 600; font-size: 0.95rem; }
.ai-progress-track { height: 10px; border-radius: 999px; background: #ede9fe; overflow: hidden; }
.ai-progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7c3aed, #a78bfa); transition: width 0.15s ease; }
.ai-progress-indeterminate .ai-progress-bar-pulse { width: 40%; animation: ai-progress-slide 1.4s ease-in-out infinite; }
.ai-upload-spinner { width: 18px; height: 18px; border: 2px solid #c4b5fd; border-top-color: #7c3aed; border-radius: 50%; animation: ai-spin 0.8s linear infinite; flex-shrink: 0; }
.ai-upload-progress--error { border-color: #fecaca; background: #fef2f2; }
.ai-upload-error { margin: 0; color: #b91c1c; font-weight: 600; }
@keyframes ai-progress-slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-review-card { margin-bottom: 20px; }
.ai-review-card-focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15); }
.ai-review-card-muted { opacity: 0.55; }
.ai-review-card-sent { opacity: 0.7; border-style: dashed; }
.ai-review-card-needs { border-color: #C9A227; background: #fffbeb; }
.ai-review-card-needs.ai-review-card-focus { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25); }
.ai-review-priority-hint { color: #b45309; font-weight: 600; }
.preview-badge-warn { background: #fef3c7; color: #92400e; }
.ai-review-progress { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ai-review-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 16px; padding: 10px; border-radius: 12px; background: #eff0f0; border: 1px solid var(--line); }
.ai-review-nav-label { font-weight: 700; min-width: 5rem; text-align: center; }
.ai-review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.ai-review-actions-main { margin-top: 16px; padding: 14px; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; }
.ai-send-btn { min-width: 12rem; font-weight: 700; }
.ai-send-btn.is-loading { opacity: 0.75; cursor: wait; }
.ai-send-hint { margin: -4px 0 12px; }
.btn-danger-text { color: #b91c1c; }
.ai-review-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.ai-review-head h2 { margin: 0; font-size: 1.1rem; flex: 1 1 auto; }
.ai-review-preview { margin: 12px 0; padding: 14px; border-radius: 12px; background: #eff0f0; border: 1px solid var(--line); }
.ai-review-edit { margin-top: 12px; }
.ai-review-edit summary { cursor: pointer; font-weight: 700; color: var(--brand-deep); padding: 8px 0; }
.ai-edit-form { display: grid; gap: 12px; margin-top: 12px; }
.ai-satisfied-field { border: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ai-satisfied-field legend { font-weight: 700; margin-bottom: 6px; }
.ai-satisfied-field .choice-chips-2 { margin-bottom: 4px; }
.ai-edit-slot { padding: 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: grid; gap: 8px; }
.ai-edit-hint { margin: 8px 0 0; }
.ai-edit-slot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-crop-badge { background: #d7ecfb; color: var(--brand-deep); border: 0; }
.ai-edit-slot-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 12px;
  align-items: start;
}
.ai-edit-media { display: grid; gap: 8px; }
.ai-crop-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #eff0f0;
  cursor: crosshair;
}
.ai-crop-thumb img { display: block; width: 100%; max-height: 180px; object-fit: contain; background: #fff; }
.ai-crop-thumb-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}
.ai-crop-thumb.is-removed { opacity: 0.35; }
.ai-crop-empty {
  padding: 18px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  text-align: center;
}
.ai-edit-slot.has-pending-crop { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.ai-replace-file span { display: block; margin-bottom: 4px; font-size: 0.82rem; font-weight: 600; }
.ai-edit-text span { display: block; margin-bottom: 4px; font-weight: 600; }
.ai-edit-text textarea,
.ai-edit-text input { width: 100%; }
body.ai-crop-open { overflow: hidden; }
.ai-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
}
.ai-crop-modal[hidden] { display: none !important; }
.ai-crop-dialog {
  width: min(920px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.ai-crop-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.ai-crop-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}
.ai-crop-toolbar .btn[disabled] {
  opacity: 0.55;
  cursor: wait;
}
.ai-crop-stage {
  position: relative;
  margin: 12px 0;
  min-height: 240px;
  max-height: min(62vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #04153E;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.ai-crop-stage img {
  max-width: 100%;
  max-height: min(62vh, 560px);
  display: block;
  pointer-events: none;
}
.ai-crop-sel {
  position: absolute;
  border: 2px solid #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
  pointer-events: none;
}
.ai-crop-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
@media (max-width: 720px) {
  .ai-edit-slot-grid { grid-template-columns: 1fr; }
}

/* —— Question browser (exam-like review) —— */
.qb-page { max-width: 1120px; margin: 0 auto; }
.qb-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid #c7e0dc;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(45, 140, 130, 0.12), transparent 55%),
    linear-gradient(160deg, #f4fbfa 0%, #eff0f0 55%, #f7faf9 100%);
}
.qb-hero h2 { margin: 0 0 6px; font-size: 1.45rem; }
.qb-hero p { margin: 0; max-width: 46rem; }
.qb-hero-stat {
  min-width: 88px;
  text-align: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #d5e8e4;
}
.qb-hero-stat strong { display: block; font-size: 1.5rem; color: var(--brand-deep); }
.qb-hero-stat span { font-size: 0.78rem; color: var(--muted); }
.qb-filters { margin-bottom: 18px; }
.qb-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 14px;
  margin: 14px 0 16px;
}
.qb-empty { margin-top: 12px; }
.qb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 14px;
}
.qb-toolbar-bottom { margin-top: 18px; }
.qb-pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qb-toolbar-hint { margin: 0; }

.qb-workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.qb-batch-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 520px;
  padding: 4px;
}
.qb-dot {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #c5d9d5;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.qb-dot:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}
.qb-dot.is-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(45, 140, 130, 0.28);
}
.qb-stage {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  justify-content: center;
}
.qb-admin-rail {
  position: sticky;
  top: 12px;
  min-width: 0;
}
.qb-admin-panel {
  display: none;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #d7e5e2;
  box-shadow: 0 10px 28px rgba(18, 38, 58, 0.06);
  overflow: hidden;
}
.qb-admin-panel.is-active,
.qb-admin-panel:not([hidden]) {
  display: block;
}
.qb-admin-panel[hidden] {
  display: none !important;
}
.qb-admin-panel.is-editing,
.qb-admin-panel.qb-card-saved {
  border-color: #5bb8ae;
  box-shadow: 0 0 0 3px rgba(45, 140, 130, 0.15);
}
.qb-admin-answer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px 12px;
  border-bottom: 1px solid #e8f0ee;
  background: #f8fcfb;
}
.qb-correct-pill {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.95rem;
}
.qb-device-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.qb-slide-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(100%, 430px);
}

.qb-device {
  margin: 0 auto;
  padding: 16px 14px 18px;
  border-radius: 32px;
  background: linear-gradient(165deg, #1f2937 0%, #111827 100%);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.28);
  width: min(100%, 430px);
}
.qb-device-tablet {
  width: min(100%, 720px);
  border-radius: 22px;
  padding: 16px;
}
.qb-device-chrome {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.qb-device-notch {
  width: 96px;
  height: 8px;
  border-radius: 999px;
  background: #374151;
}
.qb-device-tablet .qb-device-notch { width: 42px; height: 6px; }
.qb-device-screen {
  background: #eef5f3;
  border-radius: 22px;
  padding: 14px;
  min-height: 420px;
  max-height: min(72vh, 860px);
  overflow: auto;
}
.qb-device-tablet .qb-device-screen {
  border-radius: 14px;
  padding: 18px;
  min-height: 480px;
}

.qb-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #f3faf8;
  border-bottom: 1px solid #e2eeeb;
}
.qb-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.qb-card-head strong { font-size: 1rem; }
.qb-card-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }

.qb-preview {
  display: none;
  overflow: visible;
}
.qb-preview.is-active,
.qb-preview:not([hidden]) {
  display: block;
}
.qb-preview[hidden] {
  display: none !important;
}
.qb-preview .student-preview-box,
.qb-preview .question-box {
  box-shadow: none !important;
  border: 0 !important;
  padding: 14px 12px 8px !important;
  background: transparent !important;
  animation: none !important;
  transform: none !important;
  position: static !important;
  z-index: auto !important;
  overflow: visible !important;
}
.qb-preview .q-title {
  font-size: 1.08rem;
  margin-bottom: 16px;
  line-height: 1.55;
}
.qb-preview .options {
  gap: 10px;
  margin: 0;
}
.qb-preview .option {
  pointer-events: none;
  transform: none !important;
}

.qb-edit {
  padding: 14px 14px 16px;
  border-top: 1px dashed #cfe0dc;
  background: #f8fcfb;
}
.qb-edit-form label { display: block; margin-bottom: 10px; font-weight: 600; font-size: 0.9rem; }
.qb-edit-form textarea,
.qb-edit-form input[type="text"],
.qb-edit-form select {
  width: 100%;
  margin-top: 4px;
  font-weight: 400;
}
.qb-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.qb-status.is-ok { color: #0A369D; }
.qb-status.is-error { color: #b91c1c; }

.qb-img-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.qb-img-tool {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #dbe7e4;
  background: #fff;
}
.qb-img-tool[hidden] { display: none !important; }
.qb-img-tool-preview {
  width: 96px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qb-img-tool-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.qb-img-tool-meta strong { display: block; margin-bottom: 6px; font-size: 0.86rem; }
.qb-rotate-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-open-correct { margin: 8px 0 0; }

@media (max-width: 900px) {
  .qb-stage {
    grid-template-columns: 1fr;
  }
  .qb-admin-rail {
    position: static;
    order: 2;
  }
  .qb-device-wrap { order: 1; }
}

@media (max-width: 640px) {
  .qb-hero { flex-direction: column; }
  .qb-device { border-radius: 24px; width: 100%; }
  .qb-slide-nav { width: 100%; }
  .qb-img-tool { grid-template-columns: 1fr; }
  .qb-card-head { flex-direction: column; }
}

.expert-review-page { max-width: 1100px; margin: 0 auto; }
.expert-review-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e8eef8, #eff0f0);
}
.expert-review-intro h2 { margin: 0 0 6px; font-family: var(--display); font-size: 1.25rem; }
.expert-review-intro p { margin: 0; color: var(--muted); line-height: 1.5; }
.expert-review-intro > strong {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--brand-deep);
  background: #d7ecfb;
  font-size: 0.88rem;
}
.expert-filter { margin-bottom: 20px; }
.expert-grade-pick { margin-bottom: 18px; }
.expert-grade-help { margin: 0 0 10px; font-size: 0.88rem; }
.expert-pick-grade-empty { margin-top: 8px; }
.expert-question-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.expert-question-actions .inline-form {
  display: flex;
  margin: 0;
}
.expert-question-actions .inline-form .btn {
  flex: 0 0 auto;
}
.expert-search { display: block; margin-bottom: 14px; }
.expert-search span { display: block; margin-bottom: 6px; font-weight: 700; }
.expert-search input { width: 100%; min-height: 46px; }
.expert-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}
.expert-filter-grid label { margin: 0; }
.expert-filter-grid select { width: 100%; }
.expert-filter-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.expert-question-list { display: grid; gap: 18px; }
.expert-question-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  scroll-margin-top: 88px;
  scroll-margin-bottom: 24px;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.expert-question-card.expert-scroll-highlight {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}
.expert-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #eff0f0;
}
.expert-question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.expert-question-meta > span:not(.badge),
.expert-question-meta > strong {
  padding: 5px 9px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.82rem;
}
.expert-question-body { padding: 18px; }
.expert-question-body h3 { margin: 0 0 16px; font-size: 1.05rem; line-height: 1.55; }
.expert-options { display: grid; gap: 9px; }
.expert-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #eff0f0;
}
.expert-option.is-correct { border-color: #86efac; background: #f0fdf4; }
.expert-option .option-math { flex: 1 1 auto; min-width: 0; }
.expert-option .correct-mark { margin-left: auto; color: #15803d; font-size: 0.72rem; }
.expert-question-card .q-diagram { max-width: 100%; max-height: 380px; object-fit: contain; }
.expert-option .q-diagram { max-height: 180px; }
.expert-question-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fcfcfd;
  font-size: 0.78rem;
}
.expert-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
@media (max-width: 900px) {
  .expert-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .expert-review-page {
    max-width: 100%;
    overflow-x: clip;
  }
  .expert-review-intro {
    flex-direction: column;
    padding: 14px 16px;
  }
  .expert-filter-grid { grid-template-columns: 1fr; }
  .expert-grade-pick .grade-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .expert-question-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .expert-question-meta {
    width: 100%;
  }
  .expert-question-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
  }
  .expert-question-actions > .btn,
  .expert-question-actions > .inline-form {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
  }
  .expert-question-actions > .inline-form .btn {
    width: 100%;
    box-sizing: border-box;
  }
  .expert-question-body { padding: 14px; }
  .expert-question-footer {
    flex-direction: column;
    padding: 10px 14px;
  }
  .expert-option {
    flex-wrap: wrap;
    gap: 8px;
  }
  .expert-option .correct-mark {
    margin-left: 0;
    flex: 0 0 100%;
  }
  .expert-pagination {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }
}

.curated-exam-page { max-width: 1100px; margin: 0 auto; }
.curated-exam-intro {
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f0fdf4, #eff0f0);
}
.curated-exam-intro h2 { margin: 0 0 8px; font-family: var(--display); font-size: 1.25rem; }
.curated-exam-intro p { margin: 0; color: var(--muted); line-height: 1.55; }
.curated-browse-form { margin-bottom: 16px; }
.curated-grade-sector { margin-bottom: 12px; }
.curated-basket-panel {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.curated-basket-panel.has-items {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4, #fff 120px);
}
.curated-basket-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.curated-basket-count {
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d7ecfb;
  color: var(--brand-deep);
  font-size: 0.85rem;
  font-weight: 700;
}
.curated-basket-empty { margin: 0; }
.curated-basket-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 14px;
}
.curated-basket-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.curated-basket-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.82rem;
}
.curated-basket-item-main .muted {
  flex: 1 1 100%;
  font-size: 0.78rem;
}
.curated-basket-create { margin-top: 8px; padding-top: 14px; border-top: 1px dashed var(--line); }
.curated-basket-create h3 { margin: 0 0 6px; font-size: 1.05rem; }
.curated-pick-form { margin-bottom: 24px; }
.curated-pick-list { display: grid; gap: 16px; margin-bottom: 16px; }
.curated-pick-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}
.curated-pick-card.in-basket {
  border-color: #86efac;
  background: #f8fff9;
}
.curated-pick-check { padding-top: 4px; }
.curated-pick-check input { width: 18px; height: 18px; }
.curated-pick-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.82rem;
}
.curated-pick-head > span:not(.badge),
.curated-pick-head > strong {
  padding: 4px 8px;
  border-radius: 8px;
  background: #eff0f0;
  border: 1px solid var(--line);
}
.curated-in-basket { background: #dcfce7 !important; color: #166534 !important; border: 0 !important; }
.curated-pick-question { margin-bottom: 12px; line-height: 1.5; font-size: 1rem; }
.curated-pick-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.curated-pick-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eff0f0;
  font-size: 0.88rem;
  min-height: 100%;
}
.curated-pick-option.is-correct { border-color: #86efac; background: #f0fdf4; }
.curated-pick-option .option-math { flex: 1 1 auto; min-width: 0; }
.curated-pick-option .correct-mark { margin-left: auto; color: #15803d; font-size: 0.68rem; white-space: nowrap; }
.curated-pick-card .q-diagram { max-width: 100%; max-height: 200px; object-fit: contain; }
.curated-add-bar {
  position: sticky;
  bottom: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: rgba(239, 246, 255, 0.97);
  backdrop-filter: blur(8px);
  z-index: 2;
}
.curated-add-bar .btn { width: 100%; max-width: 420px; }
.curated-pick-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.curated-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}
.curated-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .curated-pick-options { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .curated-pick-card { grid-template-columns: 1fr; }
  .curated-pick-check { order: -1; }
  .curated-add-bar .btn { max-width: none; }
}

.question-stats {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.question-stats-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.question-stats-head strong {
  font-size: 1.05rem;
  color: var(--brand-deep);
  min-width: 0;
  word-break: break-word;
}
.export-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.export-label { font-size: 13px; }
.stats-table { margin: 0; width: 100%; }
.stats-table th:last-child,
.stats-table td:last-child { text-align: right; white-space: nowrap; }
.showing-note { margin: 0 0 12px; font-size: 13px; }

/* Questions page — tidy layout (sidebar untouched) */
.special-hub-page { max-width: 920px; }
.special-hub-lead { margin: 0 0 14px; font-size: 1.02rem; line-height: 1.55; }
.special-hub-count { margin: 0 0 18px; }
.special-hub-actions { margin-top: 8px; }
.abiturient-subjects { margin-top: 28px; }
.abiturient-subjects-title { margin: 0 0 6px; font-size: 1.15rem; }
.abiturient-subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.abiturient-subject-item {
  border: 1px solid var(--border, #ddd);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel, #fff);
}
.abiturient-subject-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.abiturient-subject-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}


.questions-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  box-sizing: border-box;
}
.questions-page .table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}
.questions-page .stats-table,
.questions-page .questions-table {
  margin: 0;
  min-width: 0;
}
.questions-page .questions-table th,
.questions-page .questions-table td {
  vertical-align: middle;
}
.questions-page .q-preview {
  max-width: none;
  min-width: 0;
  width: 42%;
  word-break: break-word;
  line-height: 1.55;
}
.questions-page .q-full-text {
  margin-top: 4px;
}
.questions-page .q-full-text p { margin: 0 0 0.4em; }
.questions-page .q-full-text p:last-child { margin-bottom: 0; }
.questions-page .q-list-full-img {
  display: block;
  max-width: min(100%, 420px);
  max-height: 280px;
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: #fff;
}
.questions-page .actions-cell {
  justify-content: flex-start;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .questions-page {
    max-width: 100%;
  }
  .question-stats-head {
    flex-direction: column;
    align-items: stretch;
  }
  .export-actions {
    width: 100%;
  }
  .export-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .question-stats { padding: 12px; }
  .export-actions .export-label { width: 100%; }
  .question-filter-bar select,
  .question-filter-bar .btn {
    flex: 1 1 140px;
    min-width: 0;
  }
  .question-filter-bar .filter-search {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  /* Card layout for stats + questions tables */
  .questions-page .table-scroll {
    overflow: visible;
  }
  .questions-page table.responsive-cards,
  .questions-page table.responsive-cards thead,
  .questions-page table.responsive-cards tbody,
  .questions-page table.responsive-cards th,
  .questions-page table.responsive-cards td,
  .questions-page table.responsive-cards tr {
    display: block;
    width: 100%;
  }
  .questions-page table.responsive-cards {
    border: none;
    background: transparent;
    overflow: visible;
  }
  .questions-page table.responsive-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .questions-page table.responsive-cards tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .questions-page table.responsive-cards tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
  }
  .questions-page table.responsive-cards tbody tr:hover {
    background: var(--surface);
  }
  .questions-page table.responsive-cards td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
    text-align: right;
    white-space: normal;
  }
  .questions-page table.responsive-cards td:last-child {
    border-bottom: none;
    padding-bottom: 2px;
  }
  .questions-page table.responsive-cards td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    text-align: left;
    flex: 0 0 38%;
    max-width: 42%;
  }
  .questions-page table.responsive-cards td.actions-cell {
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 8px;
  }
  .questions-page table.responsive-cards td.actions-cell::before,
  .questions-page table.responsive-cards td[data-label=""]::before {
    content: none;
    display: none;
  }
  .questions-page table.responsive-cards td.actions-cell .btn,
  .questions-page table.responsive-cards td.actions-cell .inline-form {
    flex: 1 1 auto;
  }
  .questions-page table.responsive-cards td.actions-cell .inline-form .btn {
    width: 100%;
  }
  .questions-page table.responsive-cards td.col-check {
    justify-content: flex-start;
    align-items: center;
  }
  .questions-page table.responsive-cards td.col-check::before {
    content: none;
  }
  .questions-page table.responsive-cards .q-preview {
    max-width: none;
    flex: 1;
  }
  .questions-page .stats-table th:last-child,
  .questions-page .stats-table td:last-child {
    text-align: right;
  }
  .questions-page .bulk-delete-bar {
    position: sticky;
    top: 60px;
  }
  .questions-page .bulk-delete-inner {
    width: 100%;
  }
  .questions-page .bulk-delete-inner .btn {
    flex: 1 1 auto;
  }
}

.bar-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 50px; gap: 10px; align-items: center; font-size: 14px; }
.bar-track { height: 10px; background: #e0ebe4; border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--gold), var(--accent));
  border-radius: 999px; transition: width .35s ease;
}

.letter { font-weight: 800; }
.letter-A { color: #0A369D; }
.letter-B { color: #0D47CE; }
.letter-C { color: #972024; }
.letter-D { color: #6D171A; }
.letter-E, .letter-F { color: var(--danger); }

.status { font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: #eee; }
.status-running { background: #e8eef8; color: var(--ok); }
.status-finished { background: #FDF2F2; color: #9a3412; }
.status-invite-invited { background: #eef4f4; color: #475569; }
.status-invite-interested { background: #FDF2F2; color: #6D171A; }
.status-invite-approved { background: #ecfdf5; color: #047857; }
.status-invite-rejected { background: #fef2f2; color: #b91c1c; }
.badge-pending {
  display: inline-block; min-width: 1.25em; padding: 1px 6px; margin-left: 4px;
  border-radius: 999px; background: #972024; color: #fff; font-size: 11px; font-weight: 700;
  vertical-align: middle; text-align: center;
}
.badge-muted {
  display: inline-block; min-width: 1.25em; padding: 1px 6px; margin-left: 4px;
  border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 11px; font-weight: 700;
  vertical-align: middle; text-align: center;
}
.status-draft { background: #fef9c3; color: #854d0e; }

.subject-pick { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 8px; }
.pick-row {
  display: grid; grid-template-columns: 24px 1fr 80px; gap: 10px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin: 0 !important;
}
.pick-row input[type=checkbox] { width: auto; margin: 0; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

.info-strip { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 16px 0 24px; }
.review-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: #fff; }
.review-item.correct, .review-item.ok { border-left: 4px solid var(--ok); }
.review-item.wrong { border-left: 4px solid var(--danger); }
.review-item.blank { border-left: 4px solid #999; }
.review-item header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.badge { font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 6px; background: #eee; }
.badge-ok { background: #d7ecfb; color: var(--ok); }
.badge-wrong { background: #fdecea; color: var(--danger); }
.q-text { font-weight: 600; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }
.success-text { color: var(--ok); font-weight: 700; }

/* Exam UI — calm green sidebars, clear questions */
.exam-body {
  background:
    radial-gradient(ellipse 70% 40% at 50% -10%, rgba(29, 78, 216, .07), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #eef4f4 100%);
  min-height: 100vh;
}
.exam-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='280' viewBox='0 0 360 280'%3E%3Cg fill='none' stroke='%23282828' stroke-width='1.2'%3E%3Cpath d='M40 70h70v90H40z'/%3E%3Cpath d='M50 90h50M50 110h50M50 130h35'/%3E%3Cpath d='M160 55l40-18 40 18v55l-40 18-40-18z'/%3E%3Cpath d='M200 37v55'/%3E%3Ccircle cx='290' cy='95' r='28'/%3E%3Cpath d='M290 75v40M270 95h40'/%3E%3C/g%3E%3Ctext x='24' y='268' fill='%23282828' font-family='Arial,sans-serif' font-size='13'%3EImtahan%3C/text%3E%3Ctext x='130' y='268' fill='%23C1292E' font-family='Arial,sans-serif' font-size='13'%3EBilik%3C/text%3E%3C/svg%3E");
  background-size: 360px 280px;
  background-repeat: repeat;
}
.exam-body > * { position: relative; z-index: 1; }
.exam-brand {
  font-family: var(--display); font-size: 1.45rem; font-weight: 700; margin-bottom: 4px;
  letter-spacing: -.03em; color: var(--brand-deep);
}
.exam-brand .brand-e { color: var(--accent); }
.exam-brand .brand-tld { color: var(--gold); font-size: .85em; }
.exam-list-page { padding: 40px 0; }
.exam-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.exam-card h3 { margin: 0 0 6px; font-family: var(--display); }

.exam-shell {
  display: grid; grid-template-columns: 200px 1fr 200px;
  min-height: 100vh; gap: 0;
}
.exam-left, .exam-right {
  background:
    radial-gradient(ellipse 70% 35% at 50% 0%, rgba(151, 32, 36, .2), transparent 50%),
    linear-gradient(180deg, #04153E, #07266E 55%, #0A369D);
  color: #fff; padding: 20px 14px; overflow-y: auto;
}
.exam-left h3, .exam-right h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; font-weight: 700; }
.answered-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.answered-list li { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.exam-center { padding: 20px 24px 40px; background: transparent; }
.exam-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.timer {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.3rem;
  background: #fff; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  color: var(--brand);
  box-shadow: 0 8px 20px rgba(29, 78, 216, .08);
  font-family: var(--display);
}
.timer-side { font-size: 1.6rem; font-weight: 800; margin-bottom: 16px; text-align: center; font-family: var(--display); }
.timer.timer-danger, .timer-side.timer-danger {
  color: #b91c1c; border-color: #f5c2c2; background: #fff5f5;
  animation: pulse-warn 1.2s ease-in-out infinite;
}
.time-alert {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 10px;
  background: #fff1f1; border: 1px solid #f0b4b4; color: #9b1c1c;
  font-size: 14px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
}
.time-alert strong { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
@keyframes pulse-warn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, .15); }
  50% { box-shadow: 0 0 0 6px rgba(185, 28, 28, .08); }
}
.grade-band {
  display: inline-block; margin: 4px 0 2px; font-family: var(--display);
  font-size: 1.05rem; font-weight: 700; color: var(--brand-deep);
}
.result-locked {
  margin: 16px 0; padding: 14px 16px; border-radius: 12px;
  background: #e8eef8; border: 1px solid var(--line); color: var(--muted); text-align: left;
}
.result-locked strong { display: block; color: var(--ink); margin-bottom: 4px; }
.total-q-line { margin: 12px 0 18px; font-size: 1.05rem; }
.exam-create-form .pick-row .subj-count:disabled { opacity: .45; }
.answered-list a { color: inherit; text-decoration: none; }
.answered-list a:hover { text-decoration: underline; }
.question-box {
  background: rgba(255,255,255,.98); border-radius: var(--radius); padding: 28px 26px;
  border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .35s ease both;
  position: relative; z-index: 2;
}
.q-meta { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.subject-tag { background: #e8eef8; color: var(--brand); padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.q-title {
  margin: 0 0 22px; font-size: 1.22rem; line-height: 1.5;
  font-family: var(--font); font-weight: 500; color: var(--ink);
  letter-spacing: -.015em;
}
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  background: #eff0f0; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; font: inherit;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.option:hover {
  border-color: var(--brand-2);
  background: #e8eef8;
  transform: translateX(4px);
  box-shadow: 0 8px 20px rgba(29, 78, 216, .1);
}
.option.selected {
  border-color: var(--brand);
  background: linear-gradient(135deg, #e8eef8, #FDF2F2);
  box-shadow: 0 10px 24px rgba(29, 78, 216, .12);
}
.opt-letter {
  width: 28px; height: 28px; border-radius: 8px; background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.option:hover .opt-letter { border-color: var(--brand-2); color: var(--brand); }
.option.selected .opt-letter {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; border-color: transparent; transform: scale(1.05);
}
.exam-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.open-answer-box {
  margin-top: 18px; padding: 18px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #eff0f0;
}
.open-answer-box label { display: block; margin-bottom: 8px; font-weight: 700; }
.open-answer-box input {
  width: 100%; min-height: 52px; padding: 12px 14px; font: inherit;
  font-size: 1.05rem; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff;
}
.open-answer-box input:focus { border-color: var(--brand); outline: 3px solid rgba(37,99,235,.12); }
.open-answer-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.open-answer-status { color: #15803d; font-weight: 600; }
.open-question-preview {
  margin: 16px 0; padding: 16px; border: 1px solid var(--line);
  border-radius: 12px; background: #eff0f0;
}
.open-preview-card {
  margin-top: 12px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.open-preview-card .q-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: #64748b;
}
.open-preview-question {
  margin: 0 0 14px;
  font-size: 1.1rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.open-preview-card .open-answer-box { margin: 0; }
.open-answer-line { margin-top: 14px; color: #64748b; letter-spacing: 2px; overflow: hidden; }
.open-correct-answer {
  margin-top: 14px; padding: 12px; border-radius: 10px;
  background: #ecfdf5; border: 1px solid #a7f3d0;
}
.is-invisible { visibility: hidden; pointer-events: none; }
.q-map { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.q-map-subject { display: flex; flex-direction: column; gap: 4px; }
.q-map-label {
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  color: rgba(255,255,255,.55); text-transform: none; line-height: 1.2;
}
.q-map-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.q-dot {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 12px; font-weight: 700;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.q-dot:hover { transform: scale(1.12); background: rgba(234, 179, 8, .5); text-decoration: none; }
.q-dot.done { background: linear-gradient(135deg, #0A369D, #972024); }
.q-dot.current { outline: 2px solid #fff; box-shadow: 0 0 0 3px rgba(234, 179, 8, .55); }
.q-map-hint {
  margin: 0 0 14px; padding: 8px 10px; border-radius: 8px;
  background: rgba(250, 204, 21, .18); border: 1px solid rgba(250, 204, 21, .35);
  color: #fef3c7; font-size: 11px; line-height: 1.35;
}
.q-map-hint-title { display: block; font-weight: 800; margin-bottom: 2px; color: #F0A8AB; }

.result-page { padding: 40px 0 64px; }
.result-hero {
  background: #fff; border-radius: var(--radius); padding: 32px; border: 1px solid var(--line);
  box-shadow: var(--shadow); margin-bottom: 28px; animation: rise .5s ease both;
}
.result-score { display: flex; gap: 24px; align-items: center; margin: 20px 0; }
.big-letter { font-size: 4rem; font-weight: 800; line-height: 1; font-family: var(--display); }
.pct { font-size: 2rem; font-weight: 800; font-family: var(--display); }
.motivate { margin: 8px 0 0; color: var(--muted); }
.result-stats { display: flex; gap: 16px; margin-bottom: 16px; font-weight: 700; }

.lang-switch {
  display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden;
  background: #fff;
}
.lang-switch a {
  padding: 6px 12px; font-size: 12px; font-weight: 800; color: var(--muted); text-decoration: none;
}
.lang-switch a.active { background: var(--brand); color: #fff; }
.lang-switch a:hover { text-decoration: none; color: var(--brand); }
.lang-switch a.active:hover { color: #fff; }
.sidebar .lang-switch { border-color: rgba(255,255,255,.25); background: transparent; }
.sidebar .lang-switch a { color: rgba(255,255,255,.75); }
.sidebar .lang-switch a.active { background: rgba(255,255,255,.2); color: #fff; }
.sidebar-lang { margin: 0; }
.lang-float { position: fixed; top: 14px; right: 14px; z-index: 50; }

.lang-pick-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(ellipse 50% 60% at 80% 20%, rgba(151, 32, 36, .35), transparent 55%),
    linear-gradient(145deg, #04153E, #07266E 45%, #0A369D 100%);
  color: #fff;
}
.lang-pick {
  width: min(440px, 100%); text-align: center;
  padding: 40px 28px; border-radius: 20px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(14px);
  animation: rise .6s ease both;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
  transition: transform .25s ease, box-shadow .25s ease;
}
.lang-pick:hover { transform: translateY(-4px); box-shadow: 0 28px 68px rgba(151, 32, 36, .22); }
.lang-pick-brand {
  font-family: var(--display); font-size: clamp(2.4rem, 9vw, 3.2rem);
  font-weight: 700; margin-bottom: 14px; letter-spacing: -.03em; color: #fff;
}
.lang-pick-brand .brand-e { font-style: normal; font-weight: 700; color: #E17074; }
.lang-pick-brand .brand-name { color: #fff; }
.lang-pick-brand .brand-tld { color: #F0A8AB; font-size: .82em; }
.lang-pick h1 { margin: 0 0 12px; font-family: var(--display); font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; }
.lang-pick p { opacity: .9; margin: 0 0 28px; line-height: 1.65; color: #FDF2F2; }
.lang-pick-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lang-pick .btn:not(.btn-ghost) { background: #fff; color: var(--brand-deep); }
.lang-pick .btn:not(.btn-ghost):hover { background: #FDF2F2; color: var(--accent-deep); }

/* Tablet */
@media (max-width: 960px) {
  .why-grid, .steps-modern, .admin-panels, .footer-grid { grid-template-columns: 1fr; }
  .step-card:not(:last-child)::after {
    content: "↓";
    top: auto;
    right: 50%;
    bottom: -23px;
    animation-name: step-arrow-flow-down;
  }
  .footer-legal { text-align: left; }
  .cta-panel { padding: 32px 24px; }
  .hero-content { padding: 64px 0 88px; }
  .exam-shell { grid-template-columns: 1fr; }
  .exam-left { display: none; }
  .exam-right { order: -1; max-height: none; }
}

/* Admin / parent sidebar — mobile drawer */
@media (max-width: 960px) {
  html {
    overflow-x: clip;
  }
  .panel-body {
    display: block;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    padding-top: calc(60px + env(safe-area-inset-top, 0px));
    overflow-x: clip;
  }
  .panel-body > .sidebar {
    /* drawer: must not reserve desktop column space */
    position: fixed;
  }
  .panel-body > .panel-main {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
    padding: 14px 12px max(40px, env(safe-area-inset-bottom, 0px));
  }
  .panel-body .panel-main > .panel-top,
  .panel-body .panel-main > .flash,
  .panel-body .panel-main > .page,
  .panel-body .panel-main > .import-report {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .admin-mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    height: calc(60px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) max(10px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
    background:
      linear-gradient(90deg, var(--admin-sidebar-from) 0%, var(--admin-sidebar-mid) 72%, var(--admin-sidebar-to) 100%);
    border-bottom: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 8px 24px rgba(11, 61, 63, .28);
  }
  .admin-mobile-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1 1 auto;
  }
  .admin-mobile-brand .brand-e { color: #E17074; }
  .admin-mobile-brand .brand-tld { color: #F0A8AB; }
  .admin-mobile-role { display: none; }
  .admin-mobile-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
  }
  .admin-mobile-lang .lang-switch {
    border-color: rgba(255,255,255,.28);
    background: rgba(255,255,255,.08);
  }
  .admin-mobile-lang .lang-switch a {
    color: rgba(255,255,255,.8);
    padding: 4px 8px;
    font-size: 0.78rem;
  }
  .admin-mobile-lang .lang-switch a.active {
    background: rgba(255,255,255,.22);
    color: #fff;
  }
  .admin-mobile-logout { margin: 0; }
  .admin-mobile-logout button {
    border: none;
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(151, 32, 36, .85);
    color: #fff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
  }
  .admin-mobile-logout button:hover { background: #972024; }
  .admin-menu-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
  }
  .admin-menu-bars,
  .admin-menu-bars::before,
  .admin-menu-bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: relative;
  }
  .admin-menu-bars::before,
  .admin-menu-bars::after {
    content: '';
    position: absolute;
    left: 0;
  }
  .admin-menu-bars::before { top: -6px; }
  .admin-menu-bars::after { top: 6px; }
  .admin-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 130;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
  }
  .admin-sidebar-overlay[hidden] { display: none; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(88vw, 340px);
    z-index: 140;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    padding:
      max(16px, env(safe-area-inset-top, 0px))
      14px
      max(16px, env(safe-area-inset-bottom, 0px))
      max(14px, env(safe-area-inset-left, 0px));
    transform: translateX(-105%);
    transition: transform .28s ease;
    box-shadow: 12px 0 40px rgba(0,0,0,.35);
  }
  .admin-menu-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-close-btn { display: grid; place-items: center; }
  .sidebar-head {
    flex-shrink: 0;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
  }
  .sidebar .brand-admin {
    margin-left: 12px;
    letter-spacing: .08em;
  }
  .sidebar nav {
    flex: 1 1 0;
    min-height: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-top: 6px;
    gap: 6px;
  }
  .sidebar nav a:hover,
  .sidebar nav a.active {
    transform: none;
  }
  .sidebar-group { width: 100%; }
  .sidebar-foot {
    display: none;
  }
  .sidebar-logout, .sidebar-lang { margin-top: 0; width: 100%; }
  .panel-main {
    padding: 16px 14px 40px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .panel-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 14px;
  }
  .panel-top h1 { font-size: 1.2rem; }
  .panel-top-meta { font-size: 0.85rem; }
  .panel-top-tools { display: none; }
  body.admin-menu-open { overflow: hidden; }
  .dashboard-page {
    min-height: auto;
    margin: 0 auto;
    padding: 0 14px 14px;
    border-radius: 0;
  }
  .dashboard-page::before {
    height: clamp(140px, 36vw, 220px);
    margin: 0 -14px 16px;
    background-position: center center;
  }
  .dashboard-page .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Phone */
@media (max-width: 720px) {
  .container { width: calc(100% - 24px); }
  .nav-toggle { display: flex; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 12px; margin-top: 8px; box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a, .nav .link-btn, .nav .btn { width: 100%; justify-content: center; text-align: center; }
  .nav .lang-switch { align-self: center; margin-bottom: 6px; }
  .brand-mark { font-size: clamp(3rem, 15vw, 4rem); }
  .hero { min-height: auto; }
  .hero-content { padding: 48px 0 72px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .section { padding: 56px 0; }
  .section h2 { font-size: 1.5rem; }
  .why-card, .step-card { padding: 22px 18px; }
  .seo-learning-grid { grid-template-columns: 1fr; }
  .seo-learning-card { padding: 20px 18px; }
  .cta-panel { flex-direction: column; align-items: flex-start; text-align: left; }
  .cta-copy { width: 100%; }
  .cta-panel .btn { width: 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .child-row { flex-direction: column; }
  .child-meta { align-items: flex-start; text-align: left; }
  .bar-row { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel-main { padding: 14px 12px max(36px, env(safe-area-inset-bottom, 0px)); }
  .auth-card { padding: 22px 18px; }
  .result-score { flex-direction: column; align-items: flex-start; gap: 12px; }
  .big-letter { font-size: 3rem; }
  .lang-float { top: 10px; right: 10px; }
  .dashboard-page {
    padding: 0 10px 12px;
    border-radius: 0;
  }
  .dashboard-page::before {
    height: clamp(120px, 42vw, 200px);
    margin: 0 -10px 14px;
    background-position: center center;
  }
  .dashboard-page::after {
    display: none;
  }
  .dashboard-page .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 11px;
  }
  .dashboard-page .stat {
    padding: 8px 9px;
  }
  .dashboard-page .stat-num {
    font-size: 1.12rem;
  }
  .dashboard-page .stat-label {
    font-size: 10px;
  }
  .dashboard-page .table th,
  .dashboard-page .table td {
    padding: 7px 8px;
    font-size: 11px;
  }

  /* Forms / actions — full-width, no horizontal spill */
  .page-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .page-actions .btn,
  .filter-bar .btn,
  .expert-filter-actions .btn,
  .export-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .admin-panels { grid-template-columns: 1fr; }
  .inline-reset { width: 100%; }
  .inline-reset .input-sm { width: 100% !important; flex: 1 1 auto; }
  .form-card,
  .card {
    max-width: 100%;
  }
  .auth-card input,
  .form-card input,
  .form-card select,
  .form-card textarea,
  .filter-bar select,
  .pick-row input[type=number],
  .question-filter-bar input,
  .question-filter-bar select {
    font-size: 16px; /* iOS: prevent input zoom */
  }
  .filter-bar {
    align-items: stretch;
  }
  .filter-bar select {
    min-width: 0;
    flex: 1 1 100%;
  }
  .import-preview-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .choice-chips-2 { grid-template-columns: 1fr 1fr; }
  .grade-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Exam on phone */
  .exam-center { padding: 12px 10px 28px; }
  .exam-topbar {
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
  }
  .question-box { padding: 18px 14px; }
  .q-title { font-size: 1.08rem; }
  .q-meta { flex-wrap: wrap; gap: 8px; }
  .option {
    min-height: 48px;
    padding: 12px 14px;
  }
  .exam-cards { grid-template-columns: 1fr; }
  .exam-list-page { padding: 24px 0 40px; }
  .timer { font-size: 1.15rem; }

  .flash.container,
  .site-body > .flash {
    margin-left: 12px;
    margin-right: 12px;
    width: auto;
  }
  .footer-grid { gap: 20px; }
  .subject-grid { justify-content: stretch; }
  .subject-chip { flex: 1 1 calc(50% - 8px); justify-content: center; }
}

@media (min-width: 721px) and (max-width: 960px) {
  .hero-content { max-width: 85%; }
  .subject-grid { justify-content: flex-start; }
}

/* Student-style question preview (admin) */
.student-preview-hint,
.preview-hint { margin: 0 0 10px; }
.student-preview-box { position: relative; }
.student-preview-box .option.preview-option {
  cursor: default;
  pointer-events: none;
}
.student-preview-box .option.preview-option:hover {
  transform: none;
  box-shadow: none;
}
.student-preview-box .correct-mark {
  margin-left: auto;
  color: var(--brand);
  font-size: 12px;
  align-self: center;
  flex-shrink: 0;
}
.preview-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 2;
}
.preview-badge-ok { background: #dcfce7; color: #166534; }
.preview-badge-skip { background: #fde8e9; color: #9a3412; }
.image-student-preview {
  margin-top: 22px;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed #93c5fd;
  background: #eef2f7;
}
.image-student-preview h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--brand-deep);
}
.import-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.import-preview-toolbar p { margin: 6px 0 0; }
.import-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.import-preview-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.import-preview-map {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 12px;
}
.import-preview-map h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-family: var(--display);
}
.import-q-map {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.import-q-map .q-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #eff0f0;
  font-weight: 700;
  cursor: pointer;
}
.import-q-map .q-dot.current {
  border-color: var(--brand);
  background: #e8eef8;
  color: var(--brand);
}
.import-q-map .q-dot-skip {
  opacity: 0.55;
  text-decoration: line-through;
}
.import-preview-main { min-width: 0; }
.import-preview-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.import-skip-reason {
  margin: 10px 0 0;
  padding: 8px 12px;
  background: #FDF2F2;
  border-radius: 10px;
}
.bulk-delete-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #FDF2F2;
  border: 1.5px solid #E17074;
  box-shadow: var(--shadow);
}
.bulk-delete-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.bulk-delete-count {
  font-weight: 700;
  color: #9a3412;
  margin-right: 4px;
}
.col-check {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}
.col-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.table tr.is-selected td {
  background: #FDF2F2;
}
.team-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.team-pass-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.team-role-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.team-role-form select.input-sm {
  min-width: 120px;
}
.question-detail-card { margin-top: 16px; }
.question-move-card {
  margin: 16px 0 0;
  border-color: #93c5fd;
  background: #f8fbff;
}
.question-move-title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--brand-deep);
}
.question-move-help { margin: 0 0 14px; font-size: 14px; line-height: 1.4; }
.question-move-form .btn { margin-top: 14px; }
.question-meta-picks {
  display: grid;
  gap: 18px;
  margin-bottom: 8px;
}
.meta-pick-section { margin: 0; }
.meta-pick-title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-deep);
}
.subject-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.subject-chips .choice-chip span {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  min-height: 46px;
  padding: 8px 10px;
}
.question-move-form .question-meta-picks { margin-bottom: 14px; }
.question-meta-card {
  margin: 0 0 16px;
  border-color: #d1fae5;
  background: #f8fffb;
}
.question-meta-title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--brand-deep);
}
.question-meta-list {
  display: grid;
  gap: 10px 20px;
  margin: 0;
}
.question-meta-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 8px;
  align-items: baseline;
}
.question-meta-list dt {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.question-meta-list dd { margin: 0; font-size: 14px; }
@media (max-width: 560px) {
  .question-meta-list > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 860px) {
  .import-preview-shell { grid-template-columns: 1fr; }
  .import-preview-map { position: static; }
}

/* Parent: add child — mobile-first */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.child-add-page { max-width: 520px; margin: 0 auto; }
.child-add-form { padding: 18px 16px 28px; }
.child-add-section {
  margin: 0 0 20px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}
.child-add-section:last-of-type { border-bottom: 0; padding-bottom: 0; }
.child-add-section-title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--brand-deep);
}
.child-add-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.child-add-field { margin-top: 10px !important; }
.child-add-field input[type="text"],
.child-add-field input[type="date"] {
  min-height: 48px;
  font-size: 16px; /* iOS zoom prevention */
  padding: 12px 14px;
  border-radius: 12px;
}
.child-add-date input[type="date"] {
  width: 100%;
  min-height: 52px;
}
.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice-chips-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.grade-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.choice-chip {
  position: relative;
  margin: 0 !important;
  cursor: pointer;
  display: block;
}
.choice-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}
.choice-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.choice-chip-wide span {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 12px 10px;
}
.choice-chips-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.choice-chips-stack .choice-chip-wide {
  width: 100%;
}
.choice-chips-stack .choice-chip-wide span {
  text-align: left;
  white-space: normal;
  line-height: 1.35;
}
.choice-chip input:checked + span {
  border-color: var(--brand);
  background: #e8eef8;
  color: var(--brand-deep);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}
.choice-chip input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.child-add-password-hint {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.4;
}
.child-add-submit {
  position: sticky;
  bottom: 0;
  margin: 18px -16px -12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
  z-index: 3;
}
.child-add-submit .btn {
  margin-top: 0;
  min-height: 50px;
  font-size: 1.05rem;
}

@media (min-width: 721px) {
  .grade-chips { grid-template-columns: repeat(6, 1fr); }
  .child-add-form { padding: 24px 22px 28px; }
  .child-add-submit {
    position: static;
    margin: 18px 0 0;
    padding: 0;
    background: none;
  }
}

@media (max-width: 720px) {
  .child-add-page .form-card { box-shadow: none; border: 0; padding-left: 4px; padding-right: 4px; }
  .panel-body .panel-main:has(.child-add-page) { padding-bottom: 8px; }
}

/* —— Global phone / small-tablet polish (structure kept) —— */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.panel-main,
.exam-center,
.site-body main {
  min-width: 0;
}
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.question-upload-stats-table {
  min-width: 1180px;
}
.question-upload-stats-table th:not(:first-child),
.question-upload-stats-table td:not(:first-child) {
  text-align: center;
}
.question-upload-stats-table th:first-child,
.question-upload-stats-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 220px;
  background: #fff;
}
.question-upload-stats-table th:first-child {
  z-index: 2;
  background: #e8eef8;
}
.question-upload-stats-table tbody tr:hover td:first-child {
  background: #eff0f0;
}
.question-upload-daily {
  margin-top: 28px;
}
.question-upload-daily h2 {
  margin-bottom: 4px;
}
.question-upload-daily-filters {
  align-items: flex-end;
  margin-top: 16px;
}
.question-upload-daily-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.question-upload-daily-filters select,
.question-upload-daily-filters input[type="date"] {
  width: auto;
  min-width: 150px;
  margin: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.question-upload-daily-table {
  min-width: 760px;
}
.question-upload-daily-table th:nth-child(n+4),
.question-upload-daily-table td:nth-child(n+4) {
  text-align: center;
}

@media (max-width: 420px) {
  .admin-mobile-logout button {
    padding: 8px 8px;
    font-size: 0.72rem;
  }
  .admin-mobile-lang .lang-switch a {
    padding: 4px 6px;
    font-size: 0.72rem;
  }
  .sidebar {
    width: min(92vw, 340px);
  }
  .dashboard-page .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grade-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel-top h1 {
    font-size: 1.1rem;
    line-height: 1.3;
  }
}

/* ===== Login demo stage + parent prep hub ===== */
.btn-accent {
  background: linear-gradient(135deg, #6D171A 0%, #972024 55%, #D8464B 140%);
  box-shadow: 0 12px 28px rgba(151, 32, 36, .3);
}
.btn-accent:hover { filter: brightness(1.05); }

.auth-stage {
  width: min(1100px, calc(100% - 24px));
  margin: 28px auto 48px;
}
.auth-stage-grid {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  transition: grid-template-columns .35s ease;
}
.auth-stage--register-only .auth-stage-grid {
  grid-template-columns: 1fr;
  max-width: 560px;
  margin: 0 auto;
}
.auth-stage--register-only .auth-card-login {
  display: none !important;
}
.auth-stage--register-only .demo-panel {
  animation: demoSlideIn .45s ease both;
}
.auth-card-login {
  width: 100%;
  margin: 0;
  transition: box-shadow .35s ease, transform .35s ease;
}
.auth-card-login.is-highlight {
  box-shadow: 0 0 0 3px rgba(151, 32, 36, .35), var(--shadow);
  transform: translateY(-2px);
}
.auth-kicker {
  margin: 0 0 6px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.auth-lead { margin: 0 0 8px; font-size: .95rem; }
.auth-links { margin-top: 14px; }

.demo-panel {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(ellipse 70% 55% at 100% 0%, rgba(151, 32, 36, .16), transparent 55%),
    radial-gradient(ellipse 55% 50% at 0% 100%, rgba(29, 78, 216, .14), transparent 50%),
    #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 100%;
}
.demo-slides { position: relative; min-height: 100%; }
.demo-slide {
  padding: 28px 26px 24px;
  animation: demoSlideIn .45s ease both;
}
.demo-slide[hidden] { display: none !important; }
@keyframes demoSlideIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
.demo-kicker {
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
}
.demo-kicker-warn { color: var(--accent-deep); }
.demo-panel h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  letter-spacing: -.02em;
  line-height: 1.2;
}
.demo-lead { margin: 0 0 16px; color: var(--muted); font-size: .98rem; }
.demo-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, #e8eef8, #FDF2F2);
  border: 1px solid #e2e8f0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
  min-height: 44px;
}
.demo-ticker-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: tickerPulse 1.8s ease-out infinite;
}
[data-demo-ticker] { transition: opacity .22s ease, transform .22s ease; }
[data-demo-ticker].is-swap { opacity: 0; transform: translateY(4px); }
.demo-pick-label {
  margin: 0 0 12px;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.demo-pick-label-ico {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0A369D, #972024);
  color: #fff;
  box-shadow: 0 8px 16px rgba(29, 78, 216, .22);
}
.demo-pick-label-ico .ico { width: 14px; height: 14px; }
.grade-pick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.grade-pick-btn,
.grade-pick-more {
  appearance: none;
  border: 1.5px solid transparent;
  border-radius: 16px;
  padding: 12px 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font: inherit;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, filter .22s ease;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}
.grade-pick-btn::before,
.grade-pick-more::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .95;
  z-index: 0;
  background: linear-gradient(160deg, #fff 0%, #eff0f0 100%);
}
.grade-pick-btn > *,
.grade-pick-more > * { position: relative; z-index: 1; }
.grade-tone-1 { border-color: #bfdbfe; }
.grade-tone-1::before { background: linear-gradient(160deg, #e8eef8, #d7ecfb 90%); }
.grade-tone-2 { border-color: #E17074; }
.grade-tone-2::before { background: linear-gradient(160deg, #FDF2F2, #fde8e9 90%); }
.grade-tone-3 { border-color: #93c5fd; }
.grade-tone-3::before { background: linear-gradient(160deg, #f0f9ff, #d7ecfb 90%); }
.grade-tone-4 { border-color: #fff099; }
.grade-tone-4::before { background: linear-gradient(160deg, #fffbeb, #fef3c7 90%); }
.grade-pick-ico {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.72);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 4px 10px rgba(15, 23, 42, .06);
  transition: transform .22s ease, background .22s ease, color .22s ease;
}
.grade-tone-2 .grade-pick-ico { color: var(--accent-deep); }
.grade-tone-4 .grade-pick-ico { color: #b45309; }
.grade-pick-ico .ico { width: 18px; height: 18px; }
.grade-pick-btn:hover,
.grade-pick-btn:focus-visible {
  transform: translateY(-5px) scale(1.04);
  box-shadow: 0 18px 34px rgba(29, 78, 216, .18);
  outline: none;
  z-index: 2;
}
.grade-pick-btn:hover .grade-pick-ico,
.grade-pick-btn:focus-visible .grade-pick-ico,
.grade-pick-btn.is-selected .grade-pick-ico {
  transform: scale(1.08) rotate(-4deg);
  background: #fff;
  color: var(--accent-deep);
}
.grade-pick-btn.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(151, 32, 36, .25), 0 18px 36px rgba(151, 32, 36, .22);
  transform: translateY(-3px) scale(1.03);
}
.grade-pick-btn.is-selected::before {
  background: linear-gradient(160deg, #FDF2F2, #F0A8AB 85%);
}
.grade-pick-num {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
}
.grade-pick-txt {
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: lowercase;
  letter-spacing: .02em;
}
.grade-pick-btn.is-selected .grade-pick-txt,
.grade-pick-btn:hover .grade-pick-txt { color: var(--accent-deep); }
.grade-pick-more {
  cursor: default;
  border-style: dashed;
  border-color: #cbd5e1;
  box-shadow: none;
  opacity: .92;
}
.grade-pick-more::before {
  background: linear-gradient(160deg, #eff0f0, #e2e8f0);
}
.grade-pick-more .grade-pick-ico {
  color: var(--muted);
  background: rgba(255,255,255,.85);
}
.grade-pick-etc {
  font-size: 1.05rem;
  letter-spacing: -.01em;
}
.grade-pick-grid.is-shake { animation: gradeShake .45s ease; }
@keyframes gradeShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}
.demo-panel.needs-grade .demo-pick-label { color: var(--danger); }
.demo-start-btn { margin-top: 4px; }
.demo-note { margin: 10px 0 0; text-align: center; }

.demo-back {
  appearance: none;
  border: 1.5px solid var(--line);
  background: #fff;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 14px;
  color: var(--ink);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.demo-back:hover {
  transform: translateX(-3px);
  border-color: var(--brand-2);
  background: #e8eef8;
}
.demo-register-visual {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 4px 0 12px;
  font-size: 1.4rem;
  color: var(--accent);
}
.demo-arrow {
  display: inline-block;
  animation: arrowBounce 1.2s ease-in-out infinite;
  opacity: .85;
}
.demo-arrow-2 { animation-delay: .15s; }
.demo-arrow-3 { animation-delay: .3s; }
@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); opacity: .55; }
  50% { transform: translateY(8px); opacity: 1; }
}
.register-spotlight {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin: 8px 0 14px;
  border-radius: 16px;
  text-decoration: none !important;
  color: #fff !important;
  background: linear-gradient(135deg, #04153E 0%, #0A369D 55%, #972024 130%);
  box-shadow: 0 16px 36px rgba(29, 78, 216, .28);
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}
.register-spotlight:hover,
.register-spotlight:focus-visible {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 22px 44px rgba(151, 32, 36, .28);
  filter: brightness(1.04);
  outline: none;
}
.register-spotlight.is-pulse { animation: spotlightPulse 1.5s ease; }
@keyframes spotlightPulse {
  0%, 100% { box-shadow: 0 16px 36px rgba(29, 78, 216, .28); }
  50% { box-shadow: 0 0 0 6px rgba(151, 32, 36, .28), 0 22px 44px rgba(151, 32, 36, .3); }
}
.register-spotlight-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.register-spotlight-copy {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1;
}
.register-spotlight-copy strong {
  font-size: 1.05rem; font-family: var(--display); letter-spacing: -.02em;
}
.register-spotlight-copy small { opacity: .88; font-size: .82rem; }
.register-spotlight-go {
  font-size: 1.35rem; font-weight: 700; opacity: .9;
  transition: transform .2s ease;
}
.register-spotlight:hover .register-spotlight-go { transform: translateX(4px); }
.demo-have-account { margin: 0; }

.coming-soon-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  margin-bottom: 22px;
  border-radius: 18px;
  border: 1px solid #E17074;
  background: linear-gradient(135deg, #FDF2F2 0%, #e8eef8 100%);
  box-shadow: 0 12px 28px rgba(151, 32, 36, .1);
}
.coming-soon-glow {
  position: absolute;
  inset: auto -20% -40% auto;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216,70,75,.35), transparent 70%);
  pointer-events: none;
}
.coming-soon-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #972024, #0A369D);
  color: #fff;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.coming-soon-copy { position: relative; z-index: 1; min-width: 0; }
.coming-soon-kicker {
  margin: 0 0 4px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}
.coming-soon-copy h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -.02em;
}
.coming-soon-copy p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Parent dashboard — clean responsive hub */
.parent-dash {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 920px;
}
.prep-strip {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #E17074;
  background: linear-gradient(120deg, #FDF2F2 0%, #e8eef8 100%);
}
.prep-strip-ico {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #972024, #0A369D);
  color: #fff;
  flex-shrink: 0;
}
.prep-strip-kicker {
  margin: 0 0 2px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}
.prep-strip-copy h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.12rem;
  letter-spacing: -.02em;
  line-height: 1.25;
}
.prep-strip-copy p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.45;
}
.exam-hub-head { margin-bottom: 12px; }
.exam-hub-head h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  letter-spacing: -.02em;
}
.exam-hub-lead {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}
.exam-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.exam-hub-card {
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  min-width: 0;
}
.exam-hub-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(29, 78, 216, .12);
  border-color: #bfdbfe;
}
.exam-hub-card-pro:hover {
  border-color: #E17074;
  box-shadow: 0 14px 32px rgba(151, 32, 36, .12);
}
.exam-hub-badge {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #d7ecfb;
  color: var(--brand);
}
.exam-hub-badge-pro { background: #fde8e9; color: var(--accent-deep); }
.exam-hub-card h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: -.02em;
}
.exam-hub-card > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
  flex: 1;
}
.exam-hub-points {
  margin: 0 0 14px;
  padding-left: 18px;
  color: var(--ink);
  font-size: .86rem;
}
.exam-hub-points li { margin: 3px 0; }
.exam-hub-card .btn { margin-top: auto; }

.children-hub {
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}
.children-hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.children-hub-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: -.02em;
}
.empty-state-soft {
  text-align: center;
  padding: 28px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #eff0f0, #e8eef8);
  border: 1px dashed #cbd5e1;
}
.empty-state-ico {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0A369D, #972024);
  color: #fff;
}
.empty-state-soft h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.15rem;
}
.empty-state-soft p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .95rem;
}
.parent-dash .child-list { display: flex; flex-direction: column; gap: 12px; }
.parent-dash .child-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #eff0f0;
}
.parent-dash .child-row-main { min-width: 0; }
.parent-dash .child-pwd code {
  word-break: break-all;
}
.parent-dash .exam-link-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}
.parent-dash .exam-link-box .btn {
  flex: 1 1 auto;
  min-width: min(100%, 140px);
  justify-content: center;
}
.parent-dash .child-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
  min-width: 110px;
}
.parent-dash .exam-link-url {
  word-break: break-all;
  overflow-wrap: anywhere;
}

.exam-hub { margin-bottom: 0; }

.prep-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
}
.prep-modal[hidden] { display: none !important; }
.prep-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
}
.prep-modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 22px;
  box-shadow: 0 28px 60px rgba(15, 23, 42, .28);
  text-align: center;
  animation: rise .4s ease both;
}
.prep-modal-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 36px; height: 36px;
  border: none;
  border-radius: 10px;
  background: #eef4f4;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink);
}
.prep-modal-pulse {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #E17074, #0A369D);
  animation: tickerPulse 1.6s ease-out infinite;
}
.prep-modal-card h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.35rem;
}
.prep-modal-card p { margin: 0 0 10px; color: var(--muted); }
.prep-modal-soon {
  font-weight: 700 !important;
  color: var(--accent-deep) !important;
  margin-bottom: 16px !important;
}
body.prep-modal-open { overflow: hidden; }

@media (max-width: 900px) {
  .auth-stage-grid { grid-template-columns: 1fr; }
  .exam-hub-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .parent-dash .child-row {
    grid-template-columns: 1fr;
  }
  .parent-dash .child-meta {
    align-items: stretch;
    text-align: left;
    min-width: 0;
  }
  .parent-dash .child-meta .btn { width: 100%; }
  .children-hub-head .btn { width: 100%; }
}
@media (max-width: 560px) {
  .auth-stage { width: calc(100% - 16px); margin: 16px auto 32px; }
  .demo-slide { padding: 22px 16px 18px; }
  .grade-pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .grade-pick-btn,
  .grade-pick-more { padding: 10px 6px 8px; border-radius: 14px; }
  .grade-pick-num { font-size: 1.2rem; }
  .grade-pick-ico { width: 30px; height: 30px; border-radius: 9px; }
  .grade-pick-ico .ico { width: 16px; height: 16px; }
  .coming-soon-banner { flex-direction: column; padding: 16px; }
  .register-spotlight { padding: 14px; gap: 10px; }
  .hero-ticker {
    font-size: .84rem;
    padding: 8px 12px;
    border-radius: 14px;
    margin-bottom: 18px;
  }
  .prep-strip { flex-direction: column; gap: 10px; padding: 14px; }
  .parent-dash { gap: 14px; }
  .exam-hub-card { padding: 16px 14px; }
  .children-hub { padding: 14px 12px; }
  .prep-modal { padding: 12px; }
  .prep-modal-card { padding: 24px 16px 18px; }
}

/* Azərbaycan dili — sözün tərkibi (məktəb işarələri) + cümlə üzvləri */
.q-content .az-kok,
.option-math .az-kok,
.az-kok,
.q-content .az-leksik,
.option-math .az-leksik,
.az-leksik,
.q-content .az-qrammatik,
.option-math .az-qrammatik,
.az-qrammatik,
.q-content .az-bashlangic,
.option-math .az-bashlangic,
.az-bashlangic {
  position: relative;
  display: inline-block;
  font-weight: inherit;
  color: inherit;
  line-height: 1.35;
  vertical-align: baseline;
}

/* Kök: üstə ┌───┐ */
.q-content .az-kok,
.option-math .az-kok,
.az-kok {
  padding-top: 0.42em;
  margin-top: 0.1em;
}
.q-content .az-kok::before,
.option-math .az-kok::before,
.az-kok::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0.34em;
  border: 1.6px solid currentColor;
  border-bottom: none;
  box-sizing: border-box;
  pointer-events: none;
}

/* Leksik şəkilçi: üstə ^ */
.q-content .az-leksik,
.option-math .az-leksik,
.az-leksik {
  padding-top: 0.5em;
  margin-top: 0.1em;
  min-width: 0.55em;
  text-align: center;
}
.q-content .az-leksik::before,
.option-math .az-leksik::before,
.az-leksik::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.02em;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 0.28em solid transparent;
  border-right: 0.28em solid transparent;
  border-bottom: 0.36em solid currentColor;
  pointer-events: none;
}

/* Qrammatik şəkilçi: üstə ⌒ */
.q-content .az-qrammatik,
.option-math .az-qrammatik,
.az-qrammatik {
  padding-top: 0.48em;
  margin-top: 0.1em;
  min-width: 0.55em;
  text-align: center;
}
.q-content .az-qrammatik::before,
.option-math .az-qrammatik::before,
.az-qrammatik::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 0.38em;
  border: 1.6px solid currentColor;
  border-bottom: none;
  border-radius: 60% 60% 0 0 / 100% 100% 0 0;
  box-sizing: border-box;
  pointer-events: none;
}

/* Başlanğıc forma: altda └───┘ */
.q-content .az-bashlangic,
.option-math .az-bashlangic,
.az-bashlangic {
  padding-bottom: 0.42em;
  margin-bottom: 0.1em;
  background: none;
}
.q-content .az-bashlangic::after,
.option-math .az-bashlangic::after,
.az-bashlangic::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.34em;
  border: 1.6px solid currentColor;
  border-top: none;
  box-sizing: border-box;
  pointer-events: none;
}

.q-content .az-mubteda,
.option-math .az-mubteda,
.az-mubteda {
  border-bottom: 2px solid #04153E;
  padding-bottom: 1px;
}
.q-content .az-xeber,
.option-math .az-xeber,
.az-xeber {
  border-bottom: 3px double #04153E;
  padding-bottom: 1px;
}
.q-content .az-teyin,
.option-math .az-teyin,
.az-teyin {
  text-decoration: underline wavy #04153E;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.q-content .az-tamamliq,
.option-math .az-tamamliq,
.az-tamamliq {
  border-bottom: 2px dotted #04153E;
  padding-bottom: 1px;
}
.q-content .az-zerflik,
.option-math .az-zerflik,
.az-zerflik {
  border-bottom: 2px dashed #04153E;
  padding-bottom: 1px;
}


/* =========================================================
   Admin polish + phone comfort (structure unchanged)
   ========================================================= */
.panel-body {
  background: var(--bg);
}
.panel-body .form-card,
.panel-body .card,
.panel-body .hint-box,
.panel-body .import-report,
.panel-body .ai-review-card,
.panel-body .question-box,
.panel-body .stat,
.panel-body .child-row,
.panel-body .exam-card {
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(18, 38, 58, .05);
}
.panel-body .form-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,251,251,.96));
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
}
.panel-body .hint-box {
  background: linear-gradient(135deg, #e8eef8, #FDF2F2);
  border: 1px solid color-mix(in srgb, var(--brand-2) 28%, var(--line));
}
.panel-body .table th {
  background: linear-gradient(180deg, #e8eef8, #d7ecfb);
}
.panel-body .choice-chip {
  border-radius: 12px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.panel-body .choice-chip:has(input:checked) {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-2) 14%, #fff);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.panel-body .flash-success {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  background: #ecfdf8;
}
.panel-body .flash-error {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  background: #fff1f2;
}

/* Touch-friendly controls + true full-width pages on phone */
@media (max-width: 960px) {
  .panel-body .panel-top {
    padding: 12px 12px;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .panel-body .choice-chip {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .panel-body .meta-pick-section {
    margin-bottom: 14px;
  }
  .panel-body .subject-chips,
  .panel-body .grade-chips,
  .panel-body .choice-chips {
    gap: 8px;
  }
  .panel-body .table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
  }
  /* Never force wide tables on the whole page — breaks phone layout */
  .panel-body .table,
  .panel-body .questions-table,
  .panel-body .stats-table {
    min-width: 0 !important;
    max-width: 100%;
  }
  .panel-body table.responsive-cards {
    min-width: 0 !important;
    width: 100% !important;
  }
  .panel-body .filter-bar,
  .panel-body .question-filter-bar,
  .panel-body .import-preview-toolbar,
  .panel-body .ai-review-toolbar,
  .panel-body .export-actions,
  .panel-body .page-actions {
    width: 100%;
    max-width: 100%;
    gap: 10px;
  }
  .panel-body .question-filter-bar .filter-search {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
  }
  .panel-body .filter-bar select,
  .panel-body .question-filter-bar select,
  .panel-body .question-filter-bar .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    width: auto;
  }
  .panel-body .page,
  .panel-body .questions-page,
  .panel-body .form-card,
  .panel-body .card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: clip;
  }
  .panel-body .math-toolbar,
  .panel-body .az-toolbar {
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
  }
  .panel-body .math-toolbar button,
  .panel-body .az-toolbar button {
    min-height: 40px;
  }
  .panel-body .geo-canvas {
    max-width: 100%;
    height: auto !important;
  }
  .panel-body .option.preview-option,
  .panel-body .preview-option {
    min-height: 48px;
  }
  .panel-body .q-title,
  .panel-body .q-preview,
  .panel-body .option-math {
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
    max-width: 100%;
  }
  .panel-body .ai-upload-card,
  .panel-body .math-ai-embed {
    margin-top: 18px;
    max-width: 100%;
  }
  /* Tables without card layout: scroll inside container, not the page */
  .panel-body .table:not(.responsive-cards) {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 720px) {
  .panel-body .panel-main {
    background: linear-gradient(180deg, #f7fbfb 0%, #eff0f0 100%);
    padding-left: 12px;
    padding-right: 12px;
  }
  .panel-body .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .panel-body .grid-2,
  .panel-body .grid-3,
  .panel-body .admin-panels {
    grid-template-columns: 1fr;
  }
  .panel-body .choice-chips-stack .choice-chip,
  .panel-body .choice-chip-wide {
    width: 100%;
  }
  .panel-body .grade-chips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .panel-body label {
    display: block;
    max-width: 100%;
  }
  .panel-body input[type="file"] {
    width: 100%;
    max-width: 100%;
  }
  .panel-body .btn {
    min-height: 44px;
  }
  .panel-body .btn-sm {
    min-height: 40px;
  }
  .panel-body .inline-form {
    display: flex;
    width: 100%;
    max-width: 100%;
  }
  .panel-body .inline-form .btn {
    width: 100%;
  }
  .panel-body .filter-bar select,
  .panel-body .question-filter-bar select,
  .panel-body .question-filter-bar .btn {
    flex: 1 1 100%;
  }
  .questions-page .q-preview {
    width: auto;
    min-width: 0;
  }
  .site-header .header-inner {
    padding: 10px 0;
  }
  .auth-card {
    width: min(100%, calc(100vw - 24px));
    margin-left: auto;
    margin-right: auto;
  }
  .exam-center .question-box,
  .question-box {
    border-radius: 14px;
  }
  .options {
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .panel-body .grade-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .panel-body .choice-chips-2 {
    grid-template-columns: 1fr;
  }
  .admin-mobile-logout button {
    padding: 8px 8px;
    font-size: 0.72rem;
  }
  .panel-top h1 {
    font-size: 1.05rem;
    line-height: 1.3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar nav > a.sidebar-accent.active,
  .sidebar-group a.active,
  .sidebar nav > a.active,
  .sidebar nav > a.sidebar-accent.active::before,
  .sidebar-group a.active::before {
    animation: none !important;
  }
}

/* =========================================================
   FINAL: admin content centered + phone-safe (all sections)
   ========================================================= */
.panel-body .panel-main > .panel-top,
.panel-body .panel-main > .flash,
.panel-body .panel-main > .page,
.panel-body .panel-main > .import-report,
.panel-body .expert-review-page,
.panel-body .curated-exam-page,
.panel-body .questions-page,
.panel-body .special-hub-page,
.panel-body .dashboard-page {
  width: 100% !important;
  max-width: 1100px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

.panel-body .form-card,
.panel-body .card,
.panel-body .question-stats,
.panel-body .bulk-delete-bar,
.panel-body .filter-bar,
.panel-body .question-filter-bar,
.panel-body .table-scroll,
.panel-body .ai-upload-card,
.panel-body .math-ai-embed,
.panel-body .hint-box {
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 960px) {
  .panel-body .panel-main > .panel-top,
  .panel-body .panel-main > .flash,
  .panel-body .panel-main > .page,
  .panel-body .panel-main > .import-report,
  .panel-body .expert-review-page,
  .panel-body .curated-exam-page,
  .panel-body .questions-page,
  .panel-body .special-hub-page,
  .panel-body .dashboard-page {
    max-width: 100% !important;
  }

  .panel-body .panel-main {
    overflow-x: clip;
  }

  .panel-body .page,
  .panel-body .form-card,
  .panel-body .card,
  .panel-body .question-stats,
  .panel-body .bulk-delete-inner,
  .panel-body .export-actions {
    width: 100%;
  }

  .panel-body .table-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .panel-body .q-preview,
  .panel-body .option-math,
  .panel-body td,
  .panel-body th {
    min-width: 0 !important;
  }
}

/* =========================================================
   IDEAL PANEL: one content column, equal side air, phone-safe
   ========================================================= */
.panel-body .panel-main {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 22px clamp(12px, 2.8vw, 36px) 48px !important;
}

.panel-body .panel-main > .panel-top,
.panel-body .panel-main > .flash,
.panel-body .panel-main > .page,
.panel-body .panel-main > .import-report {
  width: 100% !important;
  max-width: 1120px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: clamp(2px, 0.8vw, 10px) !important;
  padding-right: clamp(2px, 0.8vw, 10px) !important;
  box-sizing: border-box !important;
  overflow-x: visible !important;
}

.panel-body .page,
.panel-body .questions-page,
.panel-body .dashboard-page,
.panel-body .expert-review-page,
.panel-body .curated-exam-page,
.panel-body .special-hub-page,
.panel-body .question-upload-stats-page,
.panel-body .ai-review-page,
.panel-body .import-preview-page,
.panel-body .move-preview-page {
  width: 100% !important;
  max-width: 1120px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  overflow-x: visible !important;
  min-width: 0 !important;
}

/* Filter + list: same full column width, left-aligned controls, side air */
.panel-body .filter-bar,
.panel-body .question-filter-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 16px !important;
  padding: 12px 14px !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(18, 38, 58, 0.04);
}

.panel-body .question-filter-bar .filter-search {
  flex: 1 1 220px !important;
  min-width: min(100%, 180px) !important;
  max-width: none !important;
  margin: 0 !important;
}

.panel-body .question-filter-bar .filter-search input[type="search"],
.panel-body .filter-bar .search-input,
.panel-body .filter-bar input[type="search"] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.panel-body .filter-bar select,
.panel-body .question-filter-bar select {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 1 auto !important;
  max-width: 100% !important;
}

.panel-body .question-stats,
.panel-body .bulk-actions-bar,
.panel-body .bulk-delete-bar,
.panel-body .table-scroll,
.panel-body .form-card,
.panel-body .card,
.panel-body .hint-box,
.panel-body .page-actions,
.panel-body .export-actions {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

.panel-body .table-scroll {
  display: block !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

.panel-body .table,
.panel-body .questions-table,
.panel-body .stats-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (max-width: 960px) {
  .panel-body .panel-main {
    align-items: stretch !important;
    padding: 14px max(12px, env(safe-area-inset-left, 0px)) max(40px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px)) !important;
    overflow-x: visible !important;
  }

  .panel-body .panel-main > .panel-top,
  .panel-body .panel-main > .flash,
  .panel-body .panel-main > .page,
  .panel-body .panel-main > .import-report,
  .panel-body .page,
  .panel-body .questions-page,
  .panel-body .dashboard-page,
  .panel-body .expert-review-page,
  .panel-body .curated-exam-page {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: visible !important;
  }

  .panel-body {
    overflow-x: clip;
  }

  .panel-body .filter-bar,
  .panel-body .question-filter-bar {
    padding: 12px !important;
    gap: 8px !important;
  }

  .panel-body .question-filter-bar .filter-search {
    flex: 1 1 100% !important;
  }

  .panel-body .filter-bar select,
  .panel-body .question-filter-bar select,
  .panel-body .filter-bar .btn,
  .panel-body .question-filter-bar .btn {
    flex: 1 1 calc(50% - 6px) !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .panel-body .q-preview {
    width: auto !important;
    min-width: 0 !important;
  }

  .panel-body .actions-cell {
    white-space: normal !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .panel-body .actions-cell .btn,
  .panel-body .actions-cell .inline-form {
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .panel-body .filter-bar select,
  .panel-body .question-filter-bar select,
  .panel-body .filter-bar .btn,
  .panel-body .question-filter-bar .btn {
    flex: 1 1 100% !important;
  }

  /* Generic admin tables → card stack when not already carded */
  .panel-body table.table:not(.responsive-cards) {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .panel-body table.table:not(.responsive-cards) thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
  }
  .panel-body table.table:not(.responsive-cards),
  .panel-body table.table:not(.responsive-cards) tbody,
  .panel-body table.table:not(.responsive-cards) tr,
  .panel-body table.table:not(.responsive-cards) td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .panel-body table.table:not(.responsive-cards) tr {
    margin: 0 0 12px !important;
    padding: 12px !important;
    background: #fff !important;
    border: 1px solid color-mix(in srgb, var(--line) 85%, transparent) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 20px rgba(18, 38, 58, 0.04) !important;
  }
  .panel-body table.table:not(.responsive-cards) td {
    display: flex !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 8px 0 !important;
    border: 0 !important;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent) !important;
    text-align: right !important;
    white-space: normal !important;
  }
  .panel-body table.table:not(.responsive-cards) td:last-child {
    border-bottom: 0 !important;
  }
  .panel-body table.table:not(.responsive-cards) td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    text-align: left;
    flex: 0 0 42%;
  }
  .panel-body table.table:not(.responsive-cards) td:not([data-label])::before,
  .panel-body table.table:not(.responsive-cards) td[data-label=""]::before {
    content: none;
  }
}

/* Override: plain tables scroll on phone (cards need data-label) */
@media (max-width: 720px) {
  .panel-body table.table:not(.responsive-cards),
  .panel-body table.table:not(.responsive-cards) thead,
  .panel-body table.table:not(.responsive-cards) tbody,
  .panel-body table.table:not(.responsive-cards) tr,
  .panel-body table.table:not(.responsive-cards) td {
    display: revert !important;
    width: revert !important;
    margin: revert !important;
    padding: revert !important;
    border: revert !important;
    background: revert !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    clip: auto !important;
    position: static !important;
    height: auto !important;
  }
  .panel-body table.table:not(.responsive-cards) td::before {
    content: none !important;
  }
  .panel-body .page > .table,
  .panel-body .page table.table:not(.responsive-cards) {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* =========================================================
   PHONE CLEAN: questions + admin text (no mid-word chops)
   ========================================================= */
.panel-body,
.panel-body .page,
.panel-body .questions-page,
.panel-body .q-preview,
.panel-body .q-full-text,
.panel-body .option-math,
.panel-body .q-content,
.panel-body td,
.panel-body th,
.panel-body .btn,
.panel-body select,
.panel-body label,
.panel-body .muted,
.panel-body .panel-top h1 {
  overflow-wrap: break-word !important;
  word-break: normal !important;
  hyphens: none !important;
}

@media (max-width: 720px) {
  /* Question cards: readable stack, not label|value squeeze */
  .questions-page table.responsive-cards tbody {
    gap: 12px !important;
  }

  .questions-page table.responsive-cards tr {
    padding: 14px !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 24px rgba(18, 38, 58, 0.06) !important;
  }

  .questions-page table.responsive-cards td {
    display: block !important;
    width: 100% !important;
    padding: 0 0 10px !important;
    border-bottom: 0 !important;
    text-align: left !important;
  }

  .questions-page table.responsive-cards td::before {
    display: block !important;
    content: attr(data-label) !important;
    flex: none !important;
    max-width: none !important;
    width: auto !important;
    margin: 0 0 4px !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: var(--muted) !important;
  }

  .questions-page table.responsive-cards td.col-check {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent) !important;
    margin-bottom: 10px !important;
  }
  .questions-page table.responsive-cards td.col-check::before {
    content: attr(data-label) !important;
    margin: 0 !important;
  }

  /* Question body: full width, clean */
  .questions-page table.responsive-cards td.q-preview {
    padding-bottom: 12px !important;
    margin-bottom: 8px !important;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 75%, transparent) !important;
  }
  .questions-page table.responsive-cards td.q-preview::before {
    content: none !important;
    display: none !important;
  }
  .questions-page table.responsive-cards .q-preview,
  .questions-page table.responsive-cards .q-full-text,
  .questions-page table.responsive-cards .q-content {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    font-size: 0.98rem !important;
    line-height: 1.55 !important;
    text-align: left !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }
  .questions-page table.responsive-cards .q-list-full-img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Compact meta grid under question */
  .questions-page table.responsive-cards td:not(.col-check):not(.q-preview):not(.actions-cell) {
    display: grid !important;
    grid-template-columns: 96px 1fr !important;
    align-items: start !important;
    column-gap: 10px !important;
    padding: 5px 0 !important;
  }
  .questions-page table.responsive-cards td:not(.col-check):not(.q-preview):not(.actions-cell)::before {
    display: block !important;
    margin: 0 !important;
    align-self: center;
  }

  .questions-page table.responsive-cards td.actions-cell {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 10px !important;
    padding-top: 12px !important;
    border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent) !important;
  }
  .questions-page table.responsive-cards td.actions-cell::before {
    content: none !important;
    display: none !important;
  }
  .questions-page table.responsive-cards td.actions-cell .btn,
  .questions-page table.responsive-cards td.actions-cell .inline-form {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 0 !important;
  }
  .questions-page table.responsive-cards td.actions-cell .inline-form .btn {
    width: 100% !important;
  }

  /* Stats table cards */
  .questions-page .stats-table.responsive-cards td {
    display: grid !important;
    grid-template-columns: 96px 1fr !important;
    text-align: left !important;
    padding: 6px 0 !important;
    border-bottom: 0 !important;
  }
  .questions-page .stats-table.responsive-cards td::before {
    display: block !important;
    margin: 0 !important;
  }
  .questions-page .stats-table.responsive-cards tr {
    padding: 12px 14px !important;
  }

  /* Filter tidy */
  .questions-page .question-filter-bar {
    padding: 12px !important;
  }
  .questions-page .question-filter-bar select,
  .questions-page .question-filter-bar .btn {
    min-height: 44px !important;
    font-size: 0.95rem !important;
  }
  .questions-page .question-filter-bar .filter-search input {
    min-height: 44px !important;
    font-size: 16px !important;
  }

  /* Bulk bar */
  .questions-page .bulk-actions-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.95);
    border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  }
  .questions-page .bulk-actions-bar .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Panel title / selects: never letter-chop */
  .panel-body .panel-top h1 {
    font-size: 1.12rem !important;
    line-height: 1.35 !important;
  }
  .panel-body select,
  .panel-body .btn,
  .panel-body .choice-chip,
  .panel-body .subject-chip {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }
}

/* =========================================================
   Activity logs — same clean cards as questions
   ========================================================= */
.activity-logs-page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  box-sizing: border-box;
}
.activity-logs-page .table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}
.activity-log-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: var(--brand-deep);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
.activity-log-details {
  max-width: 420px;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: normal;
}
.activity-log-who strong {
  display: block;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .activity-logs-page .table-scroll {
    overflow: visible;
  }

  .activity-logs-page table.responsive-cards,
  .activity-logs-page table.responsive-cards thead,
  .activity-logs-page table.responsive-cards tbody,
  .activity-logs-page table.responsive-cards th,
  .activity-logs-page table.responsive-cards td,
  .activity-logs-page table.responsive-cards tr {
    display: block;
    width: 100%;
  }

  .activity-logs-page table.responsive-cards {
    border: none;
    background: transparent;
  }

  .activity-logs-page table.responsive-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .activity-logs-page table.responsive-cards tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .activity-logs-page table.responsive-cards tr {
    background: var(--surface, #fff);
    border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(18, 38, 58, 0.06);
    box-sizing: border-box;
  }

  .activity-logs-page table.responsive-cards td {
    display: grid !important;
    grid-template-columns: 92px minmax(0, 1fr) !important;
    align-items: start;
    column-gap: 10px;
    padding: 7px 0 !important;
    border: 0 !important;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent) !important;
    text-align: left !important;
    min-width: 0 !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  .activity-logs-page table.responsive-cards td:last-child {
    border-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .activity-logs-page table.responsive-cards td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.35;
    padding-top: 2px;
  }

  .activity-logs-page table.responsive-cards td.activity-log-action {
    align-items: center;
  }

  .activity-logs-page .activity-log-details,
  .activity-logs-page .activity-log-who,
  .activity-logs-page .activity-log-badge {
    max-width: none !important;
    min-width: 0 !important;
    width: 100%;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    white-space: normal !important;
  }

  .activity-logs-page .activity-log-badge {
    display: inline-block;
    max-width: 100%;
  }
}

/* =========================================================
   MOBILE IDEAL 2026-07: equal L/R, centered, full-width
   (overrides earlier card/bulk rules — keep last)
   ========================================================= */

/* Bulk actions — desktop + mobile base */
.bulk-actions-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 14px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(18, 38, 58, 0.04);
}
.bulk-actions-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.bulk-actions-head .bulk-delete-count {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.bulk-actions-head .btn {
  flex: 0 0 auto;
}
.bulk-move-bar.inline-form,
.bulk-delete-bar.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.bulk-move-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 180px;
  min-width: 0;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.bulk-move-label select {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  min-height: 44px;
  box-sizing: border-box;
}
.bulk-move-bar .btn,
.bulk-delete-bar .btn {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 44px;
  width: auto;
  justify-content: center;
  text-align: center;
}

@media (max-width: 720px) {
  /* Page column: full width, equal side padding, centered */
  .panel-body .panel-main {
    align-items: stretch !important;
    padding-left: max(12px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(12px, env(safe-area-inset-right, 0px)) !important;
  }
  .panel-body .panel-main > .page,
  .panel-body .questions-page,
  .panel-body .dashboard-page,
  .panel-body .activity-logs-page,
  .panel-body .expert-review-page,
  .panel-body .curated-exam-page,
  .panel-body .special-hub-page,
  .panel-body .form-card,
  .panel-body .card {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Filters: full-width stacked controls */
  .panel-body .filter-bar,
  .panel-body .question-filter-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }
  .panel-body .question-filter-bar .filter-search {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
  }
  .panel-body .filter-bar select,
  .panel-body .question-filter-bar select,
  .panel-body .filter-bar .btn,
  .panel-body .question-filter-bar .btn {
    width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
    min-height: 44px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Bulk bar: clean vertical stack, equal buttons */
  .bulk-actions-bar,
  .questions-page .bulk-actions-bar {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 0 14px !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }
  .bulk-actions-head {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .bulk-actions-head .bulk-delete-count {
    text-align: left;
  }
  .bulk-actions-head .btn {
    width: 100% !important;
    min-height: 44px !important;
  }
  .bulk-move-bar.inline-form,
  .bulk-delete-bar.inline-form,
  .questions-page .bulk-move-bar,
  .questions-page .bulk-delete-bar {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    position: static !important;
  }
  .bulk-move-label {
    width: 100% !important;
    flex: none !important;
  }
  .bulk-move-label select,
  .bulk-move-bar .btn,
  .bulk-delete-bar .btn,
  .questions-page .bulk-actions-bar .btn {
    width: 100% !important;
    flex: none !important;
    min-height: 44px !important;
  }

  /* Question / stats cards: equal 50/50 label|value rows */
  .questions-page table.responsive-cards,
  .activity-logs-page table.responsive-cards {
    width: 100% !important;
  }
  .questions-page table.responsive-cards tbody,
  .activity-logs-page table.responsive-cards tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  .questions-page table.responsive-cards tr,
  .activity-logs-page table.responsive-cards tr {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 14px !important;
    border-radius: 16px !important;
  }

  .questions-page table.responsive-cards td.col-check {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    align-items: center !important;
    justify-items: start !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 0 10px !important;
    padding: 0 0 10px !important;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent) !important;
  }
  .questions-page table.responsive-cards td.col-check::before {
    content: attr(data-label) !important;
    display: block !important;
    margin: 0 !important;
    text-align: left !important;
  }
  .questions-page table.responsive-cards td.col-check input {
    justify-self: end;
  }

  /* Question text: full width, left, no right squeeze */
  .questions-page table.responsive-cards td.q-preview {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    padding: 0 0 12px !important;
    margin: 0 0 8px !important;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 75%, transparent) !important;
  }
  .questions-page table.responsive-cards td.q-preview::before {
    content: attr(data-label) !important;
    display: block !important;
    margin: 0 0 6px !important;
    text-align: left !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: var(--muted) !important;
  }
  .questions-page table.responsive-cards .q-full-text,
  .questions-page table.responsive-cards .q-content,
  .questions-page table.responsive-cards .q-preview {
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  /* Meta rows: equal left / right halves */
  .questions-page table.responsive-cards td:not(.col-check):not(.q-preview):not(.actions-cell),
  .questions-page .stats-table.responsive-cards td,
  .activity-logs-page table.responsive-cards td:not(.activity-log-action) {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    align-items: center !important;
    column-gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 0 !important;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent) !important;
    text-align: left !important;
  }
  .questions-page table.responsive-cards td:not(.col-check):not(.q-preview):not(.actions-cell):last-of-type,
  .questions-page .stats-table.responsive-cards td:last-child {
    border-bottom: 0 !important;
  }
  .questions-page table.responsive-cards td:not(.col-check):not(.q-preview):not(.actions-cell)::before,
  .questions-page .stats-table.responsive-cards td::before,
  .activity-logs-page table.responsive-cards td::before {
    content: attr(data-label) !important;
    display: block !important;
    margin: 0 !important;
    flex: none !important;
    max-width: none !important;
    width: auto !important;
    text-align: left !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: var(--muted) !important;
  }
  .questions-page table.responsive-cards td:not(.col-check):not(.q-preview):not(.actions-cell) > *,
  .questions-page .stats-table.responsive-cards td > *:not(::before) {
    text-align: right !important;
    justify-self: end;
    min-width: 0;
    max-width: 100%;
  }
  .questions-page table.responsive-cards td.tiny {
    line-height: 1.4;
  }
  .questions-page table.responsive-cards td.tiny .muted {
    text-align: right !important;
  }

  /* Action buttons: equal thirds, full row */
  .questions-page table.responsive-cards td.actions-cell {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 10px !important;
    padding: 12px 0 0 !important;
    border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent) !important;
    border-bottom: 0 !important;
  }
  .questions-page table.responsive-cards td.actions-cell::before {
    content: none !important;
    display: none !important;
  }
  .questions-page table.responsive-cards td.actions-cell .btn,
  .questions-page table.responsive-cards td.actions-cell .inline-form {
    width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  .questions-page table.responsive-cards td.actions-cell .inline-form {
    display: block !important;
  }
  .questions-page table.responsive-cards td.actions-cell .inline-form .btn {
    width: 100% !important;
  }

  /* Stats card block also full width */
  .questions-page .question-stats,
  .questions-page .stats-table.responsive-cards tr {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .questions-page .export-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .questions-page .export-actions .export-label {
    grid-column: 1 / -1;
    text-align: center;
  }
  .questions-page .export-actions .btn {
    width: 100% !important;
    min-height: 40px !important;
  }

  /* Forms / chips / picks — full width equal grid */
  .panel-body .page-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .panel-body .page-actions .btn {
    width: 100% !important;
  }
  .panel-body .subject-chips,
  .panel-body .grade-chips {
    width: 100% !important;
  }
  .panel-body .choice-chips-2 {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 420px) {
  .questions-page table.responsive-cards td.actions-cell {
    grid-template-columns: 1fr !important;
  }
  .bulk-actions-head {
    grid-template-columns: 1fr !important;
  }
  .bulk-actions-head .btn {
    width: 100% !important;
  }
  .panel-body .filter-bar,
  .panel-body .question-filter-bar {
    grid-template-columns: 1fr !important;
  }
  .questions-page .export-actions {
    grid-template-columns: 1fr !important;
  }
  .panel-body .page-actions {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   ACTIVITY LOGS — phone cards (final override)
   ========================================================= */
@media (max-width: 720px) {
  .activity-logs-page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }
  .activity-logs-page .table-scroll {
    overflow: visible !important;
    width: 100% !important;
  }
  .activity-logs-page table.activity-logs-table.responsive-cards,
  .activity-logs-page table.activity-logs-table.responsive-cards thead,
  .activity-logs-page table.activity-logs-table.responsive-cards tbody,
  .activity-logs-page table.activity-logs-table.responsive-cards tr,
  .activity-logs-page table.activity-logs-table.responsive-cards th,
  .activity-logs-page table.activity-logs-table.responsive-cards td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .activity-logs-page table.activity-logs-table.responsive-cards {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .activity-logs-page table.activity-logs-table.responsive-cards thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
  }
  .activity-logs-page table.activity-logs-table.responsive-cards tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  .activity-logs-page table.activity-logs-table.responsive-cards tr {
    background: #fff !important;
    border: 1px solid color-mix(in srgb, var(--line) 85%, transparent) !important;
    border-radius: 16px !important;
    padding: 14px !important;
    box-shadow: 0 10px 24px rgba(18, 38, 58, 0.06) !important;
  }
  .activity-logs-page table.activity-logs-table.responsive-cards td {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    align-items: start !important;
    column-gap: 12px !important;
    padding: 8px 0 !important;
    border: 0 !important;
    border-bottom: 1px dashed color-mix(in srgb, var(--line) 70%, transparent) !important;
    text-align: left !important;
    white-space: normal !important;
    min-width: 0 !important;
  }
  .activity-logs-page table.activity-logs-table.responsive-cards td:last-child {
    border-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  .activity-logs-page table.activity-logs-table.responsive-cards td::before {
    content: attr(data-label) !important;
    display: block !important;
    margin: 0 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: var(--muted) !important;
    text-align: left !important;
  }
  .activity-logs-page .activity-log-who,
  .activity-logs-page .activity-log-details,
  .activity-logs-page .activity-log-badge {
    overflow-wrap: break-word !important;
    word-break: normal !important;
    white-space: normal !important;
    max-width: 100% !important;
  }
  .activity-logs-page .activity-log-who strong {
    display: block !important;
  }
  .activity-logs-page .activity-log-badge {
    display: inline-block !important;
    padding: 4px 8px !important;
    border-radius: 8px !important;
    background: #e8eef8 !important;
    color: var(--brand-deep, #0A369D) !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    text-align: right !important;
  }
  .activity-logs-page table.activity-logs-table.responsive-cards td.activity-log-details {
    grid-template-columns: 1fr !important;
  }
  .activity-logs-page table.activity-logs-table.responsive-cards td.activity-log-details::before {
    margin-bottom: 4px !important;
  }
}


/* ============================================================
   Calvin interaction layer — editorial hovers (no lift/shadow)
   Applied last so user + admin share the same design language.
   ============================================================ */
@keyframes calvinFadeUp {
  from { opacity: 0; transform: translate3d(0, 20%, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.link-btn {
  transition: all 0.3s ease-in-out;
  color: var(--brand);
}
.link-btn:hover { color: var(--accent); text-decoration: none; }
.link-btn.danger:hover { color: var(--accent-deep); }

/* Kill soft SaaS lift / glow across cards & tiles */
.why-card,
.step-card,
.feature-card,
.exam-hub-card,
.child-card,
.stat,
.form-card,
.panel-card,
.cta-panel,
.ai-review-card,
.exam-card,
.empty-state,
.qb-hero,
.curated-exam-intro,
.expert-review-intro {
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: border-color 0.3s ease-in-out, background-color 0.3s ease-in-out, color 0.3s ease-in-out !important;
}
.why-card:hover,
.step-card:hover,
.feature-card:hover,
.exam-hub-card:hover,
.child-card:hover,
.stat:hover,
.cta-panel:hover,
.exam-card:hover,
.ai-review-card:hover {
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
  border-color: #000 !important;
}

.why-card,
.step-card,
.feature-card,
.exam-hub-card {
  background: #fff;
  border: 1px solid var(--line);
}
.why-card:hover .icon-badge,
.step-card:hover .icon-badge {
  transform: none !important;
}

.icon-badge,
.icon-badge-alt {
  border-radius: 0 !important;
  background: #000 !important;
  color: #fff !important;
}

.section-head .eyebrow,
.eyebrow {
  font-family: var(--font);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .72rem;
  color: var(--muted);
}

.section-head h2,
.exam-hub-head h2,
.children-hub-head h2,
.panel-top h1,
.page h1,
.page h2 {
  font-family: var(--display);
  font-weight: 400;
}

/* Image / media hover like Calvin entry thumbs */
.why-card img,
.exam-hub-card img,
.qb-img-tool-preview img,
.image-upload-preview {
  transition: transform 0.3s ease-in-out;
}
.why-card:hover img,
.qb-img-tool:hover .qb-img-tool-preview img,
.image-upload-preview:hover {
  transform: scale(1.05);
}

/* Tables */
.table {
  border-radius: 0 !important;
  border: 1px solid var(--line);
  overflow: hidden;
}
.table th {
  background: #fff !important;
  color: #000 !important;
  font-family: var(--font);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
}
.table tbody tr { transition: background 0.3s ease-in-out; }
.table tbody tr:hover { background: #eff0f0 !important; }

/* Admin / parent chrome */
.panel-main,
.panel-content,
.page {
  background: transparent;
}
.panel-top {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.sidebar .brand,
.sidebar .brand-name,
.sidebar a.brand {
  color: #fff !important;
}
.sidebar nav a {
  border-radius: 0 !important;
  transition: all 0.3s ease-in-out !important;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,.08) !important;
  transform: none !important;
}

.dashboard-page {
  border-radius: 0 !important;
  border: 1px solid var(--line);
  background: #fff;
}
.dashboard-page .stat {
  border-radius: 0 !important;
  border: 1px solid var(--line);
  background: #fff !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}
.dashboard-page .stat:hover {
  border-color: #000 !important;
  transform: none !important;
}

/* Parent hub */
.prep-strip,
.exam-hub,
.children-hub {
  border-radius: 0 !important;
}
.prep-strip {
  background: #151515 !important;
  color: #fff;
  border: none;
}
.exam-hub-badge,
.exam-hub-badge-pro {
  border-radius: 0 !important;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-size: 11px;
  font-weight: 600;
}
.exam-hub-card .btn:hover {
  transform: none !important;
}

/* Buttons everywhere — force Calvin primary behavior */
button.btn,
a.btn,
input.btn,
.btn {
  border-radius: 0 !important;
  box-shadow: none !important;
}
button.btn:hover,
a.btn:hover,
.btn:hover,
button.btn:focus,
a.btn:focus,
.btn:focus {
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}

/* Soft secondary buttons (gray → black) */
.btn-secondary,
.btn-muted {
  background: var(--btn-bg) !important;
  border: 0.2rem solid var(--btn-bg) !important;
  color: var(--btn-text) !important;
}
.btn-secondary:hover,
.btn-muted:hover {
  background: var(--btn-hover-bg) !important;
  border-color: var(--btn-hover-bg) !important;
  color: var(--btn-hover-text) !important;
}

/* Underline grow pagination / tabs */
.pagination a,
.pager a,
.tabs a,
.qb-pager a {
  position: relative;
  transition: color 0.3s ease-in-out;
}
.pagination a::after,
.pager a::after,
.qb-pager a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: #000;
  transition: width .3s ease-in-out;
}
.pagination a:hover::after,
.pager a:hover::after,
.qb-pager a:hover::after {
  width: 100%;
}

/* Form cards in admin */
.form-card,
.birth-fieldset,
.filter-bar,
.pick-row {
  border-radius: 0 !important;
}
.filter-bar select,
.pick-row input,
.page input[type="text"],
.page input[type="email"],
.page input[type="password"],
.page input[type="number"],
.page textarea,
.page select {
  border-radius: 0 !important;
  transition: all .3s ease-in-out;
}
.page input:focus,
.page textarea:focus,
.page select:focus {
  outline: none;
  border-color: #000 !important;
  box-shadow: none !important;
}

/* CTA strip */
.cta-panel {
  background: #151515 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 0 !important;
}
.cta-panel .btn {
  background: #fff !important;
  color: #000 !important;
  border: 0.2rem solid #fff !important;
}
.cta-panel .btn:hover {
  background: transparent !important;
  color: #fff !important;
  border-color: #fff !important;
}

/* Status chips — sharper */
.status-scheduled,
.status-running,
.status-finished,
.preview-badge-skip,
.qb-status {
  border-radius: 0 !important;
}

/* Math editor insert stays crimson but Calvin hover */
.geo-insert:hover { filter: none !important; background: var(--accent-deep) !important; }

/* Nav brand on dark hero pages stays readable */
.site-header .brand:hover { color: var(--ink); }

/* 2026 premium polish: admin + user + AI review */
:root {
  --premium-glow: 0 20px 50px rgba(29, 78, 216, .18);
  --premium-glow-warm: 0 20px 50px rgba(151, 32, 36, .18);
}

.panel-body.panel-calvin,
.exam-body,
.site-body {
  background-image:
    radial-gradient(circle at top left, rgba(147, 197, 253, .14), transparent 30%),
    radial-gradient(circle at top right, rgba(244, 114, 182, .10), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(239,240,240,.98));
}

.panel-top,
.exam-topbar,
.auth-card,
.question-box,
.exam-left,
.exam-right,
.child-row,
.exam-hub-card,
.stat,
.dashboard-hero,
.ai-review-card,
.form-card {
  border-radius: 24px;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 24px 26px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(10,54,157,.96), rgba(151,32,36,.94));
  color: #fff;
  box-shadow: var(--premium-glow);
}
.dashboard-hero .eyebrow,
.dashboard-hero .muted,
.dashboard-hero h2 { color: #fff; }
.dashboard-hero-title { margin: 2px 0 8px; }
.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dashboard-hero .btn-ghost {
  color: #fff !important;
  border-color: rgba(255,255,255,.65) !important;
}
.dashboard-hero .btn-ghost:hover {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
}

.stat {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.6);
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.78));
  box-shadow: 0 12px 34px rgba(15, 23, 42, .08);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(10,54,157,.92), rgba(151,32,36,.88));
}
.stat:hover {
  transform: translateY(-6px);
  box-shadow: var(--premium-glow);
  border-color: rgba(96, 165, 250, .65);
}
.stat-ico {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  margin-bottom: 12px;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #9333ea);
  box-shadow: 0 10px 24px rgba(29, 78, 216, .26);
}
.stat-ico .ico { width: 1.2rem; height: 1.2rem; }

.panel-top {
  position: sticky;
  top: 14px;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(255,255,255,.62);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

.sidebar.sidebar-admin {
  border-right: 1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(5,9,18,.98), rgba(15,23,42,.94)),
    radial-gradient(circle at top, rgba(59,130,246,.15), transparent 28%);
}

.sidebar nav > a.sidebar-accent,
.sidebar-group {
  border-radius: 18px !important;
}

.table-scroll,
.dashboard-page .table {
  border-radius: 24px;
  overflow: hidden;
}

.preview-status-badge.preview-badge-info {
  background: rgba(29, 78, 216, .1);
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, .18);
}
.preview-status-badge.preview-badge-warn {
  background: rgba(234, 179, 8, .14);
  color: #92400e;
  border: 1px solid rgba(234, 179, 8, .22);
}

.ai-review-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.ai-crop-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-crop-toolbar .btn {
  min-width: 116px;
}

.auth-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255,255,255,.96), rgba(255,255,255,.84)),
    radial-gradient(circle at top right, rgba(96,165,250,.18), transparent 32%);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--premium-glow);
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(29,78,216,.07), transparent 44%, rgba(151,32,36,.05));
  pointer-events: none;
}
.exam-login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  background: rgba(10,54,157,.08);
  color: var(--brand-deep);
  border: 1px solid rgba(10,54,157,.14);
}

.exam-shell {
  gap: 18px;
}
.exam-left,
.exam-right,
.question-box {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.82));
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
}
.exam-topbar {
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}
.option {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.92));
  border-radius: 18px;
}
.option:hover {
  transform: translateX(6px) translateY(-1px);
  box-shadow: 0 12px 24px rgba(29, 78, 216, .12);
}
.option.selected {
  box-shadow: 0 18px 34px rgba(29, 78, 216, .16);
}
.q-dot.current {
  box-shadow: 0 0 0 4px rgba(234, 179, 8, .32), 0 12px 20px rgba(234, 179, 8, .22);
}

.child-row,
.exam-hub-card,
.why-card,
.seo-learning-card,
.step-card,
.cta-panel {
  backdrop-filter: blur(10px);
}

@media (max-width: 960px) {
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-quick-actions {
    width: 100%;
  }
  .dashboard-quick-actions .btn {
    flex: 1 1 180px;
  }
}

