/* =========================================================
   知序 StudyDesk — visual system
   Paper, ink, jade. Serif for ideas, sans for tools.
   ========================================================= */

:root {
  --paper: #f4f0e7;
  --paper-deep: #ece6da;
  --card: #fffdf8;
  --card-soft: #faf6ee;
  --ink: #17241f;
  --ink-2: #40514a;
  --muted: #78867f;
  --faint: #a3aea8;
  --line: rgba(23, 36, 31, 0.1);
  --line-strong: rgba(23, 36, 31, 0.16);
  --jade: #0d5145;
  --jade-deep: #082f29;
  --jade-mid: #14705f;
  --jade-soft: #e4efe9;
  --jade-wash: #f0f7f3;
  --coral: #c96a4e;
  --coral-soft: #f8e9e3;
  --gold: #b88a3e;
  --gold-soft: #f7efdf;
  --blue: #35638e;
  --blue-soft: #e9f0f7;
  --danger: #b4443c;
  --danger-soft: #fbeceb;
  --white: #ffffff;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(23, 36, 31, 0.04);
  --shadow: 0 14px 40px rgba(23, 36, 31, 0.08);
  --shadow-lg: 0 30px 80px rgba(8, 47, 41, 0.18);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "Inter", "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --sidebar-w: 264px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(1000px 680px at 92% -8%, rgba(19, 112, 95, 0.08), transparent 62%),
    radial-gradient(760px 520px at 8% 108%, rgba(201, 106, 78, 0.07), transparent 60%),
    linear-gradient(180deg, #f7f3eb 0%, #f2eee5 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
}

::selection {
  background: rgba(20, 112, 95, 0.2);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
.display {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

kbd {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
}

[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

[data-icon] svg {
  width: 1.15em;
  height: 1.15em;
  stroke-width: 1.7;
}

/* ---------- app frame ---------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 20px 18px;
  overflow-y: auto;
  color: rgba(246, 242, 233, 0.78);
  background:
    radial-gradient(500px 320px at 18% 0%, rgba(65, 160, 136, 0.25), transparent 66%),
    radial-gradient(420px 340px at 110% 78%, rgba(201, 106, 78, 0.12), transparent 70%),
    linear-gradient(178deg, #0c443b 0%, #082f29 54%, #062520 100%);
  box-shadow: 18px 0 60px rgba(8, 47, 41, 0.12);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-family: var(--serif);
  font-size: 23px;
  color: #0b352e;
  background: linear-gradient(150deg, #f6efdf, #dccfae);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 8px 18px rgba(0, 0, 0, 0.18);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-family: var(--serif);
  color: #f8f3e7;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand-copy small {
  color: rgba(246, 242, 233, 0.48);
  font-size: 9px;
  letter-spacing: 0.3em;
  margin-top: 5px;
}

.sidebar-close {
  display: none !important;
  color: #f6f2e9;
}

.new-note-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 13px;
  color: #143b31;
  background: linear-gradient(135deg, #f5efdf, #e7dcc2);
  font-weight: 650;
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.new-note-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.new-note-btn kbd {
  margin-left: auto;
  border-color: rgba(20, 59, 49, 0.18);
  background: rgba(20, 59, 49, 0.08);
  color: rgba(20, 59, 49, 0.6);
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.main-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 10px;
  color: rgba(246, 242, 233, 0.68);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, padding-left 0.2s;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fbf7eb;
}

.main-nav a.is-active {
  background: rgba(255, 255, 255, 0.11);
  color: #fffaf0;
  box-shadow: inset 3px 0 0 #d7b16a;
}

.main-nav a.is-active [data-icon] {
  color: #e0c184;
}

.sidebar-section {
  margin-top: 2px;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px 8px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 242, 233, 0.4);
}

.sidebar-section-head a {
  letter-spacing: 0;
  text-transform: none;
  font-size: 11px;
  color: rgba(246, 242, 233, 0.55);
}

.sidebar-section-head a:hover {
  color: #fff;
}

.sidebar-subjects {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-subject {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 9px;
  color: rgba(246, 242, 233, 0.62);
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
}

.sidebar-subject:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff8e8;
}

.sidebar-subject .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--subject-color, #7fb8a3);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--subject-color, #7fb8a3) 16%, transparent);
}

.sidebar-subject .count {
  margin-left: auto;
  font-size: 10px;
  color: rgba(246, 242, 233, 0.36);
  font-variant-numeric: tabular-nums;
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.countdown-card {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.countdown-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -32px;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(215, 177, 106, 0.28);
  border-radius: 50%;
}

.countdown-eyebrow {
  font-size: 8px;
  letter-spacing: 0.24em;
  color: rgba(246, 242, 233, 0.45);
}

.countdown-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 1px;
}

.countdown-main strong {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  color: #f3e8cd;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.countdown-main span {
  font-size: 12px;
  color: rgba(246, 242, 233, 0.55);
}

.countdown-card p {
  font-size: 10px;
  color: rgba(246, 242, 233, 0.45);
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  border-radius: 11px;
  color: rgba(246, 242, 233, 0.78);
}

.profile-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: #e7d9bd;
  color: #26483d;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

.profile-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.profile-copy strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #f6efdf;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy small {
  font-size: 10px;
  color: rgba(246, 242, 233, 0.45);
}

.profile-row > [data-icon] {
  margin-left: auto;
  color: rgba(246, 242, 233, 0.35);
}

.sidebar-scrim {
  display: none;
}

/* ---------- topbar ---------- */

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 74px;
  padding: 0 34px;
  background: rgba(246, 242, 233, 0.82);
  backdrop-filter: blur(18px) saturate(1.1);
  border-bottom: 1px solid rgba(23, 36, 31, 0.07);
}

.mobile-menu {
  display: none !important;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(460px, 48vw);
  height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}

.global-search:focus-within {
  border-color: rgba(13, 81, 69, 0.28);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(13, 81, 69, 0.06);
}

.global-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.global-search input::placeholder {
  color: var(--faint);
}

.global-search input::-webkit-search-cancel-button {
  display: none;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(13, 81, 69, 0.12);
  border-radius: 999px;
  background: rgba(228, 239, 233, 0.55);
  color: var(--jade);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a9b7e;
  box-shadow: 0 0 0 3px rgba(58, 155, 126, 0.13);
}

.topbar-capture {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--jade);
  color: #fdf8ec;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(13, 81, 69, 0.18);
  transition: transform 0.2s var(--ease), background 0.2s;
}

.topbar-capture:hover {
  transform: translateY(-1px);
  background: #0f5e50;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-2);
  transition: background 0.2s, border 0.2s, transform 0.2s;
}

.icon-btn:hover {
  background: var(--jade-wash);
  border-color: rgba(13, 81, 69, 0.2);
  transform: translateY(-1px);
}

/* ---------- main view ---------- */

.view {
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  padding: 30px 36px 90px;
  outline: none;
}

.view > * {
  animation: rise 0.5s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.boot-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 120px 0;
  color: var(--muted);
}

.boot-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: var(--jade);
  color: #f5eddb;
  font-family: var(--serif);
  font-size: 30px;
  box-shadow: var(--shadow);
  animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    transform: translateY(-3px);
    box-shadow: 0 20px 50px rgba(13, 81, 69, 0.2);
  }
}

