/* ═══════════════════════════════════════════════════════════════
   পড়াশোনা — Porasuna stylesheet
   Design tokens from the UI plan spec.
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --primary: #1A3C6E;
  --primary-hover: #142F57;
  --primary-soft: #EFF6FF;
  --accent: #16A34A;
  --accent-hover: #12803C;
  --warning: #D97706;
  --danger: #DC2626;
  --surface: #F8FAFC;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-faint: #94A3B8;

  --blue-bg: #EFF6FF;   --blue-tx: #1D4ED8;  --blue-bd: #BFDBFE;
  --green-bg: #F0FDF4;  --green-tx: #166534;  --green-bd: #BBF7D0;
  --amber-bg: #FFF7ED;  --amber-tx: #9A3412;  --amber-bd: #FED7AA;
  --purple-bg: #FDF4FF; --purple-tx: #7E22CE; --purple-bd: #E9D5FF;
  --red-bg: #FEF2F2;    --red-tx: #B91C1C;    --red-bd: #FECACA;

  --radius-card: 8px; --radius-btn: 6px; --radius-badge: 4px; --radius-input: 6px;

  --shadow-card: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.10);
  --shadow-sticky: 0 2px 8px rgba(0,0,0,.08);

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  --font-body: "Hind Siliguri", "Noto Sans Bengali", sans-serif;
  --font-display: "Noto Serif Bengali", serif;
  --font-mono: "JetBrains Mono", monospace;

  --header-h: 64px;
  --bottomnav-h: 60px;
}

[data-theme="dark"] {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft: #16233F;
  --surface: #0F172A;
  --card: #1E293B;
  --border: #334155;
  --border-strong: #475569;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-faint: #64748B;
  --shadow-card: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.5);
  --shadow-sticky: 0 2px 8px rgba(0,0,0,.4);

  --blue-bg: #16233F;   --blue-tx: #93C5FD;  --blue-bd: #1E3A5F;
  --green-bg: #12291A;  --green-tx: #86EFAC; --green-bd: #1E4030;
  --amber-bg: #33240D;  --amber-tx: #FDBA74; --amber-bd: #4A3210;
  --purple-bg: #2A1B33; --purple-tx: #D8B4FE; --purple-bd: #3F2A4A;
  --red-bg: #3A1414;    --red-tx: #FCA5A5;   --red-bd: #4A1E1E;
}

/* ── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.75;
  min-height: 100vh; transition: background .25s, color .25s;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.3; margin: 0 0 var(--sp-3); color: var(--text); }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { font-family: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.page { max-width: 1280px; margin: 0 auto; padding: var(--sp-5) var(--sp-4) var(--sp-7); }
.page > * { min-width: 0; }

/* Bangla question text uses taller line-height */
.q-text, .exam-q-text { line-height: 1.85; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--primary); color: #fff;
  box-shadow: var(--shadow-sticky);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; min-height: var(--header-h);
  display: flex; align-items: center; gap: var(--sp-4); padding: 0 var(--sp-4);
}
.logo { display: flex; align-items: center; gap: var(--sp-2); color: #fff; font-weight: 700; font-size: 20px; text-decoration: none !important; }
.logo-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.logo-text { font-family: var(--font-display); }
.logo-img { height: 36px; width: auto; max-width: 190px; display: block; object-fit: contain; }

.main-nav { display: flex; align-items: center; gap: var(--sp-1); flex: 1; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px; padding: var(--sp-2) var(--sp-3);
  color: rgba(255,255,255,.88); border-radius: var(--radius-btn); font-size: 15px; text-decoration: none !important;
  transition: background .15s;
}
.nav-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.caret { font-size: 10px; opacity: .8; }

.header-actions { display: flex; align-items: center; gap: var(--sp-2); }
.icon-btn {
  background: transparent; border: none; color: inherit; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 17px;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.14); }
.icon-btn:active { transform: scale(.95); }

.btn-login {
  background: #fff; color: var(--primary) !important; font-weight: 600;
  padding: 8px 18px; border-radius: var(--radius-btn); text-decoration: none !important;
  font-size: 14px; border: none; cursor: pointer; transition: background .15s;
}
.btn-login:hover { background: #E2E8F0; }

.hamburger { display: none; }

/* Megamenu */
.megamenu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 110;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-hover); padding: var(--sp-4); min-width: 300px;
  display: none;
}
.nav-item.open .megamenu, .megamenu:focus-within { display: block; }
.mm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-1) var(--sp-5); }
.mm-grid a {
  display: block; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-btn);
  color: var(--text); text-decoration: none !important; font-size: 14px;
}
.mm-grid a:hover { background: var(--primary-soft); color: var(--primary); }
.mm-sub { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.mm-sub-title { display: block; font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: var(--sp-2); }
.mm-sub-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mm-sub-links a {
  display: inline-block; padding: 4px 12px; border-radius: 9999px;
  border: 1px solid var(--border-strong); color: var(--text); font-size: 13px; text-decoration: none !important;
}
.mm-sub-links a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* Search overlay */
.search-overlay {
  position: absolute; inset: 0; top: 100%; z-index: 105;
  background: var(--card); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-hover);
}
.search-box { max-width: 720px; margin: 0 auto; padding: var(--sp-5) var(--sp-4) var(--sp-4); }
.search-box form { display: flex; gap: var(--sp-2); }
.search-box input {
  flex: 1; padding: 12px 16px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius-input);
  background: var(--surface); color: var(--text);
}
.search-box input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.search-hint { font-size: 12px; color: var(--text-muted); margin: var(--sp-2) 0 0; }
kbd {
  font-family: var(--font-mono); font-size: 11px; background: var(--surface);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px;
}
.search-results { margin-top: var(--sp-3); }
.sr-item {
  display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-btn); color: var(--text); text-decoration: none !important;
}
.sr-item:hover { background: var(--primary-soft); }
.sr-title { font-weight: 600; font-size: 14px; }
.sr-kind { font-size: 12px; color: var(--text-muted); }
.sr-empty { color: var(--text-muted); font-size: 14px; padding: var(--sp-3); text-align: center; }

/* Mobile drawer */
.mobile-drawer {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 105;
  background: var(--card); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-hover);
  display: flex; flex-direction: column; padding: var(--sp-2) var(--sp-4);
}
.mobile-drawer a {
  padding: var(--sp-3) var(--sp-2); color: var(--text); font-size: 16px;
  border-bottom: 1px solid var(--border); text-decoration: none !important;
}
.mobile-drawer a:last-child { border-bottom: none; }

