/* ============================================================================
   GPAway — Crystal-Clear Apple Liquid Glass & Classical Typography
   - Pure bright porcelain-silver studio backdrop (zero muddy/dirty grey smears)
   - True transparent Liquid Glass: high-clarity Gaussian blur + saturation +
     crisp pure-white specular rims + SDF optical edge refraction
   - Balanced soft charcoal/slate contrast (no harsh jet-black shock)
   - Strict font rule: English & numerals = Times New Roman; Chinese = 宋体
   ============================================================================ */

@font-face {
  font-family: "GPAway Times New Roman";
  src: url("./fonts/tinos-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "GPAway Times New Roman";
  src: url("./fonts/tinos-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "GPAway Times New Roman";
  src: url("./fonts/tinos-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "GPAway Times New Roman";
  src: url("./fonts/tinos-BoldItalic.woff2") format("woff2");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "GPAway Song";
  src: url("./fonts/noto-serif-sc-Regular.woff2?v=20261203-shared") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "GPAway Song";
  src: url("./fonts/noto-serif-sc-Bold.woff2?v=20261203-shared") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --font-editorial: "GPAway Times New Roman", "GPAway Song", SimSun, "宋体", "Songti SC", STSong, serif;

  /* ---- Balanced Soft Charcoal / Slate Ink Tokens ---- */
  --ink:              #2E3036;
  --ink-strong:       #22242A;
  --ink-secondary:    rgba(46, 48, 54, 0.66);
  --ink-tertiary:     #566163;
  --muted:            var(--ink-secondary);
  --navy:             var(--ink);
  --green:            var(--ink);

  /* ---- Crystal-Clear Translucent Liquid Glass Materials (leonardseo/liquid-glass-react + apple-design) ---- */
  --glass-chrome:     rgba(255, 255, 255, 0.32);
  --glass-card:       rgba(255, 255, 255, 0.38);
  --glass-sheet:      rgb(255 255 255 / 22%);
  --glass-sheet-rim:  linear-gradient(155deg, rgb(255 255 255 / 13%), transparent 56%);
  --glass-dialog-material: rgb(250 251 253 / 61%);
  --glass-dialog-page-filter: blur(8px);
  --glass-dialog-edge: linear-gradient(155deg, rgb(255 255 255 / 27%), transparent 48%);
  --glass-sheet-bar:  rgb(255 255 255 / 9%);
  --glass-sheet-row:  rgb(255 255 255 / 34%);
  --glass-sheet-hover: rgb(255 255 255 / 49%);
  --glass-sheet-selected: rgb(255 255 255 / 59%);
  --glass-popover:    rgba(255, 255, 255, 0.78);
  --glass-control:    rgba(255, 255, 255, 0.48);
  --glass-pill:       rgb(255 255 255 / 49%);
  --glass-primary:    linear-gradient(160deg, rgba(72, 78, 90, 0.88) 0%, rgba(48, 53, 64, 0.94) 100%);
  --glass-primary-h:  linear-gradient(160deg, rgba(84, 90, 104, 0.92) 0%, rgba(58, 64, 76, 0.96) 100%);

  /* ---- Pure Specular Bevels & Clean Airy Shadows (Zero Muddy Haze) ---- */
  --rim-chrome:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(255, 255, 255, 0.48),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 0 0.5px rgba(46, 48, 54, 0.06),
    0 12px 36px rgba(15, 23, 42, 0.055),
    0 2px 6px rgba(15, 23, 42, 0.025);

  --rim-card:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(255, 255, 255, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 0 0.5px rgba(46, 48, 54, 0.055),
    0 10px 30px rgba(15, 23, 42, 0.048),
    0 1px 3px rgba(15, 23, 42, 0.022);

  --rim-card-hover:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.52),
    inset 0 0 0 1px rgba(255, 255, 255, 0.85),
    0 0 0 0.5px rgba(46, 48, 54, 0.08),
    0 16px 38px rgba(15, 23, 42, 0.07),
    0 2px 6px rgba(15, 23, 42, 0.03);

  --rim-control:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.7),
    0 0 0 0.5px rgba(46, 48, 54, 0.10),
    0 2px 6px rgba(15, 23, 42, 0.04);

  --rim-primary:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 0 0.5px rgba(46, 48, 54, 0.16),
    0 5px 16px rgba(15, 23, 42, 0.12);

  --rim-sheet:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 0 0 1px rgba(255, 255, 255, 0.78),
    0 0 0 0.5px rgba(46, 48, 54, 0.065),
    0 24px 64px rgba(15, 23, 42, 0.10),
    0 4px 12px rgba(15, 23, 42, 0.04);

  --separator:        rgba(46, 48, 54, 0.08);
  --separator-strong: rgba(46, 48, 54, 0.14);
  --line:             var(--separator);

  /* ---- Spacing & Radii ---- */
  --page-gap: clamp(16px, 2vw, 24px);
  --panel-padding: clamp(20px, 2.2vw, 26px);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-2xl: 30px;
  --radius-capsule: 999px;

  /* ---- Apple Critically Damped Spring & Motion ---- */
  --ease-in: cubic-bezier(.32, 0, .65, .75);
  --dialog-exit-duration: 155ms;
  --dialog-exit-scale: .991;
  --dialog-enter-duration: 185ms;
  --dialog-enter-scale: .986;
  --page-enter-duration: 160ms;
  --page-enter-offset: 6px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --settle-spring: linear(0, .1443, .3849, .594, .7452, .8454, .9084, .9467, .9694, .9826, .9902, .9946, 1);
  --duration-instant: 95ms;
  --duration-fast:    180ms;
  --duration-base:    260ms;
  --control-duration: 240ms;
  --control-motion:   var(--control-duration) var(--ease-out);

  color: var(--ink);
  color-scheme: light;
  background: #F5F6F8;
  font-family: var(--font-editorial);
  font-size: 16px;
  line-height: 1.52;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  accent-color: #4A4E57;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 48, 54, 0.18) transparent;
}
html::-webkit-scrollbar,
.dialog-body::-webkit-scrollbar { width: 6px; height: 6px; }
html::-webkit-scrollbar-track,
.dialog-body::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb,
.dialog-body::-webkit-scrollbar-thumb { background: rgba(46, 48, 54, 0.18); border-radius: 999px; }
html::-webkit-scrollbar-thumb:hover,
.dialog-body::-webkit-scrollbar-thumb:hover { background: rgba(46, 48, 54, 0.30); }
html::-webkit-scrollbar-button,
.dialog-body::-webkit-scrollbar-button { display: none; }

body, h1, h2, h3, p { margin: 0; }
html, body, button, input, select, textarea, optgroup, option, dialog, label, summary, footer, code, output, small, span, strong, b, em, i, a, li, text {
  font-family: var(--font-editorial);
}
::placeholder {
  font-family: var(--font-editorial);
}
button, input, select, textarea { font-size: inherit; line-height: inherit; }
code {
  font-size: 0.92em;
  background: rgba(46, 48, 54, 0.06);
  border-radius: 5px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}
button { color: inherit; cursor: pointer; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
select { appearance: none; cursor: pointer; }

/* Root Canvas (#F5F6F8 on html ONLY; body MUST stay transparent so .lg-ambient-blobs at z-index:-1 shines directly behind all glass!) */
html {
  color-scheme: light;
  background-color: #F5F6F8;
}
body {
  display: flow-root;
  min-height: 100svh;
  min-height: 100dvh;
  position: relative;
  background: transparent !important;
  background-image: none;
}

/* Soft Feathered Apple Liquid Glass Focus Halos (contour-hugging, never boxy) */
:focus:not(:focus-visible),
dialog:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 0 4.5px rgba(96, 104, 120, 0.16),
    0 4px 14px -2px rgba(15, 23, 42, 0.08);
}
:is(.tabbar button, .term-picker-menu button, .registration-option, .course-button, summary):focus-visible,
.registration-option:has(input:focus-visible) {
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(88, 96, 112, 0.16),
    0 0 0 3.5px rgba(102, 112, 133, 0.09);
  border-radius: var(--radius-sm);
}
summary:focus:not(:focus-visible) { box-shadow: none; }

/* Native control polish: search clear button, file picker, textarea scrollbars */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-inline-start: 6px;
  border-radius: 50%;
  cursor: pointer;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%232E3036' fill-opacity='0.22'/%3E%3Cpath d='M5.4 5.4l5.2 5.2M10.6 5.4l-5.2 5.2' stroke='%23FFFFFF' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}
input[type="file"] {
  font-family: var(--font-editorial);
  font-size: 14px;
  color: var(--ink-secondary);
}
input[type="file"]::file-selector-button {
  margin-inline-end: 12px;
  height: 30px;
  padding: 0 14px;
  border: 1px solid rgba(46, 48, 54, 0.12);
  border-radius: var(--radius-capsule);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-family: var(--font-editorial);
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
input[type="file"]::file-selector-button:hover {
  background: #FFFFFF;
  border-color: rgba(46, 48, 54, 0.2);
}
textarea { scrollbar-width: thin; scrollbar-color: rgba(46, 48, 54, 0.18) transparent; }
textarea::-webkit-scrollbar { width: 6px; height: 6px; }
textarea::-webkit-scrollbar-track { background: transparent; }
textarea::-webkit-scrollbar-thumb { background: rgba(46, 48, 54, 0.18); border-radius: 999px; }
textarea::-webkit-scrollbar-button { display: none; }
textarea::-webkit-resizer { background: transparent; }

/* ============================================================================
   SPECULAR LIQUID GLASS RIM & POINTER LIGHT REFLECTION
   ============================================================================ */
.masthead::after,
.card::after,
.start-card::after,
.auth-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.25px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    var(--lg-angle, 136deg),
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.30) 28%,
    rgba(255, 255, 255, 0.08) 54%,
    rgba(255, 255, 255, 0.35) 80%,
    rgba(255, 255, 255, 0.92) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
}

.masthead::before,
.overview-card::before,
.registration-panel::before,
.settings-card::before,
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    ellipse 84% 40% at var(--lg-x, 26%) var(--lg-y, 0%),
    rgba(255, 255, 255, 0.62) 0%,
    rgba(255, 255, 255, 0.14) 48%,
    transparent 74%
  );
}

.card > *,
.start-card > * {
  position: relative;
  z-index: 1;
}

/* ============================================================================
   FLOATING LIQUID GLASS SIDEBAR (.masthead)
   ============================================================================ */
.masthead {
  position: fixed;
  inset: 20px auto 20px 20px;
  width: 224px;
  z-index: 20;
  border-radius: var(--radius-2xl);
  background: var(--glass-chrome);
  -webkit-backdrop-filter: blur(32px) saturate(190%) brightness(1.03);
          backdrop-filter: blur(32px) saturate(190%) brightness(1.03);
  box-shadow: var(--rim-chrome);
  overflow: hidden;
}

.masthead .masthead-inner {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 24px 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0;
}

/* 100% Alpha-Transparent Logo — floats like crisp ink on Liquid Glass */
.wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  transition: transform var(--duration-instant) var(--ease-out), opacity var(--duration-fast) var(--ease-out);
}
.wordmark:hover { opacity: 0.74; }
.wordmark:active { transform: scale(0.97); }
.wordmark .brand-crop {
  display: block;
  flex: 0 0 112px;
  width: 112px;
  aspect-ratio: 2.4;
  overflow: hidden;
}
.wordmark .brand-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Navigation Tree */
.tabbar {
  position: static;
  margin-top: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }

.tabbar button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-weight: 400;
  text-align: left;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-instant) var(--ease-out);
}
.tabbar > button,
#course-navigation > .nav-branch-label {
  padding: 10px 13px;
  gap: 11px;
  border-radius: 15px;
  font-size: 16px;
}
.tabbar svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.76;
}
.tabbar button:hover {
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink-strong);
}
.tabbar button:active { transform: scale(0.97); }

/* Active Liquid Glass Pill */
.tabbar button[aria-current="page"] {
  background: var(--glass-pill);
  color: var(--ink-strong);
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 0 0 0.5px rgba(46, 48, 54, 0.08),
    0 4px 12px rgba(15, 23, 42, 0.055);
}
.tabbar button[aria-current="page"] svg { opacity: 1; stroke-width: 1.85; }

.nav-branch { flex-shrink: 0; min-width: 0; }
.nav-branch > .nav-branch-label {
  display: flex;
  align-items: center;
  color: var(--ink-secondary);
}
#course-navigation[data-active] > .nav-branch-label {
  color: var(--ink-strong);
  font-weight: 700;
}
#course-navigation[data-active] > .nav-branch-label svg { opacity: 1; }

.course-navigation {
  display: grid;
  gap: 3px;
  padding-inline-start: 14px;
  margin-top: 2px;
}
.course-navigation .nav-branch > .nav-branch-label {
  padding: 6px 10px 3px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-tertiary);
}
.course-navigation-views {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  margin-left: 10px;
  border-left: 1px solid rgba(46, 48, 54, 0.12);
}
.tabbar .course-navigation button {
  padding: 8px 11px;
  font-size: 15px;
  border-radius: 12px;
}
.tabbar .course-navigation > button {
  margin-top: 4px;
  font-weight: 400;
  color: var(--ink-secondary);
}
.tabbar .course-navigation > button[aria-current="page"] {
  font-weight: 700;
  color: var(--ink-strong);
}
.short-nav-label { display: none; }

.sidebar-foot {
  margin-top: auto;
  padding: 14px 10px 2px;
  border-top: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.48;
}
.sidebar-foot small { font-size: 12px; color: var(--ink-secondary); }
.sidebar-foot .sidebar-account {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 700;
  margin-top: 2px;
}
.sidebar-foot .sidebar-author { font-size: 12.5px; color: var(--ink-secondary); }
.sidebar-lock {
  margin-top: 8px;
  padding: 5px 12px;
  width: fit-content;
  border: 0;
  border-radius: var(--radius-capsule);
  background: var(--glass-control);
  box-shadow: var(--rim-control);
  color: var(--ink-secondary);
  font-size: 12.5px;
  line-height: 1.3;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), transform var(--duration-instant) var(--ease-out);
}
.sidebar-lock:hover { background: rgba(255, 255, 255, 0.92); color: var(--ink-strong); }
.sidebar-lock:active { transform: scale(0.96); }

/* ============================================================================
   MAIN WORKSPACE & ALIGNED HEADERS
   ============================================================================ */
main.wrap {
  width: min(1100px, calc(100% - 308px));
  margin-left: 272px;
  margin-right: 36px;
  padding-bottom: 72px;
  overflow-anchor: none;
}
main.wrap > section {
  max-inline-size: 1060px;
  margin-inline: auto;
}

.page-heading {
  margin-block: clamp(32px, 4vw, 46px) var(--page-gap);
}
.kicker {
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}
h1 {
  color: var(--ink-strong);
  font-size: clamp(32px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.015em;
}
h2 {
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.01em;
}
h3 { color: var(--ink-strong); font-size: 16px; font-weight: 700; }
.lede { color: var(--ink-secondary); font-size: 15px; line-height: 1.55; margin-top: 8px; }
.muted { color: var(--ink-secondary); }
.quiet-note { color: var(--ink-secondary); font-size: 13.5px; }

/* ============================================================================
   CRYSTAL-CLEAR LIQUID GLASS CARDS
   ============================================================================ */
.card, .start-card {
  position: relative;
  min-width: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--glass-card);
  -webkit-backdrop-filter: blur(28px) saturate(185%) brightness(1.03);
          backdrop-filter: blur(28px) saturate(185%) brightness(1.03);
  box-shadow: var(--rim-card);
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}

.start-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  margin-bottom: var(--page-gap);
}
.start-card h2 { font-size: 18.5px; margin-bottom: 4px; }
.start-card p { font-size: 14.5px; }
.start-card button { flex-shrink: 0; }

/* Grids */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--page-gap);
  align-items: start;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--page-gap);
  align-items: stretch;
}

.overview-card { padding: var(--panel-padding) var(--panel-padding) 0; }

@media (hover: hover) and (pointer: fine) {
  .overview-card:hover {
    box-shadow: var(--rim-card-hover);
  }
}

.card-head, .line-item, .progress-label, .year-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.overview-card .card-head { align-items: center; }