.skeleton-line {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(23, 36, 31, 0.06), rgba(23, 36, 31, 0.12), rgba(23, 36, 31, 0.06));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-line.w-40 {
  width: 40%;
}
.skeleton-line.w-70 {
  width: 70%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- shared typography ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jade-mid);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-title {
  font-size: clamp(28px, 3.2vw, 40px);
  letter-spacing: -0.03em;
}

.page-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 620px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 38px 0 16px;
}

.section-head h2 {
  font-size: 24px;
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--jade);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.link-more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 11px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}

/* ---------- buttons / chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: transform 0.2s var(--ease), background 0.2s, border 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  background: var(--jade);
  color: #fbf6e9;
  box-shadow: 0 8px 20px rgba(13, 81, 69, 0.16);
}

.btn-primary:hover {
  background: #0f5f51;
}

.btn-soft {
  background: var(--jade-soft);
  color: var(--jade);
  border-color: rgba(13, 81, 69, 0.1);
}

.btn-soft:hover {
  background: #dbece4;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}

.btn-ghost:hover {
  background: var(--card);
  border-color: var(--line-strong);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(180, 68, 60, 0.14);
}

.btn-danger:hover {
  background: #f6ddda;
}

.btn-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 11.5px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
}

.chip.is-active,
.chip:hover {
  border-color: rgba(13, 81, 69, 0.28);
  background: var(--jade-soft);
  color: var(--jade);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--jade-soft);
  color: var(--jade);
  white-space: nowrap;
}

.badge-gold {
  background: var(--gold-soft);
  color: #8a641f;
}

.badge-coral {
  background: var(--coral-soft);
  color: #a14e35;
}

.badge-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-muted {
  background: rgba(23, 36, 31, 0.06);
  color: var(--muted);
}

.subject-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--subject-color, var(--jade));
}

.subject-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--subject-color, var(--jade));
}

/* ---------- dashboard hero ---------- */

.dash-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: 18px;
  align-items: stretch;
}

.hero-main {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 340px;
  padding: 38px 40px 32px;
  border-radius: var(--radius-xl);
  color: #f7f1e3;
  background:
    radial-gradient(580px 380px at 112% -8%, rgba(111, 190, 163, 0.24), transparent 64%),
    radial-gradient(360px 280px at -8% 116%, rgba(201, 106, 78, 0.16), transparent 62%),
    linear-gradient(140deg, #0f4d41 0%, #0a3a32 58%, #082d27 100%);
  box-shadow: 0 26px 60px rgba(8, 47, 41, 0.18);
}

.hero-main::before {
  content: "知序";
  position: absolute;
  right: -10px;
  bottom: -52px;
  font-family: var(--serif);
  font-size: 210px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.045);
  letter-spacing: -0.08em;
  pointer-events: none;
}

.hero-main::after {
  content: "";
  position: absolute;
  top: -120px;
  right: 80px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(236, 217, 178, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 27px;
  padding: 0 10px;
  border: 1px solid rgba(236, 217, 178, 0.24);
  border-radius: 999px;
  color: #ead9b6;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.hero-main h1 {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 24px 0 12px;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.hero-main h1 em {
  font-style: normal;
  display: inline-block;
  color: #e5c88e;
}

.hero-lede {
  position: relative;
  z-index: 1;
  max-width: 500px;
  color: rgba(247, 241, 227, 0.68);
  font-size: 13px;
  line-height: 1.8;
}

.hero-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 19px;
  border-radius: 11px;
  background: #f4ead4;
  color: #153c32;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}

.hero-cta:hover {
  background: #fff8e9;
}

.hero-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-mini strong {
  font-family: var(--serif);
  font-size: 21px;
  color: #f2e4c7;
  font-weight: 500;
}

.hero-mini span {
  font-size: 10px;
  color: rgba(247, 241, 227, 0.5);
}

.hero-capture {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid rgba(23, 36, 31, 0.08);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.capture-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.capture-head h2 {
  font-size: 21px;
  margin-top: 4px;
}

.capture-head p {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
}

.capture-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.capture-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 13px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-soft);
  transition: border 0.2s, transform 0.2s var(--ease), background 0.2s;
}

.capture-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(13, 81, 69, 0.24);
  background: var(--jade-wash);
}

.capture-tile .tile-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--jade-soft);
  color: var(--jade);
}

.capture-tile strong {
  font-size: 12.5px;
  font-weight: 650;
}

.capture-tile span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.quick-subjects {
  margin-top: auto;
  padding-top: 16px;
}

.quick-subjects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.quick-subject-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-subject {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(23, 36, 31, 0.04);
  color: var(--ink-2);
  font-size: 10.5px;
  transition: background 0.2s, color 0.2s;
}

.quick-subject::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--subject-color, var(--jade));
}

.quick-subject:hover {
  background: var(--jade-soft);
  color: var(--jade);
}

/* ---------- stats ---------- */

.lan-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(13, 81, 69, 0.14);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(228, 239, 233, 0.75), rgba(250, 246, 238, 0.7));
}

.lan-hint-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--jade-soft);
  color: var(--jade);
}

.lan-hint div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.lan-hint strong {
  font-size: 11px;
  font-weight: 650;
}

.lan-hint span {
  color: var(--muted);
  font-size: 10px;
}

.lan-hint code {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--jade);
  background: rgba(13, 81, 69, 0.07);
  padding: 1px 4px;
  border-radius: 4px;
}

.lan-hint .btn {
  margin-left: auto;
  flex: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 17px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.74);
  transition: transform 0.25s var(--ease), background 0.25s;
}

