:root {
  color-scheme: light;

  /* ---- Spark direction · Headers theme reach ---- */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --h-weight: 800;
  --h-track: -0.03em;

  /* surfaces & ink (Spark, school-independent) */
  --bg: #fbfaf7;
  --panel: #ffffff;
  --panel-soft: #f6f5f1;
  --text: #1c1a26;
  --muted: #6b6878;
  --line: rgba(20, 20, 40, 0.1);

  /* radii & elevation (Spark) */
  --radius: 22px;
  --radius-sm: 14px;
  --btn-radius: 999px;
  --shadow: 0 22px 48px rgba(24, 22, 45, 0.12);
  --shadow-sm: 0 8px 20px rgba(24, 22, 45, 0.1);

  /* category colors (calendar/event chips) */
  --blue: #2563eb;
  --green: #0e9f6e;
  --orange: #e08600;
  --red: #e5484d;
  --purple: #7c3aed;

  /* ---- school palette (default: Rutgers) ---- */
  --primary: #cc0033;
  --primary-dark: #8e0024;
  --primary-tint: #fbe9ee;
  --primary-soft: #f3c6d2;
  --secondary: #23202a;

  font-family: var(--font-body);
}

/* ---- per-school campus palettes (set via html[data-school]) ---- */
html[data-school="rutgers"] {
  --primary: #cc0033;
  --primary-dark: #8e0024;
  --primary-tint: #fbe9ee;
  --primary-soft: #f3c6d2;
  --secondary: #23202a;
}

html[data-school="pennstate"] {
  --primary: #1e407c;
  --primary-dark: #001e44;
  --primary-tint: #e7eef8;
  --primary-soft: #c2d5ed;
  --secondary: #5e8ac7;
}

html[data-school="other"] {
  --primary: #5b5bd6;
  --primary-dark: #3e37c2;
  --primary-tint: #ececfb;
  --primary-soft: #d5d5f6;
  --secondary: #8b5cf6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(120% 120% at 100% 0%, var(--primary-tint), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.hero h1,
.eyebrow {
  font-family: var(--font-display);
}

h1,
h2,
h3 {
  font-weight: var(--h-weight);
  letter-spacing: var(--h-track);
}

html {
  scroll-behavior: smooth;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: rgba(26, 115, 232, 0.14);
}

body {
  overflow-x: hidden;
}

.landing-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 14px max(28px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(219, 226, 239, 0.72);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.landing-brand,
.landing-links,
.landing-actions {
  display: flex;
  align-items: center;
}

.landing-brand {
  gap: 11px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.landing-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
}

.landing-links {
  gap: 26px;
}

.landing-links a,
.nav-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.landing-links a:hover,
.nav-link:hover {
  color: var(--primary);
}

.landing-actions {
  gap: 12px;
}

.landing-mobile-menu-button,
.mobile-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
}

.landing-mobile-menu-button span,
.mobile-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.landing-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(420px, 1.12fr);
  gap: 48px;
  align-items: center;
  width: min(1320px, calc(100% - 44px));
  min-height: calc(100vh - 70px);
  margin: 18px auto 0;
  padding: 72px clamp(22px, 4vw, 58px) 88px;
  overflow: hidden;
  border: 1px solid rgba(113, 139, 178, 0.22);
  border-radius: 36px;
  background:
    radial-gradient(circle at 70% 12%, color-mix(in srgb, var(--primary) 55%, transparent), transparent 28rem),
    radial-gradient(circle at 20% 84%, color-mix(in srgb, var(--primary-dark) 60%, transparent), transparent 24rem),
    linear-gradient(135deg, var(--primary-dark) 0%, #16121a 55%, #111827 100%);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.22);
}

.landing-hero::before,
.landing-hero::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  content: "";
  pointer-events: none;
}

.landing-hero::before {
  top: -120px;
  right: -90px;
  width: 620px;
  height: 620px;
}

.landing-hero::after {
  bottom: -220px;
  left: 18%;
  width: 720px;
  height: 420px;
  transform: rotate(-10deg);
}

.landing-copy h1 {
  max-width: 620px;
  margin: 0;
  color: white;
  font-size: clamp(3.1rem, 6.5vw, 6.4rem);
  line-height: 0.94;
  letter-spacing: -0.07em;
}

.landing-copy p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.16rem;
  line-height: 1.55;
}

.landing-note {
  margin-top: 16px;
  font-size: 0.95rem !important;
}

.landing-hero .eyebrow {
  color: #93c5fd;
}

.landing-icon-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 520px;
  margin-top: 24px;
}

.landing-icon-cloud span {
  display: inline-grid;
  min-width: 46px;
  min-height: 42px;
  place-items: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 0.84rem;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.landing-proof-row {
  display: grid;
  gap: 10px;
  max-width: 560px;
  margin-top: 22px;
}

.landing-proof-row span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

.landing-proof-row span::before {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--blue);
  content: "✓";
  font-size: 0.82rem;
  font-weight: 950;
}

.landing-cta {
  min-width: 190px;
}

.landing-visual {
  position: relative;
  min-height: 540px;
  animation: heroFloatIn 680ms ease both;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: saturate(1.08);
}

.orb-blue {
  top: -82px;
  right: 110px;
  width: 520px;
  height: 520px;
  background: linear-gradient(135deg, #08a5ff 0%, #083dff 62%, #8d33ff 100%);
}

.orb-pink {
  right: 70px;
  bottom: -50px;
  width: 180px;
  height: 540px;
  background: linear-gradient(180deg, #fb62ff 0%, #d64cf5 100%);
  transform: rotate(-18deg);
}

.preview-card {
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin-top: 82px;
  border: 1px solid #cfe0f7;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 34px 90px rgba(11, 47, 87, 0.18);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 34px;
  color: var(--text);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 900;
}

.preview-header strong {
  color: var(--blue);
  font-size: 0.95rem;
}

.preview-layout {
  display: grid;
  grid-template-columns: 0.86fr 1.05fr 0.78fr;
  min-height: 360px;
  border-top: 1px solid #edf2fa;
  background: #fbfdff;
}

.preview-layout > * {
  padding: 28px;
}

.preview-layout > * + * {
  border-left: 1px solid #dde7f5;
}

.mini-logo {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 14px;
  background: var(--blue);
  color: white;
  font-weight: 950;
}

.preview-list {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  color: #24496d;
  list-style: none;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
}

.dot.blue { background: var(--blue); }
.dot.orange { background: var(--orange); }
.dot.red { background: var(--red); }

.mini-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 24px;
  text-align: center;
}

.mini-month-grid span {
  color: #55708e;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-month-grid button,
.preview-times button {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #123c63;
  font-weight: 750;
}

.mini-month-grid button {
  min-height: 34px;
}

.mini-month-grid .soft {
  background: #e9f2ff;
}

.mini-month-grid .selected,
.preview-times .selected {
  background: var(--blue);
  color: white;
}

.preview-times {
  display: grid;
  align-content: start;
  gap: 14px;
}

.preview-times button {
  min-height: 44px;
  border-color: var(--blue);
  border-radius: 10px;
  background: white;
  color: var(--blue);
}

.landing-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: center;
  width: min(1240px, calc(100% - 56px));
  margin: 42px auto 48px;
  padding: 22px;
  color: var(--text);
  text-align: center;
}

.landing-trust span {
  width: auto;
  color: #24496d;
  font-weight: 900;
}

.landing-trust strong {
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.landing-benefits,
.landing-features,
.landing-faq {
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto 36px;
}

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

.landing-benefits article,
.faq-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(29, 41, 57, 0.06);
}

.landing-benefits h3,
.faq-grid h3 {
  margin: 0 0 10px;
  color: var(--text);
}

.landing-benefits p,
.faq-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.landing-steps {
  position: relative;
  display: grid;
  gap: 24px;
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto 36px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.how-page {
  padding: clamp(28px, 5vw, 56px);
  background:
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 24rem),
    radial-gradient(circle at 8% 88%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 24rem),
    var(--panel);
}

.how-page::before {
  position: absolute;
  top: 108px;
  bottom: 190px;
  left: clamp(48px, 6vw, 72px);
  width: 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 8%, transparent), color-mix(in srgb, var(--primary) 42%, transparent), color-mix(in srgb, var(--primary-soft) 60%, transparent));
  content: "";
}

.how-header {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.how-header h2,
.how-cta h2 {
  max-width: 860px;
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 4.8vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.how-header > p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.flow-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 920px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 20px;
  background: rgba(248, 251, 255, 0.92);
}

.flow-progress::before {
  position: absolute;
  top: 50%;
  right: 28px;
  left: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--primary));
  content: "";
  opacity: 0.28;
}

.flow-progress span {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(207, 224, 247, 0.9);
  border-radius: 999px;
  background: white;
  color: #123c69;
  font-size: 0.86rem;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(29, 41, 57, 0.05);
}

.how-flow {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.how-step-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: flex-start;
  padding: clamp(18px, 3vw, 28px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94));
  animation: howStepIn 560ms ease both;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.how-step-card:nth-child(2) { animation-delay: 60ms; }
.how-step-card:nth-child(3) { animation-delay: 120ms; }
.how-step-card:nth-child(4) { animation-delay: 180ms; }
.how-step-card:nth-child(5) { animation-delay: 240ms; }

.how-step-card:hover {
  border-color: #b8c9e7;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.1);
  transform: translateY(-3px);
}

.how-step-card .eyebrow {
  margin: 0 0 6px;
}

.how-step-card h3 {
  margin-top: 0;
}

.how-step-card p + p {
  margin-top: 8px;
}

.how-cta {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(26, 115, 232, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(26, 115, 232, 0.18), transparent 18rem),
    linear-gradient(135deg, #f9fbff, #ffffff);
}

.how-cta .hero-actions {
  margin-top: 8px;
}

.landing-features {
  display: grid;
  gap: 24px;
  padding: 32px 0;
}

.feature-heading h2 {
  max-width: 760px;
  margin: 0;
  color: #111827;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

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

.feature-card {
  min-height: 260px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(26, 115, 232, 0.11), transparent 18rem),
    #ffffff;
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.13);
}

.feature-card-wide {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.feature-card h3 {
  max-width: 520px;
  margin: 0 0 12px;
  color: #111827;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.feature-card p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.feature-mock {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #dbeafe;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fbff, #eef6ff);
}

.feature-mock span {
  padding: 16px 18px;
  border: 1px solid #cfe0f7;
  border-radius: 16px;
  background: white;
  color: var(--text);
  font-weight: 850;
}

.final-card-grid article {
  min-height: 170px;
}

.landing-steps h2 {
  color: var(--text);
  font-size: clamp(1.8rem, 3vw, 3rem);
  letter-spacing: -0.04em;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.step-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f9fbff;
}

.step-grid span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--blue);
  font-weight: 950;
}

.step-grid h3 {
  margin: 16px 0 8px;
  color: var(--text);
}

.step-grid p {
  margin: 0;
  color: var(--muted);
}

.landing-faq {
  display: grid;
  gap: 20px;
  padding: 30px;
  border: 1px solid #cfe0f7;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(26, 115, 232, 0.14), transparent 22rem),
    #ffffff;
  box-shadow: var(--shadow);
}

.landing-faq h2 {
  max-width: 760px;
  color: var(--text);
  font-size: clamp(1.8rem, 3vw, 3rem);
  letter-spacing: -0.04em;
}

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

.final-cta {
  width: fit-content;
}

body:not([data-app-route]) .app-shell {
  display: none;
}

body[data-app-route] .landing-nav,
body[data-app-route] .lp-nav {
  display: none;
}

body[data-app-route] .landing-hero,
body[data-app-route] .landing-benefits,
body[data-app-route] .landing-features,
body[data-app-route] .landing-trust,
body[data-app-route] .landing-steps,
body[data-app-route] .landing-faq,
body[data-app-route] .lp-hero,
body[data-app-route] .lp-schools,
body[data-app-route] .lp-steps,
body[data-app-route] .lp-final {
  display: none;
}

body[data-app-route="login"] .sidebar {
  display: none;
}

body[data-app-route="login"] .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body[data-app-route="login"] .main {
  display: grid;
  place-items: center;
  min-height: 100vh;
  width: 100%;
  padding: clamp(16px, 3vw, 34px);
  background:
    radial-gradient(circle at 16% 12%, rgba(26, 115, 232, 0.08), transparent 26rem),
    #f1f3f7;
}

body[data-app-route] .main > section {
  display: none;
}

body[data-app-route="upload"] #upload,
body[data-app-route="login"] #login,
body[data-app-route="review"] #review,
body[data-app-route="conflicts"] #conflicts,
body[data-app-route="export"] #export,
body[data-app-route="academic"] #academic,
body[data-app-route="semester"] #semester,
body[data-app-route="settings"] #settings {
  display: block;
}