.overview-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
  min-block-size: 140px;
  padding-block: 22px 24px;
}
.overview-content .metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}
.metric-label, .progress-label { color: var(--ink-secondary); font-size: 14px; }
.metric-value {
  font-size: clamp(32px, 3.2vw, 42px);
  color: var(--ink-strong);
  font-weight: 700;
  line-height: 1.1;
  margin-top: 6px;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.metric-value small { color: var(--ink-secondary); font-size: 15.5px; font-weight: 400; letter-spacing: 0; }

/* Crystal Glass Progress Ring */
.overview-progress {
  position: relative;
  display: grid;
  place-content: center;
  text-align: center;
  inline-size: clamp(84px, 8.4vw, 106px);
  aspect-ratio: 1;
  line-height: 1.18;
  font-variant-numeric: tabular-nums;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 2px 10px rgba(15, 23, 42, 0.04);
}
.overview-progress::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    #52565F 0%,
    #7E828C var(--progress),
    rgba(46, 48, 54, 0.09) var(--progress)
  );
  -webkit-mask-image: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
          mask-image: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
}
.overview-progress strong { font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; color: var(--ink-strong); }
.overview-progress span { font-size: 12px; color: var(--ink-secondary); margin-top: 1px; }

/* Disclosures & Progress Bars */
.disclosure { margin-top: 0; border-top: 1px solid var(--separator); display: flow-root; }
.disclosure > summary, .group > summary, .term > summary, .minor-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.disclosure > summary {
  min-height: 52px;
  padding-block: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.disclosure > summary:hover { opacity: 0.70; }
.disclosure-control { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.expand-label, .picker-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 400;
  white-space: nowrap;
}
.when-open { display: none; }
details[open]:not([data-folding-closed]) > summary .when-open { display: inline; }
details[open]:not([data-folding-closed]) > summary .when-closed { display: none; }

.detail-body {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
  color: var(--ink-secondary);
  font-size: 14.5px;
}
.line-item { padding: 5px 0; }
.line-item strong { color: var(--ink-strong); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  margin-top: 4px;
  padding: 0 13px;
  border: 1px solid rgba(46, 48, 54, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(165%);
          backdrop-filter: blur(14px) saturate(165%);
  box-shadow: inset 0 1px 0 #FFFFFF, 0 2px 6px rgba(15, 23, 42, 0.05);
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 130ms ease, box-shadow 160ms ease;
}
.inline-link::after { content: "›"; font-size: 15px; line-height: 1; opacity: 0.65; }
.inline-link:hover {
  background: #FFFFFF;
  border-color: rgba(46, 48, 54, 0.22);
  box-shadow: inset 0 1px 0 #FFFFFF, 0 3px 10px rgba(15, 23, 42, 0.08);
}
.inline-link:active { transform: scale(0.96); }

.detail-block { border-top: 1px solid var(--separator); margin-top: 12px; padding-top: 12px; }
.detail-block h3 { color: var(--ink-strong); margin-bottom: 8px; font-size: 14.5px; }
.year-line { margin: 10px 0; }
.year-label { font-size: 13.5px; font-variant-numeric: tabular-nums; }
progress {
  display: block;
  appearance: none;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: rgba(46, 48, 54, 0.09);
  margin-top: 6px;
  overflow: hidden;
}
progress::-webkit-progress-bar { background: rgba(46, 48, 54, 0.09); border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #545862, #828690); border-radius: 999px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, #545862, #828690); border-radius: 999px; }

/* ============================================================================
   LIQUID GLASS BUTTONS
   ============================================================================ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-capsule);
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), transform 220ms var(--settle-spring);
}
.button:active:not(:disabled) { transform: scale(0.965); transition-duration: 90ms; }
button:disabled { opacity: 0.50; cursor: not-allowed; }
.button.primary:disabled {
  opacity: 1;
  background: rgba(46, 48, 54, 0.10);
  color: rgba(46, 48, 54, 0.42);
  box-shadow: none;
}

.button.primary {
  background: var(--glass-primary);
  color: #F9FAFB;
  box-shadow: var(--rim-primary);
}
.button.primary:hover:not(:disabled) {
  background: var(--glass-primary-h);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 8px 20px rgba(15, 23, 42, 0.15);
}

.button.secondary,
.overview-card .manage-courses {
  background: var(--glass-control);
  color: rgba(46, 48, 54, 0.78);
  font-weight: 400;
  box-shadow: var(--rim-control);
}
.button.secondary:hover:not(:disabled),
.overview-card .manage-courses:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink-strong);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 0.5px rgba(46, 48, 54, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
}
.overview-card .manage-courses { min-height: 36px; padding: 0 16px; font-size: 14px; }

/* ============================================================================
   COURSES PAGE — PIXEL-ALIGNED HEADER, SEARCH & COURSE LISTS
   ============================================================================ */
#courses-page .page-heading { margin-bottom: 18px; }

.course-search {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 18px;
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 700;
}
.course-search::after {
  content: "";
  position: absolute;
  inset: auto auto 16px 16px;
  width: 12px;
  height: 12px;
  border: 1.6px solid var(--ink-secondary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}
.course-search::before {
  content: "";
  position: absolute;
  inset: auto auto 14px 27px;
  width: 6px;
  height: 1.6px;
  transform: rotate(45deg);
  background: var(--ink-secondary);
  pointer-events: none;
  z-index: 2;
}

@media (min-width: 960px) {
  #courses-page:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    align-items: end;
    column-gap: 24px;
  }
  #courses-page .page-heading { margin-bottom: 22px; }
  #courses-page > .course-search {
    margin-top: clamp(24px, 3vw, 38px);
    margin-bottom: 22px;
    justify-self: end;
  }
  #courses-page > :not(.page-heading, .course-search) {
    grid-column: 1 / -1;
  }
}

#course-feedback { margin: 0 0 14px; font-size: 13.5px; }
#course-feedback:empty { display: none; }
#course-search-results { margin-bottom: 18px; }

.course-list { display: grid; gap: var(--page-gap); }

/* Registration Panel & Strictly Aligned Toolbar */
.registration-panel { overflow: clip; }
.registration-header { padding: var(--panel-padding); }
.registration-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}
.registration-term-field { min-width: 0; }
.registration-toolbar > button {
  height: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  padding: 0 20px;
}

.registration-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--separator);
  font-size: 15px;
  color: var(--ink-secondary);
}
.registration-stats strong { font-weight: 700; color: var(--ink-strong); margin-left: 6px; font-variant-numeric: tabular-nums; }

/* Clean Frosted Inner Lists (Zero Muddy Grey Fill) */
.registration-list,
.group-body {
  background: rgb(255 255 255 / 9%);
  padding: clamp(12px, 1.6vw, 18px);
  border-top: 1px solid var(--separator);
}
.registration-list { display: grid; gap: 0; }
.registration-list .course-button {
  background: rgb(255 255 255 / 18%);
  border: 1px solid rgb(255 255 255 / 58%);
  border-bottom-color: var(--separator);
  padding: 15px 18px;
}
.registration-list .course-button + .course-button { border-top-color: transparent; }
.registration-list .course-button:hover { background: rgb(255 255 255 / 31%); }
.registration-list .course-button:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.registration-list .course-button:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border-bottom-color: rgba(255, 255, 255, 0.86);
}
.registration-list .course-button:only-child { border-radius: var(--radius-md); }
.registration-empty { padding: 28px; color: var(--ink-secondary); text-align: center; font-size: 15px; }

/* Planned & China Groups */
.group { overflow: clip; }
.group > summary { min-height: 66px; padding: 16px var(--panel-padding); transition: background-color var(--duration-fast) var(--ease-out); }
.group > summary:hover { background: rgba(255, 255, 255, 0.34); }
.group-title { color: var(--ink-strong); font-size: 20px; font-weight: 700; }
.group-meta { display: flex; align-items: center; flex: none; gap: 10px; color: var(--ink-secondary); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.group-meta > span:first-child { white-space: nowrap; }

.group-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.term {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 4px 14px rgba(15, 23, 42, 0.035);
  overflow: clip;
}
.term > summary { padding: 14px 16px; background: rgba(255, 255, 255, 0.54); transition: background-color var(--duration-fast) var(--ease-out); }
.term > summary:hover { background: rgba(255, 255, 255, 0.80); }
.term-label { display: block; font-size: 16px; font-weight: 700; color: var(--ink-strong); }
.term-meta { display: block; margin-top: 2px; color: var(--ink-secondary); font-size: 13.5px; font-weight: 400; font-variant-numeric: tabular-nums; }

#course-list[data-system="China"] .group-body { grid-template-columns: 1fr; gap: 0; }
#course-list[data-system="US"] .group-body > .term:last-child:nth-child(odd) { grid-column: 1 / -1; }
#course-list[data-system="China"] .course-button {
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--separator);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  padding: 15px 18px;
}
#course-list[data-system="China"] .course-button:nth-of-type(even) { background: rgba(255, 255, 255, 0.54); }
#course-list[data-system="China"] .course-button:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
#course-list[data-system="China"] .course-button:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border-bottom-color: rgba(255, 255, 255, 0.86);
}
#course-list[data-system="China"] .course-button:only-child { border-radius: var(--radius-md); }

/* ============================================================================
   COURSE ROWS — RAZOR-ALIGNED VERTICAL COLUMNS
   ============================================================================ */
.course-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--separator);
  background: rgba(255, 255, 255, 0.70);
  text-align: left;
  padding: 14px 16px;
  transition: background-color var(--duration-fast) var(--ease-out);
}
.term .course-button:nth-of-type(even) { background: rgba(255, 255, 255, 0.52); }
.course-button:hover { background: rgba(255, 255, 255, 0.90); }
.planned-course { cursor: default; }
.course-button > :first-child { min-inline-size: 0; }

.course-title { display: block; font-size: 16px; font-weight: 700; color: var(--ink-strong); line-height: 1.4; overflow-wrap: anywhere; }
.course-meta { display: block; color: var(--ink-secondary); font-size: 13.5px; margin-top: 3px; overflow-wrap: anywhere; }
.course-meta-paired {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 5px;
  row-gap: 4px;
}
.course-code-block {
  padding: 2px 6px;
  border: 1px solid var(--separator-strong);
  border-radius: 5px;
  background: rgb(255 255 255 / 55%);
  color: var(--ink-strong);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.course-pair-credits { white-space: nowrap; }
.course-credit-note {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(46, 48, 54, 0.055);
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.credit-note { color: var(--ink-secondary); font-size: 13.5px; line-height: 1.5; margin-top: 10px; }

.course-grade-summary {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  inline-size: fit-content;
  max-inline-size: 100%;
  margin-block-start: 8px;
  padding: 4px 11px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.course-grade-summary b { color: var(--ink-strong); font-weight: 700; margin-inline-start: 3px; }

.course-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.course-actions > .badge { order: -1; margin-inline-end: 4px; }

/* Consistent-width non-clickable status badge (soft Apple semantic glass tints) */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 72px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(112, 120, 134, 0.12);
  border-radius: 8px;
  background: rgba(112, 120, 134, 0.075);
  color: rgba(78, 84, 94, 0.74);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  user-select: none;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(112, 120, 134, 0.44);
  flex: none;
}
.badge.scheduled {
  background: rgba(182, 134, 60, 0.095);
  border-color: rgba(182, 134, 60, 0.18);
  color: #8B652E;
}
.badge.scheduled::before {
  background: transparent;
  border: 1.3px solid #B6863C;
}
.badge.in-progress {
  background: rgba(58, 126, 202, 0.095);
  border-color: rgba(58, 126, 202, 0.18);
  color: #36699F;
  font-weight: 400;
}
.badge.in-progress::before {
  background: #4B89CC;
}
.badge.complete {
  background: rgba(54, 146, 98, 0.095);
  border-color: rgba(54, 146, 98, 0.18);
  color: #2F7552;
  font-weight: 400;
}
.badge.complete::before {
  background: #429A6D;
}

/* Consistent-width Edit & Remove pills (soft balanced contrast) */
.edit-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(46, 48, 54, 0.12);
  border-radius: var(--radius-capsule);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(46, 48, 54, 0.74);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), transform var(--duration-instant) var(--ease-out);
}
.edit-label:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(46, 48, 54, 0.16);
  color: var(--ink-strong);
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(15, 23, 42, 0.05);
}
.edit-label:active { transform: scale(0.96); }

.remove-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(46, 48, 54, 0.08);
  border-radius: var(--radius-capsule);
  background: rgba(255, 255, 255, 0.42);
  color: rgba(46, 48, 54, 0.56);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), transform var(--duration-instant) var(--ease-out);
}
.remove-label:hover:not(:disabled) {
  background: rgba(46, 48, 54, 0.06);
  color: rgba(46, 48, 54, 0.84);
  border-color: rgba(46, 48, 54, 0.16);
}
.remove-label:active:not(:disabled) { transform: scale(0.96); }

#remove-submit.button.remove-label,
#logout-confirm.button.primary {
  min-width: auto;
  height: 42px;
  padding: 0 20px;
  background: var(--glass-primary);
  color: #F9FAFB;
  border: 0;
  font-weight: 700;
  box-shadow: var(--rim-primary);
}

/* Minor Requirements */
#minor-requirements { display: grid; gap: 16px; }
.minor-overview { padding: 16px var(--panel-padding); }
.minor-credit-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; }
.minor-credit-title { display: inline-flex; align-items: baseline; gap: 10px; }
.doc-download-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(46, 48, 54, 0.12);
  background: rgba(255, 255, 255, 0.84);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
          backdrop-filter: blur(16px) saturate(170%);
  box-shadow: inset 0 1px 0 #FFFFFF, 0 2px 8px rgba(15, 23, 42, 0.05);
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms var(--ease-out), border-color 150ms ease, transform 130ms ease, box-shadow 150ms ease;
}
.doc-download-pill:hover {
  background: #FFFFFF;
  border-color: rgba(46, 48, 54, 0.22);
  box-shadow: inset 0 1px 0 #FFFFFF, 0 4px 12px rgba(15, 23, 42, 0.08);
}
.doc-download-pill:active { transform: scale(0.96); }
.minor-credit-note { margin-top: 6px; }
.minor-overview h3, .minor-overview strong { color: var(--ink-strong); }
.minor-overview strong { font-size: 18px; }
.minor-groups { display: grid; gap: 14px; }
.minor-group { overflow: hidden; }
.minor-group > summary { padding: 14px var(--panel-padding); background: rgba(255, 255, 255, 0.44); color: var(--ink-strong); font-weight: 700; }
.minor-subgroups {
  display: grid;
  gap: 12px;
  padding: 12px var(--panel-padding) 16px;
  border-top: 1px solid var(--separator);
  background: rgba(247, 248, 251, 0.48);
}
.minor-subgroup {
  border-radius: var(--radius-md);
  border: 1px solid rgba(46, 48, 54, 0.085);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  display: flow-root;
}
.minor-subgroup > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.minor-subgroup > summary::-webkit-details-marker { display: none; }
.minor-note { display: block; margin-top: 4px; color: var(--ink-secondary); font-size: 13.5px; font-weight: 400; line-height: 1.5; }
.minor-plan-note { display: inline-block; margin: 4px 6px 0 0; }
.minor-edit { border: 0; cursor: pointer; }

/* ============================================================================
   SETTINGS PAGE — APPLE GROUPED SECTIONS + CIRCULAR AVATAR + STANDALONE LOGOUT
   ============================================================================ */
input.is-masked {
  -webkit-text-security: disc;
}
html, body {
  touch-action: manipulation;
}
*, *::before, *::after {
  font-family: var(--font-editorial);
}

#settings-page {
  padding-bottom: 44px;
}
.settings-sections {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 960px;
}

.settings-profile-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 26px;
  border: 0;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms var(--ease-out), background 180ms var(--ease-out);
}
.settings-profile-row:hover { background: rgba(255, 255, 255, 0.72); }
.settings-profile-row:active { transform: scale(0.985); }

.profile-avatar-circle {
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  border: 1px solid rgba(46, 48, 54, 0.10);
  box-shadow: inset 0 1px 0 #FFFFFF, 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s var(--apple-spring), box-shadow 0.22s ease, border-color 0.22s ease;
}
button.profile-avatar-circle {
  cursor: pointer;
}
button.profile-avatar-circle:hover {
  border-color: rgba(46, 48, 54, 0.22);
  box-shadow: inset 0 1px 0 #FFFFFF, 0 6px 16px rgba(15, 23, 42, 0.12);
}
button.profile-avatar-circle:active {
  transform: scale(0.95);
}
#avatar-action-dialog {
  width: min(380px, calc(100vw - 32px));
}
.avatar-action-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 8px;
}
.avatar-action-preview {
  width: 96px;
  height: 96px;
}
.avatar-action-preview.is-default-logo {
  padding: 16px;
}
.avatar-action-footer {
  justify-content: flex-end;
}
.profile-avatar-circle.is-large {
  width: 82px;
  height: 82px;
  cursor: pointer;
}
.profile-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-avatar-circle.is-default-logo {
  padding: 9px;
}
.profile-avatar-circle.is-default-logo img.avatar-default-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.profile-avatar-editor {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.profile-avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-acct-line {
  font-size: 14px;
  color: var(--ink-secondary);
}
.profile-acct-line strong { color: var(--ink-strong); }
.profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.profile-name-field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-secondary);
}
.profile-name-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(46, 48, 54, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-strong);
  font-size: 15px;
}

