/* ==========================================================================
   Student OS design system
   Calm, readable, premium. Light + dark themes via tokens.
   ========================================================================== */

:root {
  --font: "Segoe UI", "Noto Sans", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-arabic: "Segoe UI", "Noto Sans Arabic", "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", Tahoma, system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e7eaef;
  --border: #e2e5ea;
  --border-strong: #cfd4dc;
  --text: #141925;
  --text-2: #4d5566;
  --text-3: #6b7383;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --on-primary: #ffffff;
  --success: #15803d;
  --success-soft: #e8f6ed;
  --warning: #b45309;
  --warning-soft: #fdf3e3;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --info: #0369a1;
  --info-soft: #e6f2fa;
  --violet: #6d28d9;
  --violet-soft: #f1ebff;
  --focus: 0 0 0 3px rgba(79, 70, 229, .35);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --grid-line: #eceef2;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0d1017;
  --surface: #151a23;
  --surface-2: #1b212c;
  --surface-3: #252c39;
  --border: #262d3a;
  --border-strong: #353e4e;
  --text: #e7eaf0;
  --text-2: #aab2c0;
  --text-3: #8a93a3;
  --primary: #8b93ff;
  --primary-hover: #a2a8ff;
  --primary-soft: #232651;
  --on-primary: #0d1017;
  --success: #4ade80;
  --success-soft: #11291b;
  --warning: #fbbf24;
  --warning-soft: #2e2410;
  --danger: #f87171;
  --danger-soft: #331617;
  --info: #38bdf8;
  --info-soft: #0f2533;
  --violet: #b794ff;
  --violet-soft: #251c3d;
  --focus: 0 0 0 3px rgba(139, 147, 255, .45);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  --grid-line: #1f2530;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #0d1017;
    --surface: #151a23;
    --surface-2: #1b212c;
    --surface-3: #252c39;
    --border: #262d3a;
    --border-strong: #353e4e;
    --text: #e7eaf0;
    --text-2: #aab2c0;
    --text-3: #8a93a3;
    --primary: #8b93ff;
    --primary-hover: #a2a8ff;
    --primary-soft: #232651;
    --on-primary: #0d1017;
    --success: #4ade80;
    --success-soft: #11291b;
    --warning: #fbbf24;
    --warning-soft: #2e2410;
    --danger: #f87171;
    --danger-soft: #331617;
    --info: #38bdf8;
    --info-soft: #0f2533;
    --violet: #b794ff;
    --violet-soft: #251c3d;
    --focus: 0 0 0 3px rgba(139, 147, 255, .45);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    --grid-line: #1f2530;
    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
h4 { font-size: .9rem; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { inset-inline-start: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--primary)); display: inline-block; flex-shrink: 0; }
.color-bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c, var(--primary)); flex-shrink: 0; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w);
  background: var(--surface); border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 12px; z-index: 40; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.btn-icon.sidebar-close { display: none; }
.semester-chip { display: flex; align-items: center; gap: 8px; margin: 0 8px 12px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .8rem; font-weight: 550; }
.semester-chip .dot { background: var(--success); }
.semester-chip:hover { text-decoration: none; background: var(--surface-3); }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 520; font-size: .92rem; }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary-soft); color: var(--primary); }
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px 2px 8px; }
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-meta strong { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--text-3); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex-shrink: 0; }
.nav-backdrop { display: none; }

.main-wrap { margin-inline-start: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.btn-icon.menu-toggle { display: none; }
.page-title { font-size: 1.2rem; font-weight: 680; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
/* "Install the app": shown in the browser until the app is installed (app.js menuInstall). */
.topbar-install { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; margin-inline-end: 4px; border: 0; border-radius: 999px; font: inherit; font-size: .8rem; font-weight: 700; color: #fff; cursor: pointer; white-space: nowrap;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .7); transition: transform .15s, box-shadow .15s; }
.topbar-install[hidden] { display: none; }
.topbar-install:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -8px rgba(99, 102, 241, .8); }
.topbar-install .icon { width: 16px; height: 16px; animation: topbar-install-nudge 2.6s ease-in-out infinite; }
.topbar-install::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 2px solid rgba(139, 92, 246, .55); opacity: 0; animation: topbar-install-ring 2.6s ease-out infinite; pointer-events: none; }
@keyframes topbar-install-nudge { 0%, 60%, 100% { transform: translateY(0); } 70% { transform: translateY(2px); } 80% { transform: translateY(-1px); } }
@keyframes topbar-install-ring { 0%, 55% { opacity: 0; transform: scale(.96); } 65% { opacity: 1; } 100% { opacity: 0; transform: scale(1.18); } }
@media (max-width: 560px) { .topbar-install { width: 36px; padding: 0; justify-content: center; margin-inline-end: 2px; } .topbar-install span { display: none; } }
.topbar-install.hint { animation: topbar-install-pop .6s cubic-bezier(.3, 1.6, .5, 1) 2, topbar-install-glow 1.4s ease-in-out infinite; }
.topbar-install.hint .icon { animation: topbar-install-bounce .7s ease-in-out infinite; }
@keyframes topbar-install-pop { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.18) rotate(-4deg); } 70% { transform: scale(.96) rotate(3deg); } }
@keyframes topbar-install-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, .6), 0 6px 16px -6px rgba(99, 102, 241, .7); } 50% { box-shadow: 0 0 0 9px rgba(139, 92, 246, 0), 0 8px 22px -6px rgba(139, 92, 246, .9); } }
@keyframes topbar-install-bounce { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(3px); } }