body[data-app-route="calendar"] #calendar {
  display: grid;
}

body[data-app-route="login"] #login.signup-split {
  display: grid;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  font-weight: 900;
}

.brand small,
.mini-card p,
.message,
.hero-copy {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 8px;
  margin: 32px 0;
}

.nav-list a {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.nav-list a:hover {
  background: var(--primary-tint);
  color: var(--primary-dark);
}

.sidebar-logout {
  width: 100%;
  margin-top: 10px;
  justify-content: center;
}

.app-mobile-header,
.mobile-drawer-backdrop {
  display: none;
}

.app-mobile-header {
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(219, 226, 239, 0.78);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.mobile-app-brand {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  gap: 10px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.mobile-app-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 0.82rem;
}

.mobile-app-brand strong,
#app-mobile-login {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-mobile-login {
  max-width: min(38vw, 220px);
}

.main {
  display: grid;
  gap: 24px;
  width: min(1500px, 100%);
  padding: 32px;
}

.hero,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

/* Headers theme reach: hero wears the campus gradient with light ink */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.6fr);
  gap: 24px;
  padding: 40px;
  border: 0;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(140deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 36px 80px rgba(15, 18, 40, 0.28);
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.9);
}

.hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: var(--h-track);
  color: #fff;
}

.hero-copy {
  max-width: 720px;
  font-size: 1.08rem;
}

.hero .hero-copy {
  color: rgba(255, 255, 255, 0.82);
}

/* Headers reach: CTA on the colored hero flips to a light button */
.hero .button.primary {
  border-color: #fff;
  background: #fff;
  color: var(--primary-dark);
}

.hero .button.ghost {
  border-color: rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
}

.hero-panel {
  display: grid;
  align-content: center;
  gap: 14px;
}

.hero .stat {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.stat,
.mini-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.stat strong {
  display: block;
  font-size: 2rem;
}

.card {
  padding: 24px;
}

.section-heading,
.calendar-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.button.ghost {
  background: transparent;
}

.button.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.button.tiny {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

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

.button.primary:hover {
  box-shadow: var(--shadow);
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.compact-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.upload-grid,
.calendar-workspace {
  display: grid;
  gap: 18px;
}

.upload-grid {
  grid-template-columns: minmax(260px, 0.8fr) minmax(280px, 1.2fr);
}

.drop-zone {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 24px;
  border: 2px dashed var(--primary-soft);
  border-radius: var(--radius);
  background: var(--primary-tint);
  cursor: pointer;
  text-align: center;
}

.drop-zone input {
  max-width: 100%;
}

.drop-zone span {
  display: block;
  margin-top: 12px;
  font-size: 1.3rem;
  font-weight: 900;
}

.paste-panel,
.settings-grid {
  display: grid;
  gap: 10px;
}

textarea,
input[type="text"],
input[type="date"],
input[type="search"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.advanced {
  margin-top: 16px;
}

.upload-mode-panel {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

.review-list,
.review-panel,
.course-filters {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.review-row,
.choice-card,
.unresolved-card,
.course-filter,
.detail-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.filter-group {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.filter-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.filter-section summary {
  padding: 8px 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.filter-check {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  color: var(--text);
  font-size: 0.88rem;
}

.review-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  background: white;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.review-row:hover {
  border-color: #b8c9e7;
  box-shadow: 0 10px 24px rgba(29, 41, 57, 0.06);
}

.review-row.is-approved {
  border-color: var(--primary-soft);
  background: color-mix(in srgb, var(--primary-tint) 45%, var(--panel));
}

.review-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.review-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.review-main strong {
  overflow: hidden;
  color: #182033;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-date,
.confidence-pill,
.review-count {
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.review-date {
  display: grid;
  gap: 1px;
  min-width: 112px;
  padding: 7px 10px;
  background: #eef4ff;
  color: #123c69;
  text-align: center;
}

.review-date small {
  color: #47627f;
  font-size: 0.72rem;
  font-weight: 750;
}

.confidence-pill,
.review-count {
  padding: 6px 9px;
  background: #f3f6fb;
  color: #526173;
}

.review-course-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}

.review-course-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  color: #182033;
  font-weight: 900;
}

.review-course-title {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.course-approve-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}

.review-category-block {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.review-category-block + .review-category-block {
  border-top: 1px solid var(--line);
}

.review-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 850;
}

.review-category-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
}

.review-panel h3 {
  margin: 0 0 8px;
}

.choice-card,
.unresolved-card {
  display: grid;
  gap: 8px;
}

.unresolved-card.course-note-card {
  background: #fbfdff;
  border-style: dashed;
}

.choice-card p,
.unresolved-card p {
  margin: 0;
}

.choice-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.choice-option:hover {
  background: var(--primary-tint);
}

.review-course-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.review-course-group summary {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  cursor: pointer;
  font-weight: 800;
}

.review-category-group {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.review-category-group h4 {
  margin: 0;
  font-size: 1rem;
}

.decision-field {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.9rem;
}

.decision-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--text);
}

/* ============================================================
   Review (Step 2) redesign — approval banner, section pills,
   course cards, event rows, and the Needs-review list.
   ============================================================ */
.review-approval-banner[hidden] {
  display: none !important;
}
.review-approval-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, white);
  border-radius: 18px;
  background: color-mix(in srgb, var(--primary) 9%, white);
}

.review-approval-banner.is-complete {
  border-color: color-mix(in srgb, var(--green) 22%, white);
  background: color-mix(in srgb, var(--green) 10%, white);
}

.review-approval-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.review-approval-text strong {
  color: var(--text);
  font-size: 1.3rem;
}

.review-approval-banner .button.primary {
  flex: none;
  white-space: nowrap;
}

.review-section-chooser {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.review-section-chooser h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.review-section-sub {
  margin: 0 0 14px;
  color: var(--muted);
}

.review-section-group + .review-section-group {
  margin-top: 16px;
}

.review-section-label {
  margin: 0 0 10px;
  color: var(--text);
  font-weight: 800;
}

.review-section-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.review-section-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 13px 20px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.review-section-pill:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
}

.review-section-pill.is-selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, white);
  color: var(--primary);
}

.review-section-name {
  font-weight: 850;
}

.review-section-when {
  color: var(--muted);
  font-weight: 650;
}

.review-section-pill.is-selected .review-section-when {
  color: color-mix(in srgb, var(--primary) 70%, var(--muted));
}

.review-course-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.review-course-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.review-course-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.review-course-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.review-course-meta strong {
  color: var(--text);
  font-size: 1.15rem;
}

.review-course-code {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.review-course-rows {
  display: grid;
}

.review-event-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
}

.review-event-row + .review-event-row {
  border-top: 1px solid var(--line);
}

.review-event-row.is-approved {
  background: color-mix(in srgb, var(--primary) 5%, white);
}

/* Section-alternative rows awaiting a section pick: visible but dimmed, and not
   yet approvable (the checkbox is disabled) until "Choose your section" is used. */
.review-event-row.is-pending-section {
  opacity: 0.55;
  cursor: default;
  background: color-mix(in srgb, var(--line) 22%, white);
}

.review-event-row.is-pending-section > input[type="checkbox"] {
  cursor: not-allowed;
}

.review-section-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, white);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

.review-pending-note {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.review-event-row > input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: none;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.review-cat {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.review-cat-class { background: #e8efff; color: #2459c9; }
.review-cat-recitation,
.review-cat-lab { background: #f3ecff; color: #6b3fd1; }
.review-cat-assignment,
.review-cat-quiz { background: #fdeede; color: #b9690a; }
.review-cat-exam { background: #fdecec; color: #c5303a; }
.review-cat-office_hours { background: #e6f6f1; color: #0c8a64; }
.review-cat-custom { background: #eef1f5; color: #51607a; }

.review-event-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.review-event-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-event-when {
  color: var(--muted);
  font-size: 0.9rem;
}

.review-evidence {
  max-width: 230px;
  overflow: hidden;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: #8a93a3;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confidence-pill.is-high { background: #e6f6ec; color: #1f8a4c; }
.confidence-pill.is-mid { background: #fdf4e3; color: #b07d12; }
.confidence-pill.is-low { background: #fdecec; color: #c5303a; }

.review-needs {
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid #f0d9a6;
  border-radius: 18px;
  background: white;
}

.review-needs-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: #fdf6e3;
  color: #8a6d1a;
  font-weight: 850;
  font-size: 1.05rem;
}

.review-needs-icon {
  font-size: 1.1rem;
}

.review-needs-body {
  display: grid;
}

.review-needs-item + .review-needs-item {
  border-top: 1px solid var(--line);
}

.review-needs-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.review-needs-text {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin-right: auto;
}

.review-needs-text strong {
  color: var(--text);
  font-size: 1.05rem;
}

.review-needs-pill {
  flex: none;
  padding: 7px 14px;
  border: 1px solid #e6c768;
  border-radius: 999px;
  background: #fdf6e3;
  color: #8a6d1a;
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
}

.review-needs-set {
  flex: none;
}

.review-needs-editor {
  padding: 0 20px 18px;
}

.review-needs-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.review-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(140px, 1fr) minmax(130px, 0.8fr) minmax(110px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.review-edit-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.review-edit-grid input,
.review-edit-grid select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
}

.small-button {
  padding: 10px 12px;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .review-edit-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.warning-box {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #fedf89;
  border-radius: 14px;
  background: #fffaeb;
  color: #93370d;
  font-weight: 700;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
}

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

.calendar-workspace {
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  align-items: start;
}

.calendar-card,
.calendar-sidebar,
.detail-panel {
  min-height: 460px;
}

.calendar-toolbar {
  flex-wrap: wrap;
}

#search {
  max-width: 260px;
}

.calendar-nav-actions { display: flex; gap: 8px; }
.trial-access-banner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; align-items: center; margin: 18px 0; padding: 16px 18px; border: 1px solid #fdb022; border-radius: 16px; background: #fffaeb; }
.trial-access-banner h3, .trial-access-banner p { margin: 0; }
.trial-access-banner .message { grid-column: 1 / -1; }
.trial-access-banner--active { border-color: #6ce9a6; background: #ecfdf3; }
.trial-access-banner[hidden] { display: none !important; }
.calendar-toolbar select { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.calendar-list { display: grid; gap: 10px; margin-top: 18px; }
.calendar-list-event { margin: 0; padding: 12px; }
.list-event-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.calendar-grid.week-view .day-cell { min-height: 240px; }
.calendar-grid.day-view { grid-template-columns: 1fr; }
.calendar-grid.day-view .day-cell { min-height: 360px; }
.day-button span,
.day-button strong { display: block; }
.calendar-view-placeholder { grid-column: 1 / -1; min-height: 320px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.calendar-event-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.calendar-event-form-grid label { display: grid; gap: 6px; font-weight: 750; }
.calendar-event-form-grid select, .calendar-event-form-grid input, .calendar-event-form-grid textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.calendar-event-notes { grid-column: 1 / -1; }
.calendar-event-form-grid .check-label { display: flex; align-items: center; }

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.weekday-row span {
  padding: 8px;
}

.day-cell {
  min-height: 138px;
  padding: 9px;
  border: 1px solid var(--line);
  background: white;
}

.day-cell.outside {
  background: #f2f5fa;
  color: #98a2b3;
}

.day-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 900;
}

.event-chip {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  overflow: hidden;
  border: 0;
  border-left: 4px solid var(--blue);
  border-radius: 9px;
  background: #edf4ff;
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-chip.office_hours {
  border-left-color: var(--green);
  background: #e9f7f4;
}

.event-chip.lab,
.event-chip.recitation {
  border-left-color: var(--purple);
  background: #f5edff;
}

.event-chip.homework,
.event-chip.assignment,
.event-chip.quiz {
  border-left-color: var(--orange);
  background: #fff3e3;
}

.event-chip.midterm,
.event-chip.final {
  border-left-color: var(--red);
  background: #fff0ef;
}

.event-chip.external {
  border-left-color: #64748b;
  background: #f1f5f9;
  color: #334155;
  font-style: italic;
}

.detail-panel h3 {
  margin-top: 0;
}

.calendar-card-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 26px 20px;
  border-bottom: 1px solid rgba(219, 226, 239, 0.84);
  background:
    radial-gradient(circle at top right, rgba(26, 115, 232, 0.12), transparent 24rem),
    linear-gradient(135deg, #ffffff 0%, #f7faff 100%);
}

.calendar-card-copy {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}

.calendar-add-button {
  flex: 0 0 auto;
  min-width: 126px;
  box-shadow: 0 12px 26px rgba(217, 52, 69, 0.22);
}

.calendar-toolbar-spacer {
  flex: 1 1 auto;
}

body[data-app-route="calendar"] .app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
}

body[data-app-route="calendar"] .main {
  width: min(1840px, 100%);
  padding: clamp(18px, 2vw, 28px);
}

body[data-app-route="calendar"] .sidebar {
  padding: 22px;
}

.calendar-workspace {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(210px, 250px);
  gap: 14px;
  align-items: start;
}

.calendar-card {
  min-width: 0;
  min-height: min(820px, calc(100vh - 56px));
  overflow: hidden;
  padding: 0;
  border-color: rgba(204, 213, 229, 0.92);
  box-shadow: 0 24px 70px rgba(29, 41, 57, 0.12);
}

.calendar-control-rail,
.detail-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.calendar-control-rail {
  display: grid;
  gap: 14px;
  min-height: auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

.calendar-rail-section {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(249, 251, 255, 0.88);
}

.calendar-rail-intro {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--primary) 13%, transparent), transparent 16rem),
    var(--panel);
}

.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
}

.rail-heading small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.calendar-control-rail .course-filters {
  margin-top: 12px;
}

.calendar-control-rail .course-filter {
  padding: 12px;
  background: white;
}

.calendar-control-rail .settings-note ul {
  padding-left: 18px;
}

.calendar-control-rail .settings-note li {
  margin: 7px 0;
}

.calendar-control-rail .trial-access-banner {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
}

.calendar-control-rail .trial-access-banner .button {
  width: 100%;
}

.parser-memory-card {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.94)),
    var(--panel);
}

.parser-memory-list {
  display: grid;
  gap: 10px;
}

.parser-memory-toolbar {
  display: grid;
  gap: 7px;
}

.parser-memory-toolbar .button {
  width: 100%;
}

.parser-memory-subhead {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.parser-memory-item {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid rgba(204, 213, 229, 0.88);
  border-radius: 14px;
  background: white;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.parser-memory-item.is-unread {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
  background: color-mix(in srgb, var(--primary-tint) 42%, white);
}

.parser-memory-item strong {
  font-size: 0.94rem;
  line-height: 1.25;
}

.parser-memory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.parser-memory-lock {
  padding: 10px;
  border-radius: 12px;
  background: #fffaeb;
  color: #92400e;
}

.study-planner-card {
  display: grid;
  gap: 12px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 14%, transparent), transparent 12rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.94));
}

.study-planner-fields {
  display: grid;
  gap: 8px;
}

.study-planner-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.study-planner-fields input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
}

.study-planner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.study-planner-actions .button {
  width: 100%;
}

.study-planner-list {
  display: grid;
  gap: 8px;
}

.study-planner-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(204, 213, 229, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.study-planner-item strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.study-planner-item span,
.study-planner-item small {
  color: var(--muted);
  font-size: 0.78rem;
}

.study-suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.academic-plan-page {
  display: grid;
  gap: 18px;
  background:
    radial-gradient(circle at 12% 0%, var(--primary-tint), transparent 28rem),
    var(--panel);
}

.academic-plan-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.74)),
    radial-gradient(circle at 82% 10%, var(--primary-tint), transparent 22rem);
  box-shadow: var(--shadow-sm);
}

.academic-plan-hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 4vw, 4.1rem);
  line-height: 0.9;
}

.academic-plan-hero p {
  max-width: 760px;
}

.academic-plan-actions,
.academic-share-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.academic-plan-actions {
  justify-content: flex-end;
}

.academic-plan-content {
  display: grid;
  gap: 18px;
}

.academic-plan-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 800;
}

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

.academic-plan-metrics > div,
.academic-plan-card,
.academic-share-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.academic-plan-metrics > div {
  display: grid;
  gap: 2px;
  padding: 16px;
}

.academic-plan-metrics span,
.academic-share-link span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.academic-plan-metrics strong {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

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

.academic-plan-card,
.academic-share-card {
  padding: 18px;
}

.academic-plan-card h3,
.academic-share-card h3 {
  margin: 0 0 12px;
}

.academic-plan-row,
.academic-share-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.academic-plan-row:first-of-type,
.academic-share-link:first-child {
  border-top: 0;
}

.academic-plan-row div,
.academic-share-link div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.academic-plan-row strong,
.academic-share-link strong {
  overflow-wrap: anywhere;
}

.academic-plan-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.academic-plan-row time {
  flex: none;
  max-width: 220px;
  color: var(--primary-dark);
  font-weight: 900;
  text-align: right;
}

.academic-action-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.academic-share-card {
  display: grid;
  gap: 14px;
}

.academic-share-card .section-heading {
  align-items: flex-start;
}

.academic-share-controls label {
  display: grid;
  flex: 1 1 220px;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.academic-share-controls select,
.academic-share-controls input,
.academic-share-result input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
}

.academic-share-result:not([hidden]) {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius-sm);
  background: var(--primary-tint);
}

.academic-share-result label {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.academic-share-links {
  display: grid;
  gap: 2px;
}

.calendar-toolbar {
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(219, 226, 239, 0.76);
  background: rgba(249, 251, 255, 0.92);
}

.calendar-toolbar select,
#search {
  min-height: 38px;
}

#search {
  max-width: 300px;
  min-width: min(260px, 100%);
}