/* Settings subpages. */
.settings-subpage {
  width: 100%;
  max-width: 960px;
}
.settings-sub-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 42px 0 24px;
}
.settings-sub-bar h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink-strong);
}
.settings-back-btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(46, 48, 54, 0.11);
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(175%);
          backdrop-filter: blur(18px) saturate(175%);
  box-shadow: var(--rim-control);
  color: var(--ink-strong);
  font-size: 14px;
  cursor: pointer;
  transition: background 150ms var(--ease-out), transform 130ms ease;
}
.settings-back-btn:hover { background: #FFFFFF; }
.settings-back-btn:active { transform: scale(0.96); }
.settings-sub-stack {
  display: grid;
  gap: 16px;
}

/* OpenAI-style Profile Detail Rows inside Apple Liquid Glass Card */
.profile-detail-card {
  padding: 10px 28px 14px;
}
.profile-section-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-secondary);
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--separator);
}
.profile-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 18px 0;
  border-top: 1px solid var(--separator);
  flex-wrap: wrap;
}
.profile-detail-row:first-of-type { border-top: 0; }
.profile-row-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 180px;
  flex: 1;
}
.profile-row-left strong {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-strong);
}
.profile-row-left span {
  font-size: 13px;
  color: var(--ink-secondary);
}
.profile-row-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-value-text {
  font-size: 14.5px;
  color: var(--ink-strong);
}
.profile-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(46, 48, 54, 0.11);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 130ms ease;
}
.profile-icon-btn:hover { background: #FFFFFF; color: var(--ink-strong); }
.profile-icon-btn:active { transform: scale(0.94); }
.profile-mini-btn {
  height: 34px;
  padding: 0 13px;
  font-size: 13px;
}
.profile-name-slot {
  display: grid;
  grid-template-areas: "slot";
  align-items: center;
  justify-items: end;
  min-height: 38px;
}
.profile-name-view,
.profile-inline-editor {
  grid-area: slot;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  transform-origin: right center;
  transition:
    opacity 240ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 240ms ease,
    visibility 260ms step-end;
}
.profile-name-view {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0px);
  visibility: visible;
}
.profile-inline-editor {
  padding: 0;
  flex-wrap: nowrap;
  opacity: 0;
  transform: translate3d(10px, 0, 0) scale(0.95);
  filter: blur(4px);
  pointer-events: none;
  visibility: hidden;
}
.profile-name-slot.is-editing .profile-name-view {
  opacity: 0;
  transform: translate3d(-8px, 0, 0) scale(0.94);
  filter: blur(3px);
  pointer-events: none;
  visibility: hidden;
}
.profile-name-slot.is-editing .profile-inline-editor {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0px);
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity 260ms cubic-bezier(0.22, 1, 0.36, 1) 40ms,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1) 20ms,
    filter 260ms ease 30ms,
    visibility 0ms step-start;
}
.profile-inline-editor input {
  width: 176px;
  min-width: 130px;
  height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(46, 48, 54, 0.15);
  background: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  color: var(--ink-strong);
}
.profile-detail-row.is-danger-row {
  margin-top: 4px;
}

/* Interactive Circular Avatar Cropper */
.avatar-crop-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.avatar-crop-stage {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 18px;
  overflow: hidden;
  background: #E9ECF2;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: inset 0 0 0 1px rgba(46, 48, 54, 0.10);
}
.avatar-crop-stage:active { cursor: grabbing; }
#avatar-crop-canvas {
  display: block;
  width: 240px;
  height: 240px;
}
.avatar-crop-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(22, 24, 30, 0.44), inset 0 0 0 1.5px rgba(255, 255, 255, 0.92);
  pointer-events: none;
}
.avatar-crop-zoom-row {
  width: min(100%, 260px);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}
.avatar-crop-zoom-row input[type="range"] {
  flex: 1;
  accent-color: #464A53;
}

.settings-row-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.settings-profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-strong);
}
.settings-row-copy strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-strong);
}
.settings-row-sub {
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.settings-group-card {
  padding: 0;
  overflow: hidden;
}
.settings-group-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px;
  border: 0;
  border-top: 1px solid var(--separator);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 160ms var(--ease-out), transform 140ms var(--ease-out);
}
.settings-group-row:first-child { border-top: 0; }
.settings-group-row:hover { background: rgba(255, 255, 255, 0.56); }
.settings-group-row:active { background: rgba(46, 48, 54, 0.05); }

.settings-logout-row {
  width: 100%;
  padding: 16px 26px;
  border: 0;
  text-align: center;
  font-size: 15.5px;
  font-weight: 700;
  color: #A23D3D;
  cursor: pointer;
  transition: background 160ms var(--ease-out), transform 140ms var(--ease-out);
}
.settings-logout-row:hover { background: rgba(162, 61, 61, 0.06); }
.settings-logout-row:active { transform: scale(0.985); }

/* Registration 15s User Agreement & Disclaimer UI */
.auth-agree-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(46, 48, 54, 0.09);
  font-size: 12.5px;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.auth-agree-box:hover {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(46, 48, 54, 0.16);
}
.auth-agree-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.auth-agree-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #4A4E57;
}
.auth-agree-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-strong);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.auth-agree-status {
  font-size: 12px;
  color: var(--ink-tertiary);
}
.auth-agree-status.is-done { color: #2E7D54; font-weight: 700; }

.agreement-body {
  font-size: 13.8px;
  line-height: 1.78;
  color: var(--ink);
}
.agreement-meta {
  font-size: 12.5px;
  color: var(--ink-secondary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--separator);
}
.agreement-list {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

/* ============================================================================
   SETTINGS PAGE — BALANCED EQUAL-HEIGHT GLASS CARDS
   ============================================================================ */
.settings-card {
  padding: var(--panel-padding);
  display: flex;
  flex-direction: column;
}
.settings-card h2 { margin-bottom: 16px; }

.setting-link {
  display: flex;
  width: 100%;
  height: 46px;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: var(--glass-control);
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 15px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-strong);
  box-shadow: var(--rim-control);
  transition: background var(--duration-fast) var(--ease-out), transform var(--duration-instant) var(--ease-out);
}
.setting-link:hover { background: rgba(255, 255, 255, 0.94); }
.setting-link:active { transform: scale(0.985); }
.setting-link + .setting-link { margin-top: 10px; }

.link-meta { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-secondary); font-size: 13.5px; font-weight: 400; }
.link-meta::after { content: "›"; font-size: 16px; line-height: 1; opacity: 0.65; }

.backup-card,
.account-card {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.backup-card h2,
.account-card h2 { margin-bottom: 6px; }
.backup-card p,
.account-card p { font-size: 14.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.backup-card .actions,
.account-card .actions { margin-top: 0; }

.sync-card {
  justify-content: space-between;
  gap: 16px;
}
.sync-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sync-card-head h2 { margin-bottom: 0; }
.sync-card-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.beta-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(196, 138, 44, 0.12);
  border: 1px solid rgba(196, 138, 44, 0.24);
  color: #8D5D14;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}
.sync-card .actions { margin-top: 0; }
.plugin-dl-pill {
  height: 32px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 400;
}
.browser-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.browser-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(46, 48, 54, 0.10);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-strong);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--rim-control);
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), transform var(--duration-instant) var(--ease-out);
}
.browser-option:hover { background: rgba(255, 255, 255, 0.96); }
.browser-option:active { transform: scale(0.98); }
.browser-option.is-selected {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(46, 48, 54, 0.42);
  box-shadow: inset 0 1px 0 #fff, 0 4px 14px rgba(15, 23, 42, 0.08);
}
.browser-option-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.browser-option b { font-size: 14.5px; font-weight: 700; color: var(--ink-strong); }
.browser-option small { font-size: 12.5px; color: var(--ink-secondary); }
.browser-detect-tag {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(66, 154, 109, 0.13);
  color: #2E7D54;
  white-space: nowrap;
}
.browser-install-tip {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(46, 48, 54, 0.08);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.kw-preview-list {
  margin-top: 12px;
  border: 1px solid rgba(46, 48, 54, 0.10);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}
.kw-preview-list:empty { display: none; }
.kw-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--separator);
  cursor: pointer;
}
.kw-preview-row:first-child { border-top: 0; }
.kw-preview-row:hover { background: rgba(255, 255, 255, 0.94); }
.kw-preview-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  min-width: 0;
  flex: 1;
  font-weight: 400;
  color: var(--ink-strong);
}
.kw-preview-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
  accent-color: #4A4E57;
}
.kw-preview-info b { display: block; font-size: 14.5px; font-weight: 700; color: var(--ink-strong); }
.kw-preview-info small { display: block; font-size: 12.5px; color: var(--ink-secondary); }
.kw-guide-steps {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-secondary);
}
.supplement > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.supplement > summary::-webkit-details-marker { display: none; }

.account-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-secondary);
}
.account-meta strong {
  color: var(--ink-strong);
  font-weight: 700;
}
.account-status-pill {
  min-width: auto;
  height: 24px;
  padding: 0 9px;
  font-size: 12px;
}

.button.danger-soft {
  background: rgba(182, 66, 66, 0.08);
  border: 1px solid rgba(182, 66, 66, 0.18);
  color: #963B3B;
  font-weight: 400;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.button.danger-soft:hover:not(:disabled) {
  background: rgba(182, 66, 66, 0.14);
  border-color: rgba(182, 66, 66, 0.28);
  color: #7F2D2D;
}
.button.danger-solid {
  background-color: #A23D3D;
  background-image: linear-gradient(160deg, rgba(176, 68, 68, 0.90) 0%, rgba(148, 52, 52, 0.96) 100%);
  color: #FDF8F8;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 5px 16px rgba(148, 52, 52, 0.18);
}
.button.danger-solid:hover:not(:disabled) {
  background-color: #B04444;
  background-image: linear-gradient(160deg, rgba(188, 74, 74, 0.94) 0%, rgba(160, 58, 58, 0.98) 100%);
}
.dialog-error {
  min-height: 20px;
  margin-top: 10px;
  font-size: 13.5px;
  color: #8E3A3A;
  line-height: 1.45;
}
.dialog-error:empty {
  display: none;
}

/* ============================================================================
   INPUTS, SELECTS & TERM PICKER
   ============================================================================ */
label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-secondary); }
label + label, .field-grid + label { margin-top: 14px; }

input:not([type="radio"], [type="checkbox"]),
select,
textarea,
.term-picker-trigger,
#edit-gpa,
#edit-requirement {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  padding: 9px 13px;
  border: 1px solid rgba(46, 48, 54, 0.13);
  border-radius: var(--radius-md);
  color: var(--ink-strong);
  background: rgba(255, 255, 255, 0.80);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 1px 2px rgba(15, 23, 42, 0.03);
  font-size: 15px;
  font-weight: 400;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-tertiary); }

select:not(:disabled) {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23545862' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px;
}
select:disabled { color: var(--ink-secondary); background: rgba(46, 48, 54, 0.05); }
input[readonly] {
  background: rgba(46, 48, 54, 0.045);
  border-color: transparent;
  box-shadow: none;
  color: var(--ink-secondary);
  font-weight: 700;
  cursor: default;
}
.course-search input[type="search"] {
  height: 44px;
  padding: 0 16px 0 42px;
  border: 1px solid rgba(46, 48, 54, 0.11);
  border-radius: var(--radius-capsule);
  background: var(--glass-control);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
          backdrop-filter: blur(22px) saturate(180%);
}
input[type="number"] { appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

:is(select, input:not([type="radio"], [type="checkbox"]), textarea, .term-picker-trigger) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 0 1px rgba(46, 52, 64, 0),
    0 0 16px 1px rgba(96, 110, 134, 0),
    0 6px 20px -6px rgba(15, 23, 42, 0);
  transition:
    border-color 440ms cubic-bezier(0.25, 0.1, 0.25, 1),
    background-color 420ms cubic-bezier(0.25, 0.1, 0.25, 1),
    box-shadow 480ms cubic-bezier(0.25, 0.1, 0.25, 1);
}
:is(select, input:not([type="radio"], [type="checkbox"]), textarea, .term-picker-trigger):hover:not(:disabled, :focus, [readonly]) {
  border-color: rgba(46, 52, 64, 0.19);
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 0 0 1px rgba(46, 52, 64, 0),
    0 0 16px 1px rgba(96, 110, 134, 0.05),
    0 6px 20px -6px rgba(15, 23, 42, 0.04);
}
:is(select, input:not([type="radio"], [type="checkbox"]), textarea, #edit-gpa, #edit-requirement, .term-picker-trigger):focus,
.term-picker-trigger:has(+ :popover-open) {
  background-color: #FFFFFF;
  border-color: rgba(46, 52, 64, 0.28);
  outline: none;
  box-shadow:
    inset 0 1px 0 #FFFFFF,
    0 0 0 1px rgba(46, 52, 64, 0.06),
    0 0 16px 1px rgba(96, 110, 134, 0.16),
    0 6px 20px -6px rgba(15, 23, 42, 0.10);
  transition:
    border-color 360ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 360ms ease,
    box-shadow 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.term-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(46, 48, 54, 0.12);
  border-radius: var(--radius-md);
  background: var(--glass-control);
}
#current-term-picker .term-picker-trigger { height: 46px; }
.term-picker-trigger:hover { background: rgba(255, 255, 255, 0.94); }
.term-picker-trigger .picker-action { color: var(--ink-secondary); font-size: 13.5px; }

/* Term picker glass */
.term-picker-menu {
  inset: auto;
  position-area: bottom;
  position-try-fallbacks: flip-block;
  width: anchor-size(width, min(420px, 90vw));
  max-block-size: min(46dvh, 380px);
  margin: 8px 0;
  padding: 8px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--glass-sheet-rim) var(--glass-sheet);
  -webkit-backdrop-filter: blur(9px);
          backdrop-filter: blur(9px);
  color: var(--ink);
  box-shadow: var(--rim-sheet);
  scrollbar-width: none;
}
@media (prefers-reduced-motion: no-preference) {
  .term-picker-menu {
    transform-origin: center top;
    opacity: 0;
    transform: scale(var(--dialog-exit-scale));
    transition: opacity var(--dialog-exit-duration) var(--ease-in), transform var(--dialog-exit-duration) var(--ease-in),
      display var(--dialog-exit-duration) allow-discrete, overlay var(--dialog-exit-duration) allow-discrete;
  }
  .term-picker-menu:popover-open {
    opacity: 1;
    transform: none;
    transition-timing-function: var(--ease-out);
  }
  @starting-style { .term-picker-menu:popover-open { opacity: 0; transform: scale(var(--dialog-enter-scale)); } }
}

.registration-year { border-radius: var(--radius-sm); overflow: clip; }
.registration-year + .registration-year { margin-top: 4px; }
.registration-year > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  color: var(--ink-strong);
  background: rgba(255, 255, 255, 0.68);
  font-weight: 700;
  font-size: 14.5px;
}
.registration-seasons { padding: 4px 0; background: rgba(248, 249, 252, 0.72); }
.registration-season-group + .registration-season-group { border-top: 1px solid var(--separator); }
.registration-season-heading { padding: 6px 14px 3px; font-size: 12.5px; color: var(--ink-secondary); font-weight: 700; }
.registration-season-group > button {
  display: block;
  width: 100%;
  padding: 8px 14px 8px 22px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 14.5px;
  text-align: start;
}
.registration-season-group > button:hover { background: rgba(46, 48, 54, 0.06); }
.registration-season-group > button[aria-pressed="true"] { background: rgba(46, 48, 54, 0.09); font-weight: 700; }
.registration-season-group > button[aria-pressed="true"]::after { content: "✓"; float: inline-end; }