/* ── Hero strip ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(120deg, var(--primary), #2A5490);
  color: #fff; border-radius: var(--radius-card);
  padding: var(--sp-5) var(--sp-4); margin-bottom: var(--sp-5);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); text-align: center;
}
.hero h1 { color: #fff; font-size: 24px; margin: 0; }
.hero p { color: rgba(255,255,255,.75); margin: 0; font-size: 14px; }
.hero form { display: flex; gap: var(--sp-2); width: 100%; max-width: 560px; }
.hero input {
  flex: 1; padding: 12px 18px; border: none; border-radius: var(--radius-btn);
  font-size: 15px; font-family: inherit;
}
.hero input:focus { outline: 3px solid rgba(255,255,255,.35); }

/* ── Category quick links ────────────────────────────────────── */
.quick-links { display: flex; gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-3); margin-bottom: var(--sp-5); scrollbar-width: thin; }
.quick-link {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4); background: var(--card); border: 1px solid var(--border);
  border-radius: 9999px; font-size: 14px; font-weight: 500; color: var(--text);
  text-decoration: none !important; box-shadow: var(--shadow-card); transition: border-color .15s, box-shadow .15s;
}
.quick-link:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); text-decoration: none; }

/* ── Layout grids ────────────────────────────────────────────── */
.layout-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-5); align-items: start; }
.layout-side { display: grid; grid-template-columns: 1fr 3fr; gap: var(--sp-5); align-items: start; }
.layout-3-2 { display: grid; grid-template-columns: 3fr 2fr; gap: var(--sp-5); align-items: start; }
.layout-filters { display: grid; grid-template-columns: 280px 1fr; gap: var(--sp-5); align-items: start; }
.side-sticky { position: sticky; top: calc(var(--header-h) + var(--sp-3)); display: flex; flex-direction: column; gap: var(--sp-4); }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: var(--sp-4); box-shadow: var(--shadow-card); margin-bottom: var(--sp-4);
  transition: box-shadow .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-hover); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); gap: var(--sp-3); }
.section-head h2 { margin: 0; }
.link-more { font-size: 14px; font-weight: 600; white-space: nowrap; }

/* ── Circular card ──────────────────────────────────────────── */
.circular-card .cc-head { display: flex; gap: var(--sp-3); align-items: flex-start; margin-bottom: var(--sp-3); }
.org-logo {
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: var(--radius-card);
  background: var(--primary-soft); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.cc-org { font-size: 13px; color: var(--text-muted); }
.cc-title { font-size: 17px; margin: 2px 0 0; line-height: 1.5; }
.cc-title a { color: var(--text); }
.cc-title a:hover { color: var(--primary); }
.cc-badges { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.cc-meta, .cc-dates { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); font-size: 13.5px; color: var(--text-muted); margin-bottom: var(--sp-2); }
.cc-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); flex-wrap: wrap; }

.circular-card.compact { display: grid; grid-template-columns: 48px 1fr auto; grid-template-rows: auto auto; column-gap: var(--sp-3); padding: var(--sp-3); }
.circular-card.compact .org-logo { grid-row: 1 / span 2; align-self: center; }
.circular-card.compact .cc-head { grid-column: 2; margin: 0; gap: var(--sp-2); flex-direction: column; }
.circular-card.compact .cc-meta { grid-column: 2; margin: var(--sp-2) 0 0; }
.circular-card.compact .cc-dates { grid-column: 2; margin: 0; }
.circular-card.compact .cc-badges { display: none; }
.circular-card.compact .cc-actions { grid-column: 3; grid-row: 1 / span 2; margin: 0; flex-direction: column; align-items: stretch; }
.circular-card.compact .cc-actions .btn { white-space: nowrap; }
.circular-card.compact .cc-title { font-size: 15px; }

/* ── Badges / pills / chips ─────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-badge); font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.badge-govt, .badge-railway, .badge-defence, .badge-city, .badge-bcs { background: var(--blue-bg); color: var(--blue-tx); border-color: var(--blue-bd); }
.badge-bank { background: var(--green-bg); color: var(--green-tx); border-color: var(--green-bd); }
.badge-ntrca { background: var(--amber-bg); color: var(--amber-tx); border-color: var(--amber-bd); }
.badge-primary { background: var(--purple-bg); color: var(--purple-tx); border-color: var(--purple-bd); }
.badge-university { background: var(--purple-bg); color: var(--purple-tx); border-color: var(--purple-bd); }
.badge-ngo { background: var(--red-bg); color: var(--red-tx); border-color: var(--red-bd); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 9999px; font-size: 12px; font-weight: 600; }
.pill-live { background: var(--green-bg); color: #15803D; }
[data-theme="dark"] .pill-live { color: #86EFAC; }
.pill-soon { background: var(--amber-bg); color: #B45309; }
[data-theme="dark"] .pill-soon { color: #FDBA74; }
.pill-dead { background: var(--red-bg); color: var(--red-tx); }

.chip-deadline { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 9999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip-deadline.danger { background: var(--danger); color: #fff; }
.chip-deadline.warning { background: #FBBF24; color: #422006; }
.chip-deadline.ok { background: var(--accent); color: #fff; }
.chip-deadline.expired { background: var(--border); color: var(--text-muted); }

.tag { display: inline-flex; padding: 1px 8px; border-radius: var(--radius-badge); font-size: 11.5px; font-weight: 600; }
.tag-easy { background: var(--green-bg); color: var(--green-tx); }
.tag-medium { background: var(--amber-bg); color: var(--amber-tx); }
.tag-hard { background: var(--red-bg); color: var(--red-tx); }
.tag-src { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 9px 18px; border-radius: var(--radius-btn); font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
[data-theme="dark"] .btn-primary { background: var(--primary); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--card); color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 14px; padding: 0; font-weight: 600; }
.btn-sub.subscribed { background: var(--green-bg); color: var(--green-tx); border-color: var(--green-bd); }
.btn-sub .sub-check { display: none; }
.btn-sub.subscribed .sub-check { display: inline; }
.btn-sub.subscribed .sub-bell { display: none; }

/* ── Sidebar widgets ─────────────────────────────────────────── */
.widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--sp-4); box-shadow: var(--shadow-card); margin-bottom: var(--sp-4); }
.widget h3 { font-size: 15px; display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--border); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: var(--sp-2) 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.widget li:last-child { border-bottom: none; padding-bottom: 0; }