.calendar-card .weekday-row {
  margin-top: 0;
  padding: 0 16px;
  border-bottom: 1px solid rgba(219, 226, 239, 0.7);
  background: #ffffff;
}

.calendar-card .calendar-grid,
.calendar-card .calendar-list {
  padding: 0 16px 18px;
}

.calendar-grid.month-view .day-cell {
  min-height: clamp(144px, 12vh, 186px);
}

.calendar-grid.week-view .day-cell {
  min-height: clamp(320px, 52vh, 560px);
}

.calendar-grid.day-view .day-cell {
  min-height: clamp(420px, 60vh, 680px);
}

.calendar-card .day-cell {
  background: rgba(255, 255, 255, 0.96);
}

.calendar-card .day-cell:hover {
  background: #fbfdff;
}

.calendar-card .event-chip {
  box-shadow: 0 6px 14px rgba(29, 41, 57, 0.06);
}

.detail-panel {
  min-height: auto;
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
}

.detail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.detail-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 4px 6px;
  color: var(--color-text-muted, #6b7280);
  border-radius: 4px;
}

.premium-detail-prompt {
  display: grid;
  gap: 10px;
}

.calendar-workspace.calendar-workspace-shell {
  display: grid;
  grid-template-columns: minmax(210px, 236px) minmax(220px, 260px) minmax(0, 1fr);
  grid-template-areas:
    "topbar topbar topbar"
    "workflow rail canvas";
  gap: 12px;
  align-items: stretch;
}

.calendar-workspace.calendar-workspace-shell.has-event-detail {
  grid-template-columns: minmax(210px, 236px) minmax(220px, 260px) minmax(0, 1fr) minmax(280px, 330px);
  grid-template-areas:
    "topbar topbar topbar topbar"
    "workflow rail canvas details";
}

.calendar-workspace.calendar-workspace-shell[data-workflow-pane="closed"] {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  grid-template-areas:
    "topbar topbar"
    "rail canvas";
}

.calendar-workspace.calendar-workspace-shell[data-workflow-pane="closed"].has-event-detail {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(280px, 330px);
  grid-template-areas:
    "topbar topbar topbar"
    "rail canvas details";
}

.calendar-app-bar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 16px 45px rgba(15, 18, 40, 0.18);
}

.calendar-app-bar h2,
.calendar-app-bar p {
  margin: 0;
  color: #fff;
}

.calendar-app-bar .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.calendar-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calendar-plan-badge.is-pro {
  background: #fff;
  color: var(--primary-dark);
}

.calendar-plan-badge.is-free {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.calendar-account-label {
  margin-left: auto;
  max-width: 38ch;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-menu-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  cursor: pointer;
}

.calendar-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.calendar-workflow-pane {
  grid-area: workflow;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: min(820px, calc(100vh - 96px));
  padding: 14px;
  overflow: auto;
  border: 1px solid rgba(204, 213, 229, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 55px rgba(29, 41, 57, 0.09);
}

.calendar-workflow-pane.is-collapsed {
  display: none;
}

.workflow-pane-header {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, transparent), color-mix(in srgb, var(--primary-soft) 30%, transparent));
}

.workflow-pane-header p,
.workflow-pane-header strong {
  margin: 0;
}

.workflow-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.workflow-step > span {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-content: center;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--blue);
  font-weight: 900;
}

.workflow-step p,
.workflow-step strong {
  margin: 0 0 4px;
}

.workflow-step a {
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 900;
  text-decoration: none;
}

.workflow-export-note {
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: #f6f8fc;
  color: var(--muted);
  font-size: 0.9rem;
}

.calendar-workspace-shell .calendar-control-rail {
  grid-area: rail;
  border: 1px solid rgba(204, 213, 229, 0.9);
  border-radius: 22px;
  box-shadow: 0 18px 55px rgba(29, 41, 57, 0.08);
}

.calendar-workspace-shell .calendar-canvas {
  grid-area: canvas;
}

.calendar-workspace-shell .detail-panel {
  grid-area: details;
}

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

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 10px;
}

.mini-calendar-weekday,
.mini-calendar-day {
  min-height: 28px;
  border-radius: 9px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 850;
}

.mini-calendar-weekday {
  display: grid;
  place-content: center;
  color: var(--muted);
}

.mini-calendar-day {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.mini-calendar-day.outside {
  color: #98a2b3;
}

.mini-calendar-day.today {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 45%, transparent);
}

.mini-calendar-day.selected {
  background: var(--primary);
  color: white;
}

.calendar-export-note p {
  margin-bottom: 8px;
}

.calendar-feedback-button,
#workflow-feedback-button {
  width: 100%;
}

.calendar-week-grid {
  display: grid;
  grid-template-columns: 68px repeat(7, minmax(120px, 1fr));
  padding: 0 16px 18px;
  overflow: auto;
}

.week-grid-corner,
.week-day-header,
.week-time-label,
.week-time-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.week-day-header {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 58px;
  padding: 8px;
  background: white;
}

.week-day-header.is-today {
  background: #eef4ff;
}

.week-time-label {
  display: grid;
  min-height: 64px;
  place-content: start end;
  padding: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.week-all-day-label,
.week-all-day-cell {
  min-height: 48px;
}

.week-time-cell {
  min-height: 64px;
  padding: 5px;
  cursor: pointer;
}

.week-time-cell:hover {
  background: #fbfdff;
}

.week-time-cell .event-chip,
.week-all-day-cell .event-chip {
  margin-top: 0;
  margin-bottom: 4px;
}

.feedback-form-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.feedback-form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 750;
}

.feedback-form-grid select,
.feedback-form-grid textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

body[data-app-route="calendar"] .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body[data-app-route="calendar"] .sidebar {
  display: none;
}

body[data-app-route="calendar"] .main {
  width: min(1920px, 100%);
  padding: 12px;
}

@media (max-width: 1180px) {
  .calendar-workspace.calendar-workspace-shell,
  .calendar-workspace.calendar-workspace-shell.has-event-detail,
  .calendar-workspace.calendar-workspace-shell[data-workflow-pane="closed"],
  .calendar-workspace.calendar-workspace-shell[data-workflow-pane="closed"].has-event-detail {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "topbar"
      "workflow"
      "rail"
      "canvas"
      "details";
  }

  .calendar-workspace.calendar-workspace-shell[data-workflow-pane="closed"] {
    grid-template-areas:
      "topbar"
      "rail"
      "canvas"
      "details";
  }

  .calendar-workflow-pane,
  .calendar-workspace-shell .calendar-control-rail,
  .calendar-workspace-shell .detail-panel {
    position: static;
    max-height: none;
    min-height: auto;
  }
}

@media (max-width: 1280px) {
  body[data-app-route="calendar"] .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .calendar-workspace {
    grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }
}

.conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.conflict-pair {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  overflow: hidden;
}

.conflict-pair-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.conflict-choice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.conflict-choice-button,
.conflict-resolved-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 168px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  color: var(--text);
  text-align: left;
}

.conflict-choice-button {
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 320ms ease, filter 320ms ease;
}

.conflict-choice-button:hover,
.conflict-choice-button:focus-visible {
  border-color: #b8c9e7;
  box-shadow: 0 14px 32px rgba(29, 41, 57, 0.1);
  outline: none;
  transform: translateY(-2px);
}

.conflict-choice-button:focus-visible {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent), 0 14px 32px rgba(29, 41, 57, 0.1);
}

.conflict-choice-button strong,
.conflict-resolved-card strong {
  color: #182033;
  font-size: 1rem;
  line-height: 1.35;
}

.conflict-time-chip {
  display: grid;
  gap: 2px;
  width: fit-content;
  margin-top: auto;
  padding: 8px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #123c69;
  font-size: 0.82rem;
  font-weight: 850;
}

.conflict-time-chip small {
  color: #47627f;
}

.conflict-or {
  align-self: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  box-shadow: 0 0 0 1px var(--line);
}