@supports (appearance: base-select) and selector(::picker(select)) {
  select, select::picker(select) { appearance: base-select; }
  select { display: flex; align-items: center; }
  select::picker-icon { display: none; }
  select::picker(select) {
    margin-block: 6px;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--glass-popover);
    -webkit-backdrop-filter: blur(30px) saturate(185%);
            backdrop-filter: blur(30px) saturate(185%);
    color: var(--ink);
    box-shadow: var(--rim-sheet);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out),
      display var(--duration-fast) allow-discrete, overlay var(--duration-fast) allow-discrete;
  }
  select:open::picker(select) { opacity: 1; transform: none; }
  @starting-style { select:open::picker(select) { opacity: 0; transform: translateY(-4px); } }
  select option { padding: 8px 12px; }
  select option:is(:hover, :focus-visible) { background: rgba(46, 48, 54, 0.06); }
  select option:checked { background: rgba(46, 48, 54, 0.10); font-weight: 700; }
}

/* ============================================================================
   LIQUID GLASS DIALOGS & PIXEL-ALIGNED FORM GRIDS
   ============================================================================ */
dialog:where(:not(.lg-dialog)) {
  --dialog-height: min(88dvh, 820px);
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  width: min(calc(100% - 32px), 560px);
  max-height: var(--dialog-height);
  padding: 0;
  border: 1px solid rgb(255 255 255 / 88%);
  border-radius: var(--radius-2xl);
  color: var(--ink);
  background: var(--glass-dialog-edge) var(--glass-dialog-material);
  box-shadow: inset 0 1px rgb(255 255 255 / 70%), 0 14px 38px rgb(30 35 46 / 13%);
  overflow: hidden;
}
#course-dialog { width: min(calc(100% - 40px), 740px); }
#registration-dialog { height: min(760px, var(--dialog-height)); width: min(calc(100% - 32px), 740px); }
#logout-dialog { width: min(calc(100% - 32px), 420px); }

dialog:modal:where(:not(.lg-dialog))::backdrop {
  background: rgb(225 228 234 / 24%);
  opacity: 1;
  transition: opacity var(--dialog-enter-duration) var(--ease-out);
}
/* Apply the frost to the page so it also renders when WebKit skips backdrop filters on the top layer. */
body:has(dialog:modal:not(.lg-dialog)) #auth-page,
#app-shell:has(dialog:modal:not(.lg-dialog)) > :is(.masthead, main, .mobile-dock) {
  filter: var(--glass-dialog-page-filter);
}
dialog[data-closing]::backdrop { opacity: 0; transition: opacity var(--dialog-exit-duration) var(--ease-in); }
dialog[data-closing] { pointer-events: none; }
@starting-style { dialog:modal:where(:not(.lg-dialog))::backdrop { opacity: 0; } }

dialog[open]:where(:not(.lg-dialog)), dialog form { display: flex; flex-direction: column; }
dialog form { min-height: 0; max-height: var(--dialog-height); }
.dialog-head, .dialog-actions { flex-shrink: 0; }

.dialog-head {
  padding: 20px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--glass-sheet-bar);
  border-bottom: 1px solid var(--separator);
}
.dialog-head > div { flex: 1; min-inline-size: 0; overflow-wrap: anywhere; }
.dialog-head h2 { line-height: 1.24; }
.dialog-head .muted { font-size: 13.5px; margin-top: 4px; }

.close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--glass-control);
  color: var(--ink-secondary);
  box-shadow: var(--rim-control);
  font-size: 21px;
  line-height: 1;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), transform var(--duration-instant) var(--ease-out);
}
.close:hover { background: rgba(255, 255, 255, 0.96); color: var(--ink-strong); }
.close:active { transform: scale(0.92); }

.dialog-body {
  padding: 18px 24px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 48, 54, 0.18) transparent;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 24px;
  background: var(--glass-sheet-bar);
  border-top: 1px solid var(--separator);
}

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.field-grid > label, .field-grid > div { min-inline-size: 0; margin-top: 0; }
.course-grade-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.course-grade-grid > * { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.course-grade-grid :is(select, input), #edit-gpa, #remove-confirmation { height: 42px; }

#edit-requirement-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--separator);
  display: flex;
  align-items: center;
  gap: 10px;
}
#edit-requirement {
  width: fit-content;
  min-width: 36px;
  height: 28px;
  margin-top: 0;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-capsule);
  background: rgba(46, 48, 54, 0.055);
  border: 1px solid var(--separator);
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-strong);
}
.requirement-label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-secondary); line-height: 1.52; }
#edit-gpa {
  margin-top: 6px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  background: rgba(46, 48, 54, 0.045);
  border-color: transparent;
  box-shadow: none;
  font-weight: 700;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.form-section {
  background: rgb(255 255 255 / 22%);
  padding: 16px 18px;
  border: 1px solid rgb(255 255 255 / 58%);
  border-radius: var(--radius-lg);
}
.form-section + .form-section { margin-top: 14px; }
.form-section h3 { margin-bottom: 10px; color: var(--ink-strong); }
.field-hint { font-size: 13.5px; margin: 6px 0; color: var(--ink-secondary); }

.supplement { background: rgba(255, 255, 255, 0.62); padding: 0 16px; border: 1px solid rgba(255, 255, 255, 0.88); border-radius: var(--radius-lg); margin-top: 14px; }
.supplement > summary { padding: 12px 0; color: var(--ink-strong); font-weight: 700; font-size: 14.5px; }
.supplement[open] { padding-bottom: 14px; }
.supplement p { font-size: 14px; margin: 4px 0; color: var(--ink-secondary); }

.rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr) minmax(0, 0.85fr) auto;
  align-items: end;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.66);
}
.rule-row label { font-size: 13px; margin: 0; }
.rule-row :is(input, select) { height: 40px; padding-block: 6px; }
.remove-rule {
  height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(46, 48, 54, 0.14);
  border-radius: var(--radius-capsule);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-secondary);
  font-size: 13.5px;
  white-space: nowrap;
}
.remove-rule:hover { background: rgba(46, 48, 54, 0.08); color: var(--ink-strong); }

#registration-dialog { --registration-inset: 22px; }
#registration-count { margin-inline-end: auto; color: var(--ink-secondary); }
#registration-count:empty { display: none; }
.registration-option-group { border: 1px solid var(--separator); border-radius: var(--radius-md); overflow: hidden; }
.registration-option-group + .registration-option-group { margin-top: 12px; }
.registration-option-group h3, .registration-option-group > summary { padding: 10px 14px; background: rgb(255 255 255 / 28%); color: var(--ink-strong); font-size: 14.5px; font-weight: 700; }
.registration-option-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#registration-options .registration-option { display: flex; align-items: center; gap: 12px; padding: 9px 14px; cursor: pointer; box-shadow: inset 3px 0 transparent; transition: background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
.registration-option + .registration-option { margin: 0; border-top: 1px solid var(--separator); }
:where(#registration-options .registration-option, #ge-picker-options .ge-entry, #ge-catalog-dialog .ge-entry) {
  background: var(--glass-sheet-row);
}
@media (hover: hover) and (pointer: fine) {
  :where(#registration-options .registration-option, #ge-picker-options .ge-choice):hover {
    background: var(--glass-sheet-hover);
  }
}
.registration-option:is(:has(input:checked), [data-selected]) { background: var(--glass-sheet-selected); box-shadow: inset 2px 0 #626975; }

#registration-error { margin: 0 auto 0 0; }

#remove-course-summary { margin: 10px 0 14px; padding: 12px 14px; border: 1px solid var(--separator); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.64); }
#remove-word { display: inline-block; margin-inline-start: 6px; padding: 2px 9px; border-radius: 6px; background: rgba(46, 48, 54, 0.08); color: var(--ink-strong); letter-spacing: 0.06em; }

.callout { padding: 10px 14px; border: 1px solid var(--separator-strong); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.72); color: var(--ink); font-size: 14.5px; margin: 12px 0; }
.error { color: #7C3A3A; margin-top: 10px; font-size: 14px; font-weight: 700; }

@keyframes toast-spring-in {
  from { opacity: 0; transform: translate3d(-50%, 12px, 0); }
  to   { opacity: 1; transform: translate3d(-50%, 0, 0); }
}
@keyframes toast-fade-out {
  from { opacity: 1; transform: translate3d(-50%, 0, 0); }
  to   { opacity: 0; transform: translate3d(-50%, 9px, 0); }
}
#toast:not(:empty) {
  position: fixed;
  z-index: 95;
  bottom: 26px;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: calc(100vw - 28px);
  color: var(--ink-strong);
  font-size: 14px;
  line-height: 1.35;
}
#toast:not(:empty):not(:has(.gpaway-toast)) {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 90%);
  background: linear-gradient(170deg, rgb(255 255 255 / 80%), rgb(245 247 251 / 58%));
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
          backdrop-filter: blur(16px) saturate(1.12);
  box-shadow: inset 0 1px #fff, inset 0 -1px 2px rgb(70 78 92 / 13%), 0 7px 24px rgb(31 37 50 / 14%);
}
#toast.is-entering:not(:empty) {
  animation: toast-spring-in 220ms var(--ease-out);
}
#toast.is-leaving:not(:empty) {
  animation: toast-fade-out 180ms var(--ease-in) forwards;
}
.toast-undo {
  flex-shrink: 0;
  margin-inline-start: 4px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid rgb(70 78 92 / 14%);
  border-radius: 999px;
  background: rgb(255 255 255 / 46%);
  color: #344863;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 140ms ease, transform 120ms ease;
}
.toast-undo:hover { background: rgb(255 255 255 / 85%); }
.toast-undo:active { transform: scale(0.94); }
.course-confetti { position: fixed; z-index: 50; inset: 0; width: 100%; height: 100%; pointer-events: none; }

:is(.group, .term, .minor-group, .disclosure) > summary > :first-child,
.term-picker-trigger > :first-child { min-inline-size: 0; overflow-wrap: anywhere; }
.field-grid :is(input, select), .rule-row :is(input, select) { min-inline-size: 0; }

/* ============================================================================
   RESTORED ORIGINAL INTERACTIVE UI ANIMATIONS
   - @property --hover-light smooth light sweep across all actionable surfaces
   - Apple critically damped spring press scale (0.955) on controls & (0.992) on fields
   - Popover scale+translate entrance/exit
   ============================================================================ */
@property --hover-light {
  syntax: "<color>";
  inherits: false;
  initial-value: transparent;
}

@media (hover: hover) and (pointer: fine) {
  :is(button:not(:disabled, .button.primary, .danger-solid, .wordmark, .auth-tab, .lg-tab, .lg-button), a.button:not(.primary), summary) {
    background-image: linear-gradient(var(--hover-light), var(--hover-light));
    transition:
      --hover-light 140ms ease-out,
      background-color 160ms var(--ease-out),
      border-color 160ms var(--ease-out),
      box-shadow 180ms var(--ease-out),
      color 160ms var(--ease-out),
      scale 240ms var(--settle-spring);
  }
  :is(button:not(:disabled, .button.primary, .wordmark, .auth-tab, .lg-tab, .lg-button), a.button:not(.primary), summary):hover {
    --hover-light: rgba(255, 255, 255, 0.42);
  }
  :is(button[aria-current="page"], button[aria-pressed="true"]):hover {
    --hover-light: rgba(255, 255, 255, 0.22);
  }
  :is(button:not(:disabled, .button.primary, .wordmark, .auth-tab, .lg-tab, .lg-button), a.button:not(.primary), summary):active {
    --hover-light: rgba(46, 48, 54, 0.065);
    transition-duration: 75ms;
  }
}

@media (prefers-reduced-motion: no-preference) {
  :is(.button, .tabbar button, .term-picker-trigger, .setting-link, .edit-label, .remove-label, .sidebar-lock, .close, .remove-rule) {
    transition:
      scale 240ms var(--settle-spring),
      background-color var(--control-motion),
      border-color var(--control-motion),
      box-shadow var(--control-motion),
      color var(--control-motion),
      --hover-light 140ms ease-out;
  }
  :is(.button, .tabbar button, .term-picker-trigger, .setting-link, .edit-label, .remove-label, .sidebar-lock, .close, .remove-rule):not(:disabled):active {
    scale: 0.955;
    transition-duration: 110ms;
  }
}

/* ============================================================================
   STANDALONE FRONTEND AUTHENTICATION PAGE (#auth-page) & APP ROUTE (#app-shell)
   - Dedicated full-screen frontend auth view (NOT a modal overlay on top of app)
   - Zero-overlap route switching between #auth-page and #app-shell
   - Apple-ID 2-step progressive username -> password reveal
   ============================================================================ */