.stat-card:hover {
  transform: translateY(-2px);
  background: var(--card);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -24px;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(13, 81, 69, 0.08);
  border-radius: 50%;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-top [data-icon] {
  color: var(--jade-mid);
  opacity: 0.7;
}

.stat-value {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 31px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--muted);
  margin-left: 3px;
  font-weight: 500;
}

.stat-foot {
  margin-top: 7px;
  font-size: 10px;
  color: var(--faint);
}

/* ---------- content grid ---------- */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.note-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 176px;
  padding: 18px 19px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border 0.25s;
}

.note-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--subject-color, var(--jade));
  opacity: 0.7;
}

.note-card:hover {
  transform: translateY(-3px);
  border-color: rgba(13, 81, 69, 0.18);
  box-shadow: var(--shadow);
}

.note-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.note-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.note-card h3 {
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.35;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  color: var(--faint);
  font-size: 9.5px;
}

.note-card-foot .dot-sep::before {
  content: "·";
  margin: 0 5px;
}

.coverage-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--jade-mid);
  font-size: 9px;
  font-weight: 650;
}

.coverage-pill i {
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: rgba(13, 81, 69, 0.12);
  overflow: hidden;
  display: inline-block;
}

.coverage-pill i::after {
  content: "";
  display: block;
  width: var(--coverage, 50%);
  height: 100%;
  background: var(--jade-mid);
}

/* ---------- daily / side cards ---------- */

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.daily-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #fffdf8, #f7f1e5);
  box-shadow: var(--shadow-sm);
}

.daily-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.daily-head span {
  font-size: 9px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--gold);
}

.daily-head .badge {
  font-size: 9px;
}

.daily-card h3 {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 600;
  margin-bottom: 12px;
}

.daily-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.activity-card {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.66);
}

.activity-card h3 {
  font-size: 14px;
  margin-bottom: 12px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(23, 36, 31, 0.08);
  font-size: 10.5px;
  line-height: 1.5;
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-dot {
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--jade-mid);
  flex: none;
  opacity: 0.6;
}

.activity-item strong {
  display: block;
  font-weight: 600;
  color: var(--ink-2);
  font-size: 10.5px;
}

.activity-item span {
  color: var(--faint);
  font-size: 9px;
}

/* ---------- subject grid / cards ---------- */

.subject-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.subject-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 172px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.subject-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.subject-card::after {
  content: attr(data-glyph);
  position: absolute;
  right: -8px;
  bottom: -26px;
  font-family: var(--serif);
  font-size: 92px;
  line-height: 1;
  color: var(--subject-color, var(--jade));
  opacity: 0.07;
  pointer-events: none;
}

.subject-glyph {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--subject-color, var(--jade)) 11%, var(--card));
  color: var(--subject-color, var(--jade));
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.subject-card h3 {
  margin-top: 13px;
  font-size: 16.5px;
  font-weight: 600;
}

.subject-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.subject-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--faint);
  font-size: 9.5px;
}

.subject-card-foot .arrow {
  margin-left: auto;
  color: var(--subject-color, var(--jade));
  opacity: 0.65;
}

.subject-card.is-junior {
  background: linear-gradient(160deg, #fffdf8, #f8f4ea);
}

/* ---------- filter bar ---------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.7);
  margin-bottom: 18px;
}

.filter-bar .search-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 190px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--muted);
}

.filter-bar input,
.filter-bar select {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
  min-width: 0;
}

.filter-bar select {
  height: 36px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  cursor: pointer;
  font-size: 11.5px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: rgba(23, 36, 31, 0.055);
  gap: 2px;
}

.segmented button,
.segmented a {
  height: 29px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.segmented button.is-active,
.segmented a.is-active {
  background: var(--card);
  color: var(--jade);
  box-shadow: 0 1px 4px rgba(23, 36, 31, 0.08);
}

.result-count {
  margin-left: auto;
  color: var(--faint);
  font-size: 10.5px;
  white-space: nowrap;
}

/* ---------- subject detail ---------- */

.subject-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 28px 30px;
  border-radius: 22px;
  color: #f9f4e8;
  background:
    radial-gradient(400px 280px at 100% 0%, rgba(255, 255, 255, 0.12), transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--subject-color, #0d5145) 70%, #0a2f29), #0a2f29);
  box-shadow: var(--shadow);
}

.subject-hero::after {
  content: attr(data-glyph);
  position: absolute;
  right: 40px;
  bottom: -62px;
  font-family: var(--serif);
  font-size: 220px;
  color: rgba(255, 255, 255, 0.055);
  line-height: 1;
  pointer-events: none;
}

.subject-hero-glyph {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--serif);
  font-size: 30px;
  backdrop-filter: blur(4px);
}

.subject-hero h1 {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.subject-hero p {
  margin-top: 7px;
  max-width: 620px;
  color: rgba(249, 244, 232, 0.68);
  font-size: 12px;
  line-height: 1.7;
}

.subject-hero-stats {
  display: flex;
  gap: 18px;
  margin-top: 14px;
}

.subject-hero-stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: #f3e5c8;
  line-height: 1.1;
}

.subject-hero-stats span {
  font-size: 9px;
  color: rgba(249, 244, 232, 0.48);
}

.topic-group {
  margin-top: 26px;
}

.topic-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.topic-group-head h2 {
  font-size: 20px;
}

.topic-group-head span {
  color: var(--faint);
  font-size: 10px;
}

.topic-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  overflow: hidden;
}

.topic-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(23, 36, 31, 0.06);
  transition: background 0.2s;
}

.topic-row:last-child {
  border-bottom: 0;
}

.topic-row:hover {
  background: var(--jade-wash);
}

.topic-index {
  width: 24px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
  flex: none;
}

.topic-main {
  min-width: 0;
  flex: 1;
}

.topic-main strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.topic-main span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 9.5px;
}

.topic-counts {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.topic-actions {
  display: flex;
  gap: 6px;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.topic-row:hover .topic-actions {
  opacity: 1;
}

/* ---------- capture ---------- */

.capture-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.capture-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.capture-card-head {
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
}

.capture-card-head h2 {
  font-size: 24px;
}

.capture-card-head p {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 5px;
}

.capture-body {
  padding: 22px 26px 26px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-soft);
  padding: 9px 11px;
  font-size: 12.5px;
  outline: 0;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(13, 81, 69, 0.32);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(13, 81, 69, 0.06);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}

.field-wide {
  grid-column: 1 / -1;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: rgba(23, 36, 31, 0.05);
  margin: 22px 0 14px;
}

.mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.mode-tab.is-active {
  background: var(--card);
  color: var(--jade);
  box-shadow: 0 1px 4px rgba(23, 36, 31, 0.08);
}

.mode-panel[hidden] {
  display: none !important;
}

.capture-textarea {
  min-height: 240px;
  resize: vertical;
  line-height: 1.8;
  font-size: 12.5px;
}

.textarea-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--faint);
  font-size: 9.5px;
}