.resolved-badge {
  display: none;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f7ed;
  color: #188038;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.conflict-card--selected {
  border-color: #97d3aa;
  background: #fbfffc;
  box-shadow: 0 16px 36px rgba(24, 128, 56, 0.13);
  transform: scale(1.01);
}

.conflict-card--selected .resolved-badge,
.conflict-pair--resolved .resolved-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  animation: resolvedBadgeIn 260ms ease both;
}

.conflict-card--selected .resolved-badge::before,
.conflict-pair--resolved .resolved-badge::before {
  content: "✓";
}

.conflict-card--dismissed {
  opacity: 0;
  filter: blur(3px);
  transform: scale(0.96);
}

.conflict-pair--resolving .conflict-or,
.conflict-pair--resolving .conflict-actions {
  opacity: 0.25;
  transition: opacity 220ms ease;
}

.conflict-pair--resolved {
  border-color: #b9ddc6;
  background: #f7fff9;
}

.conflict-resolved-card {
  min-height: 0;
  border-color: #b9ddc6;
  background: white;
  animation: resolvedCardIn 320ms ease both;
}

@keyframes resolvedBadgeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes resolvedCardIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.settings-note {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

/* Calendar integrations (Phase 5) — wrap-friendly, no horizontal overflow. */
.calendar-integrations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.calendar-provider-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  min-width: 0;
}
.calendar-provider-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.calendar-provider-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.calendar-provider-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.calendar-list-target {
  margin-top: 10px;
}
.calendar-target-label {
  display: block;
  margin-bottom: 8px;
}
.calendar-target-label select {
  max-width: 100%;
}
.calendar-sync-panel {
  margin-top: 10px;
  min-width: 0;
}
.calendar-overlay-panel {
  margin-top: 14px;
}
.calendar-overlay-consent,
.calendar-overlay-provider {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.calendar-overlay-consent h4 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.calendar-overlay-consent p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.calendar-overlay-providers,
.calendar-overlay-choices {
  display: grid;
  gap: 8px;
}
.calendar-overlay-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--panel-soft);
}
.calendar-overlay-choice small {
  color: var(--muted);
  font-weight: 700;
}
.calendar-overlay-actions {
  flex-wrap: wrap;
  margin-top: 10px;
}
.debug-state-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.debug-state-list li {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.debug-state-list span,
.debug-state-list small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.sync-preview {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.sync-plan-group {
  margin: 6px 0;
}
.sync-plan-list {
  margin: 6px 0 6px 18px;
  padding: 0;
}
.sync-plan-list li {
  overflow-wrap: anywhere;
}
.sync-cleanup-result {
  margin-top: 10px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  font-weight: 700;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.calendar-sync-consent-preview ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 14px;
  padding-left: 1.2rem;
  color: var(--muted);
}

.login-card {
  display: grid;
  grid-template-columns: minmax(430px, 1.05fr) minmax(340px, 0.75fr);
  gap: clamp(18px, 2.8vw, 40px);
  align-items: center;
  width: min(1340px, 100%);
  height: calc(100vh - clamp(32px, 6vw, 68px));
  min-height: 620px;
  padding: clamp(24px, 3.2vw, 54px);
  overflow: hidden;
  border: 14px solid rgba(255, 255, 255, 0.58);
  border-radius: 38px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at 64% 48%, color-mix(in srgb, var(--primary) 28%, transparent), transparent 22rem),
    linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow:
    0 38px 90px rgba(15, 23, 42, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-visual {
  position: relative;
  display: grid;
  height: 100%;
  min-height: 0;
  align-content: start;
  grid-template-rows: auto 1fr;
  gap: 44px;
  padding: 0;
  overflow: hidden;
  color: white;
}

.auth-visual::before,
.auth-visual::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  content: "";
}

.auth-visual::before {
  width: 860px;
  height: 500px;
  left: -210px;
  top: 18%;
  transform: rotate(-22deg);
}

.auth-visual::after {
  right: -80px;
  bottom: -160px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 30%, transparent), transparent 62%);
}

.auth-brand {
  position: relative;
  z-index: 1;
  color: white;
}

.auth-mini-nav {
  position: absolute;
  top: 8px;
  left: clamp(190px, 22vw, 310px);
  z-index: 2;
  display: flex;
  gap: clamp(18px, 3vw, 40px);
  align-items: center;
}

.auth-mini-nav a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.auth-mini-nav a:hover,
.auth-mini-nav a:focus-visible {
  color: white;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.auth-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  max-width: 620px;
  margin-top: clamp(56px, 9vh, 110px);
  padding: clamp(26px, 4vw, 38px);
  border: 1px solid rgba(96, 165, 250, 0.08);
  background:
    radial-gradient(circle at 82% 18%, rgba(37, 99, 235, 0.18), transparent 14rem),
    rgba(2, 6, 23, 0.9);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.28);
}

.auth-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(3.1rem, 5.6vw, 6.45rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.auth-copy p {
  color: rgba(255, 255, 255, 0.72);
}

.auth-line-art span {
  position: absolute;
  border: 1px solid rgba(147, 197, 253, 0.26);
  border-radius: 999px;
}

.auth-line-art span:nth-child(1) { inset: 18% 12% 36% 8%; transform: rotate(14deg); }
.auth-line-art span:nth-child(2) { inset: 30% 18% 24% 18%; transform: rotate(-18deg); }
.auth-line-art span:nth-child(3) { inset: 42% 30% 34% 4%; transform: rotate(26deg); }
.auth-line-art span:nth-child(4) { inset: 12% 36% 52% 30%; transform: rotate(-8deg); }

.auth-panel {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  max-height: calc(100vh - clamp(90px, 11vw, 140px));
  margin: 0;
  overflow: auto;
  justify-self: center;
  padding: clamp(28px, 3.5vw, 42px);
  border: 1px solid #e2e8f0;
  border-radius: 26px;
  background: white;
  box-shadow:
    0 0 0 14px rgba(8, 22, 48, 0.54),
    0 30px 90px rgba(0, 0, 0, 0.38);
}

.auth-panel h2 {
  margin: 0 0 8px;
  color: #111827;
  font-size: clamp(2.1rem, 4vw, 3rem);
  letter-spacing: -0.05em;
}

.login-grid,
.signup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
  margin-top: 16px;
}

.signup-grid[hidden],
.auth-actions[hidden] {
  display: none !important;
}

.login-grid label,
.signup-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.login-grid input,
.login-grid select,
.signup-grid input,
.signup-grid select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
}

.auth-actions {
  align-items: stretch;
  margin-top: 18px;
}

.auth-actions .button {
  flex: 1 1 0;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes heroFloatIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes howStepIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.export-dialog {
  width: min(640px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.export-dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(4px);
}

.export-option-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 20px;
}

.export-option-list label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.export-option-list span {
  display: grid;
  gap: 4px;
}

.export-option-list small {
  color: var(--muted);
}

.dialog-actions {
  justify-content: flex-end;
}

@media (max-width: 1150px) {
  .landing-nav {
    grid-template-columns: 1fr;
  }

  .landing-links,
  .landing-actions {
    flex-wrap: wrap;
  }

  .landing-hero,
  .landing-benefits,
  .faq-grid,
  .step-grid,
  .feature-card-grid,
  .feature-card-wide,
  .login-card,
  .app-shell,
  .hero,
  .upload-grid,
  .conflict-choice-grid,
  .calendar-workspace {
    grid-template-columns: 1fr;
  }

  .conflict-or {
    justify-self: center;
  }

  .landing-hero {
    min-height: auto;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  body[data-app-route="calendar"] .app-shell {
    grid-template-columns: 1fr;
  }

  .calendar-control-rail,
  .detail-panel {
    position: static;
    max-height: none;
  }

  .calendar-card {
    min-height: auto;
  }

  .calendar-card-header,
  .calendar-toolbar {
    align-items: stretch;
  }

  .academic-plan-hero {
    flex-direction: column;
  }

  .academic-plan-actions {
    justify-content: flex-start;
  }

  .academic-plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  body[data-app-route] .app-shell,
  body[data-app-route="login"] .app-shell,
  body[data-app-route="calendar"] .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-app-route] .app-mobile-header {
    position: sticky;
    top: 0;
    z-index: 70;
    display: flex;
  }

  body[data-app-route] .mobile-menu-button {
    display: grid;
  }

  body[data-app-route] .sidebar,
  body[data-app-route="login"] .sidebar,
  body[data-app-route="calendar"] .sidebar {
    position: fixed;
    z-index: 90;
    top: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: min(86vw, 340px);
    height: 100dvh;
    padding: 22px;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    border-radius: 0 24px 24px 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  body.mobile-drawer-open[data-app-route] .sidebar {
    transform: translateX(0);
  }

  body.mobile-drawer-open {
    overflow: hidden;
  }

  .mobile-drawer-backdrop:not([hidden]) {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: block;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(2px);
  }

  body[data-app-route] .main,
  body[data-app-route="calendar"] .main {
    width: 100%;
    padding: 20px;
  }

  body[data-app-route="login"] .main {
    min-height: calc(100dvh - 69px);
  }

  .nav-list a,
  .button,
  .filter-section summary,
  .filter-check,
  .mini-calendar-day,
  .day-button,
  .calendar-list-event,
  .list-event-row,
  .conflict-choice-button {
    min-height: 44px;
  }

  .calendar-workspace.calendar-workspace-shell,
  .calendar-workspace.calendar-workspace-shell.has-event-detail,
  .calendar-workspace.calendar-workspace-shell[data-workflow-pane="closed"],
  .calendar-workspace.calendar-workspace-shell[data-workflow-pane="closed"].has-event-detail {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "topbar"
      "workflow"
      "rail"
      "canvas"
      "details";
  }

  .calendar-workspace.calendar-workspace-shell[data-workflow-pane="closed"],
  .calendar-workspace.calendar-workspace-shell[data-workflow-pane="closed"].has-event-detail {
    grid-template-areas:
      "topbar"
      "rail"
      "canvas"
      "details";
  }

  .calendar-app-bar,
  .calendar-card-header,
  .calendar-toolbar {
    flex-wrap: wrap;
  }

  .calendar-account-label {
    width: 100%;
    max-width: none;
    margin-left: 0;
    text-align: left;
    white-space: normal;
  }

  .calendar-workflow-pane,
  .calendar-workspace-shell .calendar-control-rail,
  .calendar-workspace-shell .detail-panel {
    position: static;
    max-height: none;
    min-height: auto;
  }

  .calendar-workspace-shell .calendar-control-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-rail-section,
  .calendar-export-note,
  .calendar-feedback-button {
    min-width: 0;
  }

  .trial-access-banner {
    grid-template-columns: minmax(0, 1fr);
  }

  .calendar-nav-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .calendar-nav-actions .button,
  .calendar-add-button,
  #search,
  #calendar-view {
    width: 100%;
    max-width: none;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .landing-nav {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .landing-actions {
    justify-self: start;
  }

  .calendar-card .calendar-grid,
  .calendar-card .calendar-list {
    padding-inline: 14px;
  }
}

@media (max-width: 720px) {
  .landing-nav,
  .landing-hero,
  .landing-trust,
  .landing-benefits,
  .landing-features,
  .landing-steps {
    width: auto;
  }

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

  .calendar-event-form-grid { grid-template-columns: 1fr; }
  .calendar-event-notes { grid-column: auto; }

  .landing-nav {
    padding: 14px 18px;
  }

  .landing-links {
    gap: 14px;
  }

  .landing-hero {
    padding: 38px 18px 48px;
  }

  .landing-copy h1 {
    font-size: 3rem;
  }

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

  .preview-layout > * + * {
    border-top: 1px solid #dde7f5;
    border-left: 0;
  }

  .landing-steps {
    margin: 0 18px 24px;
    padding: 20px;
  }

  .landing-benefits,
  .landing-features,
  .landing-faq {
    margin: 0 18px 24px;
  }

  .feature-card {
    min-height: auto;
  }

  .login-card,
  .auth-visual {
    min-height: auto;
  }

  .login-card {
    width: 100%;
    padding: 24px 18px 32px;
    border-width: 8px;
    border-radius: 26px;
  }

  .auth-visual {
    gap: 30px;
    min-height: 420px;
  }

  .auth-panel {
    width: 100%;
    margin: 0;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  }

  .auth-mini-nav {
    position: relative;
    top: auto;
    left: auto;
    flex-wrap: wrap;
  }

  .auth-copy {
    margin-top: 12px;
  }

  .auth-copy h2 {
    font-size: clamp(3rem, 14vw, 5rem);
  }

  .landing-faq {
    padding: 20px;
  }

  .main {
    padding: 18px;
  }

  .calendar-grid,
  .weekday-row {
    grid-template-columns: 1fr;
  }

  .academic-plan-metrics {
    grid-template-columns: 1fr;
  }

  .academic-plan-row,
  .academic-share-link {
    align-items: flex-start;
    flex-direction: column;
  }

  .academic-plan-row time {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .landing-nav {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
  }

  .landing-mobile-menu-button {
    display: grid;
    justify-self: end;
  }

  .landing-links,
  .landing-actions {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
  }

  body.landing-menu-open .landing-links,
  body.landing-menu-open .landing-actions {
    display: grid;
    gap: 10px;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
  }

  .landing-links a,
  .landing-actions a,
  .landing-actions .button,
  .landing-actions .nav-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .landing-hero,
  .landing-benefits,
  .landing-features,
  .landing-steps,
  .landing-faq {
    margin-inline: 12px;
  }

  .how-page {
    padding: 22px;
  }

  .how-page::before,
  .flow-progress::before {
    display: none;
  }

  .flow-progress {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .flow-progress span {
    justify-content: start;
    padding-inline: 14px;
  }

  .how-step-card {
    grid-template-columns: 1fr;
  }

  .landing-copy h1 {
    font-size: clamp(2.5rem, 13vw, 3rem);
  }

  .hero-actions,
  .actions,
  .auth-actions,
  .dialog-actions,
  .conflict-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .button,
  .actions .button,
  .actions a.button,
  .auth-actions .button,
  .dialog-actions .button {
    width: 100%;
    justify-content: center;
  }

  .button.small {
    min-height: 44px;
  }

  body[data-app-route] .main,
  body[data-app-route="calendar"] .main {
    padding: 14px;
  }

  .app-mobile-header {
    padding: 10px 12px;
  }

  #app-mobile-login {
    max-width: 34vw;
    padding-inline: 10px;
    font-size: 0.82rem;
  }

  .hero,
  .card,
  .calendar-card,
  .calendar-workflow-pane,
  .calendar-workspace-shell .calendar-control-rail,
  .detail-panel {
    border-radius: 20px;
  }

  .section-heading,
  .calendar-card-header {
    display: grid;
    gap: 12px;
  }

  .upload-grid,
  .settings-grid,
  .calendar-workspace-shell .calendar-control-rail,
  .conflict-choice-grid {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 156px;
  }

  .paste-panel textarea,
  .feedback-form-grid textarea,
  .calendar-event-form-grid textarea {
    min-height: 148px;
  }

  .review-row,
  .list-event-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .review-course-group > summary,
  .review-course-group summary,
  .review-category-heading {
    flex-wrap: wrap;
    min-width: 0;
  }

  .review-edit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-edit-grid input,
  .review-edit-grid select,
  .review-edit-grid button,
  .decision-field select {
    min-width: 0;
    max-width: 100%;
  }

  .review-main strong,
  .review-main .meta,
  .review-course-title,
  .detail-item,
  .choice-card,
  .unresolved-card,
  .calendar-list-event,
  .list-event-row,
  .conflict-choice-button {
    overflow-wrap: anywhere;
  }

  .review-main strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .calendar-app-bar {
    align-items: stretch;
  }

  .calendar-app-bar > div {
    min-width: 0;
  }

  .calendar-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .calendar-toolbar-spacer {
    display: none;
  }

  .calendar-card .weekday-row {
    display: none;
  }

  .calendar-card .calendar-grid,
  .calendar-card .calendar-list {
    padding: 0 10px 14px;
  }

  .calendar-grid.month-view .day-cell,
  .calendar-grid.week-view .day-cell,
  .calendar-grid.day-view .day-cell {
    min-height: auto;
  }

  .day-cell {
    padding: 12px;
  }

  .event-chip {
    white-space: normal;
  }

  body[data-app-route="calendar"] .detail-panel:not([hidden]) {
    position: fixed;
    z-index: 95;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    max-height: 72dvh;
    padding: 20px;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.18);
  }

  .export-dialog,
  .calendar-event-dialog,
  .feedback-dialog {
    width: 100vw;
    max-width: none;
    max-height: 88dvh;
    margin: auto 0 0;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
  }

  .calendar-event-form-grid,
  .feedback-form-grid {
    grid-template-columns: 1fr;
  }

  .calendar-event-notes {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .conflict-choice-button,
  .conflict-card--dismissed,
  .conflict-card--selected,
  .conflict-resolved-card,
  .resolved-badge,
  .landing-visual,
  .feature-card,
  .sidebar,
  .how-step-card,
  .flow-progress span,
  .reveal-on-scroll {
    animation: none !important;
    transition: none !important;
  }

  .conflict-choice-button:hover,
  .conflict-choice-button:focus-visible,
  .conflict-card--selected,
  .conflict-card--dismissed,
  .feature-card:hover,
  .how-step-card:hover,
  .reveal-on-scroll {
    filter: none;
    transform: none;
  }

  .reveal-on-scroll {
    opacity: 1;
  }
}

/* ============================================================
   Landing + Sign-up redesign (Spark direction · Headers reach)
   Faithful to the Syllabus2Cal Redesign prototype.
   ============================================================ */

/* ---- product nav ---- */
.lp-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 64px);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.lp-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.lp-brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
}

.lp-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lp-nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.lp-nav-links a {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--muted);
  text-decoration: none;
}

.lp-nav-links a:hover {
  color: var(--primary);
}

.lp-nav-login {
  color: var(--text) !important;
}

.lp-nav-cta {
  min-height: 42px;
  padding: 0 20px;
  font-size: 14.5px;
}

/* ---- hero ---- */
.lp-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 7vw, 96px) clamp(20px, 5vw, 64px) clamp(56px, 7vw, 104px);
  background: linear-gradient(140deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.lp-hero::before {
  content: "";
  position: absolute;
  top: -90px;
  right: 8%;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, var(--primary-soft), transparent 70%);
  opacity: 0.5;
  filter: blur(6px);
  animation: lpFloat 9s ease-in-out infinite;
  pointer-events: none;
}