#app-shell.is-entering main.wrap {
  animation: route-enter 190ms var(--ease-out);
}
#app-shell.is-exiting {
  opacity: 0;
  transition: opacity 140ms var(--ease-out);
  pointer-events: none;
}
@keyframes route-enter {
  from { opacity: .82; transform: translateY(6px) scale(.997); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(20px, 2.8vw, 34px) clamp(24px, 4.5vw, 60px) clamp(18px, 2.2vw, 26px);
  transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
}
.auth-page.is-exiting {
  opacity: 0;
  transform: translateY(-10px) scale(0.988);
  pointer-events: none;
}
.auth-topbar {
  width: min(100%, 1080px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.auth-topbar-brand {
  display: inline-flex;
  align-items: center;
}
.auth-topbar-logo {
  display: block;
  width: 106px;
  aspect-ratio: 2.4;
  object-fit: cover;
}

/* 2-Column Stage: Left Editorial + Line-Art Sketch Animation | Right Login Card */
.auth-stage {
  width: min(100%, 1080px);
  margin: 0 auto auto;
  padding-block: clamp(18px, calc((100dvh - 740px) / 2), 110px) 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(350px, 424px);
  align-items: start;
  gap: clamp(36px, 5.5vw, 80px);
}
@media (min-width: 761px) {
  html:has(#auth-page:not([hidden])) { scrollbar-gutter: stable both-edges; }
}
@media (min-width: 961px) and (orientation: landscape), (min-width: 1181px) {
  .auth-stage > .auth-editorial { padding-block-start: clamp(32px, 9vh, 96px); }
}

.auth-editorial {
  max-width: 520px;
}

.auth-intro {
  text-align: left;
  margin-bottom: 18px;
}
.auth-intro h1 {
  font-size: clamp(40px, 4.4vw, 52px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: 0.04em;
  color: var(--ink-strong);
}
.auth-subheadline {
  margin-top: 10px;
  font-size: clamp(18px, 1.8vw, 21px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: rgba(46, 48, 54, 0.72);
}

/* ============================================================================
   ALTERNATING 2-SCENE SHOWCASE STAGE
   Scene 1 (Hero, 6.2s): Minimalist Hand-Drawn Line-Art Animation (简笔画动效)
   Scene 2 (Brisk, 4.6s): Compact Liquid Glass UI Progress Preview
   ============================================================================ */
@property --pv-cr {
  syntax: "<integer>";
  inherits: false;
  initial-value: 77;
}
@property --pv-pct {
  syntax: "<integer>";
  inherits: false;
  initial-value: 64;
}

.auth-scenes {
  position: relative;
  margin-top: 16px;
  min-height: 298px;
  width: min(100%, 476px);
}

.auth-scene {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  pointer-events: none;
  transition:
    opacity 460ms var(--ease-out),
    transform 520ms var(--settle-spring);
}
.auth-scene.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---- Scene 1: Claude-Orange Calligraphic One-Line Canvas ---- */
.sketch-canvas-wrap {
  width: min(100%, 468px);
}
.sketch-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 468 / 210;
}

.sk-mini-strip {
  margin-top: 12px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-capsule);
  background: rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(18px) saturate(175%);
          backdrop-filter: blur(18px) saturate(175%);
  box-shadow: var(--rim-control);
  font-size: 12.5px;
  color: var(--ink-secondary);
}
.sk-mini-label { color: var(--ink-secondary); }
.sk-mini-sep { opacity: 0.45; }
.sk-mini-meta { color: rgba(46, 48, 54, 0.58); }

.sk-mini-cycle {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 22px;
}
.sk-mini-cycle i {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-style: normal;
  font-size: 11.5px;
  border-radius: 6px;
  opacity: 0;
}
.sk-mini-cycle i::before { content: ""; width: 4px; height: 4px; border-radius: 50%; }
.sk-m1 { opacity: 1; background: rgba(182, 134, 60, 0.11); color: #8B652E; }
.sk-m1::before { background: transparent; border: 1.1px solid #B6863C; }
.sk-m2 { background: rgba(58, 126, 202, 0.11); color: #36699F; }
.sk-m2::before { background: #4B89CC; }
.sk-m3 { background: rgba(54, 146, 98, 0.11); color: #2F7552; }
.sk-m3::before { background: #429A6D; }

.auth-scene-sketch.is-active .sk-m1 { animation: sk-m-1 5.6s ease-in-out forwards; }
.auth-scene-sketch.is-active .sk-m2 { animation: sk-m-2 5.6s ease-in-out forwards; }
.auth-scene-sketch.is-active .sk-m3 { animation: sk-m-3 5.6s ease-in-out forwards; }

@keyframes sk-m-1 { 0%, 28% { opacity: 1; } 36%, 100% { opacity: 0; } }
@keyframes sk-m-2 { 0%, 30% { opacity: 0; } 38%, 62% { opacity: 1; } 70%, 100% { opacity: 0; } }
@keyframes sk-m-3 { 0%, 64% { opacity: 0; } 72%, 100% { opacity: 1; } }

/* ---- Scene 2: Brisk Compact Liquid Glass UI Preview (4.6s) ---- */
.auth-scene-preview {
  gap: 10px;
}

.pv-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  -webkit-backdrop-filter: blur(24px) saturate(185%);
          backdrop-filter: blur(24px) saturate(185%);
  box-shadow: var(--rim-card);
}

.pv-main { padding: 14px 18px 13px; }
.pv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.pv-title { font-size: 15px; font-weight: 700; color: var(--ink-strong); }
.pv-chip {
  padding: 2px 10px;
  border-radius: var(--radius-capsule);
  background: rgba(255, 255, 255, 0.80);
  border: 1px solid rgba(46, 48, 54, 0.08);
  color: var(--ink-secondary);
  font-size: 12px;
}

.pv-stats {
  display: grid;
  grid-template-columns: 1fr 1.15fr auto;
  align-items: center;
  gap: 10px;
}
.pv-stat small { display: block; font-size: 11.5px; color: var(--ink-secondary); margin-bottom: 1px; }
.pv-stat b { font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.pv-credit-val { display: inline-flex; align-items: baseline; gap: 3px; }
.pv-stat em { font-style: normal; font-size: 12.5px; color: var(--ink-secondary); font-variant-numeric: tabular-nums; }

.pv-credits { counter-reset: pvcr var(--pv-cr); }
.pv-credits::after { content: counter(pvcr); }
.auth-scene-preview.is-active .pv-credits { animation: pv-cr-go 3.4s 0.35s ease-out forwards; }
@keyframes pv-cr-go {
  0%   { --pv-cr: 77; }
  36%  { --pv-cr: 80; }
  68%  { --pv-cr: 83; }
  100% { --pv-cr: 86; }
}

.pv-ring-wrap { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.pv-ring { width: 48px; height: 48px; transform: rotate(-90deg); }
.pv-ring-track { fill: none; stroke: rgba(46, 48, 54, 0.08); stroke-width: 4; }
.pv-ring-fill {
  fill: none;
  stroke: #4B89CC;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 49.8;
}
.auth-scene-preview.is-active .pv-ring-fill { animation: pv-ring-go 3.4s 0.35s var(--ease-out) forwards; }
@keyframes pv-ring-go {
  0%   { stroke-dashoffset: 49.8; stroke: #4B89CC; }
  60%  { stroke-dashoffset: 42.8; stroke: #4690A2; }
  100% { stroke-dashoffset: 38.7; stroke: #429A6D; }
}

.pv-ring-label {
  position: absolute;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
  counter-reset: pvpct var(--pv-pct);
}
.pv-ring-label::after { content: counter(pvpct) "%"; }
.auth-scene-preview.is-active .pv-ring-label { animation: pv-pct-go 3.4s 0.35s ease-out forwards; }
@keyframes pv-pct-go {
  0%   { --pv-pct: 64; }
  36%  { --pv-pct: 67; }
  68%  { --pv-pct: 69; }
  100% { --pv-pct: 72; }
}

.pv-list { padding: 4px 16px; }
.pv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px;
}
.pv-row + .pv-row { border-top: 1px solid var(--separator); }
.pv-row b { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-strong); line-height: 1.3; }
.pv-row small { display: block; font-size: 11.5px; color: var(--ink-secondary); }

.pv-badges { position: relative; width: 64px; height: 24px; flex: none; }
.pv-badges i {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-style: normal;
  font-size: 11.5px;
  border-radius: 6px;
  opacity: 0;
  transform: scale(0.92);
}
.pv-badges i::before { content: ""; width: 4px; height: 4px; border-radius: 50%; }

.pv-b1 { opacity: 1; transform: scale(1); background: rgba(182, 134, 60, 0.10); border: 1px solid rgba(182, 134, 60, 0.20); color: #8B652E; }
.pv-b1::before { background: transparent; border: 1.1px solid #B6863C; }
.pv-b2 { background: rgba(58, 126, 202, 0.10); border: 1px solid rgba(58, 126, 202, 0.20); color: #36699F; }
.pv-b2::before { background: #4B89CC; }
.pv-b3 { background: rgba(54, 146, 98, 0.10); border: 1px solid rgba(54, 146, 98, 0.20); color: #2F7552; }
.pv-b3::before { background: #429A6D; }

.auth-scene-preview.is-active .pv-b1 { animation: pv-st1 2.2s calc(0.25s + var(--r) * 0.45s) ease-out forwards; }
.auth-scene-preview.is-active .pv-b2 { animation: pv-st2 2.2s calc(0.25s + var(--r) * 0.45s) ease-out forwards; }
.auth-scene-preview.is-active .pv-b3 { animation: pv-st3 2.2s calc(0.25s + var(--r) * 0.45s) ease-out forwards; }

@keyframes pv-st1 { 0%, 18% { opacity: 1; transform: scale(1); } 30%, 100% { opacity: 0; transform: scale(0.92); } }
@keyframes pv-st2 { 0%, 20% { opacity: 0; transform: scale(0.92); } 32%, 62% { opacity: 1; transform: scale(1); } 74%, 100% { opacity: 0; transform: scale(0.92); } }
@keyframes pv-st3 { 0%, 64% { opacity: 0; transform: scale(0.92); } 76%, 100% { opacity: 1; transform: scale(1); } }

.pv-toast {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: var(--radius-capsule);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--rim-control);
  font-size: 12px;
  color: var(--ink-strong);
  opacity: 0;
  transform: translateY(6px);
}
.auth-scene-preview.is-active .pv-toast { animation: pv-toast-in 0.45s 2.95s var(--settle-spring) forwards; }
@keyframes pv-toast-in { to { opacity: 1; transform: translateY(0); } }

.pv-check {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(54, 146, 98, 0.16);
  border: 1px solid rgba(54, 146, 98, 0.30);
  position: relative;
}
.pv-check::after {
  content: "";
  position: absolute;
  left: 3.8px;
  top: 2px;
  width: 3.5px;
  height: 6px;
  border: solid #2F7552;
  border-width: 0 1.4px 1.4px 0;
  transform: rotate(42deg);
}

/* Sculpted Transparent Liquid Glass Auth Card */
.auth-card {
  position: relative;
  width: 100%;
  padding: 32px 30px 32px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.54);
  -webkit-backdrop-filter: blur(34px) saturate(195%) brightness(1.03);
          backdrop-filter: blur(34px) saturate(195%) brightness(1.03);
  box-shadow: var(--rim-sheet);
  overflow: hidden;
  transition: transform 240ms var(--ease-out), box-shadow 240ms var(--ease-out);
}

.auth-card.is-shaking {
  animation: auth-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  16%      { transform: translateX(-9px); }
  34%      { transform: translateX(7px); }
  52%      { transform: translateX(-4.5px); }
  70%      { transform: translateX(2.5px); }
  86%      { transform: translateX(-1px); }
}

.auth-card-head {
  margin-bottom: 20px;
}
.auth-card-head h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-strong);
}
.auth-card-head p {
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

/* Apple Liquid Glass Segmented Control (登录 / 创建账号) */
.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  margin-bottom: 22px;
  border-radius: var(--radius-capsule);
  background: rgba(46, 48, 54, 0.065);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}
.auth-tab-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: var(--radius-capsule);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: transform 320ms var(--settle-spring);
  pointer-events: none;
}
.auth-tabs[data-mode="register"] .auth-tab-indicator { transform: translateX(100%); }
.auth-tab {
  position: relative;
  z-index: 1;
  height: 36px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: transparent;
  color: var(--ink-secondary);
  font-size: 14.5px;
  font-weight: 400;
  transition: color var(--duration-fast) var(--ease-out);
}
.auth-tab[aria-selected="true"] { color: var(--ink-strong); font-weight: 700; }

.auth-fields { display: grid; gap: 0; }
.auth-field { margin-top: 0; }
.auth-field + .auth-field { margin-top: 14px; }
.auth-field span { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-secondary); }
.auth-field input {
  height: 44px;
  margin-top: 6px;
  padding: 0 14px;
  border: 1px solid rgba(46, 48, 54, 0.13);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.80);
  color: var(--ink-strong);
  font-size: 15px;
  ime-mode: disabled;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 0 1px rgba(46, 52, 64, 0),
    0 0 16px 1px rgba(96, 110, 134, 0),
    0 6px 20px -6px rgba(15, 23, 42, 0);
  transition:
    border-color 440ms cubic-bezier(0.25, 0.1, 0.25, 1),
    background-color 420ms cubic-bezier(0.25, 0.1, 0.25, 1),
    box-shadow 480ms cubic-bezier(0.25, 0.1, 0.25, 1);
}
.auth-field input:focus {
  background: #FFFFFF;
  border-color: rgba(46, 52, 64, 0.28);
  outline: none;
  box-shadow:
    inset 0 1px 0 #FFFFFF,
    0 0 0 1px rgba(46, 52, 64, 0.06),
    0 0 16px 1px rgba(96, 110, 134, 0.16),
    0 6px 20px -6px rgba(15, 23, 42, 0.10);
  transition:
    border-color 360ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 360ms ease,
    box-shadow 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Inline Apple-ID Next Arrow inside Username field (Step 1 -> Step 2) */
.auth-input-wrap { position: relative; }
.auth-input-wrap input { padding-right: 44px; }
.auth-step-next {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(46, 48, 54, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  transition: background-color 150ms var(--ease-out), opacity 180ms var(--ease-out), transform 180ms var(--settle-spring);
}
.auth-step-next:hover { background: #FFFFFF; }
.auth-step-next:active { transform: translateY(-50%) scale(0.92); }
.auth-step-next.is-done { opacity: 0; pointer-events: none; transform: translateY(-50%) scale(0.85); }

/* Shared timing keeps field height, spacing and opacity reversible mid-transition. */
.auth-reveal {
  display: grid;
  grid-template-rows: 1fr;
  margin-top: 12px;
  transition: grid-template-rows 210ms var(--ease-out), margin-top 210ms var(--ease-out);
}
.auth-reveal > .auth-reveal-inner {
  min-height: 0;
  overflow: clip;
  opacity: 1;
  transition: opacity 170ms var(--ease-out);
}
.auth-reveal.is-collapsed {
  grid-template-rows: 0fr;
  margin-top: 0;
  pointer-events: none;
}
.auth-reveal.is-collapsed > .auth-reveal-inner { opacity: 0; }

.field-subhint {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-tertiary);
  line-height: 1.45;
}
.auth-forgot-row.auth-reveal:not(.is-collapsed) { margin-top: 6px; }
.auth-forgot-row > .auth-reveal-inner {
  display: flex;
  justify-content: flex-end;
}
.auth-forgot-link {
  border: 0;
  padding: 2px 4px;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: color 150ms ease;
}
.auth-forgot-link:hover { color: var(--ink-strong); text-decoration: underline; text-underline-offset: 2px; }

.auth-pass-wrap { position: relative; }
.auth-pass-wrap input { padding-right: 54px; }
.auth-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12.5px;
}
.auth-eye:hover { background: rgba(46, 48, 54, 0.06); color: var(--ink-strong); }

.auth-error {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13.5px;
  color: #7C3A3A;
  text-align: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms var(--ease-out), transform 200ms var(--ease-out);
}
.auth-error.is-visible { opacity: 1; transform: translateY(0); }

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  font-size: 15.5px;
}

.auth-provider-section { margin-top: 16px; }
.auth-provider-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--ink-secondary);
  font-size: 13px;
}
.auth-provider-heading::before,
.auth-provider-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--separator);
}
.auth-provider-options {
  display: grid;
  gap: 9px;
}
.auth-provider-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 45px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-capsule);
  background-color: #17191d;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}
.auth-password-entry.auth-provider-button {
  background: var(--glass-primary);
  color: #F9FAFB;
  box-shadow: var(--rim-primary);
}
@media (hover: hover) and (pointer: fine) {
  .auth-password-entry.auth-provider-button:hover { background: var(--glass-primary-h); }
}
.auth-provider-label { display: inline-flex; align-items: baseline; gap: .33em; }
.auth-provider-label [lang="en"] { letter-spacing: .045em; }
.auth-provider-button img { object-fit: contain; flex-shrink: 0; }
.auth-provider-button.auth-provider-email {
  background-color: var(--glass-control);
  border-color: var(--separator-strong);
  color: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  .auth-provider-section .auth-provider-button { background-image: none; }
  .auth-provider-button:hover { background-color: #2b2e35; }
  .auth-provider-button.auth-provider-email:hover { background-color: var(--glass-pill); }
}
.auth-provider-section .auth-provider-button:focus-visible,
.auth-password-entry.auth-provider-button:focus-visible {
  outline: 2px solid #65738a;
  outline-offset: 2px;
}
#auth-provider-unavailable { width: min(360px, calc(100% - 28px)); }

.auth-footnote-reveal {
  display: grid;
  grid-template-rows: 1fr;
  margin-top: 14px;
  opacity: 1;
  transition: grid-template-rows 210ms var(--ease-out), margin-top 210ms var(--ease-out), opacity 170ms var(--ease-out);
}
.auth-footnote-reveal.is-collapsed { grid-template-rows: 0fr; margin-top: 0; opacity: 0; }
.auth-footnote {
  min-height: 0;
  overflow: clip;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: rgb(46 48 54 / 67%);
  text-wrap: balance;
}
.auth-terms-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: inherit;
  cursor: pointer;
}
.auth-footnote .auth-terms-link { color: rgb(46 48 54 / 75%); }

.auth-disclaimer {
  width: min(100%, 960px);
  margin-inline: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--font-editorial);
  font-size: 13px;
  line-height: 1.65;
  color: rgba(46, 48, 54, 0.42);
}
.auth-producer {
  white-space: nowrap;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.65;
}
.auth-disclaimer-sep {
  width: 1px;
  height: 26px;
  background: rgba(46, 48, 54, 0.14);
  flex-shrink: 0;
}
.auth-disclaimer-text {
  display: inline-grid;
  text-align: left;
}
.auth-disclaimer-line {
  display: block;
  text-align: justify;
  text-align-last: justify;
  white-space: nowrap;
}
@media (max-width: 780px) {
  .auth-disclaimer { flex-direction: column; gap: 6px; }
  .auth-disclaimer-sep { display: none; }
  .auth-disclaimer-text { display: block; text-align: center; }
  .auth-disclaimer-line { text-align: center; text-align-last: center; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .sketch-svg .sk-draw, .sk-book, .sk-curve-live, .sk-node-dot, .sk-node-ring, .sk-cap, .sk-tassel, .sk-spark path, .sk-pen, .sk-mini-cycle i {
    animation: none !important;
  }
  .sketch-svg .sk-draw, .sk-curve-live { stroke-dashoffset: 0; opacity: 1; }
  .sk-m1 { opacity: 0; }
  .sk-m3 { opacity: 1; }
}

@media (max-width: 920px) {
  .auth-stage {
    grid-template-columns: 1fr;
    max-width: 440px;
    gap: 28px;
  }
  .auth-editorial { max-width: none; text-align: center; }
  .auth-intro { text-align: center; }
  .sketch-svg { margin-inline: auto; }
  .sk-mini-strip { justify-content: center; }
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */
@media (max-width: 1120px) { .group-body { grid-template-columns: 1fr; } }

@media (max-width: 820px) {
  .masthead { inset: 14px auto 14px 14px; width: 176px; }
  .masthead .masthead-inner { padding: 18px 10px 16px; }
  main.wrap { margin-left: 206px; margin-right: 20px; width: calc(100% - 226px); }
  .overview-grid, .settings-grid { grid-template-columns: 1fr; gap: 18px; }
  .start-card { flex-direction: column; align-items: stretch; }
}

@media (min-width: 561px) and (max-width: 780px) {
  .registration-toolbar { grid-template-columns: 1fr; }
  .course-button > .course-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
}

@media (min-width: 561px) and (max-height: 680px) {
  .masthead .masthead-inner { padding-block: 12px; }
  .wordmark .brand-crop { flex-basis: 88px; width: 88px; }
  .tabbar { margin-top: 12px; }
  .sidebar-foot { padding-top: 8px; }
  .tabbar > button, #course-navigation > .nav-branch-label { padding-block: 8px; }
}

@media (max-width: 600px) {
  .course-grade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-row { grid-template-columns: 1fr 1fr; }
  .remove-rule { grid-column: 2; justify-self: end; }
}

/* ============================================================================
   TRUE rdev/liquid-glass-react (v1.1.1) ENGINE + 60FPS DUAL DESKTOP & MOBILE
   - Pre-feathered zero-blur-cost ambient pastel light field (0ms GPU blur cost!)
   - Chromium desktop: full SVG GlassFilter chromatic edge refraction + dual rims
   - Safari / Mobile: zero square-box mask bleed, native anti-aliased rounded glass
   ============================================================================ */
/* ============================================================================
   AUTHENTIC LIQUID-GLASS-REACT + APPLE-DESIGN + DESIGN-TASTE SYSTEM
   - Static %-mapped luminous pastel light field + architectural micro-grid
     (100% identical color proportions on Desktop, iPad & Mobile; 0ms idle GPU!)
   - Snell's-law squircle bezel refraction (Blink) + -135deg DPR specular rim +
     clear-rim interior mask across ALL devices (Desktop, iPadOS & iOS Safari)
   - Strictly ONE layer of backdrop-filter per stack (inner controls stay crisp)
   ============================================================================ */
.lg-ambient-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
  background-color: #F5F6F8;
  background-image: linear-gradient(120deg, #fafbfc, #f2f3f5 74%, #eceef1);
}
.lg-blob {
  display: none !important;
}

/* Seamless dark-ink logo Knock-Out over translucent glass & pastel light field */
.auth-topbar-logo,
.mobile-auth-logo,
.wordmark img {
  mix-blend-mode: multiply;
}

.lg__defs {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Base glass surfaces before & after LGR mounts */
.card,
.overview-card,
.start-card,
.auth-card {
  position: relative;
}
.card,
.overview-card,
.start-card,
.auth-card,
.masthead {
  background: rgba(255, 255, 255, 0.36);
  -webkit-backdrop-filter: blur(18px) saturate(1.9) brightness(1.04);
          backdrop-filter: blur(18px) saturate(1.9) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 2px rgba(108, 148, 220, 0.14),
    0 0 0 0.5px rgba(15, 23, 42, 0.055),
    0 16px 42px -12px rgba(15, 23, 42, 0.10),
    0 2px 8px rgba(15, 23, 42, 0.035);
}

/* Mounted leonardseo/liquid-glass-react surface (preserve position:fixed on .masthead, dialog, #mobile-dock!) */
:where(.lg-surface) {
  position: relative;
}
.lg-surface {
  --lg-preset-blur: 16px;
  --lg-preset-saturation: 1.16;
  --lg-preset-brightness: 1.04;
  --lg-tint: rgb(255 255 255 / 14%);

  isolation: isolate;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.90),
    inset 0 -1.5px 3px rgb(46 48 54 / 7%),
    0 0 0 0.5px rgba(15, 23, 42, 0.055),
    0 12px 36px -14px rgb(35 51 48 / 10%),
    0 2px 8px rgba(15, 23, 42, 0.035);
}
.lg-surface.lg--clear {
  --lg-preset-blur: 18px;
  --lg-preset-saturation: 1.18;
  --lg-tint: rgb(255 255 255 / 12%);
}
.lg-surface.lg--fallback {
  --lg-tint: rgb(255 255 255 / 17%);
}
.lg-surface.lg--clear.lg--fallback {
  --lg-tint: rgb(255 255 255 / 15%);
}
/* HTML5 <details class="card"> keeps specular rim & clear-rim tint right on root whether open or closed */
.lg-surface.lg--details {
  background-color: rgba(255, 255, 255, 0.16) !important;
  background-image:
    var(--lg-spec-url, none),
    radial-gradient(115% 115% at 50% 50%, rgba(255, 255, 255, 0.34) 52%, rgba(255, 255, 255, 0.08) 100%) !important;
  background-size: 100% 100%, 100% 100% !important;
  background-repeat: no-repeat !important;
}

.lg__tint,
.lg__specular {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.lg__tint {
  z-index: -3;
  background: var(--lg-tint);
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
}
.lg__specular {
  z-index: -2;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.82;
  mix-blend-mode: plus-lighter;
}
:where(.masthead, .auth-card, .card, .overview-card, .start-card, dialog, .mobile-dock, .mobile-courses-nav, .term-picker-menu, .card > summary) {
  isolation: isolate;
}
.lg__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--lg-glow-op, 0);
  background: radial-gradient(240px circle at var(--lg-px, 50%) var(--lg-py, 24%),
    rgb(255 255 255 / 48%), transparent 64%);
  mix-blend-mode: plus-lighter;
  transition: opacity 240ms ease;
}
.lgr-elastic-pill {
  translate: var(--lg-pill-x, 0px) var(--lg-pill-y, 0px);
  transition: translate 180ms cubic-bezier(.22, 1, .36, 1), background-color 180ms ease, box-shadow 180ms ease;
}

/* ONE LAYER OF GLASS PER STACK (liquid-glass-react non-negotiable rule):
   Controls sitting ON a glass card use crisp translucent crystal inner-plates with ZERO nested backdrop-filter! */
:is(.card, .overview-card, .start-card, .auth-card, dialog) :is(
  .course-button,
  .setting-link,
  .settings-group-row,
  .button:not(.primary),
  .badge,
  .inline-link,
  .doc-download-pill,
  .term-picker-trigger,
  input,
  select,
  textarea
) {
  --lg-backdrop-override: none;
  -webkit-backdrop-filter: none !important;
          backdrop-filter: none !important;
}
.course-button,
.setting-link {
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.70);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 2px 8px rgba(15, 23, 42, 0.03);
}

/* Apple Optical Tabular Numerals + Quiet Hover Micro-Interactions (apple-design & design-taste-frontend) */
.metric-value,
.overview-progress,
.registration-stats,
.pv-stat b,
.pv-credits,
.badge {
  font-variant-numeric: tabular-nums;
}
@media (hover: hover) and (pointer: fine) {
  .overview-card:hover,
  .settings-profile-row:hover,
  #lock-system:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.98),
      inset 0 -1.5px 3px rgba(104, 146, 220, 0.20),
      0 0 0 0.5px rgba(15, 23, 42, 0.07),
      0 22px 48px -12px rgba(15, 23, 42, 0.13),
      0 4px 12px rgba(15, 23, 42, 0.045);
  }
  .course-button:hover,
  .setting-link:hover {
    background: rgba(255, 255, 255, 0.68);
  }
}

/* Desktop interactive elastic Liquid Glass pills */
.lgr-elastic-pill {
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms ease, box-shadow 180ms ease;
}

/* Non-orphan credit parentheses like （3 学分） */
.credit-paren {
  display: inline-block;
  white-space: nowrap;
}

/* Agreement dialog actions: ALWAYS side-by-side left & right (respecting [hidden]!) */
#agreement-register-actions:not([hidden]),
#agreement-review-actions:not([hidden]) {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap !important;
}
#agreement-register-actions > .button,
#agreement-review-actions > .button {
  white-space: nowrap;
  width: 100%;
  justify-content: center;
}
#agreement-review-actions:has([hidden]) {
  grid-template-columns: 1fr;
}

/* Desktop courses header & search layout */
.courses-head-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.m-search-open,
.m-search-close,
.mobile-auth-topbar,
.mobile-auth-logo {
  display: none;
}
/* Desktop hides dedicated mobile iOS 26 Liquid Glass dock, courses bar & mobile auth CTA */
.mobile-dock,
.mobile-courses-nav,
.mobile-auth-cta {
  display: none;
}

/* The two choices form one compact control above the scrolling course list. */
.registration-source {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  margin: 5px var(--registration-inset) 0;
  border: 0;
  border-radius: 15px;
  background: rgb(38 43 54 / 6%);
}
.registration-source > .button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 3px 8px;
  border-radius: 12px;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
  background: transparent;
  color: var(--ink-secondary);
}
.registration-source > .button[aria-pressed="true"] {
  color: var(--ink-strong);
  background: rgb(255 255 255 / 85%);
  box-shadow: inset 0 1px #fff, 0 1px 4px rgb(36 40 49 / 10%);
}