/* the one-time pointer under it (app.js) */
.install-hint { position: fixed; z-index: 130; display: flex; align-items: center; gap: 10px; max-width: min(300px, calc(100vw - 24px)); padding: 12px 14px; border: 0; border-radius: 16px; font: inherit; text-align: start; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 18px 40px -12px rgba(49, 36, 140, .6);
  opacity: 0; transform: translateY(-10px) scale(.9); transform-origin: var(--ax) 0; transition: opacity .3s, transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.install-hint.show { opacity: 1; transform: none; }
.install-hint::before { content: ""; position: absolute; top: -7px; left: calc(var(--ax) - 8px); width: 16px; height: 16px; border-radius: 3px; background: #5b45e8; transform: rotate(45deg); }
.install-hint b { display: block; font-size: .88rem; }
.install-hint small { display: block; font-size: .75rem; opacity: .85; line-height: 1.45; margin-top: 2px; }
.install-hint-hand { font-size: 1.5rem; line-height: 1; animation: install-hint-hand 1s ease-in-out infinite; }
@keyframes install-hint-hand { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .topbar-install .icon, .topbar-install::after, .topbar-install.hint, .topbar-install.hint .icon, .install-hint-hand { animation: none; } .install-hint { transition: opacity .2s; } }
.main { padding: 8px 28px 48px; max-width: 1360px; width: 100%; margin-inline: auto; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--text-3); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.span-2 { grid-column: span 2; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.bottom-nav { display: none; }

/* --------------------------------------------------------------------------
   Components
   -------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; min-width: 0; }
.card-flush { padding: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.card-head .eyebrow { margin: 0; }
.card-link { font-size: .82rem; font-weight: 550; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; color: var(--text-3); margin-bottom: 6px; }
.card-accent { border-inline-start: 4px solid var(--c, var(--primary)); }
.card.clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.card.clickable:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 560; font-size: .9rem; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
html[data-theme="dark"] .btn-success { color: #0d1017; }
.btn-sm { height: 32px; padding: 0 10px; font-size: .84rem; gap: 6px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-2); position: relative; }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-icon.sm { width: 30px; height: 30px; }
.link-btn { border: 0; background: none; color: var(--primary); font-weight: 550; font-size: .82rem; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.btn-group { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.btn-group button { border: 0; background: transparent; padding: 0 12px; height: 34px; font-size: .85rem; font-weight: 550; color: var(--text-2); }
.btn-group button + button { border-inline-start: 1px solid var(--border); }
.btn-group button.active { background: var(--primary-soft); color: var(--primary); }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-course { background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--text)); }

.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--primary)); width: var(--v, 0%); transition: width .4s ease; }
.progress.sm { height: 5px; }
.row > .progress, .list-item > .progress, .topic-row > .progress { width: 72px; flex-shrink: 0; }
.progress.lg { height: 12px; }
.ring { --size: 64px; --v: 0; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c, var(--primary)) calc(var(--v) * 1%), var(--surface-3) 0); flex-shrink: 0; }
.ring::before { content: ""; grid-area: 1 / 1; width: calc(var(--size) - 12px); height: calc(var(--size) - 12px); border-radius: 50%; background: var(--surface); }
.ring > span { grid-area: 1 / 1; font-weight: 700; font-size: .85rem; z-index: 1; font-variant-numeric: tabular-nums; }
.ring.lg { --size: 96px; }
.ring.lg > span { font-size: 1.2rem; }

.mastery-weak { --c: var(--danger); }
.mastery-medium { --c: var(--warning); }
.mastery-strong { --c: var(--success); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--text-3); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item:last-child { padding-bottom: 0; }
.list-item .meta { font-size: .8rem; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.list-item .title { font-weight: 560; font-size: .92rem; }
.list-item.done .title { text-decoration: line-through; color: var(--text-3); }
.time-col { width: 58px; flex-shrink: 0; font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--text-2); font-weight: 600; }

.check { appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; flex-shrink: 0; cursor: pointer; margin: 0; }
.check:checked { background: var(--success); border-color: var(--success); }
.check:checked::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: .76rem; color: var(--text-3); }
.field .error { font-size: .78rem; color: var(--danger); }
.input, .select, .textarea, input[type="text"].input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: .92rem; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-inline-end: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input-sm { height: 34px; font-size: .85rem; }
input[type="color"].input { padding: 4px; width: 56px; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.checkbox-row { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.search-input { position: relative; }
.search-input .icon { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-input .input { padding-inline-start: 36px; }
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.day-picker label { display: inline-flex; }
.day-picker input { position: absolute; opacity: 0; pointer-events: none; }
.day-picker span { display: inline-grid; place-items: center; min-width: 44px; height: 34px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--text-2); }
.day-picker input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.day-picker input:focus-visible + span { box-shadow: var(--focus); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 560; font-size: .9rem; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tab .badge { margin-inline-start: 6px; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: none; }
.dropdown-menu.open { display: block; }
.dropdown-menu > button, .dropdown-menu > a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font-size: .88rem; color: var(--text); text-align: start; }
.dropdown-menu > button:hover, .dropdown-menu > a:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu .icon { color: var(--text-3); }

/* Notifications */
.notif-btn .notif-count { position: absolute; top: 3px; inset-inline-end: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; }
.notif-menu { width: 360px; max-width: calc(100vw - 24px); padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--primary-soft); }
.notif-item .icon-wrap { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; }
.notif-item strong { font-size: .86rem; display: block; }
.notif-item p { margin: 2px 0 0; font-size: .8rem; color: var(--text-3); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 11, 18, .5); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .12s ease; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; border: 1px solid var(--border); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 1.05rem; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-foot .left { margin-inline-end: auto; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Toasts */
.toasts { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 40px); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--text); color: var(--bg); padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .88rem; min-width: 260px; max-width: 420px; animation: slide-up .18s ease; }
.toast.error { background: var(--danger); color: #fff; }
.toast .icon { margin-top: 1px; }
.toast button { margin-inline-start: auto; background: none; border: 0; color: inherit; font-weight: 650; padding: 6px 10px; margin-block: -6px; min-height: 36px; min-width: 44px; border-radius: 6px; cursor: pointer; }
.toast button:hover, .toast button:focus-visible { background: color-mix(in srgb, var(--bg) 18%, transparent); }
.toast { align-items: center; }
.toast .toast-link { padding: 6px 8px; margin-block: -6px; min-height: 36px; display: inline-flex; align-items: center; }
@keyframes slide-up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Empty + loading */
.empty { text-align: center; padding: 32px 16px; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .empty-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 4px; }
.empty h3 { color: var(--text); font-size: .98rem; }
.empty p { margin: 0 0 6px; max-width: 360px; font-size: .88rem; }
.empty.compact { padding: 14px 8px; }
.skeleton, .skeleton-line { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
.skeleton-line { height: 14px; margin: 10px 0; }
.skeleton-line:nth-child(2n) { width: 70%; }
.skeleton-card { height: 120px; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Alerts */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--info); font-size: .88rem; align-items: flex-start; }
.alert.warning { background: var(--warning-soft); color: var(--warning); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert.success { background: var(--success-soft); color: var(--success); }
.alert .icon { margin-top: 2px; }
.alert p { margin: 0; color: inherit; }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: start; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------------------
   Dashboard / My Day
   -------------------------------------------------------------------------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 8px 0 20px; }
.hero h2 { font-size: 1.6rem; font-weight: 720; letter-spacing: -.025em; }
.hero p { margin: 4px 0 0; color: var(--text-3); }
.semester-progress { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; min-width: 260px; }
.semester-progress .grow { display: flex; flex-direction: column; gap: 6px; }
.focus-card { background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, #0ea5e9) 100%); color: var(--on-primary); border: 0; }
.focus-card .eyebrow, .focus-card .muted { color: color-mix(in srgb, var(--on-primary) 75%, transparent); }
.focus-card h3 { font-size: 1.3rem; font-weight: 700; margin: 2px 0 6px; }
.focus-card .btn { background: var(--on-primary); color: var(--primary); border-color: transparent; }
.focus-card .btn.btn-ghost { background: color-mix(in srgb, var(--on-primary) 15%, transparent); color: var(--on-primary); }
.next-class { display: flex; gap: 14px; align-items: center; }
.next-class .time-block { text-align: center; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--c) 12%, transparent); color: color-mix(in srgb, var(--c) 85%, var(--text)); min-width: 72px; }
.next-class .time-block strong { display: block; font-size: 1.15rem; }
.behind-list { display: flex; flex-wrap: wrap; gap: 8px; }
.behind-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: .85rem; color: var(--text-2); }
.behind-pill strong { font-size: 1rem; color: var(--text); }
.behind-pill.warn strong { color: var(--danger); }
.course-progress-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 42px; gap: 12px; align-items: center; padding: 8px 0; }
.exam-countdown { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, transparent); color: color-mix(in srgb, var(--c) 85%, var(--text)); flex-shrink: 0; }
.exam-countdown strong { font-size: 1.15rem; line-height: 1; }
.exam-countdown small { font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; }