@keyframes lpFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

.lp-hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
}

.lp-hero-eyebrow {
  color: rgba(255, 255, 255, 0.9);
}

.lp-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--h-weight);
  letter-spacing: var(--h-track);
  line-height: 0.98;
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  color: #fff;
}

.lp-hero-sub {
  max-width: 480px;
  margin: 22px 0 0;
  font-size: 1.12rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.lp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 30px;
}

.button.lp-cta-light {
  min-height: 50px;
  padding: 0 26px;
  border: 0;
  background: #fff;
  color: var(--primary-dark);
  font-size: 16px;
}

.button.lp-cta-light:hover {
  background: #fff;
  color: var(--primary-dark);
}

.button.lp-cta-outline {
  min-height: 50px;
  padding: 0 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  font-size: 16px;
}

.lp-hero-note {
  margin: 18px 0 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.82);
}

/* ---- hero preview card ---- */
.lp-preview {
  overflow: hidden;
  border-radius: calc(var(--radius) + 4px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 36px 80px rgba(15, 18, 40, 0.28);
}

.lp-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--primary);
  color: #fff;
}

.lp-preview-term {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.lp-preview-school {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
}

.lp-preview-body {
  padding: 18px 20px;
}

.lp-preview-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.lp-preview-week > span {
  display: grid;
  place-items: center;
  height: 30px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.lp-preview-dow {
  height: auto !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  color: var(--muted) !important;
}

.lp-preview-week .is-today {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.lp-preview-event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.lp-ev-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.lp-ev-dot.ev-class {
  background: var(--blue);
}
.lp-ev-dot.ev-quiz {
  background: var(--purple);
}
.lp-ev-dot.ev-midterm {
  background: var(--red);
}

.lp-ev-title {
  flex: 1;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
}

.lp-ev-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* ---- shared section bits ---- */
.lp-accent-eyebrow {
  color: var(--primary);
}

.lp-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--h-weight);
  letter-spacing: var(--h-track);
  line-height: 1.02;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  color: var(--text);
}

.lp-section-sub {
  margin: 16px auto 0;
  max-width: 560px;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ---- multi-school strip ---- */
.lp-schools {
  padding: clamp(40px, 5vw, 72px) clamp(20px, 5vw, 64px);
  background: var(--bg);
}

.lp-schools-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.lp-school-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.lp-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lp-chip[data-school-chip]:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.lp-chip[data-school-chip].is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.lp-chip[data-school-chip].is-active .lp-chip-dot {
  background: #fff !important;
}

.lp-chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: none;
}

.lp-chip-static {
  border-style: dashed;
  color: var(--muted);
  cursor: default;
}

.lp-chip-more {
  background: transparent;
}

/* ---- how it works ---- */
.lp-steps {
  padding: clamp(40px, 5vw, 80px) clamp(20px, 5vw, 64px);
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.lp-steps-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.lp-steps-title {
  margin: 0 0 36px;
  max-width: 640px;
}

.lp-step-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.lp-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
}

.lp-step-n {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-tint);
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}

.lp-step strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
}

.lp-step p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--muted);
}

.lp-steps-note {
  margin: 24px 0 0;
  max-width: 760px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ---- final CTA ---- */
.lp-final {
  padding: clamp(48px, 6vw, 88px) clamp(20px, 5vw, 64px);
  background: linear-gradient(140deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.lp-final-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.lp-final-title {
  margin: 0 0 28px;
  font-family: var(--font-display);
  font-weight: var(--h-weight);
  letter-spacing: var(--h-track);
  line-height: 1.02;
  font-size: clamp(2rem, 4vw, 3.4rem);
  color: #fff;
}

/* ============ Sign-up / login split ============ */
body[data-app-route="login"] .main {
  padding: 0;
  place-items: stretch;
  background: var(--bg);
}

.signup-split {
  width: 100%;
  min-height: 100vh;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}

.signup-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(28px, 4vw, 52px);
  background: linear-gradient(150deg, var(--primary-dark), var(--primary));
  color: #fff;
}

.signup-brand-top {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: #fff;
}

.signup-brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}

.signup-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.signup-brand-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--h-weight);
  letter-spacing: var(--h-track);
  line-height: 1;
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  color: #fff;
}

.signup-brand-eyebrow {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.78);
}

.signup-brand-copy h2 + p {
  max-width: 420px;
  margin: 18px 0 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.signup-brand-foot {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.signup-brand-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.signup-brand-pills span {
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12.5px;
  font-weight: 700;
}

.signup-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 4vw, 52px);
}

.signup-form-inner {
  width: 100%;
  max-width: 420px;
}

.signup-form-inner h2 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-weight: var(--h-weight);
  letter-spacing: var(--h-track);
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  color: var(--text);
}

.signup-form-eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
}

.signup-detect-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-tint);
  border: 1px solid var(--primary-soft);
}

/* ---- landing/login responsive ---- */
@media (max-width: 900px) {
  .lp-nav-links {
    gap: 16px;
  }

  .lp-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

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

  .signup-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .signup-brand {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .lp-step-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- Calendar Pro Workspace: Coming-to-Pro + free read-only ---- */
.coming-to-pro {
  display: grid;
  gap: 10px;
}

.coming-to-pro-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.coming-to-pro-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.coming-to-pro-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.coming-to-pro-list .lock-icon {
  opacity: 0.55;
  font-size: 13px;
}

.coming-to-pro {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--primary-tint);
  border: 1px solid var(--primary-soft);
}

/* ---- Sidebar nav: redesign active state + dots ---- */
.nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-list a::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 999px;
  background: var(--muted);
}

body[data-app-route="upload"] .nav-list a[data-route-section="upload"],
body[data-app-route="review"] .nav-list a[data-route-section="review"],
body[data-app-route="conflicts"] .nav-list a[data-route-section="conflicts"],
body[data-app-route="export"] .nav-list a[data-route-section="export"],
body[data-app-route="calendar"] .nav-list a[data-route-section="calendar"],
body[data-app-route="academic"] .nav-list a[data-route-section="academic"],
body[data-app-route="semester"] .nav-list a[data-route-section="semester"],
body[data-app-route="settings"] .nav-list a[data-route-section="settings"] {
  background: var(--primary);
  color: #fff;
}

body[data-app-route="upload"] .nav-list a[data-route-section="upload"]::before,
body[data-app-route="review"] .nav-list a[data-route-section="review"]::before,
body[data-app-route="conflicts"] .nav-list a[data-route-section="conflicts"]::before,
body[data-app-route="export"] .nav-list a[data-route-section="export"]::before,
body[data-app-route="calendar"] .nav-list a[data-route-section="calendar"]::before,
body[data-app-route="academic"] .nav-list a[data-route-section="academic"]::before,
body[data-app-route="semester"] .nav-list a[data-route-section="semester"]::before,
body[data-app-route="settings"] .nav-list a[data-route-section="settings"]::before {
  background: #fff;
}