/* ============================================================================
   Unified Gradual Fade-In / Fade-Out Focus Halo for EVERY Input, Search,
   Password, Textarea, Select, and Picker Box Across the Entire App
   ============================================================================ */
:where(body) :is(
  input:not([type="radio"], [type="checkbox"], [type="range"], [type="file"], [readonly]),
  textarea:not([readonly]),
  select:not(:disabled),
  .term-picker-trigger
),
.course-search input[type="search"],
.auth-field input,
.profile-inline-editor input {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 0 1px rgba(46, 52, 64, 0),
    0 0 16px 1px rgba(96, 110, 134, 0),
    0 6px 20px -6px rgba(15, 23, 42, 0);
  transition:
    border-color 440ms cubic-bezier(0.25, 0.1, 0.25, 1),
    background-color 420ms cubic-bezier(0.25, 0.1, 0.25, 1),
    box-shadow 480ms cubic-bezier(0.25, 0.1, 0.25, 1);
}
:where(body) :is(
  input:not([type="radio"], [type="checkbox"], [type="range"], [type="file"], [readonly], :disabled, :focus),
  textarea:not([readonly], :disabled, :focus),
  select:not(:disabled, :focus),
  .term-picker-trigger:not(:focus)
):hover,
.course-search input[type="search"]:hover:not(:focus),
.auth-field input:hover:not(:focus),
.profile-inline-editor input:hover:not(:focus) {
  border-color: rgba(46, 52, 64, 0.19);
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 0 0 1px rgba(46, 52, 64, 0),
    0 0 16px 1px rgba(96, 110, 134, 0.05),
    0 6px 20px -6px rgba(15, 23, 42, 0.04);
}
:where(body) :is(
  input:not([type="radio"], [type="checkbox"], [type="range"], [type="file"], [readonly]),
  textarea:not([readonly]),
  select:not(:disabled),
  .term-picker-trigger
):focus,
:where(body) :is(
  input:not([type="radio"], [type="checkbox"], [type="range"], [type="file"], [readonly]),
  textarea:not([readonly]),
  select:not(:disabled),
  .term-picker-trigger
):focus-visible,
.term-picker-trigger:has(+ :popover-open),
.course-search input[type="search"]:focus,
.course-search input[type="search"]:focus-visible,
.auth-field input:focus,
.auth-field input:focus-visible,
.profile-inline-editor input:focus,
.profile-inline-editor input:focus-visible {
  background-color: #FFFFFF;
  border-color: rgba(46, 52, 64, 0.28);
  outline: none;
  box-shadow:
    inset 0 1px 0 #FFFFFF,
    0 0 0 1px rgba(46, 52, 64, 0.06),
    0 0 16px 1px rgba(96, 110, 134, 0.16),
    0 6px 20px -6px rgba(15, 23, 42, 0.10);
  transition:
    border-color 360ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 360ms ease,
    box-shadow 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 760px) {
  html {
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background-color: #F5F6F8 !important;
  }
  /* Authentic Translucent Liquid Glass on Mobile (liquid-glass-react + apple-design):
     - Keep static %-mapped luminous pastel light field visible behind all glass!
     - Top-level cards, dock, courses nav, auth card & dialogs get REAL translucent Liquid Glass
       (root blur(14px) saturate(1.9) + clear-rim .lg__tint + -135deg .lg__specular).
     - Strictly ONE layer of glass per stack: inner controls (.course-button, .setting-link, etc.)
       use translucent crystal inner-plates with backdrop-filter: none for 60-120fps scrolling! */
  .lg-blob {
    display: none !important;
  }
  .lg-surface {
    --lg-preset-blur: 14px;
    --lg-preset-saturation: 1.16;
    --lg-tint: rgb(255 255 255 / 14%);
  }
  .lg-surface.lg--clear {
    --lg-preset-blur: 16px;
    --lg-preset-saturation: 1.18;
    --lg-tint: rgb(255 255 255 / 12%);
  }
  .course-button,
  .setting-link {
    contain: layout style;
  }
  button, a, summary, [role="tab"] {
    touch-action: manipulation;
  }
  /* Mobile Content Protection: Lock text selection & iOS long-press callout outside inputs */
  html, body, #app-shell, #auth-page, main, section, div, p, span, h1, h2, h3, label, button, a, li, summary, small, strong {
    -webkit-user-select: none !important;
            user-select: none !important;
    -webkit-touch-callout: none !important;
  }
  input, textarea, [contenteditable="true"] {
    -webkit-user-select: text !important;
            user-select: text !important;
    -webkit-touch-callout: default !important;
  }
  input, select, textarea {
    font-size: 16px !important;
    font-family: var(--font-editorial) !important;
  }
  button {
    font-family: var(--font-editorial);
    -webkit-tap-highlight-color: transparent;
  }

  html {
    overflow-x: clip;
    overscroll-behavior-y: auto;
    background-color: #F5F6F8 !important;
    min-height: 100svh;
    min-height: 100dvh;
  }
  body {
    overflow-x: clip;
    overscroll-behavior-y: auto;
    background: transparent !important;
    min-height: 100svh;
    min-height: 100dvh;
  }
  body:has(dialog:modal) {
    overflow: hidden;
    overscroll-behavior: none;
  }
  /* Hide desktop sidebar completely on mobile; use dedicated iOS 26 3-tab Liquid Glass Dock */
  .masthead { display: none !important; }

  /* Full-Screen Mobile Landing Page over Luminous Translucent Light Field */
  .auth-page {
    padding: max(18px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    gap: 0;
    height: 100svh;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100svh;
    background: transparent !important;
    overflow-y: auto;
    overscroll-behavior: none;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
  }
  .auth-topbar { justify-content: center; padding: 6px 0 0; width: 100%; flex-shrink: 0; }
  .auth-topbar-logo { width: 102px; }
  .auth-stage {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding-block: 0;
    gap: 0;
    min-height: min-content;
  }
  .auth-editorial {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    text-align: center;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }
  .auth-intro {
    text-align: center;
    margin: 0;
    position: relative;
    z-index: 2;
  }
  .auth-intro h1 { font-size: 27px; line-height: 1.24; letter-spacing: 0.01em; }
  .auth-subheadline { font-size: 14px; margin-top: 6px; color: var(--ink-secondary); }
  .auth-scenes {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 184px;
    min-height: 184px;
    margin: 0;
    overflow: visible;
  }
  .auth-scene {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .auth-scene-preview { display: none !important; }
  .sketch-canvas-wrap { width: 100%; max-width: 326px; margin-inline: auto; }

  .mobile-auth-cta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    width: 100%;
    flex-shrink: 0;
    padding-top: 8px;
  }
  .mobile-auth-cta .auth-provider-section { margin-top: 0; }
  .mobile-auth-cta .auth-provider-button { min-height: 46px; }
  #auth-form .auth-provider-section { display: none; }
  .m-cta-terms {
    margin: 6px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
    color: var(--ink-tertiary);
  }
  .auth-footnote-reveal { display: none; }

  .auth-card { display: none; }
  .auth-page[data-mobile-route] {
    background: transparent;
    height: auto;
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    touch-action: pan-y;
  }
  .auth-page[data-mobile-route] :is(.auth-topbar, .auth-editorial, .mobile-auth-cta) { display: none; }
  .auth-page[data-mobile-route] .auth-stage { margin-block: 0; }
  .auth-page[data-mobile-route] .auth-card {
    display: block;
    position: relative;
    width: 100%;
    max-width: 380px;
    margin-inline: auto;
    padding: 0 0 24px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transition: none;
  }
  .auth-page[data-mobile-route] .auth-card::before,
  .auth-page[data-mobile-route] .auth-card::after { content: none; }
  .mobile-auth-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 22px;
    flex-shrink: 0;
  }
  .mobile-auth-back {
    height: 36px;
    padding: 0 14px;
    font-size: 14px;
  }
  /* Google-style Logo positioned directly above the Auth Title */
  .auth-card-head {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .auth-card-head .mobile-auth-logo {
    align-self: center;
    display: block;
    width: 106px;
    height: auto;
    margin: 0 0 13px;
  }
  .auth-card-head h2 {
    font-size: 28px;
    line-height: 1.22;
  }
  .auth-card-head p {
    font-size: 14.5px;
    margin-top: 6px;
  }
  .auth-card .auth-tabs { margin-bottom: 14px; }
  .auth-card .auth-tab { min-height: 44px; }
  .auth-card .auth-reveal,
  .auth-card .auth-reveal > .auth-reveal-inner { transition-duration: 185ms; }
  .auth-card .auth-step-next {
    display: none !important;
  }
  .auth-submit {
    margin-top: 20px;
    min-height: 50px;
    border-radius: 999px;
    font-size: 16px;
  }
  .auth-disclaimer { flex-direction: column; gap: 4px; font-size: 11.5px; padding-top: 6px; }
  .auth-disclaimer-sep { display: none; }
  .auth-disclaimer-text { display: block; text-align: center; }
  .auth-disclaimer-line { text-align: center; text-align-last: center; white-space: normal; }

  /* ==========================================================================
     iOS 26 FLOATING 3-TAB LIQUID GLASS BOTTOM DOCK (首页 · 课程 · 设置)
     ========================================================================== */
  .mobile-dock {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom) + 10px);
    transform: translate3d(-50%, 0, 0);
    width: min(calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right)), 356px);
    height: 62px;
    padding: 6px;
    border-radius: 999px;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    z-index: 50;
    background: linear-gradient(176deg, rgb(255 255 255 / 62%), rgb(255 255 255 / 30%));
    border: 1px solid rgb(255 255 255 / 82%);
    -webkit-backdrop-filter: blur(16px) saturate(1.12);
            backdrop-filter: blur(16px) saturate(1.12);
    box-shadow: inset 0 1px 1px #fff, inset 0 -1px 2px rgb(70 78 92 / 13%),
      0 1px 1px rgb(31 37 50 / 10%), 0 7px 24px rgb(31 37 50 / 13%);
  }
  .mobile-dock::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 -50%;
    width: 100%;
    pointer-events: none;
    transform: translateX(var(--dock-light-x, 50%));
    background: radial-gradient(ellipse at 50% 0%, rgb(255 255 255 / 95%), transparent 57%);
    opacity: 0;
    transition: opacity 160ms ease-out;
  }
  .mobile-dock.is-pressed::before { opacity: 1; }
  .mobile-dock-indicator {
    position: absolute;
    z-index: 0;
    inset: 5px auto 5px 5px;
    width: calc((100% - 10px) / 3);
    border-radius: 999px;
    background: linear-gradient(170deg, rgb(255 255 255 / 89%), rgb(240 243 249 / 63%));
    box-shadow: inset 0 1px 1px #fff, inset 0 -1px 2px rgb(91 104 125 / 16%),
      0 2px 6px rgb(31 37 50 / 11%);
    transform: translate3d(var(--dock-lens-offset, 0%), 0, 0);
    transition: transform 255ms cubic-bezier(.19,.86,.33,1.09);
    pointer-events: none;
  }
  .mobile-dock[data-active-idx="1"] { --dock-lens-offset: 100%; }
  .mobile-dock[data-active-idx="2"] { --dock-lens-offset: 200%; }
  .mobile-dock.is-pressed .mobile-dock-indicator {
    transform: translate3d(var(--dock-lens-offset, 0%), 0, 0) scale(.96);
  }
  .mobile-dock.is-dragging .mobile-dock-indicator { transition: none; }

  .mobile-dock-tab {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 100%;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(46, 48, 54, 0.58);
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 200ms var(--ease-out), transform 140ms var(--ease-out);
  }
  .mobile-dock-tab:active { transform: scale(0.93); }
  .mobile-dock-tab svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 240ms cubic-bezier(0.22, 1.15, 0.36, 1);
  }
  .mobile-dock-tab[aria-current="page"] {
    color: var(--ink-strong);
    font-weight: 700;
  }
  .mobile-dock-tab[aria-current="page"] svg {
    stroke-width: 2;
    transform: translateY(-0.5px) scale(1.04);
  }

  /* ==========================================================================
     iOS 26 NON-STICKY LIQUID GLASS COURSES SWITCHER (Scrolls away naturally!)
     ========================================================================== */
  .mobile-courses-nav {
    display: block;
    position: relative;
    top: auto;
    z-index: 10;
    margin: 0 0 14px;
    padding: 8px;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(16px) saturate(1.98) brightness(1.04);
            backdrop-filter: blur(16px) saturate(1.98) brightness(1.04);
    border: 1px solid rgba(255, 255, 255, 0.62);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.90),
      0 0 0 0.5px rgba(15, 23, 42, 0.055),
      0 10px 26px -8px rgba(15, 23, 42, 0.10);
  }

  .m-seg {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    border-radius: 999px;
    background: rgba(46, 48, 54, 0.065);
  }
  .m-seg-indicator {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
      inset 0 1px 0 #FFFFFF,
      0 2px 7px rgba(15, 23, 42, 0.09);
    pointer-events: none;
  }
  .m-seg[data-active="China"] .m-seg-indicator { transform: translateX(100%); }

  .m-seg-btn {
    position: relative;
    z-index: 1;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-secondary);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: color 180ms var(--ease-out);
  }
  .m-seg-btn[aria-selected="true"] {
    color: var(--ink-strong);
    font-weight: 700;
  }

  .m-subpills-wrap {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 8px;
    transition: opacity 170ms var(--ease-out);
  }
  .m-subpills-wrap.is-collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
  }
  .m-subpills-inner { overflow: hidden; }
  .m-subpills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .m-pill {
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(46, 48, 54, 0.09);
    background: rgba(255, 255, 255, 0.62);
    color: var(--ink-secondary);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: background 180ms var(--ease-out), color 180ms var(--ease-out), border-color 180ms ease, transform 130ms ease, box-shadow 180ms ease;
  }
  .m-pill:active { transform: scale(0.96); }
  .m-pill[aria-selected="true"] {
    background: linear-gradient(160deg, rgba(84, 88, 96, 0.90) 0%, rgba(64, 68, 76, 0.96) 100%) !important;
    border-color: transparent !important;
    color: #F9FAFB !important;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 12px rgba(15, 23, 42, 0.12);
  }

  /* Mobile Content & Dedicated Mobile Cards (Apple Official Safe Area Insets on all 4 edges) */
  main.wrap {
    width: auto;
    margin-inline: 0;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: calc(108px + env(safe-area-inset-bottom));
  }
  .page-heading { margin: 8px 0 18px; }
  h1 { font-size: 27px; letter-spacing: -0.01em; line-height: 1.22; }
  .page-heading p { font-size: 13.5px; margin-top: 4px; line-height: 1.5; }
  h2 { font-size: 17.5px; }
  .overview-grid, .settings-grid { grid-template-columns: 1fr; gap: 14px; }
  .course-list { gap: 12px; }
  .settings-sections { gap: 14px; }
  .overview-card { padding: 18px 16px 14px; }
  .overview-content { min-block-size: 94px; padding-block: 10px 12px; }
  .overview-content .metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }
  .overview-progress { width: 78px; height: 78px; }
  .metric-value { font-size: 25px; }
  .overview-content .metric-value small { display: inline; font-size: 13px; }
  /* Single-Element Morphing Search Bar aligned top-right with #courses-title */
  .courses-head-row {
    position: relative;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    gap: 10px;
  }
  .courses-head-row #courses-title {
    margin: 0;
    filter: blur(0);
    transition: opacity 160ms var(--ease-out), filter 160ms var(--ease-out);
  }
  .courses-head-row.is-search-open #courses-title {
    opacity: 0;
    filter: blur(5px);
    pointer-events: none;
  }
  .courses-head-row .course-search {
    --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23363a42' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.75'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E");
    position: absolute;
    inset: 0;
    width: auto;
    margin: 0;
    border-radius: 24px;
    overflow: hidden;
    pointer-events: none;
  }
  .courses-head-row .course-search::before,
  .courses-head-row .course-search::after { content: none; }
  .m-search-open, .courses-head-row .search-field {
    height: 44px;
    border: 1px solid rgb(50 54 62 / 20%);
    border-radius: 22px;
    background: var(--search-icon) 12px center / 18px 18px no-repeat, rgb(255 255 255 / 78%);
    color: var(--ink-strong);
  }
  .m-search-open {
    position: absolute;
    right: 0;
    display: block;
    padding: 0 13px 0 36px;
    font-size: 15px;
    pointer-events: auto;
    transition: opacity 110ms var(--ease-out);
  }
  .courses-head-row .search-field {
    position: absolute;
    inset: 0 0 0 5px;
    transform: translate3d(calc(100% - 72px), 0, 0);
    opacity: 0;
    transition: transform 215ms var(--ease-out), opacity 140ms var(--ease-out);
  }
  .course-search.is-expanded .m-search-open { opacity: 0; pointer-events: none; }
  .courses-head-row .course-search.is-expanded .search-field {
    transform: translate3d(0,0,0);
    opacity: 1;
    pointer-events: auto;
    transition: transform 360ms cubic-bezier(.2,.84,.25,1.09), opacity 120ms var(--ease-out);
  }
  .courses-head-row .search-field input[type="search"] {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 44px 0 38px;
    appearance: none;
    border: 0;
    border-radius: inherit;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .courses-head-row .search-field:focus-within { border-color: rgb(63 76 95 / 48%); }
  .m-search-close {
    display: grid;
    place-items: center;
    position: absolute;
    inset: 0 0 0 auto;
    width: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 21px;
  }
  #courses-page.is-mobile-searching :is(#mobile-courses-nav, #course-list) {
    display: none !important;
  }

  /* Registration Toolbar: Term Picker + Add Course side-by-side on ONE row! */
  .registration-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
  }
  .registration-toolbar > button {
    width: auto;
    min-height: 42px;
    padding: 0 13px;
    font-size: 13px;
    white-space: nowrap;
  }
  .registration-stats { font-size: 13.5px; gap: 6px 14px; }

  /* Mobile Courses: Clean, legible, unclipped layout + crisp credit-note badge */
  .course-button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
    padding: 13px 14px;
  }
  .course-button > span:first-child,
  .course-button > .course-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .course-button .course-title {
    display: block;
    font-size: 14.5px;
    line-height: 1.38;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
  }
  .course-button .course-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ink-secondary);
  }
  .course-button .course-credit-note {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    margin: 0;
    border-radius: 999px;
    background: rgba(46, 48, 54, 0.065);
    border: 1px solid rgba(46, 48, 54, 0.09);
    font-size: 11px;
    line-height: 1;
    color: var(--ink-secondary);
    white-space: nowrap;
  }
  .course-button .course-grade-summary {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    color: var(--ink-secondary);
  }
  .course-button > .course-actions {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
  .course-button .badge,
  .course-button .edit-label,
  .course-button .remove-label {
    height: 26px;
    padding: 0 9px;
    font-size: 11.5px;
    border-radius: 999px;
    white-space: nowrap;
  }

  /* Registered Courses: Full-width info on top + 3 equal-size side-by-side boxes below */
  .course-button.registered-course {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }
  .course-button.registered-course > .course-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: none;
    padding-top: 10px;
    border-top: 1px solid rgba(46, 48, 54, 0.07);
  }
  .course-button.registered-course > .course-actions > * {
    width: 100%;
    height: 34px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 12.5px;
    box-sizing: border-box;
  }

  .doc-download-pill {
    height: 30px;
    padding: 0 11px;
    font-size: 12px;
  }
  .account-card, .backup-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .account-card .actions, .backup-card .actions, .sync-card .actions {
    width: 100%;
  }
  .account-card .actions > *, .backup-card .actions > *, .sync-card .actions > * {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 42px;
  }
  .browser-grid { grid-template-columns: 1fr; }

  .settings-logout-row {
    color: #B42318 !important;
    font-weight: 700;
    justify-content: center;
  }
  .settings-logout-label {
    position: relative;
    z-index: 2;
    color: #B42318;
    font-weight: 700;
  }
  .settings-sub-bar { margin: 6px 0 18px; }
  .settings-sub-bar h2 { font-size: 21px; }
  .profile-detail-card { padding: 6px 16px 10px; }
  .profile-detail-row {
    padding: 15px 0;
    flex-wrap: nowrap;
    gap: 12px;
  }
  .profile-row-left {
    min-width: 0;
    flex: 1 1 auto;
  }
  .profile-row-right,
  .profile-name-slot {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    width: auto !important;
    margin-top: 0 !important;
  }
  .profile-inline-editor {
    display: none !important;
  }
  .profile-value-text {
    max-width: 138px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .settings-profile-row { padding: 16px; }
  .settings-group-row { padding: 15px 16px; }
  .settings-logout-row { padding: 14px 16px; }
  :is(.card, .start-card, .overview-card, .course-button, .setting-link, .settings-profile-row,
      .settings-logout-row, .auth-provider-button, .auth-submit, .registration-source > .button):active {
    transform: none;
    scale: none;
  }

  /* Centered Floating Liquid Glass Term Picker Popover */
  .term-picker-menu:popover-open {
    position: fixed;
    inset: 0;
    width: calc(100vw - 32px);
    max-width: 380px;
    height: fit-content;
    margin: auto;
    inset-block: var(--visual-top, 0px) var(--visual-bottom, 0px);
    position-area: none;
    position-try-fallbacks: none;
    transform-origin: center;
    max-block-size: min(66dvh, calc(var(--visual-height, 100dvh) - 24px));
    padding: 12px;
    border-radius: 24px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      0 0 0 0.5px rgba(15, 23, 42, 0.08),
      0 20px 52px rgba(15, 23, 42, 0.22);
  }

  /* Centered Apple Liquid Glass Modals on Mobile (Single-layer blur; never double-blur ::backdrop!) */
  dialog:where(:not(.lg-dialog)),
  #course-dialog,
  #remove-dialog,
  #registration-dialog,
  #logout-dialog,
  #keanwise-dialog,
  #plugin-download-dialog,
  #change-password-dialog,
  #forgot-password-dialog,
  #profile-field-dialog,
  #delete-account-dialog,
  #agreement-dialog,
  #avatar-action-dialog,
  #avatar-crop-dialog,
  #onboarding-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: calc(100vw - 28px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-width: 420px;
    height: fit-content;
    inset-block: var(--visual-top, 0px) var(--visual-bottom, 0px);
    --dialog-height: min(82dvh, calc(var(--visual-height, 100dvh) - 24px));
    max-height: var(--dialog-height);
    border-radius: 26px;
    padding: 0;
    overflow: hidden;
  }
  dialog[open]:where(:not(.lg-dialog)) {
    display: flex;
    flex-direction: column;
  }
  dialog:where(:not(.lg-dialog))::before {
    display: none;
    content: none;
  }
  dialog > form,
  dialog > .avatar-action-sheet {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: var(--dialog-height);
    overflow: hidden;
  }
  .dialog-head {
    flex-shrink: 0;
    padding: 16px 18px 10px;
  }
  .dialog-head h2 {
    font-size: 18px;
  }
  .dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 6px 18px 14px;
  }
  .dialog-body .form-section {
    gap: 10px;
  }
  .dialog-body .course-grade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .dialog-actions {
    flex-shrink: 0;
    padding: 12px 18px 16px;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(46, 48, 54, 0.08);
  }
  .dialog-actions > .button {
    flex: 1 1 auto;
    min-height: 42px;
  }
  #toast:not(:empty) { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