/* Daily question widget */
.dq-question { font-weight: 600; font-size: 15px; margin-bottom: var(--sp-3); line-height: 1.7; }
.dq-opts { display: flex; flex-direction: column; gap: var(--sp-2); }
.dq-opt {
  display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-btn); font-size: 14px;
  background: var(--card); cursor: pointer; width: 100%; text-align: left; color: var(--text);
  transition: border-color .15s, background .15s;
}
.dq-opt:hover { border-color: var(--primary); }
.dq-opt.correct { background: var(--green-bg); border-color: var(--accent); color: var(--green-tx); font-weight: 600; }
.dq-opt.wrong { background: var(--red-bg); border-color: var(--danger); color: var(--red-tx); }
.dq-opt .opt-mark { margin-left: auto; }

/* Stats widget */
.stat-line { display: flex; justify-content: space-between; align-items: baseline; }
.stat-line b { font-family: var(--font-mono); font-size: 16px; color: var(--primary); }

/* ── Track cards / grid cards ────────────────────────────────── */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--sp-4); }
.track-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-1);
  padding: var(--sp-5) var(--sp-3); margin-bottom: 0;
}
.track-card .t-icon { font-size: 34px; line-height: 1; margin-bottom: var(--sp-2); }
.track-card h3 { font-size: 17px; margin: 0; }
.track-card .t-meta { font-size: 13px; color: var(--text-muted); }
.track-card .t-count { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--primary); }
[data-theme="dark"] .track-card .t-count { color: #93C5FD; }
.track-card .btn { margin-top: var(--sp-3); }
.track-card a.track-link { position: absolute; inset: 0; border-radius: var(--radius-card); }
.track-card { position: relative; }

.subject-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-4); text-decoration: none !important; color: var(--text); margin-bottom: 0;
  font-weight: 600; font-size: 15px;
}
.subject-tile:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); }
.subject-tile .s-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700;
  font-family: var(--font-mono);
}
[data-theme="dark"] .subject-tile .s-icon { color: #93C5FD; }
.subject-tile .s-count { font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* ── Question browser (study mode) ───────────────────────────── */
.q-card { padding: var(--sp-5); }
.q-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.q-num { font-family: var(--font-mono); font-weight: 700; color: var(--primary); }
[data-theme="dark"] .q-num { color: #93C5FD; }
.q-acc { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.q-text { font-size: 16px; font-weight: 500; margin-bottom: var(--sp-4); }
.q-options { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.q-options .opt {
  display: flex; align-items: baseline; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-strong); border-radius: var(--radius-btn); font-size: 15px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.q-options .opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.q-options .opt.picked { border-color: var(--primary); background: var(--primary-soft); }

/* Instant right/wrong feedback on option pick */
.q-options .opt.correct {
  border-color: var(--accent); background: var(--green-bg);
  animation: opt-pop .25s ease;
}
.q-options .opt.correct .opt-key,
.q-options .opt .opt-mark { font-weight: 700; }
.q-options .opt.correct .opt-key { color: var(--green-tx); }
.q-options .opt.wrong {
  border-color: var(--danger); background: var(--red-bg);
  animation: opt-shake .3s ease;
}
.q-options .opt.wrong .opt-key { color: var(--red-tx); font-weight: 700; }
.q-options .opt .opt-mark { margin-left: auto; font-weight: 700; }
.q-options .opt.correct .opt-mark { color: var(--accent); }
.q-options .opt.wrong .opt-mark { color: var(--danger); }
/* correct answer highlighted on wrong pick */
.q-options .opt.correct-opt { box-shadow: 0 0 0 2px var(--accent) inset; }
/* answered → options lock */
.q-card.answered .opt { cursor: default; }
.q-options .opt.locked { pointer-events: none; }
.q-card.answered .opt:not(.correct):not(.wrong):hover { border-color: var(--border-strong); background: none; }
@keyframes opt-pop { 0% { transform: scale(1); } 50% { transform: scale(1.015); } 100% { transform: scale(1); } }
@keyframes opt-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); } 75% { transform: translateX(4px); }
}
.opt-key { font-weight: 700; color: var(--text-muted); flex: 0 0 auto; }
.q-correct { background: var(--green-bg); border: 1px solid var(--green-bd); color: var(--green-tx); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-btn); font-weight: 600; font-size: 14px; margin: 0 0 var(--sp-2); }
.q-explain { font-size: 14px; color: var(--text-muted); margin: 0; line-height: 1.8; }
.q-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px dashed var(--border); }

/* Study sidebar tree */
.tree h3 { font-size: 14px; margin-bottom: var(--sp-2); }
.tree-group { margin-bottom: var(--sp-2); }
.tree-group > button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2);
  background: none; border: none; color: var(--text); font-weight: 600; font-size: 14px;
  padding: var(--sp-2); border-radius: var(--radius-btn); cursor: pointer; text-align: right;
}
.tree-group > button:hover { background: var(--surface); }
.tree-group .tg-arrow { transition: transform .2s; font-size: 11px; color: var(--text-muted); }
.tree-group.open .tg-arrow { transform: rotate(90deg); }
.tree-topics { display: none; flex-direction: column; padding-right: var(--sp-3); }
.tree-group.open .tree-topics { display: flex; }
.tree-topics a {
  padding: 6px var(--sp-3); font-size: 13.5px; color: var(--text-muted); text-decoration: none !important;
  border-right: 2px solid transparent; border-radius: var(--radius-btn) 0 0 var(--radius-btn);
}
.tree-topics a:hover { color: var(--primary); background: var(--primary-soft); }
.tree-topics a.active { color: var(--primary); border-right-color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.tree-topics .t-count { font-size: 11px; color: var(--text-faint); }

/* ── Filters ─────────────────────────────────────────────────── */
.filters { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--sp-4); box-shadow: var(--shadow-card); }
.filters h3 { font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text-muted); margin: var(--sp-4) 0 var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.filters h3:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.filters input[type="search"] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-input);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 14px;
}
.filters input[type="search"]:focus { border-color: var(--primary); outline: none; }
.fcheck { display: flex; align-items: center; gap: var(--sp-2); padding: 5px 8px 5px 4px; border-radius: var(--radius-btn); font-size: 14px; cursor: pointer; }
.fcheck:hover { background: var(--surface); }
.fcheck input { accent-color: var(--primary); width: 16px; height: 16px; }
.fcheck .f-count { margin-right: auto; font-size: 12px; color: var(--text-faint); }
.radio-pill { display: inline-flex; margin: 0 0 var(--sp-2); }
.radio-pill input { position: absolute; opacity: 0; }
.radio-pill span {
  padding: 5px 14px; border: 1px solid var(--border-strong); border-radius: 9999px; font-size: 13px;
  cursor: pointer; color: var(--text-muted); transition: all .15s;
}
.radio-pill input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Toolbar: view toggle + sort */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.view-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-btn); overflow: hidden; }
.view-toggle button { background: var(--card); border: none; padding: 7px 14px; cursor: pointer; font-size: 14px; color: var(--text-muted); }
.view-toggle button.active { background: var(--primary); color: #fff; }
.select {
  padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-btn);
  background: var(--card); color: var(--text); font-family: inherit; font-size: 14px; cursor: pointer;
}
.result-count { font-size: 14px; color: var(--text-muted); }

