/* ================= accounts, dashboard, subject management ================= */
.logged-out .app { grid-template-columns: 1fr; }
.logged-out .sidebar, .logged-out .nav-toggle { display: none !important; }
.logged-out .main { overflow-y: auto; }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; max-width: 1180px; width: 100%; margin: 0 auto; }
.landing-top .brand { padding: 0; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.features article { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.features article > span { font-size: 1.4rem; }
.features h3 { margin: 10px 0 4px; }
.features p { margin: 0; font-size: 0.9rem; }

.auth-page { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 22px; padding: 40px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%); }
.auth-brand { padding: 0; }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 30px; display: grid; gap: 14px; }
.auth-card h1 { font-family: var(--display); font-size: 1.6rem; margin: 0; letter-spacing: -0.02em; }
.auth-card > p { margin: 0; }
.auth-switch { text-align: center; font-size: 0.9rem; }
.auth-switch a, .link { color: var(--accent); font-weight: 600; cursor: pointer; }
.form-error { color: var(--bad); font-size: 0.88rem; margin: 0; min-height: 1.2em; }
.form-error:empty { min-height: 0; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--surface-2); color: var(--ink-2); border-radius: 7px; padding: 4px 9px; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
input[type="email"], input[type="password"], input[type="number"], input[type="date"] {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; outline: none; color: var(--ink); font-weight: 400;
}
input:disabled { opacity: 0.6; }
.field em { font-style: normal; font-weight: 400; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: grid; gap: 10px; }
.grow { flex: 1; }
.align-end { align-self: flex-end; }

/* subject badges */
.sbadge { --sc: var(--accent); flex: none; width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 0.78rem; font-weight: 800; color: #fff; background: var(--sc); line-height: 1; }
.sbadge.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 1.3rem; }