.textarea-meta button {
  border: 0;
  background: transparent;
  color: var(--jade-mid);
  font-size: 9.5px;
  font-weight: 600;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 240px;
  border: 1.5px dashed rgba(13, 81, 69, 0.24);
  border-radius: 15px;
  background: var(--jade-wash);
  text-align: center;
  padding: 24px;
  transition: border 0.2s, background 0.2s;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--jade-mid);
  background: #eaf4ef;
}

.dropzone [data-icon] {
  color: var(--jade-mid);
  font-size: 26px;
}

.dropzone strong {
  font-size: 13px;
}

.dropzone span {
  color: var(--muted);
  font-size: 10.5px;
  max-width: 340px;
  line-height: 1.6;
}

.dropzone input[type="file"] {
  display: none;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-soft);
}

.file-preview-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--jade-soft);
  color: var(--jade);
}

.file-preview-main {
  min-width: 0;
  flex: 1;
}

.file-preview-main strong {
  display: block;
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-main span {
  color: var(--faint);
  font-size: 9.5px;
}

.file-preview button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.image-preview {
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card-soft);
  margin-top: 12px;
}

.image-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.image-preview .image-badge {
  position: absolute;
  left: 10px;
  top: 10px;
}

.capture-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.capture-actions .btn-primary {
  min-width: 180px;
}

.capture-actions .privacy {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  font-size: 9.5px;
}

.capture-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.74);
}

.side-card h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.side-card p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.output-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.output-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.output-num {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 6px;
  background: var(--jade-soft);
  color: var(--jade);
  font-family: var(--mono);
  font-size: 9px;
  margin-top: 1px;
}

.output-item strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.output-item span {
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.5;
}

.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 47, 41, 0.58);
  backdrop-filter: blur(7px);
}

.progress-card {
  width: min(440px, 100%);
  padding: 30px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  animation: rise 0.4s var(--ease);
}

.progress-card h2 {
  font-size: 24px;
}

.progress-card > p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 22px 0;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 11.5px;
}

.progress-step .step-dot {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8px;
  flex: none;
}

.progress-step.is-active {
  color: var(--ink);
}

.progress-step.is-active .step-dot {
  border-color: var(--jade-mid);
  background: var(--jade-soft);
  color: var(--jade);
}

.progress-step.is-done {
  color: var(--jade-mid);
}

.progress-step.is-done .step-dot {
  border-color: var(--jade-mid);
  background: var(--jade-mid);
  color: white;
}

.progress-bar {
  height: 3px;
  border-radius: 3px;
  background: rgba(23, 36, 31, 0.08);
  overflow: hidden;
}

.progress-bar i {
  display: block;
  height: 100%;
  width: 12%;
  border-radius: 3px;
  background: var(--jade-mid);
  transition: width 0.6s var(--ease);
}

/* ---------- note detail ---------- */

.note-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}

.note-paper {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.note-hero {
  position: relative;
  padding: 34px 38px 28px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(420px 220px at 100% 0%, color-mix(in srgb, var(--subject-color, #0d5145) 8%, transparent), transparent 70%),
    linear-gradient(180deg, #fffdf8, #fbf8f1);
}

.note-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--subject-color, var(--jade)), color-mix(in srgb, var(--subject-color, #0d5145) 30%, #e5c88e));
}

.note-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 10px;
  margin-bottom: 16px;
}

.note-breadcrumb a:hover {
  color: var(--jade);
}

.note-hero h1 {
  max-width: 760px;
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.note-summary {
  max-width: 760px;
  margin-top: 13px;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.85;
}

.note-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(23, 36, 31, 0.1);
}

.note-actions .spacer {
  flex: 1;
}

.note-sections {
  padding: 12px 38px 42px;
}

.note-section {
  padding: 28px 0 4px;
  border-bottom: 1px dashed rgba(23, 36, 31, 0.09);
}

.note-section:last-child {
  border-bottom: 0;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}

.section-title-row h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-title-row span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}

.section-body {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.85;
}

/* mindmap */
.mindmap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--jade-wash), #fbf7ee);
  border: 1px solid rgba(13, 81, 69, 0.08);
}

.mindmap-root {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 14px;
  border-radius: 12px;
  background: var(--jade);
  color: #fbf5e8;
  font-family: var(--serif);
  font-size: 17px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(13, 81, 69, 0.16);
}

.mindmap-root::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 50%;
  width: 18px;
  height: 1px;
  background: rgba(13, 81, 69, 0.25);
}

.mindmap-branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
}

.mindmap-branch {
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid rgba(13, 81, 69, 0.1);
}

.mindmap-branch strong {
  display: block;
  color: var(--jade);
  font-size: 11.5px;
  margin-bottom: 6px;
}

.mindmap-branch ul {
  margin: 0;
  padding-left: 14px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

/* objectives */
.objectives {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.objective {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--card-soft);
  border: 1px solid rgba(23, 36, 31, 0.055);
  font-size: 11.5px;
  line-height: 1.65;
}

.objective .num {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: var(--jade-soft);
  color: var(--jade);
  font-family: var(--mono);
  font-size: 8px;
  flex: none;
  margin-top: 1px;
}

/* concepts */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.concept {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  transition: border 0.2s, background 0.2s;
}

.concept:hover {
  border-color: rgba(13, 81, 69, 0.2);
  background: #fffefa;
}

.concept-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.concept-head strong {
  color: var(--jade);
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 600;
}

.concept p {
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.75;
}

.concept .kind {
  margin-left: auto;
  font-size: 8px;
  color: var(--faint);
  letter-spacing: 0.06em;
}

/* keypoints */
.keypoints {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.keypoint {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(23, 36, 31, 0.06);
  font-size: 12.5px;
  line-height: 1.75;
}

.keypoint:last-child {
  border-bottom: 0;
}

.keypoint .idx {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 9px;
  padding-top: 4px;
}

/* formulas */
.formula-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.formula {
  padding: 13px 15px;
  border-radius: 11px;
  border: 1px solid rgba(13, 81, 69, 0.1);
  background: linear-gradient(135deg, #f2f8f4, #fbf8f0);
}

.formula-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--jade);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.formula code {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  word-break: break-word;
  white-space: pre-wrap;
}

.formula p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

/* pitfalls */
.pitfall {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--coral-soft);
  border: 1px solid rgba(201, 106, 78, 0.12);
  font-size: 11.5px;
  line-height: 1.7;
  margin-bottom: 7px;
}

.pitfall:last-child {
  margin-bottom: 0;
}

.pitfall [data-icon] {
  color: var(--coral);
  margin-top: 1px;
}

/* examples */
.example {
  padding: 12px 15px;
  border-left: 2px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 9px 9px 0;
  margin-bottom: 7px;
  font-size: 11.5px;
  line-height: 1.75;
}

.example:last-child {
  margin-bottom: 0;
}

/* exam */
.exam-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.exam-item {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-soft);
  font-size: 11px;
  line-height: 1.65;
}