/* grid view of circulars */
.circ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--sp-4); }
.circ-grid .circular-card { margin-bottom: 0; }

/* ── Key-value info panel (circular detail) ──────────────────── */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--sp-2) var(--sp-4); }
.kv { display: flex; align-items: baseline; gap: var(--sp-2); font-size: 14px; padding: var(--sp-2) 0; border-bottom: 1px dashed var(--border); }
.kv .k { color: var(--text-muted); flex: 0 0 auto; }
.kv .v { font-weight: 600; }
.kv .v a { word-break: break-all; }

/* Circular detail — "মূল তথ্য" as tidy tiles */
.kv-info { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-3); }
.kv-info .kv {
  flex-direction: column; align-items: flex-start; gap: 4px;
  padding: var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--surface);
}
.kv-info .kv .k { font-size: 12.5px; font-weight: 500; line-height: 1.4; }
.kv-info .kv .v { font-size: 15px; font-weight: 700; line-height: 1.5; word-break: break-word; }
.kv-info .kv .v a { word-break: break-word; }
.kv-info .kv-apply { grid-column: 1 / -1; }
.kv-info .kv-apply .v a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius-btn);
  background: var(--primary); color: #fff; font-weight: 600;
}
.kv-info .kv-apply .v a:hover { text-decoration: none; filter: brightness(1.06); }

/* Circular detail — post names list */
.post-name-list {
  list-style: none; margin: var(--sp-4) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--sp-2);
}
.post-name-list li {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--surface); font-size: 14px; line-height: 1.55;
}
.post-name-list .pn-num {
  flex: 0 0 auto; min-width: 22px; height: 22px; border-radius: 9999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.post-name-list .pn-name { font-weight: 600; word-break: break-word; }

/* Detail article body */
.detail-body { font-size: 15px; line-height: 1.9; }
.detail-body h3 { font-size: 17px; margin: var(--sp-4) 0 var(--sp-2); padding-bottom: 4px; border-bottom: 2px solid var(--primary-soft); }
.detail-body ul, .detail-body ol { padding-right: 0; padding-left: var(--sp-6); }
.detail-body li { margin-bottom: var(--sp-1); }

/* Attachment files */
.file-row {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--radius-card); margin-bottom: var(--sp-2);
  background: var(--surface);
}
.file-row .f-icon { font-size: 22px; }
.file-row .f-name { font-family: var(--font-mono); font-size: 13px; word-break: break-all; }
.file-row .f-size { font-size: 12px; color: var(--text-muted); }

/* Inline PDF viewer (circular attachments) */
.file-item { margin-bottom: var(--sp-2); }
.file-item .file-row { margin-bottom: 0; }
.file-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
.pdf-viewer {
  margin-top: var(--sp-2); border: 1px solid var(--border);
  border-radius: var(--radius-card); overflow: hidden; background: var(--surface);
}
.pdf-viewer iframe { display: block; width: 100%; height: 70vh; min-height: 420px; border: 0; background: #fff; }
.pdf-viewer-foot {
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
  padding: var(--sp-2); border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .file-row { flex-wrap: wrap; }
  .file-actions { width: 100%; justify-content: flex-start; }
  .pdf-viewer iframe { height: 60vh; min-height: 320px; }
}

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-widget { padding-right: var(--sp-5); }
.timeline li { display: flex; flex-direction: row-reverse; gap: var(--sp-3); align-items: flex-start; padding-bottom: var(--sp-4); position: relative; }
.timeline li::before {
  content: ""; position: absolute; right: 9px; top: 20px; bottom: 0; width: 2px; background: var(--border);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.tl-dot {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  border: 3px solid var(--border-strong); background: var(--card); position: relative; z-index: 1;
}
.timeline li.done .tl-dot { border-color: var(--accent); background: var(--accent); }
.timeline li.warn .tl-dot { border-color: var(--warning); background: var(--warning); }
.timeline li.danger .tl-dot { border-color: var(--danger); background: var(--danger); }
.tl-body { flex: 1 1 auto; text-align: left; font-size: 13.5px; }
.tl-body b { display: block; font-size: 14px; }
.tl-body span { color: var(--text-muted); }
.timeline li.pending .tl-body b { color: var(--text-muted); }

/* Countdown */
.countdown { font-family: var(--font-mono); font-size: 22px; font-weight: 700; text-align: center; letter-spacing: 1px; color: var(--danger); }
.countdown .cd-sep { color: var(--text-faint); font-weight: 400; }
.countdown-sub { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: var(--sp-1); }

/* ── Exam pages ─────────────────────────────────────────────── */
.exam-tabs { display: flex; gap: var(--sp-2); border-bottom: 2px solid var(--border); margin-bottom: var(--sp-5); overflow-x: auto; }
.exam-tab {
  padding: var(--sp-2) var(--sp-4); border: none; background: none; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -2px;
  white-space: nowrap;
}
.exam-tab:hover { color: var(--primary); }
.exam-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.live-banner {
  border: 2px solid var(--danger); background: var(--card); border-radius: var(--radius-card);
  padding: var(--sp-5); box-shadow: var(--shadow-card); margin-bottom: var(--sp-5);
}
.live-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 700; font-size: 14px; margin-bottom: var(--sp-2); }
.live-badge::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: pulse-dot 1.2s infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.live-banner h2 { margin-bottom: var(--sp-2); }
.live-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); color: var(--text-muted); font-size: 14px; margin-bottom: var(--sp-4); }
.live-meta .mono { font-family: var(--font-mono); }

.exam-card { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: 0; height: 100%; }
.exam-card h3 { font-size: 16px; margin: 0 0 var(--sp-2); min-height: 2.6em; }
.exam-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px var(--sp-3); font-size: 13.5px; color: var(--text-muted); margin-bottom: var(--sp-3); }
.exam-specs b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.exam-card .btn { margin-top: auto; }