.session-card { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); align-items: center; }
.session-card + .session-card { margin-top: 8px; }
.session-card.status-completed { opacity: .72; }
.session-card.status-missed { border-style: dashed; }
.session-card.running { border-color: var(--primary); box-shadow: var(--focus); }
.session-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.timer-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 24px 16px; }
.timer-display { font-size: 3.2rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.timer-panel .row { justify-content: center; flex-wrap: wrap; }
.rating-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rating-row button { padding: 10px 6px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: .85rem; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.rating-row button small { font-weight: 500; color: var(--text-3); font-size: .72rem; }
.rating-row button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.rating-row button.again:hover { border-color: var(--danger); }
.rating-row button.easy:hover { border-color: var(--success); }
/* "No rating" is a real state of the completion dialog: visibly chosen when nothing else is. */
[data-rating-skip][aria-pressed="true"] { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

/* --------------------------------------------------------------------------
   Courses
   -------------------------------------------------------------------------- */
.course-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px; overflow: hidden; color: var(--text); }
.course-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.course-card:hover { text-decoration: none; }
.course-card h3 { font-size: 1.05rem; }
.course-card .code { font-size: .78rem; color: var(--text-3); font-weight: 600; letter-spacing: .03em; }
.course-card .metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.course-card .metrics div { background: var(--surface-2); border-radius: 8px; padding: 8px; }
.course-card .metrics strong { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; }
.course-card .metrics span { font-size: .72rem; color: var(--text-3); }
.course-header { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 20px; margin-bottom: 18px; border-top: 4px solid var(--c); }
.course-header h2 { font-size: 1.4rem; }
.course-header > .grow { min-width: 240px; }

.topic-tree { list-style: none; margin: 0; padding: 0; }
.topic-tree ul { list-style: none; margin: 0; padding-inline-start: 22px; border-inline-start: 1px dashed var(--border-strong); margin-inline-start: 9px; }
.topic-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 8px; }
.topic-row:hover { background: var(--surface-2); }
.topic-row .name { font-weight: 550; font-size: .92rem; }
.topic-row .progress { width: 90px; }
.topic-row .actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.topic-row:hover .actions, .topic-row:focus-within .actions { opacity: 1; }
.strength-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--text-3); }

.att-buttons { display: inline-flex; gap: 4px; }
.att-buttons button { border: 1px solid var(--border); background: var(--surface); height: 30px; min-width: 34px; padding: 0 8px; border-radius: 7px; font-size: .75rem; font-weight: 650; color: var(--text-3); }
.att-buttons button[aria-pressed="true"].present { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.att-buttons button[aria-pressed="true"].late { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }
.att-buttons button[aria-pressed="true"].absent { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.att-buttons button[aria-pressed="true"].excused { background: var(--info-soft); color: var(--info); border-color: var(--info); }

/* --------------------------------------------------------------------------
   Tasks
   -------------------------------------------------------------------------- */
.task-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: 0; }
/* The row a link asked for (search, a notification): found, not selected — S7.14. */
.is-found { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--primary-soft); }
.task-row .title { font-weight: 580; }
.task-row.completed .title { text-decoration: line-through; color: var(--text-3); }
.task-row .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: .8rem; color: var(--text-3); }
.subtasks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.subtasks li { display: flex; align-items: center; gap: 8px; font-size: .86rem; }
.subtasks li.done span { text-decoration: line-through; color: var(--text-3); }
.subtasks .check { width: 16px; height: 16px; border-radius: 4px; }
.subtasks .check:checked::after { width: 4px; height: 8px; }
.priority-critical { color: var(--danger); }
.priority-high { color: var(--warning); }

/* --------------------------------------------------------------------------
   Calendar
   -------------------------------------------------------------------------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-toolbar h2 { font-size: 1.15rem; min-width: 190px; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--text-3); margin-inline-start: auto; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-month .dow { padding: 8px; font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); border-bottom: 1px solid var(--border); text-align: start; }
.cal-day { min-height: 118px; border-inline-end: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; }
.cal-day:nth-child(7n) { border-inline-end: 0; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .num-label { color: var(--text-3); }
.cal-day.drop-target { background: var(--primary-soft); }
.cal-day .num-label { font-size: .8rem; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .num-label { background: var(--primary); color: var(--on-primary); }
.cal-chip { display: flex; align-items: center; gap: 5px; font-size: .74rem; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; border-inline-start: 3px solid var(--c); cursor: pointer; text-align: start; width: 100%; }
.cal-chip.draggable { cursor: grab; touch-action: none; }
.cal-chip.t-exam { font-weight: 700; }
.cal-chip.t-review { --c: var(--violet); }
.cal-chip.s-completed, .cal-event.s-completed, .cal-chip.s-held, .cal-event.s-held { opacity: .6; }
.cal-chip.s-missed, .cal-event.s-missed, .cal-chip.s-cancelled, .cal-event.s-cancelled { opacity: .5; text-decoration: line-through; }
.cal-more { font-size: .72rem; color: var(--text-3); padding-inline-start: 4px; border: 0; background: none; text-align: start; }

.cal-week { display: grid; grid-template-columns: 56px repeat(var(--days, 7), minmax(0, 1fr)); }
.cal-week-head { position: relative; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); }
.cal-week-head .cell { padding: 8px 6px; text-align: center; font-size: .78rem; color: var(--text-3); border-inline-start: 1px solid var(--grid-line); }
.cal-week-head .cell strong { display: block; font-size: 1.05rem; color: var(--text); }
.cal-week-head .cell.today strong { color: var(--primary); }
.cal-allday { display: grid; grid-template-columns: 56px repeat(var(--days, 7), minmax(0, 1fr)); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-allday .cell { padding: 4px; border-inline-start: 1px solid var(--grid-line); display: flex; flex-direction: column; gap: 2px; min-height: 28px; min-width: 0; }
.cal-allday .label { font-size: .68rem; color: var(--text-3); padding: 6px 4px; }
.cal-scroll { max-height: calc(100vh - 250px); overflow-y: auto; position: relative; }
.cal-hours { position: relative; }
.cal-hour { height: 48px; font-size: .7rem; color: var(--text-3); text-align: end; padding-inline-end: 8px; transform: translateY(-7px); }
.cal-col { position: relative; border-inline-start: 1px solid var(--grid-line); background-image: repeating-linear-gradient(to bottom, var(--grid-line) 0, var(--grid-line) 1px, transparent 1px, transparent 48px); }
.cal-col.today { background-color: color-mix(in srgb, var(--primary) 4%, transparent); }
.cal-col.drop-target { background-color: var(--primary-soft); }
.cal-event { position: absolute; inset-inline: 3px; border-radius: 6px; padding: 3px 6px; font-size: .74rem; overflow: hidden; cursor: pointer; background: color-mix(in srgb, var(--c) 16%, var(--surface)); border: 0; border-inline-start: 3px solid var(--c); color: color-mix(in srgb, var(--c) 70%, var(--text)); line-height: 1.3; text-align: start; }
.cal-event strong { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event.t-session { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 16%, var(--surface)) 0 8px, color-mix(in srgb, var(--c) 10%, var(--surface)) 8px 16px); }
.cal-event.t-exam { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); border-inline-start-color: var(--danger); color: var(--danger); }
.cal-event.t-task { border-inline-start-style: dotted; }
.cal-event.draggable { cursor: grab; touch-action: none; }
.cal-event.dragging { opacity: .85; box-shadow: var(--shadow-lg); z-index: 20; cursor: grabbing; }
.now-line { position: absolute; inset-inline: 0; height: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; inset-inline-start: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* --------------------------------------------------------------------------
   Mind map
   -------------------------------------------------------------------------- */