.exam-item [data-icon] {
  color: var(--jade-mid);
  margin-top: 1px;
}

/* flashcards */
.flash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.flashcard {
  perspective: 900px;
  min-height: 86px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 86px;
  transform-style: preserve-3d;
  transition: transform 0.55s var(--ease);
}

.flashcard.is-flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flash-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 13px 14px;
  border-radius: 10px;
  backface-visibility: hidden;
  border: 1px solid var(--line);
}

.flash-front {
  background: var(--card-soft);
}

.flash-back {
  background: var(--jade);
  color: #faf4e6;
  transform: rotateY(180deg);
}

.flash-face small {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  opacity: 0.6;
}

.flash-face p {
  font-size: 11.5px;
  line-height: 1.6;
}

.flash-back p {
  color: #fbf6e9;
  font-size: 10.5px;
}

/* note rail */
.note-rail {
  position: sticky;
  top: 94px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.8);
}

.rail-card h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.rail-card h3 [data-icon] {
  color: var(--jade-mid);
  opacity: 0.7;
}

.toc {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 320px;
  overflow-y: auto;
}

.toc a {
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.toc a:hover {
  background: var(--jade-wash);
  color: var(--jade);
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.keyword {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(23, 36, 31, 0.045);
  color: var(--ink-2);
  font-size: 9.5px;
}

.keyword:nth-child(3n) {
  background: var(--jade-soft);
  color: var(--jade);
}

.rail-question {
  padding: 11px 0;
  border-bottom: 1px dashed rgba(23, 36, 31, 0.1);
}

.rail-question:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rail-question .q-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.rail-question p {
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rail-question a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  color: var(--jade);
  font-size: 9.5px;
  font-weight: 600;
}

.attachment-preview {
  width: 100%;
  border-radius: 9px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  cursor: zoom-in;
}

.attachment-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 9px;
  word-break: break-all;
}

.source-text {
  margin-top: 9px;
  max-height: 210px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.rail-empty {
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

.coverage-ring {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ring {
  --p: 50;
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(var(--jade-mid) calc(var(--p) * 1%), rgba(13, 81, 69, 0.1) 0);
  flex: none;
}

.ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--card);
}

.ring strong {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--jade);
}

.coverage-copy strong {
  display: block;
  font-size: 11px;
}

.coverage-copy span {
  color: var(--faint);
  font-size: 9px;
}

/* ---------- question bank ---------- */

.question-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.question-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  transition: border 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

.question-card:hover {
  border-color: rgba(13, 81, 69, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.question-source {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 1px;
}

.question-source .origin {
  display: grid;
  place-items: center;
  width: 42px;
  height: 30px;
  border-radius: 7px;
  background: var(--jade-soft);
  color: var(--jade);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.question-source .year {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--faint);
}

.question-main h3 {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.65;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.question-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.question-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.difficulty {
  display: inline-flex;
  gap: 2px;
}

.difficulty i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(23, 36, 31, 0.13);
}

.difficulty i.on {
  background: var(--gold);
}

.question-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
  color: var(--faint);
  font-size: 9px;
}

.question-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* practice modal */
.practice-modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 30px 26px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  animation: rise 0.35s var(--ease);
}

.practice-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.practice-top .spacer {
  flex: 1;
}

.practice-progress {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
}

.practice-progress .bar {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(23, 36, 31, 0.08);
  overflow: hidden;
}

.practice-progress .bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--jade-mid);
  transition: width 0.4s var(--ease);
}

.practice-progress span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.practice-stem {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.6;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 8px 0 18px;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-soft);
  text-align: left;
  font-size: 12.5px;
  line-height: 1.6;
  transition: border 0.2s, background 0.2s, transform 0.2s;
}

.option:hover {
  border-color: rgba(13, 81, 69, 0.24);
  background: var(--jade-wash);
}

.option.is-selected {
  border-color: var(--jade-mid);
  background: var(--jade-soft);
  box-shadow: 0 0 0 1px var(--jade-mid);
}

.option.is-correct {
  border-color: #3c8d6f;
  background: #e6f3eb;
}

.option.is-wrong {
  border-color: #c2725a;
  background: var(--coral-soft);
}

.option .letter {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  flex: none;
}

.option.is-selected .letter {
  background: var(--jade);
  color: white;
  border-color: var(--jade);
}

.option.is-correct .letter {
  background: #3c8d6f;
  color: white;
  border-color: #3c8d6f;
}

.option.is-wrong .letter {
  background: #b9684f;
  color: white;
  border-color: #b9684f;
}

.answer-box {
  margin-top: 16px;
  padding: 15px 16px;
  border-radius: 11px;
  background: var(--jade-wash);
  border: 1px solid rgba(13, 81, 69, 0.12);
}

.answer-box h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: 7px;
}

.answer-box p {
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.answer-box .result-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 650;
}

.practice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.practice-actions .spacer {
  flex: 1;
}

.self-grade {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.practice-summary {
  text-align: center;
  padding: 14px 0 6px;
}

.practice-summary .big-score {
  font-family: var(--serif);
  font-size: 64px;
  line-height: 1;
  color: var(--jade);
  font-weight: 500;
}

.practice-summary .big-score small {
  font-size: 20px;
  color: var(--faint);
}

.practice-summary h2 {
  margin-top: 12px;
  font-size: 26px;
}

.practice-summary p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- search ---------- */

.search-hero {
  padding: 26px 28px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  margin-bottom: 20px;
}

.search-hero h1 {
  font-size: 30px;
}

.search-hero form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.search-hero input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-soft);
  outline: 0;
  font-size: 14px;
}