/* Exam take (bare page) */
.exam-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.exam-topbar {
  position: sticky; top: 0; z-index: 50; background: var(--card);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sticky);
  display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-2) var(--sp-4);
  flex-wrap: wrap;
}
.exam-topbar .et-title { font-weight: 700; font-size: 15px; }
.exam-topbar .et-q { font-size: 14px; color: var(--text-muted); }
.exam-topbar .et-q b { font-family: var(--font-mono); color: var(--text); }
.exam-timer {
  margin-right: auto; font-family: var(--font-mono); font-weight: 700; font-size: 20px;
  display: inline-flex; align-items: center; gap: var(--sp-2);
}
.exam-timer.t-ok { color: var(--accent); }
.exam-timer.t-warn { color: var(--warning); }
.exam-timer.t-danger { color: var(--danger); animation: timer-pulse 1s infinite; }
@keyframes timer-pulse { 50% { opacity: .55; } }
[data-theme="dark"] .exam-timer.t-ok { color: #86EFAC; }

.exam-body { flex: 1; display: grid; grid-template-columns: 1fr 340px; gap: var(--sp-5); max-width: 1280px; margin: 0 auto; padding: var(--sp-5) var(--sp-4); width: 100%; align-items: start; }

.exam-q { padding: var(--sp-5); }
.exam-q .eq-label { font-size: 13px; color: var(--text-muted); margin-bottom: var(--sp-2); }
.exam-q-text { font-size: 17px; font-weight: 600; margin-bottom: var(--sp-5); }
.eopt {
  width: 100%; display: flex; align-items: baseline; gap: var(--sp-3); text-align: right;
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2);
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-btn);
  background: var(--card); color: var(--text); font-size: 15px; font-family: inherit; cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
}
.eopt:hover { border-color: var(--primary); background: var(--primary-soft); }
.eopt:active { transform: scale(.995); }
.eopt .eo-key { font-weight: 700; color: var(--text-muted); flex: 0 0 auto; }
.eopt.selected {
  background: var(--green-bg); border-color: var(--accent); color: var(--green-tx); font-weight: 600;
}
.eopt.selected .eo-key { color: var(--green-tx); }
.eopt.selected::after { content: "✓"; margin-right: auto; font-weight: 700; }
.eopt .eo-flag { display: none; }
.exam-nav { display: flex; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-4); }

/* palette */
.palette-card { position: sticky; top: calc(var(--sp-5) + 4px); }
.pal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-2); }
.pal-btn {
  aspect-ratio: 1; border: 1.5px solid var(--border-strong); background: var(--card); color: var(--text);
  border-radius: var(--radius-btn); font-family: var(--font-mono); font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; position: relative; transition: all .15s;
}
.pal-btn.answered { background: var(--accent); border-color: var(--accent); color: #fff; }
.pal-btn.review { background: #FBBF24; border-color: #F59E0B; color: #422006; }
.pal-btn.current { box-shadow: 0 0 0 3px var(--primary); border-color: var(--primary); }
.pal-btn .pal-flag { position: absolute; top: 2px; left: 4px; font-size: 9px; }
.pal-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-muted); margin: var(--sp-3) 0; }
.pal-legend .lg { display: inline-flex; align-items: center; gap: var(--sp-2); }
.pal-legend .swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); }
.pal-legend .sw-ans { background: var(--accent); border-color: var(--accent); }
.pal-legend .sw-rev { background: #FBBF24; border-color: #F59E0B; }
.pal-legend .sw-cur { background: var(--card); box-shadow: 0 0 0 2px var(--primary); }
.pal-counts { display: flex; justify-content: space-between; font-size: 12.5px; padding: var(--sp-2) 0; border-top: 1px solid var(--border); color: var(--text-muted); }

/* Result page */
.score-hero { text-align: center; padding: var(--sp-6) var(--sp-4); }
.ring-wrap { position: relative; width: 190px; height: 190px; margin: 0 auto var(--sp-4); }
.ring-wrap svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--border); stroke-width: 12; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1s ease-out; }
.ring-val {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 42px; line-height: 1.1;
}
.ring-val small { font-size: 13px; font-weight: 400; color: var(--text-muted); font-family: var(--font-body); }
.rank-line { font-size: 15px; color: var(--text-muted); }
.rank-line b { color: var(--primary); font-family: var(--font-mono); font-size: 18px; }
[data-theme="dark"] .rank-line b { color: #93C5FD; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--sp-3); }
.stat-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--sp-4) var(--sp-2); margin-bottom: 0; text-align: center; }
.st-icon { font-size: 20px; }
.st-label { font-size: 12.5px; color: var(--text-muted); }
.st-value { font-family: var(--font-mono); font-size: 24px; font-weight: 700; color: var(--text); }
.st-value.pos { color: var(--accent); }
.st-value.neg { color: var(--danger); }
.st-sub { font-size: 11.5px; color: var(--text-faint); }

.bar-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; }
.bar-name { font-size: 14px; }
.bar-track { background: var(--border); border-radius: 9999px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 9999px; transition: width .8s ease-out; }
.bar-fill.good { background: var(--accent); }
.bar-fill.mid { background: #F59E0B; }
.bar-fill.low { background: var(--danger); }
.bar-val { font-size: 12.5px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }

/* Review page */
.review-filters { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.review-filters .btn.active { background: var(--primary); color: #fff; }
.rv-card { border-right: 4px solid var(--border-strong); }
.rv-card.rv-correct { border-right-color: var(--accent); }
.rv-card.rv-wrong { border-right-color: var(--danger); }
.rv-card.rv-skip { border-right-color: #F59E0B; }
.rv-head { display: flex; gap: var(--sp-3); align-items: baseline; margin-bottom: var(--sp-2); }
.rv-mark { font-weight: 700; font-family: var(--font-mono); }
.rv-mark.ok { color: var(--accent); } .rv-mark.bad { color: var(--danger); } .rv-mark.skip { color: #D97706; }
.rv-answers { display: flex; flex-direction: column; gap: var(--sp-1); font-size: 14px; margin-bottom: var(--sp-2); }
.rv-a { display: flex; gap: var(--sp-2); align-items: baseline; }
.rv-a .lbl { color: var(--text-muted); flex: 0 0 auto; }
.rv-a.you-ok { color: var(--green-tx); font-weight: 600; }
.rv-a.you-bad { color: var(--red-tx); font-weight: 600; }
.rv-a.right { color: var(--green-tx); }

/* ── GK page ─────────────────────────────────────────────────── */
.gk-month { margin-bottom: var(--sp-6); }
.gk-month > h3 { font-size: 18px; border-bottom: 2px solid var(--primary); display: inline-block; padding-bottom: 4px; }
.gk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-3); }
.gk-topic {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); margin-bottom: 0;
  text-decoration: none !important; color: var(--text);
}
.gk-topic:hover { border-color: var(--primary); }
.gk-topic .g-icon { font-size: 26px; }
.gk-topic b { display: block; font-size: 15px; }
.gk-topic .g-count { font-size: 12.5px; color: var(--text-muted); }
.gk-topic .go { margin-right: auto; color: var(--text-faint); }

.gk-qa { list-style: none; padding: 0; margin: 0; }
.gk-qa li { padding: var(--sp-3) 0; border-bottom: 1px dashed var(--border); }
.gk-qa .gq { font-weight: 600; display: block; }
.gk-qa .ga { color: var(--accent); font-size: 14px; }
[data-theme="dark"] .gk-qa .ga { color: #86EFAC; }

/* ── Dashboard ───────────────────────────────────────────────── */
.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.welcome-row h1 { margin: 0; }
.welcome-row .date { color: var(--text-muted); font-size: 14px; }

.circ-update { display: flex; flex-direction: column; gap: 4px; padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-card); margin-bottom: var(--sp-2); background: var(--surface); }
.circ-update .cu-label { font-size: 13px; font-weight: 600; }
.circ-update .cu-org { font-size: 15px; font-weight: 600; }
.circ-update .cu-note { font-size: 12.5px; color: var(--text-muted); }
.circ-update .btn { align-self: flex-start; margin-top: var(--sp-1); }

.score-spark { display: flex; align-items: flex-end; gap: var(--sp-2); height: 110px; padding-top: var(--sp-2); }
.spark-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 3px; }
.spark-bar { background: var(--primary); border-radius: 3px 3px 0 0; min-height: 3px; opacity: .85; transition: height .5s; }
[data-theme="dark"] .spark-bar { background: #3B82F6; }
.spark-bar:last-child { background: var(--accent); opacity: 1; }
.spark-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); text-align: center; }