/* ============================================================================
   DEDICATED iPadOS ADAPTATION (761px – 1180px, Portrait & Landscape)
   - Compact floating Liquid Glass sidebar (196px) + balanced workspace margins
   - 44pt Apple HIG touch targets + centered iPadOS sheets
   - Portrait stacks Auth & Overview cleanly; Landscape uses 2-column split
   - Touch iPadOS Safari: 60fps zero-square-box clipping & text-selection lock
   ============================================================================ */
@media (min-width: 761px) and (max-width: 1180px),
       (min-width: 1181px) and (max-width: 1400px) and (any-pointer: coarse) {
  .masthead {
    inset: 16px auto 16px 16px;
    width: 196px;
    border-radius: 26px;
  }
  .masthead .masthead-inner {
    padding: 20px 12px 16px;
  }
  .wordmark .brand-crop {
    flex-basis: 98px;
    width: 98px;
  }
  .tabbar > button,
  #course-navigation > .nav-branch-label {
    min-height: 44px;
    padding: 10px 11px;
    font-size: 15px;
  }
  .tabbar .course-navigation button {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 14px;
  }

  main.wrap {
    width: calc(100% - 248px);
    margin-left: 228px;
    margin-right: 20px;
    padding-bottom: 56px;
  }
  .page-heading {
    margin-block: 26px 18px;
  }
  h1 {
    font-size: clamp(28px, 3.2vw, 34px);
  }
  .button,
  .term-picker-trigger,
  .course-button,
  .setting-link {
    min-height: 44px;
  }

  /* Stack the iPad workspace in portrait or when the window is narrow. */
  @media (orientation: portrait), (max-width: 960px) {
    .auth-page {
      padding: 24px 28px 36px;
    }
    .auth-stage {
      grid-template-columns: 1fr;
      justify-items: center;
      gap: 24px;
      padding-block: 12px 24px;
    }
    .auth-editorial {
      text-align: center;
      max-width: 520px;
      align-items: center;
    }
    .auth-intro {
      text-align: center;
    }
    .auth-card {
      width: 100%;
      max-width: 440px;
    }
    .overview-grid,
    .settings-grid {
      grid-template-columns: 1fr;
      gap: 18px;
    }
    .registration-toolbar {
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
      align-items: end;
    }
  }

  /* Use both columns when the iPad has room in landscape. */
  @media (orientation: landscape) and (min-width: 961px) {
    .auth-stage {
      grid-template-columns: minmax(0, 1fr) 392px;
      gap: 36px;
    }
    .overview-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 18px;
    }
    .overview-content {
      gap: 14px;
    }
    .metric-value {
      font-size: clamp(26px, 2.8vw, 34px);
    }
    .overview-progress {
      inline-size: 86px;
    }
  }

  /* Centered iPadOS Liquid Glass Dialogs */
  dialog:where(:not(.lg-dialog)) {
    width: min(560px, calc(100vw - 48px));
    max-height: 82dvh;
    border-radius: 28px;
  }
}