.search-hero input:focus {
  border-color: rgba(13, 81, 69, 0.3);
  background: var(--card);
}

.search-group {
  margin-top: 26px;
}

.search-group h2 {
  font-size: 19px;
  margin-bottom: 12px;
}

/* ---------- settings ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.settings-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.settings-card h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.settings-card > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  margin-bottom: 16px;
}

.settings-card .field {
  margin-bottom: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.switch-row strong {
  display: block;
  font-size: 11.5px;
}

.switch-row span {
  color: var(--faint);
  font-size: 9.5px;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 36, 31, 0.15);
  flex: none;
  transition: background 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s var(--ease);
}

.switch.is-on {
  background: var(--jade-mid);
}

.switch.is-on::after {
  transform: translateX(16px);
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.data-item {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--card-soft);
  border: 1px solid rgba(23, 36, 31, 0.055);
}

.data-item strong {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--jade);
}

.data-item span {
  color: var(--faint);
  font-size: 9px;
}

.lan-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.lan-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--jade-wash);
  color: var(--jade-mid);
}

.lan-url code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
}

.inline-code {
  display: inline;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(23, 36, 31, 0.06);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.roadmap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.roadmap-item {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(23, 36, 31, 0.1);
}

.roadmap-item:last-child {
  border-bottom: 0;
}

.roadmap-tag {
  min-width: 46px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--jade-soft);
  color: var(--jade);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  flex: none;
}

.roadmap-item strong {
  display: block;
  font-size: 11.5px;
}

.roadmap-item p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  margin-top: 2px;
}

.resource-list {
  display: flex;
  flex-direction: column;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(23, 36, 31, 0.1);
}

.resource-item:last-child {
  border-bottom: 0;
}

.resource-main {
  min-width: 0;
  flex: 1;
}

.resource-main strong {
  display: block;
  font-size: 11.5px;
}

.resource-main span {
  color: var(--faint);
  font-size: 9.5px;
}

.resource-item > [data-icon] {
  color: var(--jade-mid);
  opacity: 0.7;
}

.account-security {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(23, 36, 31, 0.1);
}

.recovery-code {
  margin: 14px 0 4px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px dashed rgba(13, 81, 69, 0.35);
  background: #f3f0e7;
  color: var(--jade);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  user-select: all;
}

.auth-forgot {
  display: block;
  margin: 12px auto 0;
  border: 0;
  background: transparent;
  color: var(--jade-mid);
  font: inherit;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

  display: flex;
  flex-direction: column;
  gap: 7px;
}

.video-links {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.video-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(23, 36, 31, 0.1);
  border-radius: 9px;
  color: var(--jade);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.45);
}

.video-links a:hover {
  border-color: rgba(13, 81, 69, 0.3);
  background: #fff;
}

.disclaimer {
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.7;
}

/* ---------- empty / error ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 54px 24px;
  border: 1px dashed rgba(23, 36, 31, 0.16);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.5);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--jade-soft);
  color: var(--jade);
  margin-bottom: 2px;
}

.empty h3 {
  font-size: 18px;
}

.empty p {
  color: var(--muted);
  font-size: 11.5px;
  max-width: 360px;
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 70px 24px;
  text-align: center;
}

.error-state .error-code {
  font-family: var(--serif);
  font-size: 54px;
  color: var(--coral);
}

.error-state h2 {
  font-size: 24px;
}

.error-state p {
  color: var(--muted);
  font-size: 12px;
  max-width: 420px;
}

/* ---------- modal / toast ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 47, 41, 0.55);
  backdrop-filter: blur(6px);
  animation: fade 0.2s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal-card {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  animation: rise 0.3s var(--ease);
}

.modal-card h2 {
  font-size: 22px;
  margin-bottom: 5px;
}

.modal-card > p {
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 14px;
}

.modal-close {
  float: right;
  margin: -4px -4px 0 10px;
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 220px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #143b32;
  color: #fbf6e9;
  box-shadow: 0 14px 34px rgba(8, 47, 41, 0.24);
  font-size: 11.5px;
  line-height: 1.45;
  animation: toastIn 0.3s var(--ease);
  pointer-events: auto;
}

.toast.is-error {
  background: #7d2f29;
}

.toast.is-success {
  background: #1d5c49;
}

.toast [data-icon] {
  color: #e5c88e;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px;
  color: var(--muted);
  font-size: 11px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13, 81, 69, 0.15);
  border-top-color: var(--jade-mid);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- mobile tabbar ---------- */

.mobile-tabbar {
  display: none;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 37px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--jade);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 0.2s, border 0.2s;
}

.lang-toggle:hover {
  background: var(--jade-wash);
  border-color: rgba(13, 81, 69, 0.24);
}

.auth-lang {
  float: right;
  margin: 0 0 6px 10px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--jade);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.auth-lang:hover {
  background: var(--jade-wash);
}

/* ---------- authentication ---------- */

body.auth-mode {
  background: var(--paper);
}

body.auth-mode .sidebar,
body.auth-mode .topbar,
body.auth-mode .mobile-tabbar,
body.auth-mode .sidebar-scrim {
  display: none !important;
}

body.auth-mode .app-shell {
  display: block;
}

body.auth-mode .workspace {
  min-height: 100vh;
}

body.auth-mode .view {
  max-width: none;
  padding: 0;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  min-height: 100vh;
}

.auth-brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  color: #f7f1e3;
  background:
    radial-gradient(620px 460px at 96% -10%, rgba(111, 190, 163, 0.28), transparent 66%),
    radial-gradient(420px 320px at -10% 110%, rgba(201, 106, 78, 0.14), transparent 62%),
    linear-gradient(145deg, #0f4d41 0%, #0a3a32 56%, #082d27 100%);
}