/* ---- Resolve conflicts: redesign cards (prototype) ---- */
.pwc-conflict-pair {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.pwc-conflict {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.pwc-conflict-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 18px;
}

.pwc-conflict--resolved .pwc-conflict-icon {
  background: #e9f7ef;
  color: #1a7f4b;
}

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

.pwc-conflict-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--text);
}

.pwc-conflict-body {
  margin: 5px 0 0;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--muted);
}

.pwc-conflict-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}

.pwc-opt {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

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

.pwc-opt-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.pwc-opt.conflict-card--selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.pwc-opt.conflict-card--dismissed {
  opacity: 0.4;
}

.pwc-resolved-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding: 7px 13px;
  border-radius: 999px;
  background: #e9f7ef;
  color: #1a7f4b;
  font-weight: 700;
  font-size: 12.5px;
}

.pwc-undo {
  border: 0;
  background: none;
  color: #1a7f4b;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
}

/* ---- Calendar Workload Intelligence (Pro) ---- */
.calendar-insights {
  grid-area: details;
  min-width: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.pwi {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.pwi-eyebrow {
  margin: 0 0 3px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.pwi-week {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.pwi-scope {
  margin: 4px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.pwi-empty {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.pwi-card {
  padding: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.pwi-card--heavy {
  background: linear-gradient(150deg, #fff1f1, #ffecec);
  border-color: #f7c8c8;
}

.pwi-card--calm {
  background: var(--primary-tint);
  border-color: var(--primary-soft);
}

.pwi-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwi-card-head strong {
  font-size: 0.95rem;
  color: var(--text);
}

.pwi-card--heavy .pwi-card-head strong {
  color: #b42318;
}

.pwi-card p {
  margin: 8px 0 11px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.pwi-card--heavy p {
  color: #7a2018;
}

.pwi-bars {
  display: flex;
  gap: 5px;
}

.pwi-bar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
}

.pwi-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pwi-section-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.pwi-conflict {
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--line);
}

.pwi-conflict-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pwi-conflict-head strong {
  font-size: 0.86rem;
  color: var(--text);
}

.pwi-conflict p {
  margin: 0 0 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.pwi-conflict-action {
  height: 34px;
  padding: 0 13px;
  border: 1.5px solid var(--primary);
  border-radius: 9px;
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

.pwi-digest {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pwi-digest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
}

.pwi-digest-row:hover {
  border-color: var(--primary-soft);
}

.pwi-digest-date {
  display: grid;
  place-items: center;
  width: 42px;
  flex: none;
  padding: 5px 0;
  border-radius: 8px;
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-weight: 800;
  line-height: 1.05;
}

.pwi-digest-mon {
  font-size: 9px;
  text-transform: uppercase;
}

.pwi-digest-day {
  font-size: 15px;
}

.pwi-digest-main {
  min-width: 0;
}

.pwi-digest-title {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pwi-digest-course {
  font-size: 11.5px;
  color: var(--muted);
}

/* ---- Calendar semester workspace switcher (Pro) ---- */
.semester-switcher {
  position: relative;
}

.semester-switcher-button {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.semester-switcher-badge {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
}

.semester-switcher-caret {
  font-size: 11px;
  opacity: 0.8;
}

.semester-switcher-menu {
  position: absolute;
  top: 48px;
  left: 0;
  z-index: 50;
  width: 300px;
  padding: 8px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15, 18, 40, 0.22);
}

.semester-menu-label {
  margin: 6px 10px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.semester-menu-empty {
  margin: 6px 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.semester-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.semester-row:hover {
  background: var(--primary-tint);
}

.semester-row.is-active {
  background: var(--primary-tint);
}

.semester-row-badge {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

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

.semester-row-name {
  display: block;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
}

.semester-row-meta {
  font-size: 11.5px;
  color: var(--muted);
}

.semester-row-check {
  color: var(--primary);
  font-weight: 800;
}

/* ============================================================
   My Semester (Pro) — full-page workload intelligence
   ============================================================ */
.nav-pro-tag {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: auto;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(178, 34, 34, 0.2);
}

.nav-notification-badge[hidden] {
  display: none;
}

body[data-app-route="semester"] .nav-list a[data-route-section="semester"] .nav-pro-tag {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

body[data-app-route="calendar"] .nav-list a[data-route-section="calendar"] .nav-notification-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  box-shadow: none;
}

.semester-page {
  display: grid;
  gap: 16px;
}

.semester-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.semester-page-head h2 {
  margin: 0;
}

.semester-pro-badge {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.semester-page-intro {
  margin: 0;
  max-width: 60ch;
}

.semester-term-switch {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.semester-term-switch::-webkit-scrollbar {
  height: 0;
}

.semester-term-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: none;
  min-width: 132px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease;
}

.semester-term-chip:hover {
  border-color: var(--primary-soft);
}

.semester-term-chip.is-active {
  border-color: var(--primary);
  background: var(--primary-tint);
  color: var(--primary-dark);
}

.semester-term-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.86rem;
}

.semester-term-meta {
  font-size: 0.72rem;
  opacity: 0.72;
}

.semester-body {
  display: grid;
  gap: 16px;
}

.pwi-page {
  display: grid;
  gap: 16px;
}

.pwi-bar-days {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}

.pwi-bar-day {
  flex: 1;
  text-align: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--muted);
}

.pwi-card--heavy .pwi-bar-day {
  color: #9a5048;
}

/* Smart cleanup card */
.semester-cleanup {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  border-radius: var(--radius);
  background: #f7f2ff;
  border: 1px solid #e4d7fb;
}

.semester-cleanup-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  background: #f1ebff;
  color: #7c3aed;
  font-size: 1.05rem;
}

.semester-cleanup-body {
  min-width: 0;
}

.semester-cleanup-body strong {
  font-size: 0.92rem;
  color: var(--text);
}

.semester-cleanup-list {
  margin: 10px 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.semester-cleanup-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.semester-cleanup-kind {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ece5fb;
  color: #5b21b6;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Locked / coming-soon cards */
.semester-locked {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
}

/* The author display:flex above otherwise overrides the [hidden] attribute,
   leaking the Pro-preview card in when the user is unlocked. */
.semester-locked[hidden] {
  display: none;
}

.semester-locked h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.semester-locked .button {
  flex: none;
  margin-left: auto;
}

.semester-soon-card {
  padding: 15px;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  background: var(--bg);
}

.semester-soon-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.semester-soon-head strong {
  font-size: 0.88rem;
  color: var(--text);
}

.semester-soon-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.semester-soon-card p {
  margin: 0;
}

/* ============================================================
   Mobile-web polish — match the responsive mockup at phone widths.
   Scoped to phone breakpoints; desktop layout is untouched.
   ============================================================ */
@media (max-width: 640px) {
  /* App chrome: brand mark wears the campus color, like the mockup app bar. */
  .app-mobile-header .brand-mark {
    background: var(--primary);
    color: #fff;
  }

  /* Drawer nav: rounded, generous touch rows with a tinted active state. */
  body.mobile-drawer-open[data-app-route] .sidebar .nav-list a {
    min-height: 48px;
    padding: 12px 12px;
    border-radius: 11px;
    font-size: 0.98rem;
  }

  body[data-app-route="semester"] .sidebar .nav-list a[data-route-section="semester"] {
    border-radius: 11px;
  }

  /* Primary calls-to-action: full-width, comfortable tap targets. */
  .card .actions .button.primary,
  .semester-page .button.primary {
    min-height: 50px;
    border-radius: 14px;
  }

  /* Rounded, touch-friendly cards across the app screens. */
  #semester.card,
  #upload.card,
  #review.card,
  #conflicts.card,
  #export.card,
  #settings.card {
    border-radius: 20px;
    padding: 20px 16px 24px;
  }

  .semester-page-head h2,
  #upload h2,
  #review h2,
  #conflicts h2,
  #export h2 {
    font-size: 1.6rem;
  }

  /* My Semester reads as a single comfortable column on phones. */
  .semester-locked {
    flex-direction: column;
    align-items: flex-start;
  }

  .semester-locked .button {
    margin-left: 0;
    width: 100%;
  }

  .semester-term-chip {
    min-width: 120px;
  }
}

/* ============================================================
   Mobile chrome fixes — collapse landing nav into its hamburger
   and tidy the in-app top bar so nothing wraps or overflows.
   ============================================================ */
@media (max-width: 640px) {
  .lp-nav {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 12px 16px;
  }

  .lp-brand {
    order: 1;
  }

  .landing-mobile-menu-button {
    order: 2;
    margin-left: auto;
  }

  .lp-nav-links {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    display: none;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
  }

  body.landing-menu-open .lp-nav-links {
    display: flex;
  }

  .lp-nav-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    font-size: 15px;
  }

  .lp-nav-cta {
    width: 100%;
  }

  /* In-app top bar: brand mark + name on the left, hamburger on the right.
     The account email lives in the workspace card / settings, not the bar. */
  .app-mobile-header .mobile-app-brand {
    order: 1;
  }

  .app-mobile-header #app-mobile-login {
    display: none;
  }

  .app-mobile-header .mobile-menu-button {
    order: 3;
    margin-left: auto;
  }
}

/* ============================================================
   Mobile-web — exact match to the Claude Design "Mobile Web" mockup.
   Phone widths only (<=640px); desktop layout is untouched. Reuses the
   real markup/selectors so all functionality stays intact.
   ============================================================ */
@media (max-width: 640px) {
  /* Shared: step eyebrows + section titles */
  .card .section-heading .eyebrow,
  #semester .eyebrow,
  .signup-form-inner .eyebrow:not(.signup-form-eyebrow) {
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .card .section-heading h2 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.6rem;
  }

  /* ---------- 1. LANDING ---------- */
  .lp-hero {
    padding: 30px 20px 38px;
  }

  .lp-hero-title {
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.03em;
  }

  .lp-hero-sub {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.5;
  }

  .lp-hero-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
  }

  .lp-hero-actions .button {
    width: 100%;
    height: 50px;
    border-radius: 14px;
  }

  .lp-preview {
    border-radius: 20px;
  }

  .lp-preview-head {
    padding: 13px 16px;
  }

  /* Mockup preview is just the header + event rows (no week strip). */
  .lp-preview-week {
    display: none;
  }

  .lp-preview-body {
    padding: 14px 15px;
  }

  .lp-preview-event {
    padding: 10px 11px;
    border-radius: 12px;
  }

  .lp-schools-inner .lp-section-title {
    font-size: 23px;
  }

  .lp-school-chips {
    gap: 9px;
  }

  .lp-chip {
    height: 40px;
    padding: 0 15px;
    border-radius: 999px;
    font-size: 13px;
  }

  /* ---------- 2. SIGN UP ---------- */
  /* Mockup signup is a single clean form — drop the brand panel and the
     MVP-auth helper copy on phones. */
  .signup-split .signup-brand,
  #auth-mode-eyebrow,
  #auth-mode-copy {
    display: none;
  }

  .signup-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .signup-form {
    padding: 0;
  }

  .signup-form-inner {
    padding: 24px 20px 30px;
  }

  .signup-form-inner h2 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 26px;
  }

  #login .login-grid label,
  #login .signup-grid label {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
  }

  #login .login-grid input,
  #login .login-grid select,
  #login .signup-grid input,
  #login .signup-grid select {
    height: 50px;
    padding: 0 15px;
    border: 1.5px solid var(--line);
    border-radius: 13px;
    font-size: 15px;
    font-weight: 600;
  }

  /* Detect hint reads as the mockup's tinted "theme applied" pill. */
  .signup-detect-hint {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 4px;
    padding: 10px 13px;
    border-radius: 12px;
    background: var(--primary-tint);
    border: 1px solid var(--primary-soft);
    color: var(--text);
    font-weight: 700;
    font-size: 13px;
  }

  .signup-detect-hint::before {
    content: "";
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 999px;
    background: var(--primary);
  }

  #login .auth-actions .button {
    height: 52px;
    border-radius: 14px;
    font-size: 16px;
  }

  /* ---------- 3. UPLOAD ---------- */
  .drop-zone {
    display: grid;
    place-items: center;
    gap: 9px;
    position: relative;
    min-height: 180px;
    padding: 20px;
    border: 2px dashed var(--primary-soft);
    border-radius: 18px;
    background: var(--primary-tint);
    text-align: center;
  }

  /* Whole zone is one tap target; native control is visually replaced. */
  .drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
  }

  .drop-zone::before {
    content: "⬆";
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: var(--panel);
    color: var(--primary);
    font-size: 23px;
  }

  .drop-zone span {
    margin-top: 0;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
  }

  .drop-zone small {
    font-size: 13px;
    color: var(--muted);
  }

  .paste-panel {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
  }

  .paste-panel textarea {
    border: 1.5px solid var(--line);
    border-radius: 12px;
  }

  /* ---------- 4. REVIEW ---------- */
  /* Reflow the 5-column desktop grid into a wrap-friendly flex layout: the
     class name gets its own full-width line so it reads in full, and nothing
     overlaps on a ~390px phone. (The desktop grid at the top of this file is
     outside any media query and stays unchanged.) */
  .review-event-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 10px;
    row-gap: 4px;
    padding: 12px 14px;
  }

  .review-event-row > input[type="checkbox"] { order: 0; }
  .review-event-row .review-cat { order: 1; }
  .review-event-row .confidence-pill { order: 2; margin-left: auto; }

  /* Title + schedule drop to their own full-width line and wrap in full. */
  .review-event-main { order: 3; flex-basis: 100%; }
  .review-event-main strong {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 0.98rem;
    line-height: 1.3;
  }

  /* The right-aligned monospace evidence line is the main source of the
     overlap; hide it on phones (it stays visible on desktop). */
  .review-evidence { display: none; }

  /* Keep the actionable "Choose your section" prompt, on its own line. */
  .review-pending-note {
    order: 4;
    flex-basis: 100%;
    white-space: normal;
  }

  /* The empty fallback span (no evidence, no pending note) must not add a gap. */
  .review-event-row > span:empty { display: none; }

  .confidence-pill {
    flex: none;
    padding: 3px 8px;
    font-size: 10.5px;
  }

  .confidence-pill.is-low {
    background: #fef3e2;
    color: #9a6700;
    border: 1px solid #f4d58a;
  }

  .confidence-pill.is-high {
    background: #e9f7ef;
    color: #1a7f4b;
    border: 1px solid #bfe6ce;
  }

  .review-course-group {
    border-radius: 16px;
  }

  /* ---------- 5. RESOLVE ---------- */
  .conflict-choice-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .conflict-choice-button {
    min-height: 46px;
    border: 1.5px solid var(--line);
    border-radius: 13px;
    background: var(--panel);
  }

  .conflict-choice-button:first-child {
    border-color: var(--primary);
    background: var(--primary-tint);
    color: var(--primary-dark);
  }

  #conflict-list > .card,
  #conflict-list > div {
    border-radius: 16px;
  }

  /* ---------- 6. EXPORT ---------- */
  #export .actions .button {
    width: 100%;
    height: 52px;
    border-radius: 14px;
  }

  #export .settings-note {
    border-radius: 16px;
  }

  .export-option-list label {
    min-height: 48px;
    border-radius: 12px;
  }

  /* ---------- 7. CALENDAR ---------- */
  .course-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .course-filters::-webkit-scrollbar {
    height: 0;
  }

  .course-filter {
    flex: none;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    background: var(--panel);
  }

  .calendar-card {
    border-radius: 20px;
  }

  .calendar-card .day-cell {
    border-radius: 10px;
  }
}