/* sidebar */
.side-nav { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: 0.92rem; color: var(--ink-2); }
.side-nav:hover { background: var(--surface-2); color: var(--ink); }
.side-nav.active { background: var(--accent-soft); color: var(--ink); }
.side-nav-ico { width: 24px; text-align: center; font-size: 1.05rem; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 0 8px; }
.sidebar .side-head .side-label { margin: 0; }
.icon-btn.sm { width: 28px; height: 28px; font-size: 0.95rem; }
.subject-link { display: flex; align-items: center; gap: 2px; padding: 0; border-radius: 9px; }
.subject-link > a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 7px 8px; text-decoration: none; color: inherit; }
.subject-link .item-menu { opacity: 0; margin-right: 4px; }
.subject-link:hover .item-menu, .subject-link .item-menu:focus-visible, .subject-link.active .item-menu { opacity: 1; }
.pip { background: var(--surface-3); color: var(--ink-2); }
.pip-blind { background: var(--m-blind); color: #fff; }
.pip-exam { background: color-mix(in srgb, var(--m-fading) 22%, transparent); color: var(--m-fading); }
.side-empty { border: 1px dashed var(--line-strong); background: transparent; border-radius: 10px; padding: 10px; cursor: pointer; text-align: left; width: 100%; }
.side-foot { flex-direction: column; align-items: stretch; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 6px; border-radius: 10px; cursor: pointer; text-align: left; }
.user-chip:hover { background: var(--surface-2); }
.avatar-ini { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-grad); color: #fff; font-weight: 800; font-size: 0.85rem; flex: none; }
.user-name { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-tools { display: flex; align-items: center; gap: 2px; }
.side-tools .status { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-left: 6px; }

/* dropdown menu */
.menu { position: fixed; z-index: 200; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; animation: rise 0.12s ease; }
.menu button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; text-align: left; cursor: pointer; font-size: 0.9rem; }
.menu button span { width: 18px; text-align: center; color: var(--ink-3); }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu button.danger, .menu button.danger span { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }

/* modals */
.modal-warn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1.2rem; color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.push-left { margin-right: auto; }
.subject-preview { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg); }
.subject-preview strong { display: block; }
.icon-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-opt { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.1rem; font-weight: 700; color: var(--ink-2); }
.icon-opt:hover { border-color: var(--line-strong); }
.icon-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: var(--sc); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sc); }
.file-pick { position: relative; display: block; border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 12px; font-weight: 500; color: var(--ink-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-pick:hover { border-color: var(--accent); }
.settings section { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.settings section h3 { margin: 0; font-size: 0.95rem; }
.settings section p { margin: 0; }
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.segmented { display: inline-grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; max-width: 420px; }
.segmented button { display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.danger-zone h3 { color: var(--bad); }

/* dashboard */
.dash { padding-top: 40px; }
.greet { padding: 8px 0 26px; }
.greet h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 4.6vw, 3rem); letter-spacing: -0.03em; margin: 0 0 8px; }
.greet .lede { margin: 0; max-width: none; font-size: 1.05rem; }
.today { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.today-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.today-card b { display: block; font-family: var(--display); font-size: 1.5rem; line-height: 1.1; }
.today-card small { color: var(--ink-3); font-size: 0.8rem; }
.today-card.alert { border-color: color-mix(in srgb, var(--m-blind) 45%, transparent); }
.today-card.alert b { color: var(--m-blind); }
.today-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 1.15rem; flex: none; color: var(--accent); }
.today-card.alert .today-ico { color: var(--m-blind); background: color-mix(in srgb, var(--m-blind) 12%, transparent); }
.goal-ring { --pct: 0; width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative; background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface-3) 0); }
.goal-ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.goal-ring span { position: relative; z-index: 1; font-size: 0.7rem; font-weight: 800; }
.dash-block { margin-bottom: 30px; }
.dash-block > h2, .block-head h2 { font-family: var(--display); font-size: 1.2rem; margin: 0 0 12px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.block-head h2 { margin: 0; }
.dash-steps .step { background: var(--surface); border: 1px solid var(--line); }
.dash-steps .step.first { background: var(--accent-soft); border-color: transparent; }
.subject-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.subject-card { --sc: var(--accent); display: grid; gap: 8px; align-content: start; padding: 16px; cursor: pointer; position: relative; overflow: hidden; color: inherit; font: inherit; text-align: left; }
.subject-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--sc); }
.subject-card:hover { border-color: var(--sc); }
.subject-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.subject-card h3 { margin: 4px 0 0; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-top { display: flex; align-items: flex-start; justify-content: space-between; }
.sc-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: var(--sc); border-radius: 3px; }
.sc-meta, .sc-exam { margin: 0; font-size: 0.82rem; color: var(--ink-3); }
.sc-meta b { color: var(--ink); }
.sc-exam { color: var(--ink-2); }
.sc-exam.soon { color: var(--m-shaky); font-weight: 600; }
.subject-card.add { border-style: dashed; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--ink-2); font-weight: 600; min-height: 150px; background: transparent; }
.subject-card.add::before { display: none; }
.subject-card.add span { font-size: 1.8rem; line-height: 1; color: var(--accent); }
.first-subject { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; text-align: center; box-shadow: var(--shadow); }
.first-subject > p:first-child { max-width: 60ch; margin: 0 auto 18px; }
.first-subject .small { margin: 16px 0 0; }
.exam-chip { flex: none; font-size: 0.76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.exam-chip.soon { background: color-mix(in srgb, var(--m-shaky) 16%, transparent); color: var(--m-shaky); }
.topbar-title { gap: 8px; }

@media (max-width: 1000px) {
  .today { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .landing-top { padding: 12px 16px; }
  .landing-top .btn { padding: 8px 12px; }
  .features { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .auth-card { padding: 22px; }
  .exam-chip { display: none; }
  .subject-link .item-menu { opacity: 1; }
  .dash { padding-top: 56px; }
}
@media (max-width: 480px) {
  .today { grid-template-columns: 1fr 1fr; gap: 8px; }
  .today-card { padding: 12px; gap: 10px; }
  .today-ico, .goal-ring { width: 34px; height: 34px; }
}
@media print {
  .menu { display: none !important; }
}

/* Forgot / reset password */
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-link { color: var(--accent); font-weight: 500; font-size: 0.8rem; }
.field-link:hover { text-decoration: underline; }
.auth-legal { font-size: 0.78rem; text-align: center; margin: -4px 0 0; }
.auth-legal a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.auth-done { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }

/* Terms & Privacy */
.legal-links { display: inline-flex; gap: 16px; }
.legal-links a { color: inherit; }
.legal-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.legal { max-width: 720px; margin: 0 auto; padding-top: 24px; padding-bottom: 80px; line-height: 1.65; color: var(--ink-2); }
.legal h1 { font-family: var(--display); font-weight: 420; font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.02em; color: var(--ink); margin: 18px 0 4px; }
.legal h2 { font-family: var(--display); font-weight: 500; font-size: 1.2rem; color: var(--ink); margin: 34px 0 8px; }
.legal b { color: var(--ink); font-weight: 600; }
.legal ul { padding-left: 20px; display: grid; gap: 8px; }
.legal a { color: var(--accent); }
.legal-date { color: var(--ink-3); font-size: 0.85rem; margin: 0 0 24px; }
.legal-tabs .legal-links { gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.legal-tabs .legal-links a { color: var(--ink-2); padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; text-decoration: none; }
.legal-tabs .legal-links a.on { background: var(--ink); color: var(--bg); }
.pricing-legal { text-align: center; margin: 8px 0 40px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.settings-legal { margin-top: 14px; }
.lp-foot .legal-links { font-size: 0.82rem; }