.auth-brand-panel::before {
  content: "知序";
  position: absolute;
  right: -18px;
  bottom: -72px;
  font-family: var(--serif);
  font-size: 260px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.04);
  letter-spacing: -0.08em;
  pointer-events: none;
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  top: -160px;
  right: 80px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(236, 217, 178, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand-top,
.auth-brand-copy,
.auth-brand-foot {
  position: relative;
  z-index: 1;
}

.auth-brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand-top .brand-copy strong {
  color: #f8f3e7;
}

.auth-brand-copy {
  max-width: 560px;
  margin: 34px 0;
}

.auth-brand-copy h1 {
  margin: 20px 0 16px;
  font-size: clamp(38px, 4.4vw, 62px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.auth-brand-copy h1 em {
  font-style: normal;
  display: inline-block;
  color: #e5c88e;
}

.auth-brand-copy > p {
  max-width: 480px;
  color: rgba(247, 241, 227, 0.66);
  font-size: 13px;
  line-height: 1.85;
}

.auth-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 28px;
}

.auth-benefits div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(247, 241, 227, 0.72);
  font-size: 10.5px;
}

.auth-benefits [data-icon] {
  color: #d9bd85;
}

.auth-brand-foot {
  color: rgba(247, 241, 227, 0.4);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 40px 28px;
  background:
    radial-gradient(600px 420px at 100% 0%, rgba(13, 81, 69, 0.05), transparent 70%),
    var(--paper);
  overflow-y: auto;
}

.auth-panel-inner {
  width: min(470px, 100%);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: rgba(23, 36, 31, 0.055);
  margin-bottom: 22px;
}

.auth-tabs button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.auth-tabs button.is-active {
  background: var(--card);
  color: var(--jade);
  box-shadow: 0 2px 8px rgba(23, 36, 31, 0.08);
}

.auth-form-head {
  margin-bottom: 18px;
}

.auth-form-head h2 {
  margin-top: 7px;
  font-size: 29px;
  font-weight: 500;
}

.auth-form-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.auth-form .field {
  margin-bottom: 12px;
}

.auth-submit {
  margin-top: 6px;
  min-height: 44px;
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(180, 68, 60, 0.16);
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  line-height: 1.55;
}

.auth-error [data-icon] {
  margin-top: 1px;
}

.auth-footnote {
  margin-top: 16px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.65;
  text-align: center;
}

.auth-step-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-soft);
  font-size: 11px;
}

.auth-step-summary > span:nth-child(2) {
  color: var(--ink-2);
  font-weight: 600;
}

.auth-back {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--jade-mid);
  font-size: 9.5px;
  font-weight: 600;
}

.auth-subject-section {
  margin-bottom: 17px;
}

.auth-subject-label {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 8px;
}

.auth-subject-label strong {
  font-size: 11px;
  font-weight: 700;
}

.auth-subject-label span {
  color: var(--faint);
  font-size: 9px;
}

.auth-subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.auth-subject {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  text-align: left;
  transition: border 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-subject:hover {
  border-color: rgba(13, 81, 69, 0.24);
}

.auth-subject.is-selected {
  border-color: rgba(13, 81, 69, 0.42);
  background: var(--jade-wash);
  box-shadow: inset 0 0 0 1px rgba(13, 81, 69, 0.16);
}

.auth-subject.is-locked {
  cursor: default;
  background: var(--card-soft);
}

.auth-subject-glyph {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  border-radius: 8px;
  background: color-mix(in srgb, var(--subject-color, var(--jade)) 11%, var(--card));
  color: var(--subject-color, var(--jade));
  font-family: var(--serif);
  font-size: 13px;
}

.auth-subject-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.auth-subject-copy strong {
  font-size: 10.5px;
  font-weight: 650;
  white-space: normal;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.auth-subject-copy small {
  color: var(--faint);
  font-size: 8px;
  white-space: normal;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.lang-en .auth-subject-copy small {
  display: none;
}

body.lang-en .settings-subject small {
  display: none;
}

.auth-subject-check {
  margin-left: auto;
  color: var(--faint);
  flex: none;
}

.auth-subject.is-selected .auth-subject-check {
  color: var(--jade-mid);
}

.auth-subject.is-locked .auth-subject-check {
  color: var(--faint);
}

.auth-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

/* settings account / subjects */

.account-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
}

.account-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.account-copy strong {
  font-size: 13px;
}

.account-copy span {
  color: var(--faint);
  font-size: 9.5px;
}

.account-row .btn {
  margin-left: auto;
}

.settings-subject-section {
  margin-bottom: 12px;
}

.settings-subject-section > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.settings-subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.settings-subject {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-soft);
  font-size: 10.5px;
  cursor: pointer;
}

.settings-subject > span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.settings-subject input {
  accent-color: var(--jade-mid);
}

.settings-subject small {
  margin-left: auto;
  color: var(--faint);
  font-size: 8px;
}

.settings-subject.is-selected {
  border-color: rgba(13, 81, 69, 0.28);
  background: var(--jade-wash);
}

.settings-subject.is-locked {
  opacity: 0.7;
  cursor: default;
}

@media (max-width: 920px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 32px 18px;
  }
}

@media (max-width: 680px) {
  .auth-form-head h2 {
    font-size: 25px;
  }

  .auth-subject-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    place-items: start center;
    padding-top: 26px;
  }

  .auth-panel-inner {
    width: 100%;
  }
}

/* ---------- print ---------- */