/* ============================================================
   Export screen — matches the "Export your semester" mockup.
   Include checklist + default-reminder chips + target rows.
   ============================================================ */
.export-page {
  display: grid;
  gap: 14px;
}

.export-ready-count {
  margin: -4px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.export-card-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.export-include-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.export-include-list {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}

.export-include-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.export-include-box {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.export-include-row.is-on .export-include-box {
  border: 0;
  background: var(--primary);
}

.export-include-label {
  flex: 1;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
}

.export-include-count {
  flex: none;
  font-size: 0.9rem;
  color: var(--muted);
}

.export-reminder-card {
  padding: 16px;
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius);
  background: var(--primary-tint);
}

.export-reminder-card .export-card-label {
  color: var(--primary-dark);
}

.export-reminder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.export-reminder-chip {
  padding: 7px 13px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.export-reminder-chip.is-on {
  border-color: var(--primary);
  background: var(--panel);
  color: var(--primary);
}

.export-targets {
  display: grid;
  gap: 9px;
}

.export-target {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.export-target:hover {
  border-color: var(--primary-soft);
}

.export-target-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 1rem;
}

.export-target-main {
  display: grid;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.export-target-main strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.export-target-main small {
  font-size: 0.8rem;
  color: var(--muted);
}

.export-target-caret {
  flex: none;
  font-size: 1.1rem;
  color: var(--muted);
}

.export-details {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.export-details > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
}

.export-details[open] > summary {
  margin-bottom: 10px;
}

/* ============================================================
   Calendar (mobile) — match the mockup: compact 7-column month grid
   with colored day-dots, a tight header, and an Export .ics shortcut.
   ============================================================ */
.calendar-export-ics {
  display: none;
}

@media (max-width: 640px) {
  /* Tighter canvas header (month title + controls, like the mockup) */
  .calendar-canvas .calendar-card-header .eyebrow,
  .calendar-canvas .calendar-card-copy {
    display: none;
  }

  .calendar-canvas #calendar-title {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.5rem;
  }

  .calendar-canvas .calendar-add-button {
    width: auto;
    min-height: 40px;
    padding: 0 16px;
    justify-self: start;
  }

  /* Weekday header row: S M T W T F S */
  .calendar-card .weekday-row {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    padding: 0 10px 4px;
  }

  .calendar-card .weekday-row span {
    text-align: center;
    font-size: 9px;
    font-weight: 800;
    color: var(--muted);
  }

  /* Month view → compact 7-column grid */
  .calendar-card .calendar-grid.month-view {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 3px;
    padding: 0 10px 14px;
  }

  .calendar-grid.month-view .day-cell {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 2px;
    min-height: 44px !important;
    padding: 4px 2px !important;
    border: 0;
    border-radius: 9px;
    background: transparent;
  }

  .calendar-grid.month-view .day-cell.outside {
    opacity: 0.32;
  }

  .calendar-grid.month-view .day-cell.is-today {
    background: var(--primary-tint);
  }

  .calendar-grid.month-view .day-button {
    flex-basis: 100%;
    width: auto;
    min-height: 0 !important;
    margin: 0;
    padding: 1px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
  }

  .calendar-grid.month-view .day-cell.is-today .day-button {
    color: var(--primary-dark);
    font-weight: 800;
  }

  /* Event chips become small colored dots under the day number */
  .calendar-grid.month-view .event-chip {
    width: 7px;
    height: 7px;
    min-height: 0;
    padding: 0;
    margin: 0;
    font-size: 0;
    line-height: 0;
    border: 0;
    border-radius: 3px;
    overflow: hidden;
  }

  /* Export .ics shortcut under the calendar (as in the mockup) */
  .calendar-export-ics {
    display: block;
    width: 100%;
    height: 50px;
    margin: 14px 10px 4px;
    width: calc(100% - 20px);
    border-radius: 14px;
  }
}

@media (max-width: 640px) {
  /* Day-dot colors mirror each category's accent (class=blue is default). */
  .calendar-grid.month-view .event-chip {
    background: var(--blue);
  }
  .calendar-grid.month-view .event-chip.office_hours {
    background: var(--green);
  }
  .calendar-grid.month-view .event-chip.lab,
  .calendar-grid.month-view .event-chip.recitation {
    background: var(--purple);
  }
  .calendar-grid.month-view .event-chip.homework,
  .calendar-grid.month-view .event-chip.assignment,
  .calendar-grid.month-view .event-chip.quiz {
    background: var(--orange);
  }
  .calendar-grid.month-view .event-chip.midterm,
  .calendar-grid.month-view .event-chip.final {
    background: var(--red);
  }
}

@media (max-width: 640px) {
  /* Declutter the mobile Calendar: the desktop control rail (Semester
     controls, Mini calendar, Account, Trial access, Coming to Pro, export
     note, feedback) is not part of the calendar mockup. The course-calendar
     filters now live in the tappable "Filters" bar at the top of the canvas,
     so the whole rail is hidden on phones. */
  .calendar-workspace-shell .calendar-control-rail {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .calendar-workspace-shell .calendar-control-rail > .calendar-rail-section {
    display: none;
  }

  .calendar-workspace-shell .calendar-feedback-button {
    display: none;
  }
}

/* ============================================================
   Calendar day-agenda (mobile) — the mockup's "Mon, Jan 20" list
   of the selected day's events, shown under the month grid.
   ============================================================ */
.calendar-agenda {
  margin: 16px 10px 0;
}

.calendar-agenda-heading {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1rem;
  color: var(--text);
}

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

.calendar-agenda-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--agenda-accent, var(--blue));
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
}

.calendar-agenda-row:hover {
  border-color: var(--primary-soft);
  border-left-color: var(--agenda-accent, var(--blue));
}

.calendar-agenda-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-agenda-time {
  flex: none;
  font-size: 0.82rem;
  color: var(--muted);
}

.calendar-agenda-empty {
  margin: 0;
}

/* ============================================================
   Calendar "Filters" bar (mobile) — a tappable header that expands the
   course-filter chips below it. Collapsed by default to keep the canvas clean.
   ============================================================ */
.calendar-filters {
  margin: 2px 0 6px;
}

.calendar-filters-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
}

.calendar-filters-label {
  flex: 1;
  text-align: left;
}

.calendar-filters-count:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.calendar-filters-caret {
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.calendar-filters.is-open .calendar-filters-caret {
  transform: rotate(180deg);
}

.calendar-filters-panel {
  padding: 6px 2px 2px;
}

.calendar-filter-course + .calendar-filter-course {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.calendar-filter-course-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-filter-course-head .calendar-course-chip {
  flex: 1;
  min-width: 0;
}

.calendar-filter-expand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: 38px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}

.calendar-filter-expand.is-open .calendar-filters-caret {
  transform: rotate(180deg);
}

.calendar-filter-categories {
  padding-left: 4px;
}

@media (min-width: 641px) {
  .calendar-filters {
    display: none !important;
  }
}

/* ============================================================
   Calendar course-filter chips (mobile) — horizontal scrolling pills
   with a per-course color dot, like the mockup. Toggles hiddenCourses.
   ============================================================ */
.calendar-course-chips:not([hidden]) {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  margin: 8px 0 0;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.calendar-course-chips::-webkit-scrollbar {
  height: 0;
}

.calendar-course-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 38px;
  padding: 0 15px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
}

.calendar-course-chip.is-on {
  border-color: var(--chip-color, var(--primary));
  background: color-mix(in srgb, var(--chip-color, var(--primary)) 10%, var(--panel));
  color: var(--text);
}

.calendar-course-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 999px;
  background: var(--muted);
}

.calendar-course-chip.is-on .calendar-course-dot {
  background: var(--chip-color, var(--primary));
}

@media (min-width: 641px) {
  .calendar-course-chips {
    display: none !important;
  }
}

/* =========================================================================
   Calendar Visual Spec — workspace redesign (Week/Day/Month/List/Semester).
   Reuses the existing :root tokens (--bg #fbfaf7, --muted, --line, --primary*,
   category colors --green/orange/red/purple/blue, --font-display/-body).
   Scoped to the calendar canvas + rail so the rest of the app is untouched.
   ========================================================================= */

/* --- Segmented view switcher --- */
.calendar-view-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: #f1f0ec; }
.calendar-view-tab { border: 0; background: transparent; padding: 7px 15px; border-radius: 9px; font: inherit; font-weight: 800; font-size: 0.82rem; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.calendar-view-tab:hover { color: var(--primary-dark); }
.calendar-view-tab.is-active { background: #fff; color: var(--primary-dark); box-shadow: 0 2px 6px rgba(24, 22, 45, 0.1); }

.calendar-search-wrap { position: relative; }
.calendar-search-wrap .calendar-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.95rem; pointer-events: none; }
.calendar-search-wrap input { padding-left: 30px; border: 1px solid var(--line); border-radius: 11px; background: #fff; min-height: 40px; }

/* --- Rail legend card --- */
.calendar-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; font-size: 0.74rem; font-weight: 700; }
.calendar-legend span { display: flex; align-items: center; gap: 7px; }
.calendar-legend .legend-dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }

/* --- Month polish --- */
.calendar-grid.month-view { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 8px; }
.calendar-grid.month-view .day-cell { min-height: 104px; }
.day-cell.is-today .day-button { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; }
.day-more { display: block; font-size: 0.68rem; font-weight: 700; color: var(--muted); padding-left: 2px; margin-top: 2px; }