.mm-page .main { max-width: none; padding-bottom: 0; }
.mm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; height: calc(100vh - var(--topbar-h) - 20px); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.mm-layout.panel-closed { grid-template-columns: minmax(0, 1fr) 0; }
.mm-stage { position: relative; overflow: hidden; background-color: var(--bg); background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); background-size: 24px 24px; touch-action: none; }
#mm-svg { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.mm-toolbar { position: absolute; top: 12px; inset-inline: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; z-index: 5; pointer-events: none; }
.mm-toolbar > * { pointer-events: auto; }
.mm-toolbar .group { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; box-shadow: var(--shadow); }
.mm-toolbar .btn-icon.active { background: var(--primary-soft); color: var(--primary); }
.mm-title-input { height: 36px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 0 12px; font-weight: 650; min-width: 180px; max-width: 320px; box-shadow: var(--shadow); }
.mm-status { font-size: .76rem; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.mm-hint { position: absolute; bottom: 12px; inset-inline-start: 12px; font-size: .76rem; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; z-index: 5; max-width: calc(100% - 24px); }
.mm-node { cursor: pointer; }
.mm-node .body { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.mm-node.selected .body { stroke: var(--primary); stroke-width: 2.5; }
.mm-node.connect-source .body { stroke: var(--warning); stroke-width: 2.5; stroke-dasharray: 5 3; }
.mm-node text { fill: var(--text); font-size: 13px; font-weight: 560; pointer-events: none; font-family: var(--font); }
.mm-node text.type { fill: var(--text-3); font-size: 9.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.mm-node rect.accent { stroke: none; }
.mm-node .linked { fill: var(--primary); }
.mm-node .mastery-bg { fill: var(--surface-3); }
.mm-edge { stroke: var(--border-strong); stroke-width: 2; fill: none; }
.mm-edge.selected { stroke: var(--primary); stroke-width: 3; }
.mm-edge-hit { stroke: transparent; stroke-width: 14; fill: none; cursor: pointer; }
.mm-edge-label { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.mm-panel { border-inline-start: 1px solid var(--border); overflow-y: auto; padding: 16px; background: var(--surface); }
.mm-layout.panel-closed .mm-panel { display: none; }
.mm-panel section { padding: 12px 0; border-top: 1px solid var(--border); }
.mm-panel section:first-of-type { border-top: 0; padding-top: 0; }
.mm-panel h4 { margin-bottom: 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.type-concept { --c: #64748b; } .type-topic { --c: #4f46e5; } .type-lecture { --c: #0284c7; } .type-question { --c: #d97706; }
.type-task { --c: #0d9488; } .type-resource { --c: #16a34a; } .type-exam { --c: #dc2626; } .type-review { --c: #7c3aed; }

/* --------------------------------------------------------------------------
   Flashcards & notes
   -------------------------------------------------------------------------- */
.flip-card { perspective: 1200px; max-width: 640px; margin: 0 auto; width: 100%; }
.flip-inner { position: relative; min-height: 280px; transition: transform .45s ease; transform-style: preserve-3d; }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; font-size: 1.2rem; font-weight: 560; white-space: pre-wrap; overflow-y: auto; }
.flip-face.back { transform: rotateY(180deg); }
.flip-face .eyebrow { position: absolute; top: 16px; inset-inline-start: 20px; }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } * { animation: none !important; } }
.review-shell { max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.note-content { white-space: pre-wrap; font-size: .95rem; line-height: 1.65; overflow-wrap: anywhere; }
.note-card { display: flex; flex-direction: column; gap: 8px; }
.note-card .excerpt { color: var(--text-2); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.tag { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 0; }
button.tag.active { background: var(--primary); color: var(--on-primary); }
.notes-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.note-list-item { display: block; width: 100%; text-align: start; border: 0; background: none; padding: 12px; border-radius: 10px; border-bottom: 1px solid var(--border); }
.note-list-item:hover { background: var(--surface-2); }
.note-list-item.active { background: var(--primary-soft); }
.note-editor .title-input { font-size: 1.3rem; font-weight: 680; border: 0; background: none; width: 100%; padding: 4px 0; }
.note-editor .title-input:focus { outline: none; box-shadow: none; }
.note-editor .body-input { width: 100%; min-height: 420px; border: 0; background: none; resize: vertical; font-size: .95rem; line-height: 1.65; padding: 0; }
.note-editor .body-input:focus { outline: none; box-shadow: none; }

/* Onboarding + auth */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, var(--primary-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 32px; }
.auth-card h1 { font-size: 1.5rem; margin: 18px 0 6px; }
.auth-card .form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.btn-google { margin-top: 18px; gap: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.btn-google:hover { background: var(--surface-2); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; color: var(--text-3); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-error { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: .88rem; }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; gap: 8px; }
.btn-whatsapp:hover { background: #1ebe5b; border-color: #1ebe5b; color: #fff; text-decoration: none; }
.auth-foot { margin-top: 18px; text-align: center; font-size: .9rem; color: var(--text-3); }
.demo-hint { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .82rem; color: var(--text-2); }
.onboarding { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.steps { display: flex; gap: 6px; margin: 18px 0 24px; }
.steps span { flex: 1; height: 5px; border-radius: 999px; background: var(--surface-3); }
.steps span.done { background: var(--primary); }
.avail-grid { display: grid; gap: 8px; }
.avail-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.avail-blocks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.avail-block { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 8px; padding: 3px 4px 3px 6px; }
.avail-block input { height: 30px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: 0 4px; font-size: .82rem; }

/* Charts */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-chart .bar span.fill { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--c, var(--primary)); min-height: 2px; }
.bar-chart .bar small { font-size: .66rem; color: var(--text-3); white-space: nowrap; }
.load-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.load-day { border-radius: 8px; padding: 6px 4px; text-align: center; background: var(--surface-2); font-size: .7rem; color: var(--text-3); }
.load-day strong { display: block; font-size: .82rem; color: var(--text); font-variant-numeric: tabular-nums; }
.load-day.l1 { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.load-day.l2 { background: color-mix(in srgb, var(--primary) 24%, var(--surface)); }
.load-day.l3 { background: color-mix(in srgb, var(--primary) 40%, var(--surface)); }
.load-day.today { outline: 2px solid var(--primary); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .mm-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 900px) {
  :root { --topbar-h: 56px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); width: 280px; }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open, [dir="rtl"] .sidebar.open { transform: none; }
  .btn-icon.sidebar-close { display: inline-grid; }
  .nav-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(8, 11, 18, .45); z-index: 35; }
  .main-wrap { margin-inline-start: 0; }
  .btn-icon.menu-toggle { display: inline-grid; }
  .topbar { padding: 0 12px; }
  .main { padding: 4px 16px calc(84px + env(safe-area-inset-bottom)); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .notes-layout { grid-template-columns: minmax(0, 1fr); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 600; color: var(--text-3); background: none; border: 0; padding: 4px 0; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav .icon { width: 22px; height: 22px; }
  .bottom-nav a:hover { text-decoration: none; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); inset-inline: 12px; }
  .toast { min-width: 0; max-width: none; }
  .mm-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; height: calc(100vh - var(--topbar-h) - 92px); }
  .mm-panel { border-inline-start: 0; border-top: 1px solid var(--border); max-height: 42vh; }
  .cal-day { min-height: 84px; }
  .cal-chip { font-size: .68rem; padding: 1px 4px; }
  .cal-scroll { max-height: calc(100vh - 300px); }
  .hide-sm { display: none; }
  .mm-hint, .mm-status { display: none; }
  .mm-title-input { min-width: 0; flex: 1 1 120px; }
  .mm-toolbar { top: 8px; inset-inline: 8px; gap: 4px; }
  .mm-panel { max-height: 36vh; }
  .mm-stage { min-height: 52vh; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .hero h2 { font-size: 1.3rem; }
  .semester-progress { min-width: 0; width: 100%; }
  .card { padding: 14px; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; }
  .cal-month .dow { font-size: .62rem; padding: 6px 3px; }
  .cal-day { min-height: 64px; padding: 3px; }
  .cal-day .cal-chip span.label { display: none; }
  .cal-legend { margin-inline-start: 0; }
  .course-progress-row { grid-template-columns: minmax(0, 1fr) 80px 38px; }
  .session-card { flex-wrap: wrap; }
  .session-actions { width: 100%; justify-content: flex-start; }
  .timer-display { font-size: 2.6rem; }
  .avail-row { grid-template-columns: minmax(0, 1fr); }
  .task-row { padding: 12px; }
  .topic-row .progress { width: 56px; }
  .topic-row .actions { opacity: 1; }
  .page-head h2 { font-size: 1.25rem; }
}

/* --------------------------------------------------------------------------
   Localization: Arabic typography, RTL details, mixed-direction content
   -------------------------------------------------------------------------- */
:lang(ar) body, :lang(ar) button, :lang(ar) input, :lang(ar) select, :lang(ar) textarea { font-family: var(--font-arabic); }
:lang(ar) body { line-height: 1.65; }
/* Letter-spacing breaks the joining of Arabic letters. */
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(ar) h4, :lang(ar) .brand, :lang(ar) .hero h2, :lang(ar) .page-head h2,
:lang(ar) .stat strong, :lang(ar) .eyebrow, :lang(ar) .table th, :lang(ar) .cal-month .dow, :lang(ar) .mm-panel h4,
:lang(ar) .mm-node text.type, :lang(ar) .exam-countdown small { letter-spacing: 0; text-transform: none; }
:lang(ar) .eyebrow { font-size: .78rem; }
:lang(ar) .table th { font-size: .8rem; }
[dir="rtl"] .select { background-position: 11px 17px, 16px 17px; }

/* Directional icons (arrows, chevrons, sign-out) point the reading direction. */
[dir="rtl"] .icon.dir-icon { transform: scaleX(-1); }

/* User content keeps its own direction inside the interface (English names in Arabic UI and vice versa). */
bdi, .ugc { unicode-bidi: isolate; }
.ugc-block { unicode-bidi: plaintext; text-align: start; }
.ltr, input[type="email"], input[type="url"], .email, .url, .filename, .code, code { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"], [dir="rtl"] input[type="password"] { text-align: end; }
[dir="rtl"] input[type="email"]::placeholder, [dir="rtl"] input[type="url"]::placeholder { text-align: end; }
.num-ltr, .timer-display, .clock { direction: ltr; unicode-bidi: isolate; }
.textarea, .body-input, .title-input { unicode-bidi: plaintext; }
.note-content > * { unicode-bidi: plaintext; text-align: start; }
.note-content p, .note-content li, .note-content h2, .note-content h3, .note-content h4 { margin: 0 0 .5rem; }
.note-content ul, .note-content ol { margin: 0 0 .5rem; padding-inline-start: 1.25rem; }
.note-content { white-space: normal; }
.note-content code { font-size: .88em; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.flip-face .ugc-block, .flip-face .flip-text { width: 100%; text-align: center; unicode-bidi: isolate; }
.language-switch { display: inline-flex; align-items: center; gap: 6px; }
.language-switch .icon { width: 16px; height: 16px; }
.auth-lang { position: fixed; top: 16px; inset-inline-end: 16px; }
.why-text { font-size: .95rem; line-height: 1.7; color: var(--text); }

/* --------------------------------------------------------------------------
   Trust the plan: ownership, plan changes, locks, quiz, trash
   -------------------------------------------------------------------------- */
.why-factors { margin: 0 0 12px; padding-inline-start: 18px; line-height: 1.8; font-size: .95rem; }
.why-factors li { margin-bottom: 2px; }
.plan-changes .plan-change { margin-bottom: 10px; }
.plan-changes .plan-change ul { margin: 4px 0 0; padding-inline-start: 18px; line-height: 1.7; }
.plan-changes .plan-change strong { font-size: .85rem; color: var(--text-2); }
.session-card .badge { margin-inline-end: 4px; }
.btn-icon.active { background: var(--primary-soft); color: var(--primary); }
.missed-panel { border-top: 1px solid var(--border); padding-top: 10px; }
.missed-panel summary { cursor: pointer; font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.missed-panel summary::-webkit-details-marker { display: none; }
.quiz-prompt { font-size: 1.15rem; font-weight: 560; line-height: 1.6; }
.quiz-options { margin: 10px 0 0; padding-inline-start: 20px; line-height: 1.9; }
.danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone h2 { color: var(--danger); }

/* --------------------------------------------------------------------------
   Configurable academic OS: formulas, precedence levels, settings rows
   -------------------------------------------------------------------------- */
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.plain-list { list-style: none; margin: 0; padding: 0; line-height: 1.8; }
.text-danger { color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--primary)); flex: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.radio-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.radio-row:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-row input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--primary); flex: none; }
.radio-row > span { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.radio-row .hint { font-size: .8rem; color: var(--text-3); font-weight: 400; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg-btn { border: 0; background: var(--surface); padding: 6px 12px; font: inherit; font-size: .85rem; color: var(--text-2); cursor: pointer; }
.seg-btn + .seg-btn { border-inline-start: 1px solid var(--border); }
.seg-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); margin: 8px 0; }
.f-term { display: inline-flex; flex-direction: column; align-items: center; padding: 4px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; min-width: 64px; text-align: center; }
.f-term strong { font-size: .92rem; font-variant-numeric: tabular-nums; }
.f-term small { font-size: .7rem; color: var(--text-3); }
.f-term.f-result { border-color: var(--primary); background: var(--primary-soft); }
.f-term.f-result strong { color: var(--primary); }
.f-op { font-size: 1.1rem; color: var(--text-3); font-weight: 600; }
.calc { margin-top: 6px; }
.calc summary { cursor: pointer; font-size: .82rem; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; font-weight: 550; }
.calc summary::-webkit-details-marker { display: none; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; margin: 0 0 6px; }
.levels > div { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; }
.levels dt { font-size: .72rem; color: var(--text-3); }
.levels dd { margin: 0; font-weight: 600; font-size: .9rem; }
.levels > div.unset dd { font-weight: 400; }
.levels > div.effective { border-color: var(--primary); background: var(--primary-soft); }
.levels > div.effective dd { color: var(--primary); }
.cfg-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 12px 20px; padding: 14px 0; border-top: 1px solid var(--border); align-items: start; }
.cfg-row:first-child { border-top: 0; padding-top: 0; }
.cfg-row h3 { font-size: .95rem; margin: 0 0 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cfg-row .desc { font-size: .84rem; color: var(--text-2); margin: 0; }
.cfg-impact { font-size: .78rem; color: var(--text-3); margin: 6px 0 0; }
.cfg-control { display: flex; flex-direction: column; gap: 6px; }
.cfg-control .row { gap: 8px; }
.cfg-control .input, .cfg-control .select { min-width: 0; }
.cfg-actions { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; align-items: center; }
.change-list { display: grid; gap: 6px; margin: 0 0 10px; }
.change-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.change-list dt { color: var(--text-3); font-size: .85rem; }
.change-list dd { margin: 0; }
.more-fields summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--text-2); }
.menu-btn { justify-content: flex-start; width: 100%; }
.struct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.struct-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.struct-item h3 { font-size: .9rem; margin: 0; display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.struct-item .big { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .cfg-row { grid-template-columns: 1fr; } .change-list > div { grid-template-columns: 1fr; gap: 0; } }

/* --------------------------------------------------------------------------
   Lecture timetable
   -------------------------------------------------------------------------- */
.tt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tt-range { font-size: 1.05rem; margin: 0 6px; }
.tt-conflict-note { margin-bottom: 10px; }
.tt-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
.tt-grid { --gutter: 60px; min-width: calc(var(--gutter) + var(--cols) * 104px); position: relative; }
.tt-grid[data-view="day"] { min-width: 0; }
.tt-head, .tt-body { display: grid; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)); }
.tt-head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--border); }
.tt-dayhead { padding: 8px 6px; text-align: center; border-inline-start: 1px solid var(--grid-line); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .78rem; color: var(--text-3); min-width: 0; }
.tt-dayhead strong { font-size: .98rem; color: var(--text); }
.tt-dayhead.today strong { color: var(--primary); }
.tt-dayhead.off { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--warning) 8%, transparent) 6px 12px); }
.tt-body { position: relative; }
.tt-gutter { position: relative; }
.tt-hour { position: relative; font-size: .7rem; color: var(--text-3); text-align: end; padding-inline-end: 8px; }
.tt-hour span { position: relative; top: -7px; }
.tt-hour:first-child span { top: 2px; }
.tt-col { position: relative; border-inline-start: 1px solid var(--grid-line); background-image: repeating-linear-gradient(to bottom, var(--grid-line) 0, var(--grid-line) 1px, transparent 1px, transparent calc(60px * var(--ppm))); cursor: cell; min-width: 0; }
.tt-col.today { background-color: color-mix(in srgb, var(--primary) 4%, transparent); }
.tt-col.off { background-color: color-mix(in srgb, var(--warning) 6%, transparent); }
.tt-off-label { position: sticky; top: 0; font-size: .7rem; color: var(--warning); padding: 2px 6px; text-align: center; }
.tt-block { position: absolute; box-sizing: border-box; padding: 4px 6px 6px; border: 0; border-inline-start: 4px solid var(--c); border-radius: 7px; background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--text); font: inherit; font-size: .74rem; line-height: 1.3; text-align: start; display: flex; flex-direction: column; gap: 1px; overflow: hidden; cursor: pointer; margin: 0 1px; box-shadow: var(--shadow-sm); z-index: 1; text-decoration: none; }
.tt-block[data-draggable] { cursor: grab; touch-action: pan-y; }
.tt-block:hover { z-index: 2; box-shadow: var(--shadow); }
.tt-block:focus-visible { outline: none; box-shadow: var(--focus); z-index: 3; }
.tt-block .tt-title { font-weight: 650; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-block .tt-sub, .tt-block .tt-meta { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-block .tt-time { font-variant-numeric: tabular-nums; color: var(--text-2); }
.tt-block .tt-tag { font-size: .66rem; padding: 0 5px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); }
.tt-block .tt-kind { font-size: .68rem; font-weight: 650; letter-spacing: .02em; color: color-mix(in srgb, var(--c) 70%, var(--text)); display: inline-flex; gap: 4px; align-items: center; }
.tt-block > * { flex-shrink: 0; }
.tt-block .tt-flag { display: inline-flex; gap: 3px; align-items: center; font-weight: 650; color: var(--danger); }
.tt-block.has-conflict { outline: 2px dashed var(--danger); outline-offset: -2px; }
.tt-block.cancelled { opacity: .55; text-decoration: line-through; }
.tt-block.k-lab { background-image: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--c) 10%, transparent) 8px 16px); }
.tt-block.k-section, .tt-block.k-tutorial { border-inline-start-style: double; border-inline-start-width: 6px; }
.tt-block.dragging { opacity: .35; }
.tt-exam { --c: var(--danger); background: var(--danger-soft); }
.tt-session { border-inline-start-style: dashed; background: color-mix(in srgb, var(--c) 7%, var(--surface)); opacity: .85; cursor: default; }
.tt-resize { position: absolute; inset-inline: 0; bottom: 0; height: 9px; cursor: ns-resize; touch-action: none; }
.tt-resize::after { content: ""; position: absolute; bottom: 2px; inset-inline-start: calc(50% - 11px); width: 22px; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--c) 60%, transparent); opacity: 0; transition: opacity .15s; }
.tt-block:hover .tt-resize::after, .tt-block:focus-visible .tt-resize::after { opacity: 1; }
.tt-ghost { position: absolute; inset-inline: 2px; z-index: 5; border: 2px dashed var(--c); border-radius: 7px; background: color-mix(in srgb, var(--c) 22%, transparent); display: flex; flex-direction: column; gap: 2px; padding: 4px 6px; font-size: .74rem; pointer-events: none; }
.tt-ghost strong { font-variant-numeric: tabular-nums; }
.tt-dragging, .tt-dragging * { cursor: grabbing !important; user-select: none; }
.tt-lock { position: absolute; inset-inline: 0; background: repeating-linear-gradient(45deg, var(--surface-2) 0 6px, var(--surface-3) 6px 12px); opacity: .8; font-size: .68rem; color: var(--text-3); padding: 2px 6px; pointer-events: none; }
.tt-slot-menu { position: absolute; inset-inline: 4px; z-index: 6; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 8px; display: flex; flex-direction: column; gap: 6px; cursor: default; min-width: 150px; }
.tt-daypick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
.tt-daypick button { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; font: inherit; font-size: .72rem; color: var(--text-3); cursor: pointer; min-width: 0; }
.tt-daypick button strong { font-size: .95rem; color: var(--text); }
.tt-daypick button[aria-selected="true"] { border-color: var(--primary); background: var(--primary-soft); }
.tt-daypick button.today strong { color: var(--primary); }
.tt-conflict .row { gap: 6px; }
@media (max-width: 760px) {
  .tt-grid { --gutter: 46px; }
  .tt-toolbar h2 { font-size: .95rem; }
}