/* Touch iPadOS Safari (pointer: coarse on tablet width): 60fps + real Liquid Glass + copy lock */
@media (min-width: 761px) and (pointer: coarse) {
  html, body, #app-shell, #auth-page, main, section, div, p, span, h1, h2, h3, label, button, a, li, summary, small, strong {
    -webkit-user-select: none !important;
            user-select: none !important;
    -webkit-touch-callout: none !important;
  }
  input, textarea, [contenteditable="true"] {
    -webkit-user-select: text !important;
            user-select: text !important;
    -webkit-touch-callout: default !important;
  }
  button, a, summary, [role="tab"] {
    touch-action: manipulation;
  }
}

/* Static material is available before the first frame of any navigation. */
:is(.card, .overview-card, .start-card, .mobile-courses-nav) {
  background: rgb(255 255 255 / 42%);
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
}
.auth-card {
  background: rgb(255 255 255 / 61%);
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
  box-shadow: inset 0 1px #fff, 0 0 0 1px rgb(35 40 51 / 7%), 0 15px 36px rgb(35 40 51 / 9%);
}
/* Keep the highlight inside the rounded field during the form reveal. */
#auth-form .auth-field input {
  box-shadow: inset 0 0 0 1px transparent, inset 0 0 8px transparent;
  transition: border-color 140ms ease-out, background-color 140ms ease-out, box-shadow 140ms ease-out;
}
#auth-form .auth-field input:hover:not(:focus) {
  box-shadow: inset 0 0 0 1px rgb(69 84 108 / 7%), inset 0 0 8px rgb(96 110 134 / 5%);
}
#auth-form .auth-field input:focus {
  border-color: #65738a;
  box-shadow: inset 0 0 0 1px rgb(69 84 108 / 24%), inset 0 0 8px rgb(96 110 134 / 10%);
}
#password-reset-success { width: min(380px, calc(100% - 32px)); }

@media (max-width: 760px) {
  :root {
    --ease-out: cubic-bezier(.18, .79, .23, 1);
    --dialog-exit-duration: 185ms;
    --dialog-exit-scale: .987;
    --dialog-enter-duration: 230ms;
    --dialog-enter-scale: .977;
    --page-enter-duration: 185ms;
    --page-enter-offset: 9px;
  }
  .mobile-auth-topbar { margin-bottom: clamp(26px, 7vh, 60px); }
  .mobile-auth-back { min-height: 44px; }
  .auth-card-head { margin-bottom: 20px; }
  .auth-card-head h2 { font-size: 23px; }
  .auth-card .auth-reveal:not(.is-collapsed) { margin-top: 9px; }
  .auth-card .auth-agree-box { padding: 8px 10px; }
  .auth-card .auth-submit { margin-top: 10px; min-height: 44px; }

  #registration-dialog {
    --registration-inset: 13px;
    height: min(660px, var(--dialog-height));
  }
  .registration-source > .button { min-height: 44px; }
  #registration-options .registration-option { min-height: 48px; }
  #course-list > .group, #course-list .term {
    content-visibility: auto;
    contain-intrinsic-block-size: auto 52px;
  }
  #course-list > .group[open] { contain-intrinsic-block-size: auto 800px; }
  #course-list .term[open] { contain-intrinsic-block-size: auto 320px; }
  #registration-dialog[data-first-screen] [data-later-term] { content-visibility: hidden; }
  #registration-options > section {
    content-visibility: auto;
    contain-intrinsic-block-size: auto 300px;
  }

}
@media (min-width: 761px) and (max-width: 1180px),
       (min-width: 1181px) and (max-width: 1400px) and (any-pointer: coarse) {
  :root {
    --ease-out: cubic-bezier(.21, .78, .28, 1);
    --dialog-exit-duration: 170ms;
    --dialog-exit-scale: .989;
    --dialog-enter-duration: 205ms;
    --dialog-enter-scale: .982;
    --page-enter-duration: 175ms;
    --page-enter-offset: 8px;
  }
  .auth-reveal { transition-duration: 195ms; }
  .auth-card { max-width: 420px; }
  .auth-stage { gap: 26px; }
  #registration-dialog { --registration-inset: 18px; }
  .registration-source > .button { min-height: 44px; }
}

@media (max-width: 360px) {
  #agreement-register-actions > .button, #agreement-review-actions > .button { white-space: normal; }
}
@media (max-width: 760px) and (max-height: 600px) {
  .auth-scenes { min-height: 115px; height: 115px; }
  .sketch-canvas-wrap { max-width: 260px; }
}

/* Settings detail pages and registration panels. */
#settings-root-view > .page-heading { margin-bottom: 0; }
#onboarding-major-fields { margin-bottom: 12px; }
#major-switch-dialog .callout { margin-block: 12px 14px; }
#open-major-switch { min-height: 34px; padding-inline: 12px; }
.settings-major-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 14px 26px;
}
.settings-major-row > span { color: var(--ink-secondary); text-align: end; }
#settings-major-options { display: none; }
.settings-major-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 8px 14px; }
.settings-detail-page > .settings-back-btn { margin: 24px 0 14px; }
.settings-detail-page > dialog[open]:not(:modal) {
  position: static;
  margin: 0;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
}
.settings-detail-page > dialog[open]:not(:modal) :is(form, .dialog-body) { max-height: none; overflow: visible; }
.settings-detail-page > dialog:not(:modal) .dialog-head { touch-action: auto; cursor: default; }
.settings-detail-page > dialog:not(:modal) .dialog-head .close { display: none; }

.registration-layers { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.registration-layers > form { height: 100%; }
#ge-picker-form .dialog-head > div { display: flex; align-items: center; gap: 12px; }
#registration-options .registration-option.registration-elective { gap: 0; padding: 0 6px 0 0; cursor: default; }
.registration-elective-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 9px 8px 9px 14px;
  text-align: start;
  border: 0;
  background: transparent;
  cursor: pointer;
}
:is(#registration-options input[type="checkbox"], #ge-picker-options input[type="radio"], .registration-elective-mark) {
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid #777d86;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: inset 0 0 0 0 #4a5260;
  transition: box-shadow 170ms var(--ease-out), border-color 170ms var(--ease-out);
}
:is(#registration-options input[type="checkbox"], #ge-picker-options input[type="radio"]):checked,
#ge-picker-options [data-picked] input,
.registration-elective[data-selected] .registration-elective-mark {
  border-color: #4a5260;
  box-shadow: inset 0 0 0 4px #4a5260;
}
:is(#registration-options input[type="checkbox"], #ge-picker-options input[type="radio"]):focus-visible {
  outline: 2px solid #424954;
  outline-offset: 2px;
}
.registration-elective-choice .link-meta { white-space: nowrap; }
.registration-option .course-meta { font-weight: 600; }
.registration-elective > .button { min-width: 0; min-height: 32px; padding: 0 8px; }
@media (max-width: 760px) {
  .settings-major-row { grid-template-columns: auto minmax(0, 1fr) auto; padding-inline: 14px; column-gap: 8px; }
  .settings-major-row > span { font-size: 13px; overflow-wrap: anywhere; }
  #settings-major-options { display: inline-flex; min-width: 48px; min-height: 44px; padding-inline: 10px; }
  #settings-major-options[aria-expanded="false"] + .settings-major-actions { display: none; }
  .settings-major-actions {
    grid-column: 1 / -1;
    padding-top: 8px;
    border-top: 1px solid var(--separator);
    gap: 8px;
  }
  .settings-major-actions :is(#open-major-switch, .doc-download-pill) { min-height: 44px; padding-inline: 10px; }
  #ge-picker-form .dialog-head > div { gap: 8px; }
}

/* General education reference, shared with the course header and dialog controls. */
.course-plan-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 10px;
}
.course-plan-tools:not(:has(> :not([hidden]))) { display: none; }
#ge-catalog-open { min-height: 36px; cursor: pointer; }
#ge-catalog-dialog { width: min(calc(100% - 32px), 880px); }
.ge-catalog-body { overflow-x: hidden; }
.ge-group + .ge-group { margin-top: 16px; }
.ge-group h3 { margin: 0 0 7px; font-size: 16px; }
.ge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.ge-section + .ge-section { margin-top: 10px; }
.ge-section > :is(h3, h4) { margin: 0 0 6px; font-size: 13px; color: var(--ink-secondary); }
.ge-grid li { display: flex; min-width: 0; }
.ge-entry {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 50px;
  padding: 9px 11px;
  border: 1px solid var(--separator);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.ge-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  cursor: pointer;
  transition: background-color 170ms var(--ease-out), border-color 170ms var(--ease-out);
}
.ge-choice input { margin-top: 1px; }
.ge-choice-copy { display: grid; min-width: 0; gap: 4px; }
.ge-course-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  color: var(--ink-secondary);
  font-size: 12px;
}
.ge-course-meta > span { white-space: nowrap; }
#ge-picker-options label:has(input:focus-visible) { border-color: #777d86; }
#ge-picker-options label:has(input:checked),
#ge-picker-options label[data-picked] {
  background-color: var(--glass-sheet-selected);
  border-color: #848b96;
}
#ge-picker-options label[data-picked] { cursor: default; }
.ge-section-note {
  margin: 0 0 7px;
  color: var(--ink-secondary);
  font-size: 13px;
}
#ge-picker-error { flex-basis: 100%; }
@media (max-width: 760px) {
  .course-plan-tools { justify-content: flex-end; }
  .courses-heading:not(:has(#us-search-wrap.is-expanded:not([hidden]))) .course-plan-tools { display: none; }
  #ge-catalog-open { min-height: 44px; backdrop-filter: none; -webkit-backdrop-filter: none; }
  #ge-catalog-dialog { width: calc(100% - 20px); }
  .ge-catalog-body { padding-inline: 10px; }
  .ge-grid { gap: 4px; }
  .ge-entry { padding: 6px; font-size: 13px; }
}

@media (max-width: 360px) {
  #ge-catalog-dialog .ge-entry { padding-inline: 4px; }
  #ge-catalog-dialog .ge-course-meta > span { white-space: normal; }
}

@media (max-width: 540px) {
  #ge-picker-options .ge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
}

/* ============================================================================
   ACCESSIBILITY FALLBACKS
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  :where(*):not(.gpaway-glisse-host *, .gpaway-glisse-progress *, .gpaway-toast, .gpaway-toast *, .lg-dialog, .lg-dialog *),
  :where(*):not(.gpaway-glisse-host *, .gpaway-glisse-progress *, .gpaway-toast, .gpaway-toast *, .lg-dialog, .lg-dialog *)::before,
  :where(*):not(.gpaway-glisse-host *, .gpaway-glisse-progress *, .gpaway-toast, .gpaway-toast *, .lg-dialog, .lg-dialog *)::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-dialog-page-filter: none; }
  #toast:not(:empty):not(:has(.gpaway-toast)) { background: #f8f9fc; backdrop-filter: none; -webkit-backdrop-filter: none; }
  html { background: #F5F6F8 !important; }
  .lg-ambient-blobs { display: none !important; }
  :is(.masthead, .card, .start-card, .auth-card, dialog:where(:not(.lg-dialog)), .term-picker-menu, .mobile-dock, .mobile-courses-nav) {
    --lg-backdrop-override: none;
    background: #FFFFFF !important;
    -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
  }
  .lg__tint, .lg__specular, .lg__glow { display: none !important; }
  dialog:modal:where(:not(.lg-dialog))::backdrop { background: rgb(28 32 41 / 23%); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --separator: rgba(46, 48, 54, 0.30); --separator-strong: rgba(46, 48, 54, 0.52); --ink-secondary: rgba(46, 48, 54, 0.85); }
  .masthead, .card, .start-card, .auth-card, dialog:where(:not(.lg-dialog)), .term-picker-menu { box-shadow: 0 0 0 1.5px var(--ink-strong); }
}
@media (forced-colors: active) {
  .lg__glow { display: none; }
  :root { --ink: CanvasText; --ink-strong: CanvasText; --ink-secondary: CanvasText; --separator: CanvasText; }
  body, :is(.masthead, .card, .start-card, .auth-card, dialog:where(:not(.lg-dialog)), .term-picker-menu, #toast:not(:empty)) {
    background: Canvas; color: CanvasText; border: 1px solid CanvasText; backdrop-filter: none !important; box-shadow: none;
  }
  .overview-progress::before { mask-image: none; border: 1px solid CanvasText; }
  :is(.button, .term-picker-trigger, .edit-label, .remove-label, .badge) { border: 1px solid ButtonText; }
}

/* Glisse owns the material and interaction on the enhanced controls. */
[data-glisse-enhanced] > :not(.gpaway-glisse-host) { display: none !important; }
:is(#auth-tabs, #m-system-seg, .m-subpills, .registration-source, #mobile-dock)[data-glisse-enhanced] {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  background: none;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* The login switch uses the Glisse rim and thumb over a clear track. */
#auth-tabs[data-glisse-enhanced] {
  --lg-segment-track: transparent;
}
.gpaway-glisse-host {
  width: 100%;
  min-width: 0;
  container-type: inline-size;
}
.gpaway-glisse-host > :is(.lg-segmented, .lg-tab-bar) {
  box-sizing: border-box;
  width: 100%;
  --lg-tab-width: calc((100cqi - 2 * var(--lg-tab-inset)) / var(--lg-tabs));
}
/* Match the existing grayscale palette without repainting the Glisse button. */
#glisse-provider-notice { --lg-fill: #464c58; }

@media (min-width: 761px) and (max-width: 1180px) and (orientation: portrait) {
  .auth-stage { gap: 16px; }
  .auth-editorial .auth-scenes {
    margin-top: 8px;
    min-height: clamp(220px, 22dvh, 260px);
  }
}
#mobile-dock[data-glisse-enhanced]::before { display: none; }
.gpaway-glisse-progress { width: 100%; }

.gpaway-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 16px;
  border-radius: 22px;
}
.gpaway-toast > span { overflow-wrap: anywhere; }
#mobile-dock[data-glisse-enhanced],
#auth-tabs[data-glisse-enhanced],
.mobile-courses-nav:has([data-glisse-enhanced]),
.m-subpills-wrap:not(.is-collapsed):has([data-glisse-enhanced]) > .m-subpills-inner {
  overflow: visible;
}
.mobile-courses-nav:has([data-glisse-enhanced]) {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

#auth-email-dialog { width: min(420px, calc(100% - 32px)); }
#auth-email-address { width: 100%; margin-top: 6px; }
@media (max-width: 760px) {
  #auth-email-address { font-size: 16px; }
}
button[data-provider-busy] {
  position: relative;
  color: transparent !important;
  opacity: 1;
  cursor: wait;
}
button[data-provider-busy] > * { visibility: hidden; }
button[data-provider-busy]::after {
  content: attr(data-busy-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
}