/* --- Week time-grid (spec) --- */
.calendar-week-spec { display: block; margin-top: 6px; }
.wk-headrow, .wk-alldayrow, .wk-body { display: grid; grid-template-columns: 54px repeat(7, minmax(0, 1fr)); }
.wk-headrow { position: sticky; top: 0; z-index: 2; background: var(--bg); padding-top: 6px; }
.wk-col-head { text-align: center; padding: 6px 4px 10px; }
.wk-day-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; cursor: pointer; font: inherit; width: 100%; }
.wk-dow { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.wk-date { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--text); }
.wk-date.is-today { background: var(--primary); color: #fff; }
.wk-alldayrow { border-bottom: 1px solid var(--line); min-height: 34px; }
.wk-allday-label { font-size: 0.6rem; font-weight: 800; color: var(--muted); text-transform: uppercase; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }
.wk-allday-cell { border-left: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.wk-allday-pill { border: 0; border-left: 3px solid var(--blue); border-radius: 6px; background: #edf4ff; color: var(--text); padding: 4px 7px; font: inherit; font-size: 0.7rem; font-weight: 800; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-gutter .wk-hour { position: relative; }
.wk-gutter .wk-hour span { position: absolute; top: -7px; right: 8px; font-size: 0.66rem; font-weight: 700; color: var(--muted); }
.wk-daycol { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(180deg, transparent 0, transparent 53px, var(--line) 53px, var(--line) 54px); }
.wk-daycol.is-today { background-image: repeating-linear-gradient(180deg, transparent 0, transparent 53px, var(--line) 53px, var(--line) 54px); background-color: var(--primary-tint); }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; }
.wk-now-dot { position: absolute; left: -5px; top: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.wk-event { position: absolute; left: 3px; right: 3px; padding: 5px 7px; border: 0; border-left: 3px solid var(--blue); border-radius: 7px; background: #edf4ff; color: var(--text); cursor: pointer; text-align: left; overflow: hidden; box-shadow: 0 1px 3px rgba(24, 22, 45, 0.08); font: inherit; }
.wk-event-title { font-weight: 800; font-size: 0.76rem; line-height: 1.1; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-event-meta { font-size: 0.68rem; opacity: 0.82; font-weight: 600; }

/* Category accents (shared with .event-chip palette) for week chips. */
.wk-event.office_hours, .wk-allday-pill.office_hours { border-left-color: var(--green); background: #e9f7f4; }
.wk-event.lab, .wk-event.recitation, .wk-allday-pill.lab, .wk-allday-pill.recitation { border-left-color: var(--purple); background: #f5edff; }
.wk-event.homework, .wk-event.assignment, .wk-event.quiz, .wk-allday-pill.homework, .wk-allday-pill.assignment, .wk-allday-pill.quiz { border-left-color: var(--orange); background: #fff3e3; }
.wk-event.midterm, .wk-event.final, .wk-event.exam, .wk-allday-pill.midterm, .wk-allday-pill.final, .wk-allday-pill.exam { border-left-color: var(--red); background: #fff0ef; }
.wk-event.external, .wk-allday-pill.external { border-left-color: #64748b; background: #f1f5f9; color: #334155; }

/* --- List (spec) --- */
.calendar-list-spec { display: flex; flex-direction: column; gap: 18px; max-width: 720px; margin-top: 18px; }
.list-day-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.list-day-badge { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; background: var(--primary-tint); color: var(--primary-dark); }
.list-day-badge.is-today { background: var(--primary); color: #fff; }
.list-day-date { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -0.02em; }
.list-day-rows { display: flex; flex-direction: column; gap: 7px; }
.list-spec-row { display: grid; grid-template-columns: 78px 1fr auto; gap: 14px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 13px; background: #fff; cursor: pointer; text-align: left; font: inherit; }
.list-row-time { font-size: 0.82rem; font-weight: 800; color: var(--muted); }
.list-row-title { display: block; font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-sub { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.list-spec-row.office_hours { border-left-color: var(--green); }
.list-spec-row.lab, .list-spec-row.recitation { border-left-color: var(--purple); }
.list-spec-row.homework, .list-spec-row.assignment, .list-spec-row.quiz { border-left-color: var(--orange); }
.list-spec-row.midterm, .list-spec-row.final, .list-spec-row.exam { border-left-color: var(--red); }
.list-spec-row.external { border-left-color: #64748b; background: #f8fafc; }

/* --- Category badges (semester / list / detail) --- */
.detail-badge, [class*="sem-badge-"] { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; white-space: nowrap; background: #edf4ff; color: #1d4ed8; }
.sem-badge-office_hours { background: #e9f7f4; color: #066043; }
.sem-badge-lab, .sem-badge-recitation { background: #f5edff; color: #59189d; }
.sem-badge-homework, .sem-badge-assignment, .sem-badge-quiz { background: #fff3e3; color: #8a5200; }
.sem-badge-midterm, .sem-badge-final, .sem-badge-exam { background: #fff0ef; color: #a01b1f; }
.sem-badge-external { background: #f1f5f9; color: #334155; }

/* --- Semester view (spec) --- */
.calendar-semester-view { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; padding: 18px 0 10px; }
.sem-heavy { grid-column: 1 / -1; background: linear-gradient(150deg, var(--primary-tint), #fff 70%); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; }
.sem-heavy-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sem-tag { padding: 4px 11px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; }
.sem-tag.is-heavy { background: #fdecec; color: #a01b1f; }
.sem-tag.is-light { background: #e7f6f0; color: #066043; }
.sem-heavy-label { font-family: var(--font-display); font-size: 1.18rem; letter-spacing: -0.02em; }
.sem-heavy-counts { font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.sem-heavy-summary { margin: 9px 0 16px; font-size: 0.96rem; font-weight: 600; line-height: 1.45; max-width: 640px; }
.sem-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.sem-bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sem-bar-track { width: 100%; height: 74px; display: flex; flex-direction: column-reverse; border-radius: 9px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.sem-bar-fill { width: 100%; }
.sem-bar-meet { background: var(--primary); opacity: 0.85; }
.sem-bar-grade { background: var(--red); }
.sem-bar-day { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.sem-bar-day.is-today { color: var(--primary-dark); }
.sem-bars-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.sem-bars-legend span { display: flex; align-items: center; gap: 6px; }
.sem-swatch { width: 10px; height: 10px; border-radius: 3px; }
.sem-swatch-meet { background: var(--primary); }
.sem-swatch-grade { background: var(--red); }
.sem-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.sem-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.sem-card-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -0.02em; }
.sem-card-meta { font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.sem-card-empty { font-size: 0.82rem; color: var(--muted); font-weight: 600; margin: 0; }
.sem-deadline { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; font: inherit; width: 100%; margin-bottom: 9px; }
.sem-deadline:last-child { margin-bottom: 0; }
.sem-deadline-date { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 42px; border-radius: 9px; background: var(--primary-tint); }
.sem-deadline-mon { font-size: 0.56rem; font-weight: 800; letter-spacing: 0.06em; color: var(--primary-dark); }
.sem-deadline-day { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; line-height: 1; color: var(--primary-dark); }
.sem-deadline-main { min-width: 0; }
.sem-deadline-title { display: block; font-weight: 800; font-size: 0.88rem; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sem-deadline-course { font-size: 0.74rem; color: var(--muted); font-weight: 600; }
.sem-rightcol { display: flex; flex-direction: column; gap: 18px; }
.sem-conflict { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start; padding: 11px 13px; border-radius: 12px; background: var(--primary-tint); border: 1px solid var(--primary-soft); margin-bottom: 9px; }
.sem-conflict:last-child { margin-bottom: 0; }
.sem-conflict-icon { font-size: 1.05rem; line-height: 1.2; }
.sem-conflict-title { font-weight: 800; font-size: 0.86rem; margin-bottom: 2px; }
.sem-conflict-body { font-size: 0.78rem; color: var(--muted); font-weight: 600; line-height: 1.4; }
button.sem-conflict { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.sem-soon { background: repeating-linear-gradient(135deg, #fafaf8, #fafaf8 10px, #f3f2ee 10px, #f3f2ee 20px); border: 1px dashed var(--line); }
.sem-soon-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.sem-soon-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -0.02em; color: var(--muted); }
.sem-soon-tag { margin-left: auto; padding: 2px 9px; border-radius: 999px; background: var(--secondary, #1c1a26); color: #fff; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; }
.sem-locked, .sem-empty { grid-column: 1 / -1; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px 26px; text-align: left; }
.sem-locked h3, .sem-empty h3 { margin: 6px 0 8px; font-family: var(--font-display); letter-spacing: -0.02em; }
.sem-locked p, .sem-empty p { margin: 0 0 16px; color: var(--muted); font-weight: 600; max-width: 560px; line-height: 1.5; }
.sem-locked-eyebrow { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--primary); }
@media (max-width: 900px) { .calendar-semester-view { grid-template-columns: minmax(0, 1fr); } }

/* --- Detail drawer (spec) --- */
.detail-panel:not([hidden]) { animation: cwxPanelIn 0.22s ease; }
@keyframes cwxPanelIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.detail-title { margin: 12px 0 4px; font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
.detail-course { font-size: 0.92rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 18px; }
.detail-rows { display: flex; flex-direction: column; gap: 12px; }
.detail-row { display: flex; gap: 11px; align-items: flex-start; }
.detail-ic { width: 22px; text-align: center; opacity: 0.6; flex: none; }
.detail-when { font-weight: 700; font-size: 0.9rem; }
.detail-sub { font-size: 0.85rem; color: var(--muted); font-weight: 600; line-height: 1.5; }
.detail-actions { margin-top: 16px; }
.detail-prov { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.74rem; color: var(--muted); font-weight: 600; line-height: 1.5; }

/* Phase 9: notification center (wrap-friendly, no horizontal overflow). */
.reminder-preferences {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 14px;
  margin: 10px 0;
}
.reminder-actions { flex-wrap: wrap; gap: 8px; }
.reminder-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 10px 0 6px;
}
.reminder-list { display: flex; flex-direction: column; gap: 8px; }
.reminder-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.reminder-row-main { min-width: 0; flex: 1 1 260px; }
.reminder-row-main strong { overflow-wrap: anywhere; }
.reminder-body { margin: 4px 0 0; }
.reminder-row[data-severity="urgent"], .reminder-row[data-severity="critical"] {
  border-color: rgba(204, 0, 51, 0.45);
}
.digest-view {
  white-space: pre-wrap;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.85rem;
}

/* Phase 11: mobile/PWA polish + beta readiness hardening. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 72%, white);
  outline-offset: 3px;
}

.offline-banner {
  position: sticky;
  top: 0;
  z-index: 4000;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.offline-banner[hidden] { display: none; }

body.is-offline [data-network-required],
body.is-offline .network-required {
  opacity: 0.62;
}

.pwa-install-card,
.beta-readiness-panel {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 8%, transparent), transparent 36%),
    var(--card);
}

.skeleton-card {
  min-height: 96px;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.16), rgba(148, 163, 184, 0.32), rgba(148, 163, 184, 0.16));
  background-size: 200% 100%;
  animation: syllabus2cal-skeleton 1.2s ease-in-out infinite;
}

@keyframes syllabus2cal-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.beta-readiness-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  list-style: none;
  margin: 14px 0;
  padding: 0;
}

.beta-readiness-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.beta-readiness-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-transform: capitalize;
}

.beta-readiness-list strong {
  flex: 0 0 auto;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.beta-readiness-list .is-ok strong { color: #047857; }
.beta-readiness-list .is-warn strong { color: #b45309; }

.message.error { color: #b42318; }

@media (max-width: 720px) {
  button,
  .button,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  .actions,
  .reminder-actions,
  .reminder-filter-row {
    gap: 10px;
  }

  .reminder-filter-row {
    align-items: stretch;
  }

  .reminder-filter-row label,
  .reminder-filter-row select,
  .reminder-actions .button,
  .academic-share-link .button,
  .pwa-install-card .button {
    width: 100%;
  }

  .reminder-row,
  .academic-plan-card,
  .calendar-overlay-card,
  .calendar-integrations-list,
  .debug-state-list,
  .beta-readiness-list,
  .settings-note {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .reminder-row .actions,
  .calendar-overlay-card .actions,
  .academic-share-link {
    align-items: stretch;
  }

  .calendar-grid,
  .calendar-week-view,
  .calendar-day-view,
  .calendar-list-view {
    min-width: 0;
    overflow-x: auto;
  }
}

/* Phase 12: Ask Syllabus2Cal assistant (mobile-first, no overflow). */
.assistant-card {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}
.assistant-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.assistant-form input {
  flex: 1 1 220px;
  min-height: 44px;
  min-width: 0;
}
.assistant-form .button { min-height: 44px; }
.assistant-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.assistant-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 44px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}
.assistant-chip:hover { border-color: var(--primary, #cc0033); }
.assistant-answer {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  overflow-wrap: anywhere;
}
.assistant-grounding { margin: 4px 0 8px 18px; font-size: 0.85rem; }
.assistant-grounding-label { margin: 8px 0 0; }
.assistant-warning { color: #8a5a00; font-size: 0.9rem; }
.assistant-actions-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Phase 14: beta launch onboarding. */
.onboarding-card {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--primary, #cc0033) 12%, transparent), transparent 32%),
    var(--panel);
}
.onboarding-step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.onboarding-step {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: color-mix(in srgb, var(--panel-soft) 82%, white);
  min-width: 0;
}
.onboarding-step strong {
  display: block;
  margin-bottom: 6px;
}
.onboarding-step .button {
  margin-top: 8px;
}