/* --------------------------------------------------------------------------
   Mind map editor (professional): nodes, edges, ports, menus, minimap, presentation
   -------------------------------------------------------------------------- */
.mm-stage { background-image: none; }
.mm-grid-dot { fill: var(--border-strong); }
.mm-toolbar .group .btn-icon[disabled] { opacity: .4; cursor: default; }
.mm-toolbar .btn-icon[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); }
.mm-node .body { transition: stroke .12s; }
.mm-node:hover .body { stroke: color-mix(in srgb, var(--primary) 55%, var(--border-strong)); }
.mm-node.collapsed .body { stroke-width: 2; filter: drop-shadow(3px 3px 0 var(--surface-3)); }
.mm-node.dim { opacity: .22; }
.mm-node.search-hit .body { stroke: var(--warning); stroke-width: 2.5; }
.mm-node.search-current .body { stroke: var(--warning); stroke-width: 3.5; fill: var(--warning-soft); }
.mm-node text.status { fill: var(--text-3); font-size: 10px; font-weight: 500; }
.mm-node text.links { fill: var(--text-3); font-size: 10px; font-weight: 600; }
.mm-node .mm-icon { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mm-node .mm-link-icon { color: var(--text-3); }
.mm-node .toggle { cursor: pointer; }
.mm-node .toggle circle { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.mm-node .toggle text { fill: var(--text-2); font-size: 10px; font-weight: 700; pointer-events: none; }
.mm-node .toggle:hover circle { stroke: var(--primary); }
.mm-node:not(.collapsed):not(.selected):not(:hover) .toggle { opacity: 0; }
.mm-port { fill: var(--surface); stroke: var(--primary); stroke-width: 2; cursor: crosshair; }
.mm-port:hover { fill: var(--primary); }
.mm-rubber { stroke: var(--primary); stroke-width: 2; stroke-dasharray: 6 4; fill: none; pointer-events: none; }
.mm-marquee { fill: color-mix(in srgb, var(--primary) 10%, transparent); stroke: var(--primary); stroke-dasharray: 4 3; pointer-events: none; }
.mm-edge.line-dashed { stroke-dasharray: 7 5; }
.mm-edge.line-dotted { stroke-dasharray: 2 5; stroke-linecap: round; }
.mm-edge.dim, .mm-edge.dim + .mm-edge-hit { opacity: .15; }
.mm-arrowhead { fill: var(--border-strong); }
.mm-arrowhead.selected { fill: var(--primary); }
.mm-edge-label-bg { fill: var(--surface); stroke: var(--border); cursor: pointer; }
.mm-inline-edit { position: absolute; z-index: 8; border: 2px solid var(--primary); border-radius: 8px; background: var(--surface); color: var(--text); font: 560 13px var(--font); line-height: 1.35; padding: 4px 6px; resize: none; box-shadow: var(--shadow-lg); unicode-bidi: plaintext; min-width: 80px; }
.mm-minimap { position: absolute; bottom: 12px; inset-inline-end: 12px; width: 180px; height: 120px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); z-index: 5; overflow: hidden; cursor: pointer; touch-action: none; }
.mm-minimap svg { width: 100%; height: 100%; display: block; }
.mm-minimap-view { fill: color-mix(in srgb, var(--primary) 10%, transparent); stroke: var(--primary); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.mm-menu { position: absolute; z-index: 20; min-width: 230px; max-width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; display: flex; flex-direction: column; max-height: 70%; overflow-y: auto; }
.mm-menu[hidden] { display: none; }
.mm-menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; font: inherit; font-size: .86rem; color: var(--text); padding: 7px 10px; border-radius: 6px; cursor: pointer; text-align: start; }
.mm-menu button:hover, .mm-menu button:focus-visible { background: var(--surface-2); outline: none; }
.mm-menu button[disabled] { opacity: .45; cursor: default; }
.mm-menu button.danger { color: var(--danger); }
.mm-menu button span { flex: 1; }
.mm-menu button[aria-checked="true"] span { font-weight: 650; }
.mm-menu kbd { font-size: .72rem; color: var(--text-3); background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }
.mm-search { position: absolute; top: 62px; inset-inline-end: 12px; z-index: 6; display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.mm-search[hidden] { display: none; }
.mm-search .input { width: 220px; }
.mm-present-bar { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-lg); padding: 6px 10px; max-width: calc(100% - 24px); }
.mm-present-bar[hidden] { display: none; }
.mm-present-bar strong { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.mm-layout.presenting { grid-template-columns: minmax(0, 1fr); }
.mm-layout.presenting .mm-panel, .mm-layout.presenting .mm-toolbar, .mm-layout.presenting .mm-hint, .mm-layout.presenting .mm-minimap, .mm-layout.presenting .mm-search { display: none; }
.mm-layout:fullscreen { height: 100vh; border-radius: 0; }
.mm-status.s-unsaved { color: var(--warning); }
.mm-status.s-saving { color: var(--info); }
.mm-status.s-failed, .mm-status.s-conflict, .mm-status.s-retrying, .mm-status.s-offline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.mm-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mm-keys li { display: flex; gap: 8px; align-items: baseline; }
.mm-keys kbd { font-size: .72rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.mm-tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.mm-tpl-grid .radio-row { height: 100%; }
@media (max-width: 640px) {
  .mm-toolbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .mm-toolbar .group { flex: none; }
  .mm-status { display: inline-flex; flex: none; font-size: .7rem; }
  .mm-minimap { display: none; }
  .mm-search { inset-inline: 8px; top: 56px; }
  .mm-search .input { width: auto; flex: 1; }
}
.mm-toolbar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-bottom: 6px; }
.mm-toolbar::-webkit-scrollbar { display: none; }
.mm-toolbar > * { flex: none; }
.mm-title-input { min-width: 0; width: 170px; }
.mm-search { top: 64px; }
@media (max-width: 640px) { .mm-title-input { width: 110px; } }
@media (max-width: 640px) {
  .mm-layout { height: auto; grid-template-rows: auto auto; }
  .mm-stage { height: 60vh; min-height: 320px; }
  .mm-panel { max-height: none; }
}

/* ------------------------------------------------------------------ Student OS: capture, topics, search, My Day */
.quick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.quick-row .btn { min-height: 36px; }
.dropdown-sep { height: 1px; margin: 6px 4px; background: var(--border); }

.topic-field { position: relative; }
.topic-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; color: var(--text-2); min-height: 0; }
.topic-suggest:empty { display: none; }
.topic-suggest .link-btn { font-weight: 600; min-height: 32px; padding: 2px 6px; }
.topic-suggest .icon { color: var(--primary); }

.search-input { display: flex; align-items: center; gap: 8px; }
.search-input .icon { color: var(--text-3); flex: none; }
.search-results { max-height: min(60vh, 520px); overflow-y: auto; }
.search-group + .search-group { margin-top: 12px; }
.search-group .eyebrow { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.search-hit { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; min-height: 44px; }
.search-hit:hover, .search-hit:focus-visible, .search-hit[aria-selected="true"] { background: var(--primary-soft); text-decoration: none; }
.search-hit .dot { margin-top: 6px; flex: none; }
.search-hit .title { display: block; font-weight: 600; }
.search-hit .small { display: block; }

.repeat-box { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }

.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); min-height: 44px; }
.choice-card > span { display: flex; flex-direction: column; gap: 2px; }
.choice-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice-card input { margin-top: 3px; }
.choice-card:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }

/* My Day: head, NEXT strip, plan + side column */
.myday-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.myday-head h2 { font-size: 1.5rem; margin: 2px 0 4px; }
.next-strip { border: 1px solid var(--border); border-inline-start: 5px solid var(--c); border-radius: var(--radius); background: color-mix(in srgb, var(--c) 8%, var(--surface)); padding: 14px 18px; margin-bottom: 16px; }
.next-strip h3 { font-size: 1.15rem; }
.myday-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.myday-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.side-section { min-width: 0; }
.side-section + .side-section { border-top: 1px solid var(--border); padding-top: 14px; }
.side-section .card-head h2 { font-size: 1rem; }
.plan-list .list-item { align-items: flex-start; }
.why-line { color: var(--text-2); margin-top: 4px; }

/* Timetable quick add */
.tt-quick { margin-bottom: 12px; padding: 12px 14px; }
.tt-quick-fields { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(140px, 1.3fr) minmax(130px, 1fr) minmax(100px, .8fr) minmax(100px, .8fr) auto; gap: 8px 10px; align-items: end; }
.tt-quick-fields .field { margin: 0; min-width: 0; }
.tt-quick-actions { display: flex; gap: 6px; align-items: center; }
.tt-quick-repeat { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; }
.tt-quick-repeat .field { margin: 0; }
.tt-quick-repeat input[type=date] { width: auto; }
/* Class times in the series form: one line per weekly slot (days + start–end), removable. */
.slot-list { display: grid; gap: 10px; }
.slot-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin: 0; min-width: 0; }
.slot-times { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.slot-times .input { width: auto; min-width: 0; flex: 1 1 110px; }
.slot-error:empty { display: none; }
/* Topic field state (S6.4): linked is unmistakable; suggestions stay one quiet line. */
.topic-state.linked { color: var(--success); font-weight: 600; }
.topic-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; }
.topic-suggest:empty { display: none; }
.topic-suggest .link-btn { min-height: 32px; }
/* Exam-topic feedback (S6.5): one line per topic, choices wrap under the name on narrow screens. */
.feedback-list { display: grid; gap: 8px; }
.feedback-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.feedback-topic { flex: 1 1 180px; min-width: 0; display: grid; gap: 2px; }
.feedback-choices { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.feedback-choices .btn { min-height: 36px; }
.feedback-choices .btn[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.feedback-choices .fb-again[aria-pressed="true"] { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.feedback-choices .fb-good[aria-pressed="true"] { border-color: var(--success); background: var(--success-soft); color: var(--success); }
/* A course's weekly schedule: one column per weekday, every class time its own line. */
.schedule-week { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.schedule-day { border: 1px solid var(--border); border-radius: 10px; padding: 10px; min-width: 0; }
.schedule-day.has-slots { border-color: var(--border-strong); }
.schedule-dayhead { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.schedule-list { display: grid; gap: 6px; }
.schedule-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.schedule-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.schedule-actions { margin-inline-start: auto; display: inline-flex; gap: 2px; }
.schedule-count { grid-column: 1 / -1; }

@media (max-width: 1100px) {
  .tt-quick-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }

}
@media (max-width: 900px) {
  .myday-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .tt-quick-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tt-quick-fields .field:first-child, .tt-quick-fields .field:nth-child(2) { grid-column: 1 / -1; }
  .tt-quick-actions { grid-column: 1 / -1; }
  .quick-row .btn { flex: 1 1 calc(33% - 8px); justify-content: center; }
  .choice-row { flex-direction: column; }
  .next-strip { padding: 12px 14px; }
}
@media (hover: none) { .topic-row .actions { opacity: 1; } }

.tt-quick-summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; min-height: 36px; }
.tt-quick[open] .tt-quick-summary { margin-bottom: 8px; }
@media (min-width: 761px) { .tt-quick-summary { display: none; } }
@media (max-width: 640px) {
  .topic-row { flex-wrap: wrap; }
  .topic-row .actions { flex-basis: 100%; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
  .topic-row .actions .btn-icon { width: 38px; height: 38px; }
}
@media (max-width: 640px) { .quick-row > .small { flex-basis: 100%; } }

/* ------------------------------------------------------------------ Student OS: everyday use */
/* Dashboard flow: sections in the student's order; wide ones span the row. */
.dash-flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-flow > .sec-wide { grid-column: 1 / -1; }
.dash-flow > .quick-row { margin: 0; }
.attention { margin-bottom: 16px; border-inline-start: 4px solid var(--warning); }
.attention .eyebrow { margin-top: 4px; }
.now-card { border-inline-start: 5px solid var(--c); padding: 4px 0 4px 14px; padding-inline: 14px 0; }
.now-card h3 { font-size: 1.2rem; margin: 2px 0; }
.now-empty { display: flex; align-items: center; gap: 8px; color: var(--text-2); margin: 0 0 8px; }
.next-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.next-item { display: flex; gap: 12px; align-items: baseline; padding: 8px 10px; border-radius: var(--radius-sm); border-inline-start: 3px solid var(--c); color: var(--text); text-decoration: none; min-height: 44px; flex-wrap: wrap; }
.next-item:hover, .next-item:focus-visible { background: var(--surface-2); text-decoration: none; }
.next-when { min-width: 120px; color: var(--text-2); font-size: .85rem; }
.next-list .reason-chips { padding-inline-start: 10px; }
.reason-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 4px 0 0; padding: 0; }
.reason { font-size: .72rem; line-height: 1.5; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.reason-overdue, .reason-due_today { background: var(--warning-soft, var(--surface-2)); color: var(--text); border-color: var(--warning); }
.reason-exam_soon, .reason-exam { border-color: var(--primary); }
.reason-planned_by_you { border-color: var(--info, var(--primary)); }
.tl-row.cancelled .title { text-decoration: line-through; color: var(--text-3); }
.task-line { align-items: flex-start; }
.today-progress { margin-bottom: 8px; }
.layout-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.layout-item { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); min-height: 48px; }
.layout-item .btn-icon { width: 40px; height: 40px; }
/* Course "at a glance" */
.glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.glance-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; min-height: 64px; min-width: 0; }
.glance-cell:hover { background: var(--surface-2); }
.glance-cell strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast .toast-link { color: inherit; font-weight: 600; margin-inline-start: 4px; }
/* Visible focus everywhere keyboard users land. */
.search-hit:focus-visible, .glance-cell:focus-visible, .next-item:focus-visible, .layout-item button:focus-visible, .reason:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 900px) {
  .dash-flow { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .glance { grid-template-columns: minmax(0, 1fr); }
  .next-when { min-width: 0; width: 100%; }
}
.btn-icon:disabled, .btn-icon[disabled] { opacity: .35; cursor: not-allowed; }
#exam-detail .grid.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
body:has(.modal-backdrop) .toasts { bottom: auto; top: 20px; }
/* Phones and touch screens: comfortable touch targets for small icon buttons, chips and link buttons. */
@media (max-width: 640px), (pointer: coarse) {
  .btn-icon.sm { width: 40px; height: 40px; }
  .tag, .link-btn { min-height: 36px; display: inline-flex; align-items: center; }
  .session-actions { gap: 6px; flex-wrap: wrap; }
  .att-buttons button { min-height: 40px; min-width: 40px; }
}

/* "View as student" (admin) */
.impersonation-bar { position: sticky; top: 0; z-index: 200; display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #b45309; color: #fff; font-weight: 600; font-size: .9rem; }
.impersonation-bar .btn { background: #fff; color: #7c2d12; border-color: #fff; }

/* Subscriptions (billing page, sidebar pill, read-only banner) */
.access-pill { font-size: .66rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.access-pill.active { background: var(--success-soft); color: var(--success); }
.access-pill.trial { background: var(--info-soft); color: var(--info); }
.access-pill.expired { background: var(--warning-soft); color: var(--warning); }
.access-banner { margin: 8px 0 14px; align-items: center; }
.billing-hero { display: flex; gap: 16px; align-items: center; padding: 22px 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.billing-hero > .icon { width: 44px; height: 44px; padding: 10px; border-radius: 14px; flex-shrink: 0; background: var(--surface-2); }
.billing-hero h2 { margin: 0; font-size: 1.25rem; }
.billing-hero p { margin: 4px 0 0; color: var(--text-2); }
.billing-hero.active > .icon { background: var(--success-soft); color: var(--success); }
.billing-hero.trial > .icon { background: var(--info-soft); color: var(--info); }
.billing-hero.expired { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.billing-hero.expired > .icon { background: var(--warning-soft); color: var(--warning); }
.mt-3 { margin-top: 24px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; }
.plan-card h3 { margin: 0; font-size: 1.05rem; }
.plan-card.selectable { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.plan-card.selectable:hover, .plan-card.selectable:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); transform: translateY(-2px); outline: none; }
.plan-card.selectable:active { transform: translateY(0); }
.btn-instapay { background: linear-gradient(135deg, #5b2c83, #7b3fb0); border-color: #5b2c83; color: #fff; gap: 8px; margin: 4px 0; min-height: 52px; }
.instapay-mark { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; direction: ltr; }
.btn-instapay:hover { background: #4a2270; border-color: #4a2270; color: #fff; text-decoration: none; }
.plan-card.inactive { opacity: .65; }
.plan-price { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-price span { font-size: .85rem; font-weight: 500; color: var(--text-3); margin-inline-start: 6px; }
.plan-card > .btn, .plan-card .row { margin-top: auto; }
.pay-method { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.pay-instapay { background: color-mix(in srgb, #5b2c83 12%, transparent); color: #6d3a9c; }
.pay-vodafone_cash { background: color-mix(in srgb, #e60000 12%, transparent); color: #d40000; }
[data-theme="dark"] .pay-instapay { color: #c9a3ef; }
[data-theme="dark"] .pay-vodafone_cash { color: #ff8a8a; }
.pay-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.pay-summary span { display: inline-flex; gap: 6px; }
.pay-summary strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.step-title { font-size: .95rem; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-grid; place-items: center; font-size: .8rem; }
.method-picker { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.method-option { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.method-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.pay-target { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.pay-target-value { font-size: 1.2rem; letter-spacing: .02em; }