.quick-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* ── Tools ───────────────────────────────────────────────────── */
.tool-card { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: 0; height: 100%; }
.tool-card .tool-icon { font-size: 36px; line-height: 1; }
.tool-card h3 { margin: 0; }
.tool-card p { font-size: 13.5px; color: var(--text-muted); margin: 0; }
.tool-card .t-stat { font-family: var(--font-mono); font-size: 13px; color: var(--primary); font-weight: 600; }
[data-theme="dark"] .tool-card .t-stat { color: #93C5FD; }
.tool-card .btn { margin-top: auto; align-self: flex-start; }

/* Pomodoro */
.pomo-settings { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.pomo-settings label {
  display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted);
  background: var(--card); border: 1px solid var(--border); padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-card);
}
.pomo-settings input { width: 90px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-input); font-family: var(--font-mono); background: var(--surface); color: var(--text); }
.pomo-stage { text-align: center; }
.pomo-ring { position: relative; width: 260px; height: 260px; margin: 0 auto var(--sp-4); }
.pomo-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.pomo-ring .pr-track { fill: none; stroke: var(--border); stroke-width: 10; }
.pomo-ring .pr-fill { fill: none; stroke: var(--primary); stroke-width: 10; stroke-linecap: round; transition: stroke .3s; }
.pomo-ring.focus .pr-fill { stroke: var(--primary); }
.pomo-ring.short .pr-fill { stroke: var(--accent); }
.pomo-ring.long .pr-fill { stroke: var(--warning); }
.pomo-display {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.pomo-display .pd-time { font-family: var(--font-mono); font-size: 52px; font-weight: 700; letter-spacing: 2px; }
.pomo-display .pd-stage { color: var(--text-muted); font-size: 15px; }
.pomo-tomatoes { display: flex; justify-content: center; gap: var(--sp-2); font-size: 22px; margin-bottom: var(--sp-4); }
.pomo-tomatoes .t-empty { opacity: .25; filter: grayscale(1); }
.pomo-controls { display: flex; justify-content: center; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.pomo-task { display: flex; justify-content: center; margin-bottom: var(--sp-4); }
.pomo-task select { min-width: 260px; }
.pomo-sound { display: flex; align-items: center; justify-content: center; gap: var(--sp-5); color: var(--text-muted); font-size: 14px; margin-bottom: var(--sp-4); flex-wrap: wrap; }
.pomo-sound label { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
input[type="range"] { accent-color: var(--primary); }
.switch { position: relative; width: 40px; height: 22px; appearance: none; background: var(--border-strong); border-radius: 9999px; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: right .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { right: 21px; }

/* Tasks (kanban) */
.task-add { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.task-add input[type="text"] { flex: 1; min-width: 200px; padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-input); background: var(--card); color: var(--text); font-family: inherit; font-size: 14px; }
.task-add input:focus { border-color: var(--primary); outline: none; }
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.kanban-col h3 { font-size: 15px; display: flex; align-items: center; gap: var(--sp-2); }
.kanban-col h3 .k-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 9999px; padding: 1px 9px; }
.task-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: var(--sp-3); margin-bottom: var(--sp-2); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 4px; cursor: grab;
}
.task-item.dragging { opacity: .5; }
.task-item .ti-top { display: flex; align-items: flex-start; gap: var(--sp-2); }
.task-item .ti-check {
  width: 20px; height: 20px; flex: 0 0 auto; margin-top: 3px; accent-color: var(--accent); cursor: pointer;
}
.task-item .ti-title { font-size: 14px; font-weight: 500; line-height: 1.6; }
.task-item.done .ti-title { text-decoration: line-through; color: var(--text-faint); }
.task-item .ti-meta { display: flex; align-items: center; gap: var(--sp-3); font-size: 12px; color: var(--text-muted); }
.task-item .ti-meta .prio { font-weight: 700; }
.task-item .ti-meta .prio.p-red { color: var(--danger); }
.task-item .ti-meta .prio.p-amber { color: var(--warning); }
.task-item .ti-del { margin-right: auto; background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.task-item .ti-del:hover { color: var(--danger); background: var(--red-bg); }
.task-due { font-family: var(--font-mono); }
.task-empty { border: 2px dashed var(--border); border-radius: var(--radius-card); padding: var(--sp-4); text-align: center; color: var(--text-faint); font-size: 13px; }

/* Planner */
.planner-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.planner-head h2 { margin: 0; }
.planner-grid { display: grid; grid-template-columns: 70px repeat(7, 1fr); gap: 3px; overflow-x: auto; padding-bottom: var(--sp-2); }
.pl-corner { }
.pl-day { text-align: center; font-size: 12.5px; padding: var(--sp-1) 0; color: var(--text-muted); }
.pl-day b { display: block; color: var(--text); font-size: 13px; }
.pl-day.today b { color: var(--primary); text-decoration: underline; }
.pl-hour { font-size: 11.5px; color: var(--text-faint); text-align: left; padding: 3px 4px 0 0; font-family: var(--font-mono); }
.pl-cell {
  min-height: 44px; background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px; display: flex; flex-direction: column; gap: 2px; cursor: pointer;
}
.pl-cell:hover { border-color: var(--primary); }
.pl-cell.today-col { background: var(--primary-soft); }
.pl-block {
  font-size: 10.5px; line-height: 1.4; border-radius: 4px; padding: 2px 5px; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600;
}
.pl-block.b-bangla { background: #1A3C6E; }
.pl-block.b-english { background: #0E7490; }
.pl-block.b-math { background: #B45309; }
.pl-block.b-gk { background: #15803D; }
.pl-block.b-mock { background: #7E22CE; }
.pl-block.b-rest { background: var(--text-muted); }

/* ── Ad slots ────────────────────────────────────────────────── */
/* Subscribers see no ads — main.js sets html.ad-free. */
html.ad-free .ad-slot { display: none !important; }
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-card);
  background: repeating-linear-gradient(45deg, transparent, transparent 12px, var(--surface) 12px, var(--surface) 24px);
  margin: var(--sp-4) 0; flex-shrink: 0;
}
.ad-label { font-size: 12px; color: var(--text-faint); letter-spacing: 1px; }

/* Live AdSense unit: drop the placeholder dashed box, keep the label above. */
.ad-slot.ad-live {
  display: block;
  border: 0;
  background: none;
  text-align: center;
}
.ad-slot.ad-live .ad-label { display: block; margin-bottom: 4px; }
.ad-slot.ad-live .adsbygoogle { max-width: 100%; margin: 0 auto; }

/* ── Toast ───────────────────────────────────────────────────── */
.toast-stack { position: fixed; top: calc(var(--header-h) + var(--sp-3)); right: var(--sp-3); z-index: 300; display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none; }
.toast {
  background: #0F172A; color: #F1F5F9; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-card); box-shadow: var(--shadow-hover);
  display: flex; align-items: center; gap: var(--sp-2); font-size: 14px; max-width: 340px;
  animation: toast-in .25s ease-out; pointer-events: auto;
}
@keyframes toast-in { from { transform: translateX(30px); opacity: 0; } }
.toast.hide { transition: all .3s; opacity: 0; transform: translateX(30px); }
.toast.t-success::before { content: "✅"; }
.toast.t-error::before { content: "⚠️"; }

/* ── Empty / pagination / breadcrumb ─────────────────────────── */
.empty { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--text-muted); }
.empty-icon { font-size: 38px; display: block; margin-bottom: var(--sp-2); }

.pagination { display: flex; justify-content: center; align-items: center; gap: var(--sp-1); flex-wrap: wrap; margin: var(--sp-5) 0; }
.pg {
  min-width: 38px; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-btn);
  text-decoration: none !important; color: var(--text); font-family: var(--font-mono); font-size: 14px; text-align: center;
}
.pg:hover { border-color: var(--primary); color: var(--primary); }
.pg.current { background: var(--primary); border-color: var(--primary); color: #fff; cursor: default; }
.pg-gap { color: var(--text-faint); padding: 0 4px; }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: 13px; color: var(--text-muted); margin-bottom: var(--sp-4); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 600; }
.breadcrumb .sep { color: var(--text-faint); }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer { background: #0F172A; color: #94A3B8; padding: var(--sp-7) 0 0; margin-top: var(--sp-7); }
[data-theme="dark"] .site-footer { background: #0B1120; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 var(--sp-4); display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: var(--sp-5); }
.footer-col h4 { color: #F1F5F9; font-size: 15px; margin-bottom: var(--sp-3); }
.footer-col a { display: block; color: #94A3B8; font-size: 13.5px; padding: 4px 0; text-decoration: none !important; }
.footer-col a:hover { color: #fff; }
.footer-brand .logo { margin-bottom: var(--sp-3); }
.footer-brand p { font-size: 13.5px; line-height: 1.8; max-width: 300px; }
.socials { display: flex; gap: var(--sp-2); }
.socials a {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid #334155;
  display: inline-flex; align-items: center; justify-content: center; color: #94A3B8; font-size: 14px;
}
.socials a:hover { background: #1E293B; color: #fff; }
.store-btn {
  display: inline-flex !important; align-items: center; gap: var(--sp-2); padding: 8px 16px !important;
  border: 1px solid #334155; border-radius: var(--radius-btn); margin-bottom: var(--sp-2) !important; font-size: 13px;
}
.store-btn:hover { background: #1E293B; }
.footer-bottom {
  max-width: 1280px; margin: var(--sp-6) auto 0; padding: var(--sp-4); border-top: 1px solid #1E293B;
  display: flex; justify-content: space-between; gap: var(--sp-3); font-size: 12.5px; flex-wrap: wrap;
}
.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-weight: 700;
  color: #CBD5E1;
}

.footer-links a {
  display: inline-flex !important;
  align-items: center;
  padding: 4px 7px !important;
  color: #F1F5F9 !important;
  font-size: 13px;
  font-weight: 700 !important;
  border-radius: 6px;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}

.footer-links a:hover {
  background: #1E293B;
  color: #fff !important;
  text-decoration: underline !important;
}

/* ── Bottom tab bar (mobile) ─────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90; display: none;
  background: var(--card); border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,.08); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 0 6px; color: var(--text-muted); font-size: 11px; text-decoration: none !important;
}
.bottom-nav a.active { color: var(--primary); font-weight: 600; }
[data-theme="dark"] .bottom-nav a.active { color: #93C5FD; }
.bn-icon { font-size: 19px; line-height: 1; }

/* ── App CTA band ────────────────────────────────────────────── */
.app-cta {
  background: linear-gradient(120deg, #0F172A, #1E3A5F); color: #fff;
  border-radius: var(--radius-card); padding: var(--sp-6) var(--sp-4); text-align: center; margin-top: var(--sp-5);
}
.app-cta h2 { color: #fff; }
.app-cta p { color: rgba(255,255,255,.7); }
.app-cta .stores { display: flex; justify-content: center; gap: var(--sp-3); flex-wrap: wrap; }
.app-cta .store-btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.app-cta .store-btn:hover { background: rgba(255,255,255,.2); }

/* ── Info pages (About / Contact / Privacy) ─────────────────── */
.info-hero {
  background: linear-gradient(120deg, var(--primary), #2A5490);
  color: #fff;
  border-radius: var(--radius-card);
  padding: var(--sp-6) var(--sp-5);
  margin-bottom: var(--sp-5);
}
.info-hero h1 {
  color: #fff;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.35;
  margin: 12px 0;
  max-width: 900px;
}
.info-hero p {
  color: rgba(255,255,255,.8);
  line-height: 1.95;
  max-width: 800px;
  margin: 0;
  font-size: 14.5px;
}
.info-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.info-card { margin-bottom: 0; }
.info-card .info-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 13px;
  background: var(--primary-soft);
  font-size: 22px;
  margin-bottom: var(--sp-3);
}
.info-card h3 { margin: 0 0 7px; font-size: 16px; }
.info-card p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.85; }

.info-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--primary-soft), transparent 72%);
}
.info-highlight h2 { margin: 0 0 7px; font-size: 19px; }
.info-highlight p { margin: 0; color: var(--text-muted); line-height: 1.9; max-width: 700px; font-size: 14px; }
.info-highlight .btn { flex: 0 0 auto; }

.contact-layout {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.contact-card { margin-bottom: 0; }
.contact-card h2 { margin: 0 0 8px; font-size: 18px; }
.contact-card p { color: var(--text-muted); line-height: 1.9; font-size: 14px; }
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  color: var(--primary);
  font-size: clamp(18px, 2.5vw, 25px);
  font-weight: 700;
  text-decoration: none;
  word-break: break-all;
}
.contact-email:hover { text-decoration: underline; }
.contact-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
  line-height: 2;
  font-size: 14px;
}

.contact-form-card {
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}

.contact-form-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: var(--sp-4);
}

.contact-form-icon {
  width: 48px; height: 48px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--primary-soft);
  font-size: 23px;
}

.contact-form-head h2 { margin: 0 0 4px; font-size: 20px; }
.contact-form-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.contact-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-1);
}

.contact-form-actions span {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.contact-success {
  margin: 0 0 var(--sp-3);
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid rgba(34, 160, 92, 0.35);
  background: rgba(34, 160, 92, 0.10);
  color: #15803D;
  font-size: 13.5px;
  line-height: 1.7;
}

[data-theme="dark"] .contact-success { color: #86EFAC; }

@media (max-width: 640px) {
  .contact-form-card { padding: var(--sp-4); }
  .contact-form-grid { grid-template-columns: 1fr; gap: 0; }
  .contact-form-actions .btn { width: 100%; }
}

.privacy-wrap { max-width: 880px; margin: 0 auto; }
.privacy-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--sp-3); }
.privacy-meta span {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
}
.privacy-card { padding: var(--sp-5); }
.privacy-card h2 { font-size: 17px; margin: var(--sp-5) 0 var(--sp-2); }
.privacy-card h2:first-child { margin-top: 0; }
.privacy-card p, .privacy-card li { color: var(--text-muted); font-size: 14.5px; line-height: 1.95; }
.privacy-card ul { padding-left: 20px; margin: var(--sp-2) 0; }
.privacy-card a { color: var(--primary); font-weight: 600; }

@media (max-width: 760px) {
  .info-hero { padding: var(--sp-5) var(--sp-4); }
  .info-highlight { align-items: flex-start; }
  .contact-layout { grid-template-columns: 1fr; }
  .privacy-card { padding: var(--sp-4); }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .layout-2, .layout-3-2 { grid-template-columns: 1fr; }
  .layout-side { grid-template-columns: 1fr; }
  .layout-filters { grid-template-columns: 1fr; }
  .side-sticky { position: static; }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
  .filters { order: 2; }
  .exam-body { grid-template-columns: 1fr; }
  .palette-card { position: static; }
  .kanban { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  :root { --header-h: 56px; }
  .main-nav, .btn-login, .hamburger { display: none; }
  body { padding-bottom: var(--bottomnav-h); }
  .bottom-nav { display: flex; }
  .page { padding: var(--sp-4) var(--sp-3) var(--sp-7); }
  h1 { font-size: 22px; }
  .hero { padding: var(--sp-4) var(--sp-3); }
  .hero form { flex-direction: column; }
  .hero .btn { width: 100%; }
  .grid-cards { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
  .track-card { padding: var(--sp-3); }
  .track-card .t-icon { font-size: 26px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .circ-grid { grid-template-columns: 1fr; }
  .exam-topbar { gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); }
  .exam-topbar .et-title { font-size: 13px; }
  .exam-timer { font-size: 16px; margin-right: 0; }
  .exam-nav .btn { flex: 1; }
  .kanban { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: var(--sp-4); }
  .footer-bottom { justify-content: center; text-align: center; }
  .footer-links { justify-content: center; gap: 2px; }
  .toast-stack { right: var(--sp-2); left: var(--sp-2); }
  .toast { max-width: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .cc-actions { flex-direction: column; align-items: stretch; }
  .cc-actions .btn { width: 100%; }
  .kanban-col { margin-bottom: var(--sp-5); }
  .planner-grid { grid-template-columns: 70px repeat(2, 1fr); }
  .pl-day:nth-child(n+9) { display: none; }
  .pl-cell:nth-child(n+16) { display: none; }
  .ring-wrap { width: 160px; height: 160px; }
  .ring-val { font-size: 34px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid-cards { grid-template-columns: repeat(3, 1fr); }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
}

@media print {
  .site-header, .site-footer, .bottom-nav, .ad-slot, .quick-links, .cc-actions { display: none !important; }
  body { background: #fff; }
}

/* ── Auth pages (login / register) ──────────────────────────── */
.auth-wrap { max-width: 460px; margin: 0 auto; }
.auth-card h1 { font-size: 24px; margin: 0 0 var(--sp-2); }
.auth-field { display: grid; gap: 6px; margin-bottom: var(--sp-3); font-size: 14px; font-weight: 600; }
.auth-field input, .auth-field select, .auth-field textarea {
  padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-btn);
  background: var(--card); color: var(--text); font-family: inherit; font-size: 15px;
}
.auth-field textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.auth-field input:focus, .auth-field select:focus, .auth-field textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.auth-error {
  margin: 0 0 var(--sp-3); padding: 10px 12px; border-radius: 8px; font-size: 13.5px;
  background: rgba(226, 76, 76, 0.12); border: 1px solid #e24c4c; color: #e24c4c;
}
.auth-card a { color: var(--primary); font-weight: 600; }

/* Account deletion request */
.del-warning {
  padding: 13px 15px;
  margin: 0 0 var(--sp-4);
  border: 1px solid rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.07);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.8;
}

.del-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 var(--sp-4);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-muted);
  cursor: pointer;
}

.del-confirm input {
  width: 17px; height: 17px;
  flex: 0 0 auto;
  margin-top: 3px;
  accent-color: var(--danger);
  cursor: pointer;
}

.del-status-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.del-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
}

.del-meta-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.del-meta-item span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.del-meta-item b { font-size: 14px; }