@media print {
  body {
    background: white;
  }

  body::before,
  body::after,
  .sidebar,
  .topbar,
  .mobile-tabbar,
  .note-rail,
  .note-actions,
  .toast-root {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .view {
    max-width: none;
    padding: 0;
  }

  .note-layout {
    display: block;
  }

  .note-paper {
    border: 0;
    box-shadow: none;
  }

  .note-hero,
  .note-sections {
    padding-left: 0;
    padding-right: 0;
  }

  .note-section {
    break-inside: avoid;
  }

  .flashcard-inner {
    transform: none !important;
  }

  .flash-back {
    display: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1240px) {
  .subject-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-hero {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.72fr);
  }

  .hero-main h1 {
    font-size: 42px;
  }

  .note-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
}

@media (max-width: 1080px) {
  .view {
    padding: 26px 26px 90px;
  }

  .topbar {
    padding: 0 24px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .side-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .note-layout {
    grid-template-columns: 1fr;
  }

  .note-rail {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capture-layout {
    grid-template-columns: 1fr;
  }

  .capture-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(300px, 86vw);
    transform: translateX(-104%);
    transition: transform 0.4s var(--ease);
    z-index: 80;
  }

  body.sidebar-open .sidebar {
    transform: none;
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(8, 47, 41, 0.4);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  body.sidebar-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close,
  .mobile-menu {
    display: inline-grid !important;
  }

  .dash-hero {
    grid-template-columns: 1fr;
  }

  .hero-main {
    min-height: 300px;
  }

  .subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .global-search {
    width: auto;
    flex: 1;
    max-width: 420px;
  }

  .status-pill {
    display: none;
  }

  .mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 248, 0.92);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }

  .mobile-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    color: var(--faint);
    font-size: 8.5px;
    font-weight: 600;
  }

  .mobile-tabbar a.is-active {
    color: var(--jade);
  }

  .mobile-tabbar .tab-capture {
    position: relative;
    top: -16px;
    width: 46px;
    height: 46px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--jade);
    color: white;
    box-shadow: 0 8px 18px rgba(13, 81, 69, 0.28);
    justify-content: center;
  }

  .mobile-tabbar .tab-capture [data-icon] {
    font-size: 21px;
  }

  .toast-root {
    bottom: 86px;
  }

  .note-sections {
    padding: 8px 24px 30px;
  }

  .note-hero {
    padding: 28px 24px 22px;
  }

  .note-rail {
    grid-template-columns: 1fr;
  }

  .side-stack {
    grid-template-columns: 1fr;
  }

  .capture-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  .topbar {
    height: 64px;
    padding: 0 14px;
    gap: 8px;
  }

  .global-search {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .topbar-actions {
    margin-left: 0;
    flex: none;
    gap: 0;
  }

  .topbar-capture,
  #topbar-avatar,
  #install-btn {
    display: none !important;
  }

  .hero-main {
    min-width: 0;
  }

  .hero-main h1,
  .hero-lede,
  .page-title,
  .note-hero h1,
  .note-summary {
    overflow-wrap: anywhere;
  }

  .capture-tile {
    min-width: 0;
  }

  .capture-tile span {
    flex: 1;
    max-width: none;
    text-align: right;
    white-space: normal;
  }

  .dash-hero,
  .content-grid,
  .capture-layout,
  .settings-grid {
    min-width: 0;
  }

  .topbar-capture span:last-child {
    display: none;
  }

  .topbar-capture {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .topbar-actions {
    gap: 6px;
  }

  .view {
    padding: 20px 15px 96px;
  }

  .hero-main {
    padding: 28px 22px 24px;
    border-radius: 22px;
    min-height: 330px;
  }

  .hero-main h1 {
    font-size: 34px;
  }

  .hero-main::before {
    font-size: 150px;
    bottom: -38px;
  }

  .hero-bottom {
    gap: 16px;
  }

  .hero-mini strong {
    font-size: 18px;
  }

  .hero-capture {
    padding: 18px;
    border-radius: 22px;
  }

  .capture-tiles {
    grid-template-columns: 1fr;
  }

  .capture-tile {
    flex-direction: row;
    align-items: center;
    min-height: 0;
    padding: 12px;
  }

  .capture-tile .tile-icon {
    width: 32px;
    height: 32px;
  }

  .capture-tile strong {
    font-size: 12px;
  }

  .capture-tile span {
    margin-left: auto;
    text-align: right;
    max-width: 120px;
  }

  .stat-grid {
    gap: 8px;
  }

  .lan-hint {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .lan-hint div {
    flex: 1;
  }

  .lan-hint .btn {
    margin-left: 38px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 25px;
  }

  .note-grid {
    grid-template-columns: 1fr;
  }

  .subject-grid {
    grid-template-columns: 1fr;
  }

  .subject-card {
    min-height: 138px;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-title {
    font-size: 30px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .capture-body,
  .capture-card-head {
    padding: 18px;
  }

  .mode-tabs {
    position: sticky;
    top: 64px;
    z-index: 5;
  }

  .note-sections {
    padding: 4px 18px 24px;
  }

  .note-hero h1 {
    font-size: 30px;
  }

  .note-summary {
    font-size: 14px;
  }

  .objectives,
  .concept-grid,
  .exam-list,
  .flash-grid {
    grid-template-columns: 1fr;
  }

  .mindmap {
    grid-template-columns: 1fr;
  }

  .mindmap-root::after {
    display: none;
  }

  .mindmap-branches {
    grid-template-columns: 1fr;
  }

  .topic-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .topic-counts {
    margin-left: 38px;
  }

  .topic-actions {
    margin-left: auto;
    opacity: 1;
  }

  .subject-hero {
    grid-template-columns: 1fr;
    padding: 22px;
    gap: 12px;
  }

  .subject-hero-glyph {
    width: 52px;
    height: 52px;
    font-size: 24px;
  }

  .subject-hero-stats {
    margin-top: 10px;
  }

  .subject-hero > .btn {
    justify-self: start;
  }

  .filter-bar {
    padding: 10px;
  }

  .filter-bar .search-inline {
    flex-basis: 100%;
  }

  .result-count {
    display: none;
  }

  .question-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .question-source .origin {
    width: 34px;
    height: 26px;
  }

  .question-side {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .practice-modal {
    padding: 20px 16px;
    max-height: 94vh;
  }

  .practice-stem {
    font-size: 17px;
  }

  .settings-grid {
    gap: 12px;
  }

  .settings-card {
    padding: 17px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .search-hero {
    padding: 18px;
  }

  .search-hero h1 {
    font-size: 24px;
  }

  .toast-root {
    left: 12px;
    right: 12px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }

  .modal-card {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.support-widget {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 70;
}

.support-fab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--jade);
  color: #f8f1df;
  box-shadow: 0 10px 28px rgba(11, 53, 46, 0.24);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.support-fab [data-icon] {
  display: inline-flex;
  font-size: 17px;
}

.support-widget.is-open .support-fab {
  background: #0a2d26;
}

.support-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: 300px;
  padding: 16px;
  border: 1px solid rgba(23, 36, 31, 0.12);
  border-radius: 16px;
  background: #fffdf7;
  box-shadow: 0 18px 50px rgba(11, 53, 46, 0.22);
}

.support-panel[hidden] {
  display: none;
}

.support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.support-head .eyebrow {
  display: block;
  margin-bottom: 2px;
}

.support-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
}

.support-qr {
  display: block;
  width: 100%;
  max-height: 265px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(23, 36, 31, 0.08);
  background: #fff;
}

.support-scan {
  margin: 8px 0;
  color: var(--faint);
  font-size: 9.5px;
  text-align: center;
}

.support-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f3f0e7;
}

.support-id code {
  color: var(--jade);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  user-select: all;
}

.support-note {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.65;
}

@media (max-width: 760px) {
  .support-widget {
    right: 14px;
    bottom: 88px;
  }

  .support-panel {
    width: min(300px, calc(100vw - 28px));
    bottom: 58px;
  }

  .support-fab {
    padding: 10px 14px;
  }
}
