/* 00-base-auth.css */
/* Full app stylesheet. Split later only at complete CSS rule boundaries. */

:root {
  --ink: #0e0c0a;
  --paper: #f5f0e8;
  --paper2: #ede8dc;
  --paper3: #faf7f2;
  --washi: #e8e0d0;
  --sumi: #1a1612;
  --vermillion: #c0392b;
  --vermillion2: #e74c3c;
  --gold: #b8860b;
  --gold2: #d4a017;
  --gold3: #f0c040;
  --pine: #2d5a27;
  --indigo: #1a2c4a;
  --slate: #4a5568;
  --muted: #7a6e5e;
  --faint: #c8bfae;
  --border: rgba(26,22,18,0.12);
  --border2: rgba(26,22,18,0.22);
  --shadow: 0 4px 24px rgba(14,12,10,0.14);
  --shadow2: 0 2px 8px rgba(14,12,10,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
.hidden { display: none !important; }

body {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231a1612' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-size: auto;
  background-repeat: repeat;
  background-position: center;
  color: var(--ink);
  font-family: "Cormorant Garamond", serif;
  min-height: 100vh;
  padding-top: 126px;
}
#auth-gate {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 36px 18px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.44), transparent 30%),
    linear-gradient(135deg, rgba(245,240,232,0.96), rgba(232,224,208,0.94));
}
.auth-gate-shell {
  width: min(920px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(360px, 1.18fr);
  overflow: hidden;
  border: 1px solid rgba(26,22,18,0.14);
  border-radius: 10px;
  background: rgba(250,247,242,0.96);
  box-shadow: 0 18px 54px rgba(14,12,10,0.18);
}
.auth-gate-aside {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 38px 34px;
  border-right: 1px solid rgba(26,22,18,0.13);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.42), rgba(232,224,208,0.58)),
    var(--paper2);
  color: var(--ink);
}
.auth-gate-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.auth-gate-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(14,12,10,0.34);
  border-radius: 6px;
  background: #050505;
  box-shadow: 0 6px 16px rgba(14,12,10,0.16), inset 0 0 0 2px rgba(250,247,242,0.10);
}
.auth-gate-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.25) brightness(0.78);
}
.auth-gate-logo.logo-missing::before,
.nav-brand.logo-missing::before {
  content: "SN";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}
.auth-gate-label {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink);
}
.auth-gate-title {
  font-family: "Shippori Mincho", serif;
  font-size: clamp(42px, 4.8vw, 58px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ink);
}

.auth-unitrack-logo-title {
  display: flex;
  align-items: center;
  line-height: 1;
}

.auth-unitrack-logo {
  height: clamp(42px, 4.8vw, 58px);
  width: auto;
  display: block;
}

.auth-unitrack-logo-white {
  display: none;
}

body.theme-dark .auth-unitrack-logo-black,
body.theme-charcoal .auth-unitrack-logo-black {
  display: none;
}

body.theme-dark .auth-unitrack-logo-white,
body.theme-charcoal .auth-unitrack-logo-white {
  display: block;
}

@media (max-width: 700px) {
  .auth-unitrack-logo {
    height: 38px;
  }
}

.auth-gate-copy,
.auth-gate-message {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  line-height: 1.4;
  color: #5a4d40;
}
.auth-gate-panel {
  padding: 38px 34px;
  background: rgba(250,247,242,0.98);
}
.auth-gate-card {
  display: grid;
  gap: 16px;
}
.auth-gate-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.auth-gate-tab {
  border: 1px solid rgba(26,22,18,0.16);
  border-radius: 999px;
  background: rgba(232,224,208,0.42);
  color: var(--slate);
  padding: 8px 12px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.auth-gate-tab.active {
  background: var(--sumi);
  border-color: var(--sumi);
  color: var(--paper3);
}
.auth-success,
.auth-error {
  min-height: 14px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.auth-success { color: var(--pine); }
.auth-error { color: var(--vermillion); }
.auth-switch-copy,
.auth-email {
  color: #5a4d40;
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  line-height: 1.45;
}
.auth-email {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  word-break: break-word;
}
body.theme-dark #auth-gate,
body.theme-charcoal #auth-gate {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.08), transparent 34%),
    linear-gradient(135deg, #0f1012, #181515);
}
body.theme-dark .auth-gate-shell,
body.theme-charcoal .auth-gate-shell {
  background: rgba(22,22,24,0.96);
  border-color: rgba(255,255,255,0.10);
  box-shadow: 0 22px 64px rgba(0,0,0,0.38);
}
body.theme-dark .auth-gate-aside,
body.theme-charcoal .auth-gate-aside {
  background: rgba(255,255,255,0.035);
  border-right-color: rgba(255,255,255,0.08);
}
body.theme-dark .auth-gate-panel,
body.theme-charcoal .auth-gate-panel {
  background: rgba(18,18,20,0.98);
}
body.theme-dark .auth-gate-label,
body.theme-dark .auth-gate-title,
body.theme-charcoal .auth-gate-label,
body.theme-charcoal .auth-gate-title {
  color: #f1ede4;
}
body.theme-dark .auth-gate-copy,
body.theme-dark .auth-gate-message,
body.theme-dark .auth-switch-copy,
body.theme-dark .auth-email,
body.theme-charcoal .auth-gate-copy,
body.theme-charcoal .auth-gate-message,
body.theme-charcoal .auth-switch-copy,
body.theme-charcoal .auth-email {
  color: rgba(241,237,228,0.72);
}
body.theme-dark .auth-gate-tab,
body.theme-charcoal .auth-gate-tab {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.10);
  color: rgba(241,237,228,0.72);
}
body.theme-dark .auth-gate-tab.active,
body.theme-charcoal .auth-gate-tab.active {
  background: #f1ede4;
  border-color: #f1ede4;
  color: #111;
}
body.theme-dark .auth-success,
body.theme-charcoal .auth-success {
  color: #b9d7ac;
}
body.theme-dark .auth-error,
body.theme-charcoal .auth-error {
  color: #f08b80;
}
@media (max-width: 700px) {
  #auth-gate { padding: 12px; align-items: flex-start; }
  .auth-gate-shell { width: 100%; grid-template-columns: 1fr; border-radius: 12px; }
  .auth-gate-aside { border-right: none; border-bottom: 1px solid rgba(26,22,18,0.12); padding: 22px 18px; }
  .auth-gate-panel { padding: 22px 18px; }
  .auth-gate-logo { width: 34px; height: 34px; flex-basis: 34px; }
  .auth-gate-title { font-size: 38px; }
  .auth-gate-copy, .auth-gate-message { font-size: 17px; }
  .auth-gate-tab { flex: 1 1 auto; min-height: 38px; text-align: center; }
}

body.auth-required {
  padding-top: 0;
}
body.auth-required .sticky-exams,
body.auth-required .nav-bar,
body.auth-required .hero,
body.auth-required .content,
body.auth-required #dashboard-modal,
body.auth-required #onboarding-modal,
body.auth-required #timeline-modal,
body.auth-required #todo-modal,
body.auth-required #calendar-modal,
body.auth-required #deadline-form-modal,
body.auth-required #course-setup-modal,
body.auth-required #deadline-splash,
body.auth-required #template-splash,
body.auth-required #auth-modal {
  display: none !important;
}
body.auth-required #auth-gate {
  display: flex;
}
body.auth-loading {
  padding-top: 0;
}
body.auth-loading .sticky-exams,
body.auth-loading .nav-bar,
body.auth-loading .hero,
body.auth-loading .content,
body.auth-loading #dashboard-modal,
body.auth-loading #onboarding-modal,
body.auth-loading #timeline-modal,
body.auth-loading #todo-modal,
body.auth-loading #calendar-modal,
body.auth-loading #deadline-form-modal,
body.auth-loading #course-setup-modal,
body.auth-loading #deadline-splash,
body.auth-loading #template-splash,
body.auth-loading #auth-modal {
  display: none !important;
}
body.auth-loading #auth-gate {
  display: flex;
}
body.setup-required {
  padding-top: 0;
}
body.setup-required .sticky-exams,
body.setup-required .nav-bar,
body.setup-required .hero,
body.setup-required .content,
body.setup-required #dashboard-modal,
body.setup-required #onboarding-modal,
body.setup-required #timeline-modal,
body.setup-required #todo-modal,
body.setup-required #calendar-modal,
body.setup-required #deadline-form-modal,
body.setup-required #deadline-splash,
body.setup-required #template-splash,
body.setup-required #auth-modal,
body.setup-required #auth-gate {
  display: none !important;
}
body.setup-required #course-setup-modal {
  display: flex !important;
  background: var(--paper);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.has-body-background::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(245,240,232,0.9), rgba(245,240,232,0.9)),
    var(--page-bg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
body.theme-dark.has-body-background::before {
  background:
    linear-gradient(rgba(24,24,27,0.84), rgba(24,24,27,0.84)),
    var(--page-bg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

textarea,
select,
input,
button {
  font-size-adjust: none;
}
.timeline-notes,
.notes-area,
.app-dialog-input {
  font-size: 14px;
  line-height: 1.45;
}
body.theme-dark select,
body.theme-dark option {
  background: #202024;
  color: #f1ede4;
}

body.font-sans,
body.font-sans * {
  font-family: "Segoe UI", Arial, sans-serif;
}

body.font-mono,
body.font-mono * {
  font-family: "DM Mono", Consolas, monospace;
}

body.font-mono h1,
body.font-mono .mod-name,
body.font-mono .dashboard-title,
body.font-mono .deadline-splash-title {
  letter-spacing: 0;
}

/* 01-shell.css */
.deadline-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 18, 0.55);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease;
}

.deadline-splash.hidden {
  display: none;
}

.template-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.template-choice {
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-align: left;
}

.template-choice-title {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f8ead5;
  margin-bottom: 8px;
}

.template-choice-detail {
  color: rgba(255,255,255,0.68);
  font-size: 14px;
  line-height: 1.4;
}

.template-choice.primary {
  border-color: rgba(216,200,176,0.45);
  background: rgba(216,200,176,0.18);
}

.template-choice:hover {
  background: rgba(255,255,255,0.14);
}

.template-splash-copy {
  color: rgba(255,255,255,0.68);
  font-size: 16px;
  line-height: 1.45;
}

.deadline-splash-card {
  width: min(420px, calc(100vw - 32px));
  padding: 26px 28px;
  border-radius: 12px;
  background: rgba(22, 24, 29, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.34);

  position: relative;
  overflow: hidden;
}

.template-splash-card {
  width: min(640px, calc(100vw - 32px));
}

/* close button */
.deadline-splash-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,0.72);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.deadline-splash-close:hover {
  color: white;
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

/* label */
.deadline-splash-label {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 10px;
}

/* title */
.deadline-splash-title {
  font-family: "Shippori Mincho", serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

/* BIG timer */
.deadline-splash-time {
  font-family: "DM Mono", monospace;
  font-size: 32px;
  color: #d8c8b0;
  letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(216,200,176,0.1);
}

.app-dialog-card {
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
}
.app-dialog-message {
  color: rgba(245,240,232,0.72);
  font-size: 15px;
  line-height: 1.45;
  margin: 8px 0 12px;
}
.app-dialog-field {
  display: grid;
  gap: 7px;
  margin: 12px 0 16px;
}
.app-dialog-field.hidden { display: none !important; }
.app-dialog-field label,
.app-dialog-check {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.58);
}
.app-dialog-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #f5f0e8;
  padding: 11px 12px;
  font-family: "DM Mono", monospace;
  font-size: 14px;
  outline: none;
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
body:not(.theme-dark) .app-dialog-card {
  background: rgba(250,247,242,0.98);
  border-color: rgba(26,22,18,0.16);
  box-shadow: 0 18px 40px rgba(14,12,10,0.14);
}
body:not(.theme-dark) .app-dialog-card .deadline-splash-title { color: var(--ink); }
body:not(.theme-dark) .app-dialog-card .deadline-splash-label,
body:not(.theme-dark) .app-dialog-field label,
body:not(.theme-dark) .app-dialog-check { color: var(--muted); }
body:not(.theme-dark) .app-dialog-message { color: var(--muted); }
body:not(.theme-dark) .app-dialog-input {
  background: var(--paper2);
  color: var(--ink);
  border-color: var(--border2);
}

body.theme-dark .deadline-splash-card,
body.theme-charcoal .deadline-splash-card {
  background: #1b1c20;
  border-color: rgba(255,255,255,0.09);
  box-shadow: 0 18px 42px rgba(0,0,0,0.42);
}

body.theme-dark .deadline-splash-label,
body.theme-charcoal .deadline-splash-label {
  color: rgba(241,237,228,0.52);
}

body.theme-dark .deadline-splash-title,
body.theme-charcoal .deadline-splash-title,
body.theme-dark .template-choice-title,
body.theme-charcoal .template-choice-title {
  color: #f4efe7;
}

body.theme-dark .template-splash-copy,
body.theme-dark .template-choice-detail,
body.theme-charcoal .template-splash-copy,
body.theme-charcoal .template-choice-detail {
  color: rgba(241,237,228,0.78);
}

body.theme-dark .template-choice,
body.theme-charcoal .template-choice {
  background: #23242a;
  border-color: rgba(255,255,255,0.1);
}

body.theme-dark .template-choice.primary,
body.theme-charcoal .template-choice.primary {
  background: #2a2723;
  border-color: rgba(216,200,176,0.3);
}

/* animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.topic-row.dragging {
  background: rgba(192,57,43,0.06);
}

.topic-row {
  cursor: pointer;
}

.sticky-exams {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--sumi);
  color: var(--paper);
  border-bottom: 1px solid rgba(245,240,232,0.16);
  height: 66px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  overscroll-behavior-x: contain;
}
.sticky-exams.dragging {
  cursor: grabbing;
}
.sticky-exams::-webkit-scrollbar { display: none; }
body.countdown-header-hidden:not(.auth-required):not(.auth-loading):not(.setup-required) {
  padding-top: 60px;
}
body.countdown-header-hidden .sticky-exams {
  display: none;
}
body.countdown-header-hidden .nav-bar {
  top: 0;
}
.exam-ticker {
  flex-shrink: 0;
  padding: 0 28px;
  min-width: 260px;
  border-right: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  cursor: pointer;
  transition: background 0.2s;
}
.exam-ticker:hover { background: rgba(192,57,43,0.16); }

.ticker-mod {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--gold2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 2px;
}
.ticker-time {
  font-family: "DM Mono", monospace;
  font-size: 18px;
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.ticker-time.urgent { color: var(--vermillion2); }
.ticker-date {
  font-family: "DM Mono", monospace;
  font-size: 9px;
  color: rgba(245,240,232,0.48);
  margin-top: 2px;
}
.add-exam-btn {
  flex-shrink: 0;
  min-height: 100%;
  border: none;
  background: none;
  color: rgba(245,240,232,0.65);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 20px;
  cursor: pointer;
  transition: color 0.2s;
}
.add-exam-btn:hover { color: var(--vermillion2); }

.nav-bar {
  position: fixed;
  top: 66px;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--paper2);
  border-bottom: 1px solid var(--border);
  padding: 10px 32px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.nav-brand {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #050505;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow2);
}
.nav-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.prefs-toggle-btn {
  margin-left: auto;
}
.year-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-btn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 6px 14px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s;
  color: var(--slate);
  font-weight: 500;
}

.danger-btn {
  background: #1a2c4a;
  border: 1px solid #1a2c4a;
  color: white;
}

.danger-btn:hover {
  background: #26406b;
  border-color: #26406b;
}
.nav-select {
  background: var(--paper2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 10px 12px;
  box-sizing: border-box;
  font-family: "DM Mono", monospace;
  font-size: 15px;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--slate);
  min-width: 120px;
  max-width: 100%;
  text-overflow: ellipsis;
  outline: none;
}
.nav-select:focus { border-color: var(--vermillion); }
.nav-btn:hover {
  border-color: var(--vermillion);
  color: var(--vermillion);
  background: var(--paper3);
  box-shadow: var(--shadow2);
}

.hero {
  background: var(--sumi);
  background-image:
    radial-gradient(ellipse at 80% 0%, rgba(192,57,43,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 100%, rgba(26,44,74,0.35) 0%, transparent 50%),
    var(--hero-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 44px 32px 38px;
  position: relative;
  overflow: hidden;
  margin-top: -10px;
  padding-top: 54px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
  filter: grayscale(100%) brightness(0.42) contrast(1.08);
  z-index: 0;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(5,10,18,0.45), rgba(5,10,18,0.28)),
    linear-gradient(to right, rgba(5,10,18,0.22), rgba(5,10,18,0.12));
  z-index: 1;
}
.hero-accent {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(45deg, var(--vermillion), var(--gold), transparent);
  z-index: 3;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
}
.eyebrow {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold2);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  display: none;
}

h1 {
  font-family: "Shippori Mincho", serif;
  font-size: clamp(48px, 5vw, 56px);
  font-weight: 800;
  color: #f5f0e8;
  line-height: 1.05;
  letter-spacing: 0;
  margin-bottom: 14px;
}
.h1-jp {
  font-family: "Noto Serif JP", serif;
  font-weight: 500;
  font-size: clamp(13px, 2vw, 18px);
  color: rgba(255,255,255,0.6);
  margin-bottom: 28px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(190px, 0.55fr) minmax(220px, 0.95fr);
  gap: 14px;
  margin-top: 10px;
}
.dash-actions-card {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 100%;
}
.dash-hero-btn {
  width: 100%;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 42px 24px 24px;
}
.dash-hero-btn .dash-launch-icon {
  max-width: none;
  width: 100%;
  display: block;
  text-align: center;
  line-height: 1.06;
}
.washi-card {
  background: rgba(6, 12, 22, 0.5);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 3px;
  padding: 20px 22px;
  position: relative;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.card-label {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.4);
  margin-bottom: 14px;
}

.calendar-btn {
  background: var(--indigo);
  border-color: var(--indigo);
  color: white;
}

.calendar-btn:hover {
  background: #243f6b;
  border-color: #243f6b;
  color: #487ccf;
}

.global-big {
  font-family: "Shippori Mincho", serif;
  font-size: 36px;
  font-weight: 700;
  color: #f5f0e8;
  line-height: 1;
  margin-bottom: 12px;
}
.global-big span {
  font-size: 14px;
  font-weight: 400;
  color: rgba(245,240,232,0.45);
  font-family: "DM Mono", monospace;
}
.progress-track {
  height: 3px;
  background: rgba(245,240,232,0.1);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--vermillion), var(--gold2));
  border-radius: 99px;
  transition: width 0.45s ease;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: rgba(245,240,232,0.35);
  flex-wrap: wrap;
  gap: 4px;
}
.dash-launch {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: rgba(17,18,21,0.72);
  border-color: rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform 0.28s ease, background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.dash-launch:hover {
  transform: translateY(-2px);
  background: rgba(17,18,21,0.84);
  border-color: rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 24px rgba(0,0,0,0.16);
}

.dash-launch::after {
  content: "Open";
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.55);
}

.dash-launch-icon {
  font-family: "Shippori Mincho", serif;
  font-size: 26px;
  color: #f5f0e8;
  line-height: 1;
  max-width: 120px;
}
.dash-launch-copy {
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  color: rgba(245,240,232,0.72);
  line-height: 1.3;
  margin-top: 6px;
}
#hero-title,
.mod-name {
  letter-spacing: 0 !important;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
.predictor-hero-number {
  font-family: "Shippori Mincho", serif;
  font-size: clamp(58px, 9vw, 92px);
  line-height: 0.92;
  color: #fff;
  margin-bottom: 10px;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(0,0,0,0.18);
}
.predictor-hero-sub {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.44);
  margin-bottom: 8px;
}
.hero-summary {
  font-family: "Cormorant Garamond", serif;
  font-size: 17px;
  color: rgba(245,240,232,0.82);
  line-height: 1.4;
}
.hero-summary strong {
  color: #fff;
  font-weight: 600;
}

/* 02-modules.css */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.module {
  background: var(--paper3);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  padding-top: 8px;
}
.module:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow2);
}
.module::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: var(--module-accent, #c0392b);
}
.module-empty-state {
  border: 1px dashed var(--border2);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: rgba(26,22,18,0.025);
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  text-align: center;
}
.module-header {
  display: grid;
  grid-template-columns: 20px minmax(240px, 1.5fr) minmax(220px, 1fr) minmax(280px, 1fr) auto auto 20px;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
}
.mod-stripe { width: 2px; height: 72px; border-radius: 99px; opacity: 0.85; }
.mod-name {
  font-family: "Shippori Mincho", serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.2;
}
.mod-kanji {
  font-family: "Noto Serif JP", serif;
  font-weight: 200;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.14em;
  margin-bottom: 6px;
}
.module-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.module-edit-tools {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 20px 12px 42px;
  border-bottom: 1px solid var(--border);
  background: rgba(26,22,18,0.025);
}
.module-edit-primary,
.module-edit-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.module-major-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--border2);
  border-radius: 5px;
  background: rgba(26,22,18,0.035);
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.module-major-toggle input {
  margin: 0;
}
.bb-link, .bb-edit-btn, .formula-btn, .formula-edit-btn, .mini-btn {
  background: rgba(26,22,18,0.04);
  border: 1px solid var(--border2);
  border-radius: 2px;
  color: var(--slate);
  padding: 6px 11px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s;
}
.bb-link {
  background: #111;
  border-color: #111;
  color: #fff;
}
.bb-link:hover {
  background: #1d1d1d;
  border-color: var(--vermillion);
  color: #fff;
}
.bb-edit-btn:hover, .formula-btn:hover, .formula-edit-btn:hover, .mini-btn:hover {
  border-color: var(--vermillion);
  color: var(--vermillion);
  background: var(--paper2);
}
.weight-edit-btn {
  background: rgba(26,44,74,0.08);
  border-color: rgba(26,44,74,0.18);
  color: var(--indigo);
}
.weight-edit-btn:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  background: rgba(26,44,74,0.12);
}
body.theme-dark .weight-edit-btn{
  background: rgba(111,139,191,0.14);
  border-color: rgba(111,139,191,0.28);
  color: #e8edf7;
}
body.theme-dark .weight-edit-btn:hover{
  background: rgba(111,139,191,0.2);
  border-color: rgba(111,139,191,0.42);
  color: #ffffff;
}
.progress-section { min-width: 0; }
.prog-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.prog-done {
  font-family: "Shippori Mincho", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.prog-pct {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  align-self: flex-end;
}
.prog-track {
  height: 3px;
  background: var(--washi);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.prog-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width 0.45s ease;
}
.prog-of {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.06em;
}
.inputs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}
.inputs-grid.single-grade-input {
  grid-template-columns: minmax(0, 1fr);
}
.inputs-grid .field {
  min-width: 0;
}
.inputs-grid .nav-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.field label {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--paper2);
  color: var(--ink);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "DM Mono", monospace;
  font-size: 15px;
  line-height: 1.4;
  outline: none;
}
.input:focus { border-color: var(--vermillion); }
.input:disabled { opacity: 0.45; cursor: not-allowed; }
.final-col { text-align: right; }
.final-mark {
  font-family: "Shippori Mincho", serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}
.final-cls {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 1px;
  display: inline-block;
}
.cls-s-first { background: rgba(192,57,43,0.1); color: var(--vermillion); border: 1px solid rgba(192,57,43,0.3); }
.cls-s-21 { background: rgba(184,134,11,0.1); color: var(--gold); border: 1px solid rgba(184,134,11,0.3); }
.cls-s-22 { background: rgba(26,44,74,0.1); color: var(--indigo); border: 1px solid rgba(26,44,74,0.25); }
.cls-s-third { background: rgba(74,85,104,0.1); color: var(--slate); border: 1px solid var(--border2); }
.chevron {
  color: var(--faint);
  transition: transform 0.25s ease;
}
.chevron::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.chevron.open::before { transform: rotate(45deg); }
.module-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.module-delete-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--vermillion);
  border-color: rgba(192,57,43,0.45);
  background: rgba(192,57,43,0.06);
  font-size: 12px;
  line-height: 1;
}
.module-delete-corner {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}
.module-delete-btn:hover {
  background: rgba(192,57,43,0.14);
}
.topic-list {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--paper2);
}
.topic-list.open { display: block; }
.notes-area-wrap, .formula-links-wrap, .relevant-links-wrap {
  padding: 12px 20px 12px 42px;
  border-bottom: 1px solid var(--border);
}
.notes-area {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 14px;
  color: var(--slate);
  outline: none;
  resize: vertical;
  line-height: 1.6;
}
.notes-area::placeholder { color: var(--faint); }
.formula-links-head, .relevant-links-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.topic-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.topic-tools-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topic-tools-title {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.topic-entry-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.topic-entry-row .input {
  flex: 1;
  min-width: 0;
}
.topic-entry-help {
  font-family: "Cormorant Garamond", serif;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 4px;
}
.formula-links-title, .relevant-links-title {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.module-section {
  border-bottom: 1px solid var(--border);
}
.module-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px 12px 42px;
}
.module-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  min-width: 0;
}
.module-section-title {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.module-section.coursework-section .module-section-title {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--sumi);
}
body.theme-dark .module-section.coursework-section .module-section-title{
  color: #f1ede4;
}
.module-section-chevron {
  color: var(--faint);
  transition: transform 0.2s ease;
  flex: 0 0 auto;
  margin-top: 1px;
}
.module-section-chevron::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.module-section-chevron.open::before {
  transform: rotate(45deg);
}
.module-section-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.module-section-body {
  display: none;
  padding: 0 20px 12px 42px;
}
.module-section-body.open {
  display: block;
}
body.setup-required .dashboard-content {
  background: rgba(250,247,242,0.985);
  border: 1px solid rgba(26,22,18,0.16);
  box-shadow: 0 24px 60px rgba(14,12,10,0.12);
}
body.setup-required .setup-content {
  width: min(780px, calc(100vw - 28px));
}
body.setup-required .setup-grid {
  background: rgba(255,255,255,0.52);
  border: 1px solid rgba(26,22,18,0.08);
  border-radius: 8px;
  padding: 14px;
}
body.auth-loading .auth-gate-shell {
  background: rgba(250,247,242,0.985) !important;
  border: 1px solid rgba(26,22,18,0.16) !important;
  box-shadow: 0 24px 60px rgba(14,12,10,0.12) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.auth-loading .auth-gate-aside {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.7), rgba(237,232,220,0.86)),
    var(--paper2) !important;
  border-right-color: rgba(26,22,18,0.12) !important;
}
body.auth-loading .auth-gate-panel {
  background: rgba(255,255,255,0.9) !important;
}
body.auth-loading .auth-gate-card {
  min-height: 160px;
  align-content: center;
}
body.auth-loading #auth-gate-body .deadline-splash-title,
body.auth-loading #auth-gate-body .auth-gate-message {
  color: var(--ink) !important;
}
body.auth-loading #auth-gate-body .deadline-splash-title {
  font-weight: 700;
}
.formula-links-list, .relevant-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.formula-chip, .relevant-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border2);
  background: rgba(26,22,18,0.03);
  padding: 5px 8px;
  border-radius: 2px;
}
.formula-chip a, .relevant-link-chip a {
  color: var(--slate);
  text-decoration: none;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}
.formula-chip a:hover, .relevant-link-chip a:hover { color: var(--vermillion); }
.formula-remove-btn, .relevant-link-remove-btn {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}
.formula-remove-btn:hover, .relevant-link-remove-btn:hover { color: var(--vermillion); }
.formula-empty, .relevant-links-empty {
  font-family: "Cormorant Garamond", serif;
  font-size: 14px;
  color: var(--muted);
}
.material-library {
  display: grid;
  gap: 10px;
}
.material-library-list {
  display: grid;
  gap: 8px;
}
.material-library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(26,22,18,0.03);
  padding: 10px 12px;
  border-radius: 8px;
}
.material-library-name {
  color: var(--sumi);
  font-family: "Shippori Mincho", serif;
  font-size: 18px;
  line-height: 1.2;
}
.material-library-url {
  grid-column: 1 / -1;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-library-empty {
  color: var(--muted);
  line-height: 1.5;
}
body.theme-dark .material-library-item{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
body.theme-dark .material-library-name{
  color: #f1ede4;
}
body.theme-dark .material-library-url,
body.theme-dark .material-library-empty{
  color: rgba(241,237,228,0.72);
}

/* 03-library-topics.css */
.module-library-content {
  width: min(1320px, calc(100vw - 28px));
  max-height: 88vh;
  overflow-y: hidden;
  scrollbar-width: none;
  background: color-mix(in srgb, var(--paper) 92%, white 8%);
  border-color: color-mix(in srgb, var(--border) 84%, transparent 16%);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(14,12,10,0.16);
}
.module-library-content::-webkit-scrollbar { display: none; }
.module-library-topline .timeline-page-title {
  font-size: clamp(36px, 4vw, 52px);
  line-height: 0.96;
  letter-spacing: 0;
}
.module-library-topline {
  align-items: flex-start;
  gap: 16px;
}
.module-library-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.module-library-top-actions .nav-btn {
  min-width: 124px;
}
.module-library-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr);
  gap: 12px;
  margin: 18px 0 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%);
  border-radius: 8px;
  background: rgba(255,255,255,0.52);
  box-shadow: none;
}
.module-library-toolbar .nav-select,
.module-library-toolbar .input,
.module-library-toolbar .nav-btn {
  min-width: 0;
}
.module-library-view-toggle {
  display: inline-flex;
  gap: 8px;
  justify-self: end;
  padding: 4px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.5);
}
.module-library-stack {
  display: grid;
  gap: 18px;
  min-height: 0;
}
.module-library-section {
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%);
  background: color-mix(in srgb, var(--paper2) 92%, white 8%);
  border-radius: 8px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.module-library-materials-section:not(.is-collapsed) {
  min-height: 360px;
}
.module-library-section-collapsible.is-collapsed {
  min-height: 0;
}
.module-library-section-collapsible.is-collapsed .module-library-section-actions {
  display: none;
}
.module-library-section-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%);
  background: rgba(255,255,255,0.2);
}
.module-library-collapse {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px 14px;
  cursor: pointer;
}
.module-library-section-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px 0;
}
.module-library-section-actions .nav-btn {
  min-width: 116px;
}
.module-library-collapse-chevron {
  width: 12px;
  height: 12px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  color: var(--muted);
  flex-shrink: 0;
  margin-right: 4px;
  transition: transform 0.18s ease;
}
.module-library-collapse-chevron.open {
  transform: rotate(225deg);
}
.module-library-section-label {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.module-library-section-copy {
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  color: var(--sumi);
  opacity: 0.82;
}
.module-library-list {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
  overflow: auto;
  scrollbar-width: none;
}
.module-library-list::-webkit-scrollbar { display: none; }
.module-library-list.hidden { display: none !important; }
.module-library-section-collapsible .module-library-list {
  overflow: visible;
}
.module-library-list.cards {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.module-library-list.cards .module-library-folder-browser,
.module-library-list.cards .module-library-active-folder {
  grid-column: 1 / -1;
}
.module-library-folder-browser {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.module-library-folder-tile {
  border: 1px solid color-mix(in srgb, var(--border2) 78%, var(--gold2) 22%);
  background: color-mix(in srgb, var(--paper) 88%, white 12%);
  color: var(--sumi);
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 72px;
  padding: 12px 14px;
  text-align: left;
  cursor: default;
  font: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.module-library-folder-tile:hover {
  transform: translateY(-1px);
  border-color: var(--gold2);
  background: color-mix(in srgb, var(--paper) 78%, white 22%);
  box-shadow: 0 10px 22px rgba(26,22,18,0.09);
}
.module-library-folder-tile.selected {
  border-color: color-mix(in srgb, var(--gold2) 74%, var(--sumi) 26%);
  background: color-mix(in srgb, var(--gold2) 20%, var(--paper) 80%);
  box-shadow: inset 3px 0 0 var(--gold2), 0 10px 22px rgba(26,22,18,0.08);
}
.module-library-folder-tile:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold2) 72%, var(--sumi) 28%);
  outline-offset: 2px;
}
.module-library-folder-tile.readonly {
  cursor: default;
}
.module-library-folder-tile .module-library-folder-icon {
  width: 24px;
  height: 18px;
  flex-basis: 24px;
}
.module-library-folder-tile .module-library-folder-icon::before {
  width: 12px;
  height: 6px;
  top: -6px;
}
.module-library-folder-tile-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.module-library-folder-tile-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-library-folder-tile-meta {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.module-library-active-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 2px 0 6px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.module-library-active-folder span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-library-folder-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 2px 0 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
}
.module-library-folder-nav-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.module-library-folder-nav .mini-btn {
  min-width: 54px;
  height: 30px;
  padding: 0 8px;
}
.module-library-folder-nav .mini-btn:disabled,
.module-library-folder-tile .mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}
.module-library-folder-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.module-library-folder-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.module-library-list.cards .module-library-folder-group {
  grid-column: 1 / -1;
}
.module-library-folder-group + .module-library-folder-group {
  margin-top: 8px;
}
.module-library-folder-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 2px 3px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.module-library-folder-head span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-library-folder-icon {
  width: 13px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: 0.72;
  position: relative;
  flex: 0 0 auto;
}
.module-library-folder-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -4px;
  width: 7px;
  height: 4px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
}
.module-library-folder-tile .module-library-folder-icon {
  width: 24px;
  height: 18px;
  flex-basis: 24px;
}
.module-library-folder-tile .module-library-folder-icon::before {
  width: 12px;
  height: 6px;
  top: -6px;
}
.module-library-folder-count {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--border2) 82%, var(--gold2) 18%);
  text-align: center;
  background: rgba(255,255,255,0.35);
}
.module-library-folder-items {
  display: grid;
  gap: 8px;
}
.module-library-folder-items.cards {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.module-library-card {
  border: 1px solid color-mix(in srgb, var(--border2) 78%, var(--gold2) 22%);
  background: color-mix(in srgb, var(--paper) 92%, white 8%);
  padding: 14px 16px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  position: relative;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.module-library-card:hover {
  transform: translateY(-1px);
  border-color: var(--gold2);
  box-shadow: 0 10px 22px rgba(26,22,18,0.1);
}
.module-library-list:not(.cards) .module-library-card {
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  background: color-mix(in srgb, var(--paper) 82%, white 18%);
  border-radius: 3px;
}
.module-library-list.cards .module-library-card {
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: start;
  padding: 16px 18px;
}
.module-library-list:not(.cards) .module-library-card-head {
  align-items: center;
  grid-column: 2;
}
.module-library-list.cards .module-library-card-head,
.module-library-list.cards .module-library-card-notes,
.module-library-list.cards .module-library-card-actions {
  grid-column: 2;
}
.module-library-list:not(.cards) .module-library-card-meta {
  margin-top: 2px;
  gap: 6px;
}
.module-library-list:not(.cards) .module-library-card-notes {
  grid-column: 2 / -1;
  margin-top: -3px;
  font-size: 12px;
  opacity: 0.9;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.module-library-list:not(.cards) .module-library-card-actions {
  grid-column: 3;
}
.module-library-card-head {
  display: flex;
  gap: 10px;
  align-items: start;
}
.module-library-card-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--sumi);
  line-height: 1.1;
}
.module-library-list:not(.cards) .module-library-card-title {
  font-size: 16px;
}
.module-library-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.module-library-pill {
  border: 1px solid color-mix(in srgb, var(--border2) 80%, var(--gold2) 20%);
  padding: 3px 6px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255,255,255,0.42);
}
.module-library-card-notes {
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  color: var(--slate);
  line-height: 1.4;
  word-break: break-word;
}
.module-library-card-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.module-library-card-actions .mini-btn {
  min-width: 38px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.module-library-card-actions .module-delete-btn {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}
.module-library-empty {
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  color: var(--muted);
  padding: 8px 2px;
}
.module-library-module-accent {
  width: 8px;
  min-width: 8px;
  border-radius: 999px;
  align-self: stretch;
  grid-row: 1 / -1;
  grid-column: 1;
}
body.theme-dark .module-library-content{
  background: #1b1c1f;
  border-color: rgba(255,255,255,0.1);
}
body.theme-dark .module-library-toolbar{
  background: #232428;
  border-color: rgba(255,255,255,0.1);
  box-shadow: none;
}
body.theme-dark .module-library-collapse{
  color: #f1ede4;
  background: transparent;
}
body.theme-dark .module-library-section{
  background: #232428;
  border-color: rgba(255,255,255,0.1);
}
body.theme-dark .module-library-section-head{
  border-color: rgba(255,255,255,0.1);
  background: #202126;
}
body.theme-dark .module-library-section-copy,
body.theme-dark .module-library-card-notes,

body.theme-dark .module-library-empty{
  color: rgba(241,237,228,0.74);
}
body.theme-dark .module-library-card{
  background: #26272c;
  border-color: rgba(255,255,255,0.1);
}
body.theme-dark .module-library-folder-tile{
  color: #f2ece0;
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.09);
}
body.theme-dark .module-library-folder-tile:hover{
  background: rgba(255,255,255,0.065);
  border-color: rgba(216,200,176,0.44);
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
}
body.theme-dark .module-library-folder-tile.selected{
  background: rgba(216,200,176,0.14);
  border-color: rgba(216,200,176,0.58);
  box-shadow: inset 3px 0 0 rgba(216,200,176,0.7), 0 14px 28px rgba(0,0,0,0.18);
}
body.theme-dark .module-library-folder-nav {
  border-color: rgba(255,255,255,0.08);
}
body.theme-dark .module-library-card:hover{
  border-color: rgba(216,200,176,0.44);
  background: rgba(255,255,255,0.065);
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
}
body.theme-dark .module-library-list:not(.cards) .module-library-card{
  background: rgba(255,255,255,0.04);
}
body.theme-dark .module-library-card-title{
  color: #f2ece0;
}
body.theme-dark .module-library-pill{
  border-color: rgba(255,255,255,0.1);
  color: #b8b1a4;
  background: rgba(255,255,255,0.04);
}
body.theme-dark .module-library-folder-count{
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}
@media (max-width: 760px) {
  .module-library-content {
    width: calc(100vw - 18px);
  }
  .module-library-toolbar {
    grid-template-columns: 1fr;
  }
  .module-library-view-toggle {
    justify-self: start;
  }
  .module-library-section {
    min-height: 0;
  }
  .module-library-section-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .module-library-folder-tile {
    align-items: flex-start;
  }
  .module-library-folder-nav {
    align-items: flex-start;
    flex-direction: column;
  }
  .module-library-folder-nav-left {
    flex-wrap: wrap;
  }
  .module-library-list {
    max-height: 42vh;
  }
  .module-library-list:not(.cards) .module-library-card {
    grid-template-columns: 10px minmax(0, 1fr);
  }
  .module-library-list:not(.cards) .module-library-card-head,
  .module-library-list:not(.cards) .module-library-card-notes,
  .module-library-list:not(.cards) .module-library-card-actions {
    grid-column: 2;
  }
  .module-library-card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .module-library-topline {
    flex-direction: column;
    align-items: stretch;
  }
}

.coursework-calc-wrap {
  padding: 12px 0 4px;
  border: 0;
  background: transparent;
}
.coursework-calc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}
.coursework-calc-title {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  line-height: 1.25;
}
.coursework-calc-summary {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 10px;
}
.coursework-component-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 92px 92px auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.coursework-component-row .field label { margin-bottom: 4px; }
.coursework-empty {
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 8px;
}
.coursework-component-delete { height: 32px; align-self: end; }
@media (max-width: 700px) {
  .coursework-component-row { grid-template-columns: 1fr; }
  .coursework-component-delete { width: fit-content; }
}
.topic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 8px 20px 8px 42px;
  transition: background 0.15s;
  cursor: grab;
}
.topic-row.selected {
  background: rgba(26,44,74,0.12);
  box-shadow: inset 3px 0 0 rgba(26,44,74,0.62);
}
.topic-row.subtopic-row {
  margin-left: 0;
  padding-left: 74px;
  border-left: 1px solid var(--border);
}
.topic-row:hover { background: rgba(26,22,18,0.03); }
.topic-row.reordering {
  opacity: 0.55;
  background: rgba(26,44,74,0.06);
}
.topic-row.drop-before,
.topic-row.drop-after,
.topic-row.drop-subtopic {
  position: relative;
}
.topic-row.drop-before::before,
.topic-row.drop-after::before,
.topic-row.drop-subtopic::before {
  content: "";
  position: absolute;
  left: 42px;
  right: 18px;
  top: 0;
  height: 2px;
  background: var(--gold2);
  border-radius: 999px;
  pointer-events: none;
}
.topic-row.drop-after::before {
  top: auto;
  bottom: 0;
}
.topic-row.drop-subtopic::before {
  left: 110px;
}
.topic-row.drop-subtopic {
  background: rgba(26,44,74,0.07);
}
.topic-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  cursor: pointer;
  min-width: 0;
}
.topic-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  margin-top: 0;
}
.subtopic-list {
  margin-left: 22px;
}
.topic-row input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border2);
  border-radius: 1px;
  background: transparent;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 0;
}
.topic-row input[type=checkbox]:checked {
  background: var(--vermillion);
  border-color: var(--vermillion);
}
.topic-row input[type=checkbox]:checked::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 1px;
  width: 4px;
  height: 7px;
  border: 1.5px solid #f5f0e8;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.topic-label {
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--sumi);
  line-height: 1.35;
  min-width: 0;
}
.topic-row.subtopic-row .topic-label {
  font-size: 15px;
}
.topic-label.done {
  color: var(--faint);
  text-decoration: line-through;
  text-decoration-color: var(--faint);
}
.subtopic-toggle,
.topic-edit-btn,
.topic-options-summary {
  border: 1px solid var(--border2);
  background: rgba(26,22,18,0.04);
  color: var(--slate);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 2px;
  text-transform: uppercase;
}
.subtopic-toggle {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  position: relative;
  color: var(--muted);
}
.subtopic-toggle.topic-disclosure {
  margin-top: 0;
}
.subtopic-toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(-50%, -62%) rotate(45deg);
  transition: transform 0.18s ease, color 0.18s ease;
}
.subtopic-toggle.collapsed::before {
  transform: translate(-62%, -50%) rotate(-45deg);
}
.subtopic-toggle:hover,
.topic-edit-btn:hover,
.topic-options-summary:hover,
.topic-options-menu[open] .topic-options-summary { color: var(--gold); border-color: var(--gold); }
.subtopic-list.hidden { display: none; }
.topic-options-menu {
  position: relative;
  margin-left: auto;
}
.topic-options-summary { list-style: none; }
.topic-options-summary::-webkit-details-marker {
  display: none;
}
.topic-options-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 170px;
  padding: 8px;
  border: 1px solid var(--border2);
  background: var(--paper3);
  box-shadow: var(--shadow2);
  display: grid;
  gap: 4px;
}
.topic-options-action {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: rgba(26,22,18,0.025);
  color: var(--sumi);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  padding: 8px 10px;
  cursor: pointer;
}
.topic-options-action:hover {
  border-color: var(--border2);
  background: rgba(26,22,18,0.06);
}
.topic-options-action.danger {
  color: var(--vermillion);
}
body.theme-dark .topic-options-summary{
  background: rgba(255,255,255,0.06);
  color: #ece7dc;
  border-color: rgba(255,255,255,0.1);
}
body.theme-dark .topic-row.selected{
  background: rgba(255,255,255,0.08);
  box-shadow: inset 3px 0 0 rgba(255,255,255,0.58);
}
body.theme-dark .topic-options-panel{
  background: #1c1c1f;
  border-color: rgba(255,255,255,0.1);
}
body.theme-dark .topic-options-action{
  background: rgba(255,255,255,0.04);
  color: #ece7dc;
}
body.theme-dark .topic-options-action:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
}
body.theme-dark .topic-options-action.danger{
  color: #f08b80;
}
.timeline-item.completing {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.topic-delete-btn {
  border: none;
  background: none;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  cursor: pointer;
  padding: 2px 4px;
  text-transform: uppercase;
}
.topic-delete-btn:hover { color: var(--vermillion); }

body.theme-dark .subtopic-toggle,
body.theme-dark .topic-edit-btn,
body.theme-dark .topic-options-summary{
  background: rgba(255,255,255,0.06);
  color: #ece7dc;
  border-color: rgba(255,255,255,0.1);
}
body.theme-dark .coursework-empty{
  color: #ece7dc;
}

.topic-drag-handle {
  border: none;
  background: none;
  color: var(--faint);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  cursor: grab;
  padding: 2px 0;
}
.topic-drag-handle:hover { color: var(--muted); }


/* UniTrack library source browser layout */
#module-library-modal.library-v8-active .module-library-content {
  width: min(1680px, calc(100vw - 20px));
  max-height: 94vh;
  min-height: min(880px, calc(100vh - 32px));
  overflow: hidden;
}
#module-library-modal.library-v8-active .module-library-toolbar {
  grid-template-columns: minmax(420px, 1fr);
  margin: 14px 0 16px;
}
#module-library-modal.library-v8-active #module-library-filter,
#module-library-modal.library-v8-active .module-library-view-toggle,
#module-library-modal.library-v8-active .module-library-section:has(#module-library-links),
#module-library-modal.library-v8-active .library-v8-hidden {
  display: none !important;
}
#module-library-modal.library-v8-active .module-library-topline {
  align-items: center;
}
#module-library-modal.library-v8-active .module-library-stack,
#module-library-modal.library-v8-active .library-v8-stack {
  display: block;
  min-height: 0;
}
#module-library-modal.library-v8-active .library-v8-main-section {
  min-height: min(680px, calc(100vh - 250px));
  height: min(680px, calc(100vh - 250px));
}
#module-library-modal.library-v8-active .library-v8-main-section .module-library-collapse {
  display: none;
}
#module-library-modal.library-v8-active .module-library-section-actions {
  display: none !important;
}
#module-library-modal.library-v8-active .module-library-list.library-v8-list {
  height: 100%;
  max-height: none;
  overflow: auto;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 14px;
}
.library-v8-source-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.library-v8-source {
  border: 1px solid color-mix(in srgb, var(--border2) 74%, var(--library-source-accent, var(--gold2)) 26%);
  background: color-mix(in srgb, var(--paper) 90%, white 10%);
  color: var(--sumi);
  display: grid;
  gap: 5px;
  min-height: 100px;
  padding: 16px 18px 16px 22px;
  text-align: left;
  position: relative;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.library-v8-source::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--library-source-accent, var(--gold2));
}
.library-v8-source:hover {
  transform: translateY(-1px);
  border-color: var(--library-source-accent, var(--gold2));
  box-shadow: 0 12px 24px rgba(26,22,18,0.10);
}
.library-v8-source.active {
  border-color: var(--library-source-accent, var(--gold2));
  background: color-mix(in srgb, var(--library-source-accent, var(--gold2)) 12%, var(--paper) 88%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--library-source-accent, var(--gold2)) 42%, transparent 58%);
}
.library-v8-source-code {
  font-family: "DM Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.library-v8-source-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--sumi);
}
.library-v8-source-meta {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.library-v8-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-top: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
}
.library-v8-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.library-v8-crumb,
.library-v8-crumb-muted,
.library-v8-crumb-sep {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.library-v8-crumb {
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 6px;
  cursor: pointer;
}
.library-v8-crumb.active {
  color: var(--sumi);
}
.library-v8-crumb:hover {
  border-color: var(--border2);
}
.library-v8-action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.library-v8-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}
.library-v8-folder {
  border: 1px solid color-mix(in srgb, var(--border2) 78%, var(--library-source-accent, var(--gold2)) 22%);
  background: color-mix(in srgb, var(--paper) 90%, white 10%);
  color: var(--sumi);
  min-height: 98px;
  padding: 16px 18px 16px 22px;
  display: flex;
  gap: 14px;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.library-v8-folder::before,
.library-v8-item .module-library-module-accent {
  background: var(--library-source-accent, var(--gold2)) !important;
}
.library-v8-folder::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
}
.library-v8-folder:hover,
.library-v8-item:hover {
  transform: translateY(-1px);
  border-color: var(--library-source-accent, var(--gold2));
  box-shadow: 0 12px 24px rgba(26,22,18,0.10);
}
.library-v8-folder.selected {
  border-color: var(--library-source-accent, var(--gold2));
  background: color-mix(in srgb, var(--library-source-accent, var(--gold2)) 14%, var(--paper) 86%);
}
.library-v8-folder-icon {
  width: 30px;
  height: 22px;
  border: 1.6px solid currentColor;
  border-radius: 3px;
  color: var(--library-source-accent, var(--gold2));
  position: relative;
  flex: 0 0 auto;
}
.library-v8-folder-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: -8px;
  width: 15px;
  height: 8px;
  border: 1.6px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}
.library-v8-folder-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.library-v8-folder-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--sumi);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-v8-folder-meta {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-v8-item {
  border-color: color-mix(in srgb, var(--border2) 78%, var(--library-source-accent, var(--gold2)) 22%);
}
.library-v8-destination-modal,
.library-v5-destination-modal {
  z-index: 10040;
}
.library-v8-destination-card {
  width: min(980px, calc(100vw - 28px));
}
.library-v8-destination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
#link-form-modal.library-v5-link-form-front,
#link-form-modal.library-v8-link-form-front {
  z-index: 10050;
}
body.theme-dark #module-library-modal.library-v8-active .module-library-content,
body.theme-dark .library-v8-source,
body.theme-dark .library-v8-folder {
  background: #171719;
  color: #f2ece0;
}
body.theme-dark .library-v8-source.active,
body.theme-dark .library-v8-folder.selected {
  background: color-mix(in srgb, var(--library-source-accent, #d8c8b0) 18%, #171719 82%);
}
body.theme-dark .library-v8-source-name,
body.theme-dark .library-v8-folder-name {
  color: #f2ece0;
}
@media (max-width: 760px) {
  #module-library-modal.library-v8-active .module-library-content {
    width: calc(100vw - 12px);
    min-height: calc(100vh - 12px);
    max-height: calc(100vh - 12px);
  }
  .library-v8-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .library-v8-source-rail,
  .library-v8-grid {
    grid-template-columns: 1fr;
  }
}

/* UniTrack Library V9 interaction cleanup */
#module-library-modal .module-library-content,
#module-library-modal .module-library-list,
#module-library-modal .library-v5-grid,
#module-library-modal .library-v5-folder,
#module-library-modal .library-v5-item,
#module-library-modal .library-v9-item,
#module-library-modal .library-v5-folder-title,
#module-library-modal .module-library-card-title,
#module-library-modal .module-library-card-meta,
#module-library-modal .module-library-card-notes {
  -webkit-user-select: none;
  user-select: none;
}
#module-library-modal .library-v5-folder,
#module-library-modal .library-v9-item {
  cursor: pointer;
}
#module-library-modal .library-v9-item[draggable="true"] { cursor: grab; }
#module-library-modal .library-v9-item[draggable="true"]:active { cursor: grabbing; }
#module-library-modal .library-v9-item.selected,
#module-library-modal .library-v5-folder.selected {
  border-color: var(--library-source-accent, var(--gold2)) !important;
  background: color-mix(in srgb, var(--library-source-accent, var(--gold2)) 14%, var(--paper) 86%) !important;
  box-shadow: inset 5px 0 0 var(--library-source-accent, var(--gold2)), 0 12px 24px rgba(26,22,18,0.10);
}
#module-library-modal .library-v9-drop-target,
#module-library-modal .library-v5-list.library-v9-drop-target {
  outline: 2px dashed var(--library-source-accent, var(--gold2));
  outline-offset: 4px;
  background: color-mix(in srgb, var(--library-source-accent, var(--gold2)) 10%, transparent 90%);
}
#module-library-modal .library-v5-folder.library-v9-drop-target {
  transform: translateY(-2px);
  border-color: var(--library-source-accent, var(--gold2)) !important;
  box-shadow: inset 5px 0 0 var(--library-source-accent, var(--gold2)), 0 16px 30px rgba(26,22,18,0.14);
}
#module-library-modal .module-library-card-actions .module-delete-btn,
#module-library-modal .module-library-move-select { display: none !important; }
body.theme-dark #module-library-modal .library-v9-item.selected,
body.theme-dark #module-library-modal .library-v5-folder.selected {
  background: color-mix(in srgb, var(--library-source-accent, #d8c8b0) 18%, #171719 82%) !important;
  box-shadow: inset 5px 0 0 var(--library-source-accent, #d8c8b0), 0 14px 28px rgba(0,0,0,0.20);
}


/* UniTrack unified library view */
#module-library-modal.library-v10-active,
#module-library-modal .library-v10-active {
  user-select: none;
}

.module-library-content {
  width: min(1520px, calc(100vw - 24px)) !important;
  max-height: 94vh !important;
  border-radius: 0;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--gold2) 18%);
  background: color-mix(in srgb, var(--paper) 92%, white 8%);
  box-shadow: 0 20px 48px rgba(26, 22, 18, 0.12);
}

.library-v10-hidden {
  display: none !important;
}

.library-v10-unified-section {
  min-height: min(72vh, 760px) !important;
}

.library-v10-source-browser {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
}

.library-v10-source-browser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.library-v10-source-browser-title {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.library-v10-source-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.library-v10-source-rail-quick {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.library-v10-source-rail-quick .library-v10-source-shell:first-child {
  order: 1;
}

.library-v10-source-rail-all {
  margin-top: 6px;
}

.library-v10-source-shell {
  position: relative;
}

.library-v10-source-shell-compact {
  position: relative;
}

.library-v10-source-browse-tile {
  appearance: none;
  width: 100%;
  min-height: 78px;
  border: 1px solid color-mix(in srgb, var(--border2) 80%, var(--gold2) 20%);
  background: color-mix(in srgb, var(--paper) 94%, white 6%);
  color: var(--sumi);
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  order: 2;
  grid-column: span 2;
}

.library-v10-source-browse-tile:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--gold2) 76%, var(--sumi) 24%);
  box-shadow: 0 10px 20px rgba(26, 22, 18, 0.10);
}

.library-v10-source-browse-tile.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold2) 22%, var(--paper) 78%) 0%, color-mix(in srgb, white 18%, var(--paper) 82%) 100%);
  border-color: color-mix(in srgb, var(--gold2) 78%, var(--sumi) 22%);
  box-shadow: inset 4px 0 0 var(--gold2), 0 10px 20px rgba(26, 22, 18, 0.08);
}

.library-v10-source-browse-kicker {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.library-v10-source-browse-tile strong {
  font: inherit;
  font-family: var(--font-heading, inherit);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
  color: inherit;
}

.library-v10-source-browse-meta {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.library-v10-source-browser-panel {
  display: none;
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--border) 78%, transparent 22%);
}

.library-v10-source-browser-panel.open {
  display: grid;
  gap: 10px;
}

.library-v10-source-card {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--border2) 80%, var(--source-accent) 20%);
  background: color-mix(in srgb, var(--paper) 94%, white 6%);
  color: var(--sumi);
  min-height: 92px;
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  position: relative;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.library-v10-source-card-compact {
  min-height: 78px;
}

.library-v10-source-card:hover {
  transform: translateY(-1px);
  border-color: var(--source-accent);
  box-shadow: 0 10px 20px rgba(26, 22, 18, 0.10);
}

.library-v10-source-card.active {
  background: color-mix(in srgb, var(--source-accent) 10%, var(--paper) 90%);
  border-color: color-mix(in srgb, var(--source-accent) 76%, var(--sumi) 24%);
  box-shadow: inset 4px 0 0 var(--source-accent), 0 10px 20px rgba(26, 22, 18, 0.08);
}

.library-v10-source-accent {
  width: 8px;
  align-self: stretch;
  background: var(--source-accent);
  border-radius: 999px;
}

.library-v10-source-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.library-v10-source-code {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-v10-source-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--sumi);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-v10-source-meta {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.library-v10-source-pin,
.library-v10-source-toggle {
  border-radius: 0;
}

.library-v10-source-pin {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  z-index: 2;
}

.library-v10-source-pin span {
  display: block;
  transform: translateY(-1px);
}

.library-v10-source-pin.active {
  background: color-mix(in srgb, var(--source-accent) 12%, var(--paper) 88%);
  color: var(--sumi);
}

.library-v10-source-menu {
  position: absolute;
  top: 36px;
  right: 8px;
  min-width: 170px;
  display: none;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
  background: color-mix(in srgb, var(--paper) 96%, white 4%);
  box-shadow: 0 12px 24px rgba(26, 22, 18, 0.12);
  z-index: 4;
}

.library-v10-source-menu.open {
  display: grid;
}

.library-v10-source-menu-item {
  border: 0;
  background: transparent;
  color: var(--sumi);
  text-align: left;
  padding: 8px 10px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.library-v10-source-menu-item:hover {
  background: color-mix(in srgb, var(--source-accent) 10%, var(--paper) 90%);
}

.library-v10-actions {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.library-v10-toolbar-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.library-v10-view-toggle {
  display: inline-flex;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
  background: color-mix(in srgb, var(--paper) 94%, white 6%);
}

.library-v10-view-btn {
  min-width: 62px;
  border: 0;
  border-radius: 0;
}

.library-v10-view-btn.active {
  background: color-mix(in srgb, var(--gold2) 12%, var(--paper) 88%);
  color: var(--sumi);
}

.library-v10-search-wrap {
  position: relative;
  flex: 1 1 360px;
  min-width: 240px;
}

.library-v10-search-wrap .input {
  padding-right: 42px;
}

.library-v10-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 0;
  line-height: 1;
}

.library-v10-sort-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.library-v10-colour-control {
  display: inline-grid;
  grid-template-columns: auto auto minmax(56px, 72px);
  gap: 8px;
  align-items: center;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.library-v10-colour-label {
  white-space: nowrap;
}

.library-v10-colour-input {
  width: 38px;
  height: 28px;
}

.library-v10-colour-preview {
  height: 14px;
}

.library-v10-sort-select {
  min-width: 180px;
}

.library-v10-nav-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.library-v10-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 420px;
}

.library-v10-nav-buttons {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

.library-v10-arrow-btn {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 0;
  font-size: 16px;
  line-height: 1;
}

.library-v10-breadcrumbs {
  min-height: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
  border-radius: 0;
  background: rgba(255,255,255,0.36);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  flex: 1 1 auto;
  min-width: 0;
}

.library-v10-crumb {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
}

.library-v10-crumb:hover {
  color: var(--gold);
}

.library-v10-crumb.active {
  color: var(--sumi);
  font-weight: 700;
}

.library-v10-sep {
  opacity: 0.45;
}

.library-v10-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
}

.library-v10-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.library-v10-details {
  display: grid;
  gap: 0;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
  background: color-mix(in srgb, var(--paper) 96%, white 4%);
}

.library-v10-details-header,
.library-v10-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) minmax(90px, 1fr) minmax(90px, 0.9fr) minmax(120px, 1.1fr) minmax(150px, 1.1fr) minmax(80px, 0.8fr) minmax(120px, 0.9fr);
  gap: 12px;
  align-items: center;
}

.library-v10-details-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
  background: color-mix(in srgb, var(--paper) 90%, white 10%);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.library-v10-details-body {
  display: grid;
}

.library-v10-row {
  padding: 12px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 76%, transparent 24%);
  cursor: pointer;
  background: color-mix(in srgb, var(--paper) 96%, white 4%);
}

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

.library-v10-row:hover {
  background: color-mix(in srgb, var(--gold2) 6%, var(--paper) 94%);
}

.library-v10-col {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-v10-col-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: inherit;
}

.library-v10-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-v10-row-file-accent {
  width: 10px;
  height: 10px;
  background: var(--source-accent);
  flex: 0 0 auto;
}

.library-v10-col-date,
.library-v10-col-count {
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.library-v10-col-actions {
  text-align: right;
}

.library-v10-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.library-v10-item-action {
  min-width: 0;
  padding: 4px 8px;
  border-radius: 0;
}

.module-library-card-head .library-v10-item-actions {
  margin-left: 12px;
}

.library-v10-column-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0;
  cursor: pointer;
}

.library-v10-column-btn.active,
.library-v10-column-btn:hover {
  color: currentColor;
}

.library-v10-list {
  max-height: min(68vh, 720px);
  overflow: auto;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
  border-radius: 0;
  background: color-mix(in srgb, var(--paper) 94%, white 6%);
}

.library-v10-folder,
.library-v10-item {
  --source-accent: var(--gold2);
  user-select: none;
  -webkit-user-select: none;
}

.library-v10-folder {
  cursor: pointer !important;
  border-color: color-mix(in srgb, var(--border2) 80%, var(--source-accent) 20%) !important;
  border-radius: 0;
  background: color-mix(in srgb, var(--paper) 94%, white 6%);
  box-shadow: 0 6px 14px rgba(26, 22, 18, 0.06);
}

.library-v10-folder:hover {
  border-color: var(--source-accent) !important;
  box-shadow: 0 10px 18px rgba(26, 22, 18, 0.10);
}

.library-v10-folder .module-library-folder-icon {
  color: var(--source-accent);
}

.library-v10-item {
  cursor: pointer !important;
  grid-template-columns: 8px minmax(0, 1fr) !important;
  border-color: color-mix(in srgb, var(--border2) 80%, var(--source-accent) 20%) !important;
  border-radius: 0;
  background: color-mix(in srgb, var(--paper) 94%, white 6%);
  box-shadow: 0 6px 14px rgba(26, 22, 18, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.library-v10-item .module-library-module-accent {
  background: var(--source-accent) !important;
}

.library-v10-item .module-library-card-actions,
.library-v10-item .library-v5-move-row {
  display: none !important;
}

.library-v10-item .module-library-card-meta {
  row-gap: 6px;
}

.library-v10-selected {
  border-color: var(--source-accent) !important;
  background: color-mix(in srgb, var(--source-accent) 12%, var(--paper) 88%) !important;
  box-shadow: inset 4px 0 0 var(--source-accent), 0 10px 18px rgba(26, 22, 18, 0.10) !important;
}

.library-v10-drop-target {
  outline: 2px solid var(--source-accent);
  outline-offset: 3px;
  background: color-mix(in srgb, var(--source-accent) 22%, var(--paper) 78%) !important;
}

.library-v10-dragging {
  opacity: 0.58;
  transform: scale(0.985);
  box-shadow: 0 16px 26px rgba(26, 22, 18, 0.16) !important;
}

body.library-v10-drag-active .library-v10-folder,
body.library-v10-drag-active .library-v10-crumb {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.library-v10-crumb-drop-target {
  color: var(--sumi) !important;
  background: color-mix(in srgb, var(--gold2) 14%, var(--paper) 86%) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold2) 42%, transparent 58%), 0 8px 18px rgba(26, 22, 18, 0.08);
  transform: translateY(-1px);
}

.library-v10-results-label {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

#link-form-modal {
  z-index: 9999 !important;
}

#link-form-modal.library-v10-link-modal {
  z-index: 10050 !important;
}

body.theme-dark .library-v10-source-card,
body.theme-dark .library-v10-folder,
body.theme-dark .library-v10-item,
body.theme-dark .library-v10-details,
body.theme-dark .library-v10-row,
body.theme-dark .library-v10-source-menu,
body.theme-dark .library-v10-source-browse-tile {
  background: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: #f2ece0;
}

body.theme-dark .library-v10-col-name,
body.theme-dark .library-v10-row-name {
  color: #f2ece0 !important;
}

body.theme-dark .library-v10-details-header,
body.theme-dark .library-v10-details-header .library-v10-col,
body.theme-dark .library-v10-column-btn {
  color: #b8b1a4;
}

body.theme-dark .library-v10-column-btn.active,
body.theme-dark .library-v10-column-btn:hover {
  color: #f2ece0;
}

body.theme-dark .library-v10-source-card.active,
body.theme-dark .library-v10-selected {
  background: color-mix(in srgb, var(--source-accent) 18%, #161618 82%) !important;
  border-color: var(--source-accent) !important;
}

body.theme-dark .library-v10-source-code,
body.theme-dark .library-v10-crumb.active {
  color: #f2ece0;
}

body.theme-dark .library-v10-source-name {
  color: #f2ece0;
}

body.theme-dark .library-v10-source-browse-tile,
body.theme-dark .library-v10-source-browse-tile.active {
  background: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: #f2ece0;
}

body.theme-dark .library-v10-source-browse-tile:hover {
  background: rgba(255, 255, 255, 0.065) !important;
  border-color: rgba(216, 200, 176, 0.44) !important;
}

body.theme-dark .library-v10-source-browse-kicker,
body.theme-dark .library-v10-source-browse-meta {
  color: #b8b1a4;
}

body.theme-dark .library-v10-source-browse-tile strong {
  color: #f2ece0;
}

body.theme-dark .library-v10-breadcrumbs {
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.08);
}

body.theme-dark .library-v10-details-header {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  color: #b8b1a4;
}

.module-library-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.module-library-crumb {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 3px;
}

.module-library-crumb:hover {
  color: var(--sumi);
  text-decoration: underline;
}

.module-library-crumb.active {
  color: var(--sumi);
  font-weight: 700;
}

.module-library-crumb-sep {
  color: var(--muted);
  opacity: 0.55;
}

@media (max-width: 760px) {
  .library-v10-source-rail {
    grid-template-columns: 1fr;
  }
  .library-v10-source-shell {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .library-v10-source-browse-tile {
    grid-column: span 1;
  }
  .library-v10-action-buttons {
    justify-content: flex-start;
  }
  .library-v10-grid {
    grid-template-columns: 1fr;
  }
  .library-v10-toolbar-shell {
    align-items: stretch;
  }
  .library-v10-view-toggle,
  .library-v10-colour-control,
  .library-v10-sort-label {
    width: 100%;
  }
  .library-v10-sort-select {
    min-width: 0;
    width: 100%;
  }
  .library-v10-details {
    overflow-x: auto;
  }
  .library-v10-details-header,
  .library-v10-row {
    min-width: 980px;
  }
  .library-v10-list {
    max-height: 58vh;
  }
}



/* Clickable library breadcrumbs */
.module-library-breadcrumbs,
.library-v10-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  position: relative;
  z-index: 6;
}

.module-library-crumb,
.library-v10-crumb {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 4px 6px;
  user-select: none;
  pointer-events: auto;
  position: relative;
  z-index: 7;
  border-radius: 0;
}

.module-library-crumb:hover,
.library-v10-crumb:hover {
  color: var(--sumi);
  background: rgba(255,255,255,0.38);
  text-decoration: none;
}

.module-library-crumb.active,
.library-v10-crumb.active {
  color: var(--sumi);
  font-weight: 700;
  background: color-mix(in srgb, var(--gold2) 10%, transparent 90%);
}

.module-library-crumb-sep,
.library-v10-sep {
  color: var(--muted);
  opacity: 0.55;
  user-select: none;
}

body.theme-dark .module-library-crumb:hover,
body.theme-dark .library-v10-crumb:hover,
body.theme-dark .module-library-crumb.active,
body.theme-dark .library-v10-crumb.active {
  color: #f2ece0;
}

/* 04-preferences-account.css */
.prefs-panel {
  position: fixed;
  top: 118px;
  right: 14px;
  left: auto;
  z-index: 1200;
  width: min(380px, calc(100vw - 28px));
  max-height: min(72vh, 680px);
  overflow: auto;
  background: rgba(250,247,242,0.98);
  border: 1px solid rgba(26,22,18,0.16);
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(14,12,10,0.18);
  padding: 14px;
  scrollbar-width: none;
}
.prefs-panel::-webkit-scrollbar { display: none; }
.prefs-panel.hidden { display: none; }
.prefs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  padding: 2px 2px 4px;
}
.prefs-title {
  font-family: "Shippori Mincho", serif;
  font-size: 24px;
  line-height: 1.05;
  color: var(--ink);
}
.prefs-subtitle {
  font-family: "DM Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}
.prefs-close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  background: transparent;
  color: var(--muted);
  border-color: rgba(26,22,18,0.2);
  box-shadow: none;
}
.prefs-close:hover {
  background: rgba(26,22,18,0.05);
  color: var(--ink);
  transform: none;
}
.prefs-grid { display: grid; gap: 10px; }
.prefs-grid-compact { grid-template-columns: 1fr; gap: 10px; }
.prefs-grid .field { min-width: 0; }
.prefs-grid .field label { margin-bottom: 5px; }
.prefs-grid .nav-select,
.prefs-grid .input { width: 100%; min-width: 0; }
.prefs-input-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; align-items: center; }
.prefs-input-row .nav-btn { white-space: normal; min-width: 0; width: 100%; }
.prefs-span-2 { grid-column: 1 / -1; }
.prefs-inline-field {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: rgba(26,22,18,0.025);
}
.prefs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.prefs-actions .nav-btn { flex: 1 1 150px; }
body.theme-dark .prefs-panel {
  background: rgba(24,24,27,0.98);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 22px 54px rgba(0,0,0,0.42);
}
body.theme-dark .prefs-title,
body.theme-dark .prefs-panel .account-meta-value { color: #f3efe7; }
body.theme-dark .prefs-subtitle,
body.theme-dark .prefs-panel label,
body.theme-dark .prefs-panel .countdown-header-pref-copy { color: rgba(243,239,231,0.68); }
body.theme-dark .prefs-panel .nav-select,
body.theme-dark .prefs-panel .input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: #f3efe7;
}
body.theme-dark .prefs-close {
  background: transparent;
  border-color: rgba(255,255,255,0.16);
  color: rgba(243,239,231,0.68);
}
body.theme-dark .prefs-close:hover {
  background: rgba(255,255,255,0.07);
  color: #f3efe7;
}
body.theme-dark .prefs-inline-field { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); }


@media (max-width: 760px) {
  .prefs-panel {
    top: 76px !important;
    right: 8px !important;
    left: auto !important;
    width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 92px) !important;
    transform: none !important;
  }
}
.account-card {
  border: 1px solid var(--border);
  background: rgba(26,22,18,0.03);
  border-radius: 8px;
  padding: 14px;
}
.account-title {
  font-family: "Shippori Mincho", serif;
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 8px;
}
.account-copy {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 12px;
}
.account-meta {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.account-meta-row {
  display: grid;
  gap: 3px;
}
.account-meta-label {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.account-meta-value {
  color: var(--ink);
  word-break: break-word;
}
.account-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.account-section-title {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.account-actions {
  display: grid;
  gap: 8px;
}
body.theme-dark .prefs-inline-field,
body.theme-dark .account-card{
  background: rgba(255,255,255,0.03);
}
#auth-modal .account-card {
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.08);
}
#auth-modal .account-title,
#auth-modal .account-meta-value {
  color: #f3efe7;
}
#auth-modal .account-copy {
  color: rgba(243,239,231,0.74);
}
#auth-modal .account-meta-label,
#auth-modal .account-section-title {
  color: rgba(243,239,231,0.46);
}
#auth-modal .account-section {
  border-top-color: rgba(255,255,255,0.08);
}
body.theme-quiet #auth-modal .account-actions .nav-btn,
body.theme-quiet #auth-modal .account-actions .danger-btn {
  background: #efe8dc;
  color: #2a241c;
  border-color: rgba(42,36,28,0.18);
}
body.theme-quiet #auth-modal .account-actions .nav-btn:hover,
body.theme-quiet #auth-modal .account-actions .danger-btn:hover {
  background: #f7f1e8;
  color: #17120c;
  border-color: rgba(42,36,28,0.28);
}
.setup-linked-status {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(26,22,18,0.035);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.setup-linked-status strong {
  color: var(--ink);
  font-weight: 600;
}
.module-colour-picker {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}
.module-colour-input {
  width: 44px;
  height: 32px;
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: transparent;
  padding: 2px;
  cursor: pointer;
}
.module-colour-preview {
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.module-colour-meta {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.module-colour-copy {
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 10px;
}
.compact-marks-wrap {
  display: none;
}

.pref-toggle-pill {
  justify-self: end;
  align-self: center;
  min-width: 86px;
  height: 34px;
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: rgba(26,22,18,0.08);
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.pref-toggle-pill.is-on {
  background: var(--sumi);
  color: var(--paper3);
  border-color: var(--sumi);
}
.countdown-header-pref {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
}
.countdown-header-pref-copy {
  color: var(--muted);
  line-height: 1.35;
}
body.theme-dark .pref-toggle-pill {
  background: rgba(255,255,255,0.06);
  color: rgba(241,237,228,0.72);
  border-color: rgba(255,255,255,0.12);
}
body.theme-dark .pref-toggle-pill.is-on {
  background: #f1ede4;
  color: #101010;
  border-color: #f1ede4;
}

.bg-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.bg-thumb {
  width: 100%;
  height: 100%;
  display: block;
  border: 1px solid var(--border2);
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.bg-thumb:hover {
  transform: scale(1.08);
  border-color: var(--vermillion);
}

.bg-thumb.active {
  border: 2px solid var(--vermillion);
}

.bg-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-width: 0;
}


.bg-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border2);
  border-radius: 50%;
  background: var(--paper3);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
}

.bg-delete-btn:hover {
  background: var(--vermillion);
  color: white;
}

body.compact-ui .module-header {
  grid-template-columns: 12px minmax(170px, 1.2fr) minmax(120px, 0.7fr) auto auto 18px;
  gap: 10px;
  padding: 12px 14px;
}
body.compact-ui .topic-row,
body.compact-ui .notes-area-wrap,
body.compact-ui .formula-links-wrap,
body.compact-ui .relevant-links-wrap {
  padding-top: 8px;
  padding-bottom: 8px;
}
body.compact-ui .module {
  margin-bottom: 8px;
}
body.compact-ui .mod-name {
  font-size: 15px;
}
body.compact-ui .mod-kanji {
  font-size: 10px;
  margin-bottom: 4px;
}
body.compact-ui .module-header > .inputs-grid,
body.compact-ui .module-header > .final-col,
body.compact-ui .module-header > .module-actions {
  display: none;
}
body.compact-ui .module-header .bb-edit-btn,
body.compact-ui .module-header .formula-edit-btn {
  display: none;
}
body.compact-ui .module-header .bb-link,
body.compact-ui .module-header .formula-btn {
  padding: 5px 7px;
  min-width: 34px;
  text-align: center;
}
body.compact-ui .compact-marks-wrap {
  display: block;
}
body.compact-ui .prog-header {
  justify-content: flex-end;
  margin-bottom: 6px;
}
body.compact-ui .prog-done,
body.compact-ui .prog-of {
  display: none;
}
body.compact-ui .prog-pct {
  font-size: 10px;
}

/* 05-themes.css */
body.theme-quiet {
  --vermillion: #8b7b68;
  --vermillion2: #9b8c78;
  --gold: #8d7c68;
  --gold2: #a89784;
  --gold3: #c9bbab;
  --indigo: #8c8072;
}

body.theme-quiet .hero::before {
  filter: grayscale(100%) sepia(18%) brightness(0.5) contrast(0.95);
}
body.theme-quiet .hero::after {
  background:
    linear-gradient(to bottom, rgba(20,18,16,0.38), rgba(20,18,16,0.2)),
    linear-gradient(to right, rgba(20,18,16,0.16), rgba(20,18,16,0.08));
}
body.theme-quiet .module {
  background: #f7f2ea;
}
body.theme-quiet .washi-card {
  background: rgba(28, 24, 20, 0.46);
}
body.theme-quiet .prog-fill,
body.theme-quiet .progress-fill,
body.theme-quiet .module::before,
body.theme-quiet .mod-stripe,
body.theme-quiet .classification-badge {
  filter: grayscale(100%) sepia(14%);
}
body.theme-quiet .prog-fill,
body.theme-quiet .progress-fill {
  background: linear-gradient(90deg, #a69480, #c1b19f) !important;
}
body.theme-quiet .module::before,
body.theme-quiet .mod-stripe {
  background: #a69480 !important;
}
body.theme-quiet .c0,
body.theme-quiet .c1,
body.theme-quiet .c2,
body.theme-quiet .c3,
body.theme-quiet .c4,
body.theme-quiet .c5,
body.theme-quiet .c6 {
  background: #988775;
}
body.theme-quiet .f0,
body.theme-quiet .f1,
body.theme-quiet .f2,
body.theme-quiet .f3,
body.theme-quiet .f4,
body.theme-quiet .f5,
body.theme-quiet .f6 {
  background: linear-gradient(90deg, #a69480, #c1b19f);
}
body.theme-quiet .b0::before,
body.theme-quiet .b1::before,
body.theme-quiet .b2::before,
body.theme-quiet .b3::before,
body.theme-quiet .b4::before,
body.theme-quiet .b5::before,
body.theme-quiet .b6::before {
  background: #a69480;
}
body.theme-quiet .fc0,
body.theme-quiet .fc1,
body.theme-quiet .fc2,
body.theme-quiet .fc3,
body.theme-quiet .fc4,
body.theme-quiet .fc5,
body.theme-quiet .fc6 {
  color: #786857;
}

body.theme-dark {
  --ink: #ececec;
  --paper: #171717;
  --paper2: #202020;
  --paper3: #262626;
  --washi: #303030;
  --sumi: #0f0f0f;
  --slate: #d4d4d4;
  --muted: #a3a3a3;
  --faint: #737373;
  --border: rgba(255,255,255,0.1);
  --border2: rgba(255,255,255,0.18);
  --shadow: 0 8px 28px rgba(0,0,0,0.34);
  --shadow2: 0 4px 10px rgba(0,0,0,0.24);
}
body.theme-dark .nav-btn,
body.theme-dark .nav-select,
body.theme-dark .input {
  background: #2a2a2a;
}
body.theme-dark .nav-select,
body.theme-dark select.nav-select,
body.theme-dark .input,
body.theme-dark textarea {
  background: #202020;
  color: #f4efe7;
  border-color: rgba(255,255,255,0.16);
}
body.theme-dark .nav-select option,
body.theme-dark select.nav-select option {
  background: #202020;
  color: #f4efe7;
}
body.theme-dark .nav-select:focus,
body.theme-dark .input:focus,
body.theme-dark textarea:focus {
  border-color: rgba(245,240,232,0.38);
}

body.theme-dark .dashboard-chart-wrap {
  background: rgba(255,255,255,0.04);
}
body.theme-dark .term-summary-card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
}
body.theme-dark .term-summary-card.active,
body.theme-dark .term-summary-card:hover {
  border-color: rgba(245,240,232,0.42);
  box-shadow: 0 0 0 1px rgba(245,240,232,0.1);
}
body.theme-dark .topic-label {
  color: #e7e7e7;
}
body.theme-dark .topic-row:hover {
  background: rgba(255,255,255,0.04);
}
body.theme-dark .topic-row.reordering {
  background: rgba(255,255,255,0.08);
}
body.theme-dark .prog-done,
body.theme-dark .final-mark,
body.theme-dark .mod-name,
body.theme-dark .dashboard-score,
body.theme-dark .term-summary-value,
body.theme-dark .dashboard-subtitle,
body.theme-dark .formula-chip a,
body.theme-dark .formula-empty {
  color: var(--ink);
}
body.theme-dark .prog-pct,
body.theme-dark .prog-of,
body.theme-dark .mod-kanji,
body.theme-dark .field label,
body.theme-dark .topic-tools-title,
body.theme-dark .term-summary-label,
body.theme-dark .term-summary-meta,
body.theme-dark .term-summary-empty,
body.theme-dark .formula-links-title,
body.theme-dark .timeline-notes-label {
  color: #a3a3a3;
}
body.theme-dark .topic-entry-help {
  color: #a3a3a3;
}
body.theme-dark .setup-copy,
body.theme-dark .setup-choice-detail {
  color: #d4d4d4;
}
body.theme-dark .setup-choice {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}
body.theme-dark .setup-choice:hover {
  border-color: rgba(255,255,255,0.2);
}
body.theme-dark .setup-choice.active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.26);
}
body.theme-dark .setup-choice-title {
  color: #f3f3f3;
}
body.theme-dark .timeline-notes {
  background: rgba(255,255,255,0.08);
  color: #f3f3f3;
  border-color: rgba(255,255,255,0.16);
}
body.theme-dark .timeline-notes::placeholder {
  color: rgba(255,255,255,0.42);
}
body.theme-dark .timeline-badge.countdown {
  background: rgba(245,240,232,0.12);
  color: #fff;
  border-color: rgba(245,240,232,0.2);
}
body.theme-dark .timeline-badge.countdown.urgent {
  background: rgba(192,57,43,0.18);
  color: var(--vermillion2);
  border-color: rgba(192,57,43,0.34);
}
body.theme-dark .timeline-badge:not(.countdown) {
  background: rgba(255,255,255,0.08);
  color: #f3f3f3;
  border-color: rgba(255,255,255,0.16);
}
body.theme-dark .ticker-time {
  color: #fff;
}
body.theme-dark .ticker-time.urgent {
  color: var(--vermillion2);
}
body.theme-dark .bb-link {
  background: #000;
  border-color: #000;
}
body.theme-dark .bb-edit-btn:hover,
body.theme-dark .formula-btn:hover,
body.theme-dark .formula-edit-btn:hover,
body.theme-dark .mini-btn:hover,
body.theme-dark .nav-btn:hover {
  background: #343434;
}

/* 06-dashboard-timeline.css */
.dashboard-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(14,12,10,0.52);
  backdrop-filter: blur(10px) saturate(0.96);
  -webkit-backdrop-filter: blur(10px) saturate(0.96);

  animation: dashboardBackdropFade 0.22s ease;
}

.dashboard-content {
  animation: dashboardCardIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dashboardBackdropFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dashboardCardIn {
  from {
    opacity: 0;
    transform: scale(0.985);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

.dashboard-modal.hidden {
  display: none;
}

.dashboard-content {
  width: min(720px, calc(100vw - 32px));
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px;
  background: var(--paper3);
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 18px 42px rgba(14,12,10,0.16);
  position: relative;

  animation: dashboardCardIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
}
.dashboard-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%);
  border-radius: 999px;
  background: transparent;
  font-size: 21px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.dashboard-close:hover {
  color: var(--sumi);
  border-color: color-mix(in srgb, var(--border2) 70%, var(--ink) 30%);
  background: rgba(26,22,18,0.04);
  transform: translateY(-1px);
}

.dashboard-title {
  font-family: "Shippori Mincho", serif;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--ink);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.dashboard-card {
  background: var(--paper2);
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%);
  border-radius: 8px;
  padding: 18px;
}
.dashboard-card-title {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.dashboard-score {
  font-family: "Shippori Mincho", serif;
  font-size: 38px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}
.dashboard-score.predictor-big {
  font-size: clamp(58px, 7vw, 82px);
  line-height: 0.92;
}
.dashboard-subtitle {
  font-family: "Cormorant Garamond", serif;
  font-size: 17px;
  color: #5a4d40;
  line-height: 1.4;
}
.term-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.term-summary-card {
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 12px;
  background: rgba(255,255,255,0.42);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.term-summary-card.active,
.term-summary-card:hover {
  border-color: var(--vermillion);
  box-shadow: 0 0 0 1px rgba(192,57,43,0.12);
}
.term-summary-label {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.term-summary-value {
  font-family: "Shippori Mincho", serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 7px;
}
.term-summary-meta {
  display: grid;
  gap: 3px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
}
.term-summary-empty {
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-size: 17px;
}
.dashboard-wide { grid-column: 1 / -1; }
.dashboard-chart-wrap {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(26,22,18,0.1);
  border-radius: 8px;
  padding: 14px;
}
#dashboard-chart {
  width: 100%;
  max-width: 100%;
  height: 220px;
}

.classification-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 2px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  border: 1px solid;
  margin-top: 10px;
}
.cls-first { background: rgba(255,25,0,0.12); border-color: var(--vermillion); color: var(--vermillion); }
.cls-21 { background: rgba(212,160,23,0.14); border-color: var(--gold2); color: var(--gold); }
.cls-22 { background: rgba(26,44,74,0.08); border-color: rgba(26,44,74,0.25); color: var(--indigo); }
.cls-third { background: rgba(74,85,104,0.1); border-color: var(--border2); color: var(--slate); }

.timeline-content {
  width: min(860px, calc(100vw - 32px));
}

body.theme-dark .dashboard-content,
body.theme-charcoal .dashboard-content {
  background: #1b1c1f;
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 18px 44px rgba(0,0,0,0.36);
}

body.theme-dark .dashboard-title,
body.theme-dark .dashboard-score,
body.theme-dark .term-summary-value,
body.theme-dark .timeline-page-title,
body.theme-charcoal .dashboard-title,
body.theme-charcoal .dashboard-score,
body.theme-charcoal .term-summary-value,
body.theme-charcoal .timeline-page-title {
  color: #f4efe7;
}

body.theme-dark .dashboard-subtitle,
body.theme-dark .term-summary-empty,
body.theme-dark .timeline-subtitle,
body.theme-dark .dashboard-card-title,
body.theme-dark .term-summary-label,
body.theme-dark .term-summary-meta,
body.theme-charcoal .dashboard-subtitle,
body.theme-charcoal .term-summary-empty,
body.theme-charcoal .timeline-subtitle,
body.theme-charcoal .dashboard-card-title,
body.theme-charcoal .term-summary-label,
body.theme-charcoal .term-summary-meta {
  color: rgba(241,237,228,0.72);
}

body.theme-dark .dashboard-card,
body.theme-dark .term-summary-card,
body.theme-charcoal .dashboard-card,
body.theme-charcoal .term-summary-card {
  background: #232428;
  border-color: rgba(255,255,255,0.1);
}

body.theme-dark .dashboard-chart-wrap,
body.theme-charcoal .dashboard-chart-wrap {
  background: #202126;
  border-color: rgba(255,255,255,0.1);
}

body.theme-dark .dashboard-close,
body.theme-charcoal .dashboard-close {
  color: rgba(241,237,228,0.78);
  border-color: rgba(255,255,255,0.1);
}

body.theme-dark .dashboard-close:hover,
body.theme-charcoal .dashboard-close:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.18);
}

.timeline-head {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
  padding-right: 28px;
}

.timeline-subtitle {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.timeline-topline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.timeline-page-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  margin: 0;
}

.timeline-list {
  display: grid;
  gap: 18px;
}

/* 07-todo.css */
.todo-content {
  position: fixed;
  top: 128px;
  right: 28px;
  width: min(720px, calc(100vw - 32px));
  min-width: 360px;
  min-height: 320px;
  max-width: calc(100vw - 18px);
  max-height: calc(100vh - 18px);
  overflow: hidden;
  overscroll-behavior: contain;
  margin: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  padding: 0;
  background: var(--paper3);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(14,12,10,0.18);
}
#todo-modal {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overscroll-behavior: contain;
  pointer-events: none;
}
#todo-modal .todo-content {
  pointer-events: auto;
}
#todo-modal .timeline-head {
  margin-bottom: 0;
  padding: 18px 20px 16px;
  flex: 0 0 auto;
  cursor: move;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--paper3) 86%, white 14%);
}
#todo-modal .timeline-topline {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
}
#todo-modal .timeline-page-title {
  font-size: 28px;
  line-height: 1;
}
.todo-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.todo-header-actions .dashboard-close {
  position: static;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
}
#todo-lock-btn {
  height: 34px;
  min-width: 64px;
  border-radius: 6px;
}
.todo-drag-handle {
  cursor: inherit;
  width: fit-content;
}
.todo-content.is-locked .timeline-head,
.todo-content.is-locked .todo-drag-handle {
  cursor: default;
}
#todo-modal .todo-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, .7fr) minmax(104px, auto);
  gap: 10px;
  align-items: end;
  margin-top: 16px;
}
#todo-modal .todo-toolbar .field,
#todo-modal .todo-toolbar .input,
#todo-modal .todo-toolbar .nav-select {
  min-width: 0;
}
#todo-modal .todo-add-btn {
  align-self: end;
  min-width: 104px;
  height: 42px;
  border-radius: 6px;
  background: var(--sumi);
  border-color: var(--sumi);
  color: var(--paper3);
}
.todo-view-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(26,22,18,0.018);
}
.todo-summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(26,22,18,0.03);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
#todo-modal .todo-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px 20px 18px;
}
#todo-modal .todo-list,
#todo-modal .todo-inline-note {
  overscroll-behavior: contain;
}
.todo-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(26,22,18,0.035);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.todo-expanded-card,
.todo-task-row {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--paper) 74%, white 26%);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, opacity .16s ease;
}
.todo-expanded-card:hover,
.todo-task-row:hover {
  background: rgba(26,22,18,0.04);
  border-color: var(--border2);
}
.todo-expanded-card {
  display: grid;
  grid-template-columns: 22px minmax(0,1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
}
.todo-expanded-main {
  min-width: 0;
}
.todo-expanded-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.todo-expanded-title {
  color: var(--sumi);
  font-family: "Shippori Mincho", serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.15;
}
.todo-task-row {
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
}
.todo-row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.todo-row-title {
  color: var(--sumi);
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.todo-row-meta {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.todo-note-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(26,22,18,0.018);
  margin-top: 8px;
  cursor: default;
}
.todo-note-details summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 9px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.todo-note-details summary::-webkit-details-marker {
  display: none;
}
.todo-inline-note {
  width: calc(100% - 18px);
  margin: 0 9px 9px;
  min-height: 72px;
  height: 72px;
  resize: none;
  overflow: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
  font-size: 15px;
  line-height: 1.45;
  background: var(--paper2);
  border-radius: 8px;
}
.todo-inline-note::-webkit-scrollbar { display: none; }
.todo-check-btn {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border2);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  align-self: center;
  position: relative;
  flex-shrink: 0;
}
.todo-check-btn:hover {
  border-color: var(--gold2);
  background: rgba(212,160,23,0.08);
}
.todo-delete-btn {
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.todo-delete-btn:hover {
  color: var(--vermillion);
  border-color: color-mix(in srgb, var(--vermillion) 32%, transparent 68%);
  background: rgba(192,57,43,0.06);
}
.todo-expanded-card.is-done,
.todo-task-row.is-done {
  opacity: .62;
}
.todo-expanded-card.is-done .todo-expanded-title,
.todo-task-row.is-done .todo-row-title {
  text-decoration: line-through;
  color: var(--muted);
}
.todo-expanded-card.is-done .todo-check-btn,
.todo-task-row.is-done .todo-check-btn {
  background: var(--gold2);
  border-color: var(--gold2);
  box-shadow: none;
}
.todo-expanded-card.is-done .todo-check-btn::after,
.todo-task-row.is-done .todo-check-btn::after {
  content: none;
}
#todo-modal.todo-compact-mode .todo-toolbar {
  grid-template-columns: minmax(170px, 1.35fr) minmax(130px, .65fr) minmax(96px, auto);
  gap: 8px;
  margin-top: 12px;
}
#todo-modal.todo-compact-mode .todo-view-row {
  padding-top: 10px;
  padding-bottom: 10px;
}
#todo-modal.todo-compact-mode .todo-list {
  gap: 8px;
  scrollbar-width: none;
  overflow: auto;
  padding-bottom: 18px;
}
#todo-modal.todo-compact-mode .todo-list::-webkit-scrollbar { display: none; }
#todo-modal.todo-compact-mode .todo-task-row {
  min-height: 48px;
  padding: 9px 11px;
  align-items: center;
}
#todo-modal.todo-compact-mode .todo-row-title {
  font-size: 14px;
  line-height: 1.28;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
#todo-modal.todo-compact-mode .todo-delete-btn {
  height: 28px;
  padding: 0 8px;
  font-size: 8px;
}
.todo-resize-handle {
  position: absolute;
  z-index: 8;
  background: transparent;
}
.todo-resize-handle[data-edge="left"],
.todo-resize-handle[data-edge="right"] {
  top: 14px;
  bottom: 14px;
  width: 12px;
  cursor: ew-resize;
}
.todo-resize-handle[data-edge="left"] { left: -6px; }
.todo-resize-handle[data-edge="right"] { right: -6px; }
.todo-resize-handle[data-edge="top"],
.todo-resize-handle[data-edge="bottom"] {
  left: 14px;
  right: 14px;
  height: 12px;
  cursor: ns-resize;
}
.todo-resize-handle[data-edge="top"] { top: -6px; }
.todo-resize-handle[data-edge="bottom"] { bottom: -6px; }
.todo-resize-handle[data-edge="top-left"],
.todo-resize-handle[data-edge="top-right"],
.todo-resize-handle[data-edge="bottom-left"],
.todo-resize-handle[data-edge="bottom-right"] {
  width: 18px;
  height: 18px;
}
.todo-resize-handle[data-edge="top-left"] { top: -7px; left: -7px; cursor: nwse-resize; }
.todo-resize-handle[data-edge="top-right"] { top: -7px; right: -7px; cursor: nesw-resize; }
.todo-resize-handle[data-edge="bottom-left"] { bottom: -7px; left: -7px; cursor: nesw-resize; }
.todo-resize-handle[data-edge="bottom-right"] { bottom: -7px; right: -7px; cursor: nwse-resize; }
body.theme-dark #todo-modal .todo-content {
  background: #1c1c1f;
  box-shadow: 0 18px 54px rgba(0,0,0,0.34);
}
body.theme-dark .todo-expanded-card,
body.theme-dark .todo-task-row,
body.theme-dark .todo-note-details {
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.1);
}
body.theme-dark .todo-inline-note {
  background: #202020;
  color: #f4efe7;
  border-color: rgba(255,255,255,0.16);
}
body.theme-dark .todo-expanded-card:hover,
body.theme-dark .todo-task-row:hover {
  background: rgba(255,255,255,0.065);
  border-color: rgba(255,255,255,0.16);
}
body.theme-dark .todo-expanded-title,
body.theme-dark .todo-row-title {
  color: #f1ede4;
}
body.theme-dark .todo-badge,
body.theme-dark .todo-summary {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}
body.theme-dark .todo-expanded-card.is-done .timeline-dot.complete-toggle,
body.theme-dark .todo-task-row.is-done .timeline-dot.complete-toggle {
  box-shadow: inset 0 0 0 3px #1c1c1f;
}
body.theme-dark .todo-check-btn {
  border-color: rgba(255,255,255,0.2);
}
body.theme-dark .todo-expanded-card.is-done .todo-check-btn,
body.theme-dark .todo-task-row.is-done .todo-check-btn {
  box-shadow: none;
}
body.theme-dark #todo-modal .todo-toolbar .input,
body.theme-dark #todo-modal .todo-toolbar .nav-select {
  background: #202024;
  border-color: rgba(255,255,255,0.16);
  color: #f4efe7;
}
body.theme-dark #todo-modal .todo-toolbar .input::placeholder {
  color: rgba(244,239,231,0.48);
}
body.theme-dark #todo-modal .todo-toolbar .field label {
  color: rgba(244,239,231,0.68);
}
@media (max-width: 760px) {
  #todo-modal.todo-mobile .todo-resize-handle {
    display: none;
  }
  #todo-modal.todo-mobile #todo-lock-btn {
    display: none;
  }
  #todo-modal .todo-content {
    width: calc(100vw - 16px) !important;
    left: 8px !important;
    right: auto !important;
    top: 76px !important;
    min-width: 0;
    max-height: calc(100vh - 92px);
  }
  #todo-modal .todo-toolbar {
    grid-template-columns: 1fr;
  }
  #todo-modal .timeline-topline {
    grid-template-columns: 1fr;
  }
  .todo-header-actions {
    justify-content: flex-start;
  }
  .todo-task-row {
    grid-template-columns: 22px minmax(0,1fr);
  }
  .todo-task-row .todo-delete-btn,
  .todo-expanded-head .todo-delete-btn {
    grid-column: 2;
    justify-self: start;
  }
}
@container (max-width: 520px) {
  #todo-modal .todo-toolbar,
  #todo-modal.todo-compact-mode .todo-toolbar {
    grid-template-columns: 1fr;
  }
  #todo-modal .todo-add-btn {
    width: 100%;
  }
  .todo-view-row {
    align-items: stretch;
    flex-direction: column;
  }
  .todo-summary,
  #todo-view-toggle {
    width: 100%;
    justify-content: center;
  }
  .todo-task-row {
    grid-template-columns: 22px minmax(0,1fr) 48px;
    gap: 8px;
  }
  .todo-task-row .todo-delete-btn {
    grid-column: auto;
    justify-self: end;
    width: 48px;
    padding: 0;
    overflow: hidden;
  }
  .todo-expanded-head {
    grid-template-columns: 1fr;
  }
  .todo-expanded-head .todo-delete-btn {
    justify-self: start;
  }
}
body.suppress-topic-refresh { scroll-behavior: auto !important; }
body.suppress-topic-refresh .module,
body.suppress-topic-refresh .topic-list,
body.suppress-topic-refresh .topic-row,
body.suppress-topic-refresh .subtopic-list,
body.suppress-topic-refresh #modules {
  transition: none !important;
  animation: none !important;
}
@media(max-width:700px){ .deadline-title-module-row, .deadline-card-lower, .deadline-choice-grid { grid-template-columns:1fr; } .deadline-priority-row { grid-template-columns: repeat(2,minmax(0,1fr)); } .countdown-header-pref { grid-template-columns: 1fr; } }


body.theme-dark #todo-modal .todo-add-btn {
  background: rgba(216, 200, 176, 0.16);
  border-color: rgba(216, 200, 176, 0.42);
  color: #f2ece0;
}

body.theme-dark #todo-modal .todo-add-btn:hover {
  background: rgba(216, 200, 176, 0.24);
  border-color: rgba(216, 200, 176, 0.58);
  color: #ffffff;
}

/* 08-setup-deadlines.css */
.deadline-form-content {
  width: min(560px, calc(100vw - 32px));
}
.deadline-form-grid {
  display: grid;
  gap: 14px;
}

.setup-content {
  width: min(760px, calc(100vw - 32px));
}

.setup-grid {
  display: grid;
  gap: 16px;
}

.setup-copy {
  font-family: "Cormorant Garamond", serif;
  font-size: 19px;
  line-height: 1.52;
  color: color-mix(in srgb, var(--slate) 74%, var(--ink) 26%);
}

.setup-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.setup-fields .field {
  min-width: 0;
}

.setup-fields .input,
.setup-fields .nav-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.setup-fields .field:first-child,
.setup-fields .field:nth-child(2),
.setup-fields .field:nth-child(3) {
  grid-column: 1 / -1;
}

.setup-template-block {
  display: grid;
  gap: 12px;
}

.setup-template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setup-choice {
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper2) 92%, white 8%);
  box-shadow: none;
  text-align: left;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.setup-choice:hover {
  border-color: color-mix(in srgb, var(--border2) 72%, var(--ink) 28%);
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--paper2) 86%, white 14%);
}

.setup-choice.active {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--paper) 94%, white 6%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent 84%);
}

.setup-choice-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.setup-choice-detail {
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--slate) 80%, var(--ink) 20%);
}

.setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.onboarding-content {
  width: min(760px, calc(100vw - 32px));
}

.onboarding-tour {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 18px;
  align-items: stretch;
}

.onboarding-steps {
  display: grid;
  gap: 8px;
  align-content: start;
}

.onboarding-step-tab {
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%);
  background: color-mix(in srgb, var(--paper2) 92%, white 8%);
  border-radius: 10px;
  padding: 12px 13px;
  text-align: left;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.onboarding-step-tab:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--border2) 72%, var(--ink) 28%);
  color: var(--ink);
}

.onboarding-step-tab.active {
  background: var(--sumi);
  border-color: var(--sumi);
  color: var(--paper);
}

.onboarding-stage {
  background: color-mix(in srgb, var(--paper2) 92%, white 8%);
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 14px 32px rgba(14,12,10,0.08);
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.onboarding-kicker {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.onboarding-step-title {
  font-family: "Shippori Mincho", serif;
  font-size: 30px;
  line-height: 1.05;
  color: var(--ink);
}

.onboarding-step-copy {
  font-family: "Cormorant Garamond", serif;
  font-size: 21px;
  line-height: 1.48;
  color: color-mix(in srgb, var(--slate) 74%, var(--ink) 26%);
}

.onboarding-preview {
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%);
  background: rgba(255,255,255,0.42);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.onboarding-preview-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: center;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--slate);
}

.onboarding-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold2);
}

.onboarding-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.onboarding-progress {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

body.theme-dark .setup-copy,
body.theme-dark .setup-choice-detail,
body.theme-dark .onboarding-step-copy,
body.theme-dark .onboarding-preview-row,
body.theme-charcoal .setup-copy,
body.theme-charcoal .setup-choice-detail,
body.theme-charcoal .onboarding-step-copy,
body.theme-charcoal .onboarding-preview-row {
  color: rgba(241,237,228,0.8);
}

body.theme-dark .setup-choice,
body.theme-dark .onboarding-step-tab,
body.theme-dark .onboarding-stage,
body.theme-dark .onboarding-preview,
body.theme-charcoal .setup-choice,
body.theme-charcoal .onboarding-step-tab,
body.theme-charcoal .onboarding-stage,
body.theme-charcoal .onboarding-preview {
  background: #232428;
  border-color: rgba(255,255,255,0.1);
  box-shadow: none;
}

body.theme-dark .setup-choice:hover,
body.theme-dark .onboarding-step-tab:hover,
body.theme-charcoal .setup-choice:hover,
body.theme-charcoal .onboarding-step-tab:hover {
  background: #28292e;
  border-color: rgba(255,255,255,0.18);
}

body.theme-dark .setup-choice.active,
body.theme-charcoal .setup-choice.active {
  background: #1f2024;
  border-color: rgba(241,237,228,0.44);
  box-shadow: inset 0 0 0 1px rgba(241,237,228,0.18);
}

body.theme-dark .setup-choice-title,
body.theme-dark .onboarding-step-title,
body.theme-dark .onboarding-kicker,
body.theme-dark .onboarding-progress,
body.theme-charcoal .setup-choice-title,
body.theme-charcoal .onboarding-step-title,
body.theme-charcoal .onboarding-kicker,
body.theme-charcoal .onboarding-progress {
  color: #f4efe7;
}

body.theme-dark .onboarding-step-tab,
body.theme-charcoal .onboarding-step-tab {
  color: rgba(241,237,228,0.72);
}

body.theme-dark .onboarding-step-tab.active,
body.theme-charcoal .onboarding-step-tab.active {
  background: #f4efe7;
  border-color: #f4efe7;
  color: #161616;
}
.deadline-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.deadline-form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.timeline-card {
  background: rgba(255,255,255,0.42);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.timeline-rail {
  position: relative;
  display: flex;
  justify-content: center;
}
.timeline-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -22px;
  width: 1px;
  background: var(--border);
}
.timeline-item:last-child .timeline-rail::before { bottom: 50%; }
.timeline-dot.complete-toggle {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 50%;
  border: 2px solid var(--gold2);
  background: var(--paper3);
  cursor: pointer;
  margin-top: 10px;
}
.timeline-dot.complete-toggle:hover { background: rgba(212,160,23,0.16); }
.deadline-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(26,22,18,0.035);
}
.deadline-tab-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 7px 12px;
  cursor: pointer;
}
.deadline-tab-btn.active { background: var(--sumi); color: var(--paper); }
body.theme-dark .deadline-tabs { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.11); }
body.theme-dark .deadline-tab-btn { color: rgba(245,240,232,0.72); }
body.theme-dark .deadline-tab-btn.active { background: rgba(245,240,232,0.9); color: #151515; }


#timeline-list {
  scrollbar-width: none;
  transition: opacity .18s ease, transform .18s ease, height .22s ease;
  overflow: hidden;
  -ms-overflow-style: none;
}
#timeline-list::-webkit-scrollbar { display: none; }
#timeline-list.is-switching { opacity: 0; transform: translateY(8px); pointer-events: none; }
.deadline-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.deadline-choice-card {
  min-height: 118px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(26,22,18,0.02);
  color: var(--sumi);
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
  font: inherit;
}
.deadline-choice-card:hover { transform: translateY(-1px); border-color: var(--border2); background: rgba(255,255,255,0.26); }
.deadline-choice-title { font-family: "Shippori Mincho", serif; font-size: 18px; line-height: 1.1; font-weight: 700; color: var(--sumi); margin-bottom: 10px; }
.deadline-choice-copy { color: var(--muted); font-size: 15px; line-height: 1.42; }
.deadline-view-shell { display: grid; gap: 22px; }
.timeline-card.deadline-card-clickable {
  position: relative;
  border: 1px solid var(--border);
  border-bottom: 4px solid var(--deadline-edge-colour, var(--border2));
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  padding: 20px 22px 18px;
  margin: 0;
  background: rgba(255,255,255,0.18);
}
.timeline-card.deadline-card-clickable::before { content: none !important; display: none !important; }
.deadline-card-top { display: grid; gap: 10px; }
.deadline-card-title-line .timeline-title,
.deadline-card-clickable .timeline-title {
  color: var(--sumi);
  font-size: 16px;
  line-height: 1.22;
  font-weight: 650;
  letter-spacing: 0;
}
.deadline-card-countdown {
  width: fit-content;
  font-family: "DM Mono", monospace;
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--sumi);
  font-weight: 700;
  text-transform: uppercase;
}
.deadline-card-countdown.urgent { color: var(--vermillion); }
.deadline-meta-line {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--muted);
  line-height: 1.5;
}
.deadline-card-lower {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
  align-items: start;
  margin-top: 14px;
}
.deadline-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  padding: 0;
}
.deadline-details summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 10px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sumi);
}
.deadline-detail-grid { display: grid; gap: 5px; padding: 0 10px 10px; color: var(--muted); line-height: 1.35; }
.deadline-type-badge { font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.deadline-field-hidden { display: none !important; }
.deadline-form-type-pill { display: inline-flex; width: fit-content; border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: rgba(26,22,18,0.02); }
.deadline-title-module-row { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(170px,.7fr); gap: 12px; }
.deadline-priority-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.priority-choice { border: 1px solid var(--border); border-radius: 8px; padding: 8px 9px; background: rgba(26,22,18,0.025); color: var(--muted); font-family: "DM Mono", monospace; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.priority-choice.active { color: var(--sumi); border-color: var(--priority-colour, var(--border2)); box-shadow: inset 0 -3px 0 var(--priority-colour, var(--border2)); background: rgba(255,255,255,0.32); }
.priority-choice[data-priority="high"] { --priority-colour: #b84a3f; }
.priority-choice[data-priority="medium"] { --priority-colour: #b38a2f; }
.priority-choice[data-priority="low"] { --priority-colour: #4f7a53; }
.deadline-form-content .timeline-notes,
.calendar-form-content .timeline-notes {
  width: 100%;
  display: block;
  min-height: 82px;
  height: 82px;
  max-height: 82px;
  resize: none;
  overflow: auto;
  scrollbar-width: none;
  font-size: 15px;
  line-height: 1.45;
  border-radius: 8px;
  background: var(--paper2);
}
.deadline-form-content .timeline-notes::-webkit-scrollbar,
.calendar-form-content .timeline-notes::-webkit-scrollbar { display: none; }
body.theme-dark .deadline-choice-card { background: rgba(255,255,255,0.045); border-color: rgba(255,255,255,0.1); color: #f1ede4; }
body.theme-dark .deadline-choice-card:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.18); }
body.theme-dark .deadline-choice-title { color: #f1ede4; }
body.theme-dark .deadline-choice-copy { color: rgba(241,237,228,0.72); }
body.theme-dark .timeline-card:not(.deadline-card-clickable) { background: rgba(255,255,255,0.045); border-color: rgba(255,255,255,0.1); }
body.theme-dark .timeline-card.deadline-card-clickable {
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.1);
  border-bottom-color: var(--deadline-edge-colour, rgba(255,255,255,0.22));
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.04);
}
body.theme-dark .timeline-dot.complete-toggle { background: #1c1c1f; }
body.theme-dark .deadline-card-title-line .timeline-title,
body.theme-dark .deadline-card-clickable .timeline-title { color: #f1ede4; }
body.theme-dark .deadline-card-countdown { color: #f4efe7; }
body.theme-dark .deadline-meta-line,
body.theme-dark .deadline-type-badge { color: rgba(241,237,228,0.78); }
body.theme-dark .deadline-card-countdown.urgent { color: #f08b80; }
body.theme-dark .deadline-details { background: transparent; border-color: rgba(255,255,255,0.1); color: rgba(245,240,232,0.76); }
body.theme-dark .deadline-details summary { color: #f1ede4; }
body.theme-dark .deadline-form-content .timeline-notes,
body.theme-dark .calendar-form-content .timeline-notes { background: #202020; border-color: rgba(255,255,255,0.16); color: #f4efe7; }
body.theme-dark .priority-choice { background: rgba(255,255,255,0.045); border-color: rgba(255,255,255,0.1); color: rgba(245,240,232,0.72); }
body.theme-dark .priority-choice.active { color: #fff; background: rgba(255,255,255,0.08); }

@media(max-width:700px){ .deadline-title-module-row, .deadline-card-lower, .deadline-choice-grid, .deadline-form-row { grid-template-columns:1fr; } .deadline-priority-row { grid-template-columns: repeat(2,minmax(0,1fr)); } .countdown-header-pref { grid-template-columns: 1fr; } }

.exam-ticker { border-bottom: 0 !important; }
.sticky-exams { border-bottom-color: rgba(245,240,232,0.16) !important; }
body.theme-quiet .sticky-exams{ border-bottom-color: rgba(245,240,232,0.16) !important; }
.module-library-section-collapsible.is-collapsed .module-library-list { display: none !important; }

/* 09-responsive-polish.css */
/* Global UI readability, responsive shell behaviour, and interaction polish */
.context-menu {
  position: fixed;
  background: var(--paper, #faf8f3);
  border: 1px solid var(--border, rgba(26,22,18,0.12));
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 10000;
  min-width: 120px;
  overflow: hidden;
}

.context-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: var(--sumi, #17120e);
  cursor: pointer;
}

.context-menu button:hover {
  background: var(--border, rgba(26,22,18,0.08));
}

.nav-btn,
.bb-link,
.bb-edit-btn,
.formula-btn,
.formula-edit-btn,
.mini-btn,
.topic-edit-btn,
.topic-options-summary,
.topic-options-action,
.deadline-tab-btn,
.priority-choice,
.pref-toggle-pill,
.auth-gate-tab {
  font-size: 11.5px;
  line-height: 1.25;
  min-height: 36px;
  padding: 9px 14px;
}

.mini-btn,
.topic-edit-btn,
.topic-options-summary {
  min-height: 32px;
  padding: 7px 11px;
}

.module-delete-btn,
.subtopic-toggle {
  min-height: 28px;
  min-width: 28px;
}

.nav-bar {
  gap: 10px;
}

body.setup-required #course-setup-modal {
  color: #17120e;
  background: #f5f0e8;
}

body.setup-required .setup-content {
  background: rgba(250,247,242,0.992) !important;
  color: #17120e !important;
  border: 1px solid rgba(26,22,18,0.16) !important;
  box-shadow: 0 26px 70px rgba(14,12,10,0.16) !important;
}

body.setup-required .setup-content .dashboard-title,
body.setup-required .setup-content .timeline-subtitle,
body.setup-required .setup-content .setup-copy,
body.setup-required .setup-content .setup-choice-title,
body.setup-required .setup-content .setup-choice-detail,
body.setup-required .setup-content .field label,
body.setup-required .setup-content .setup-linked-status {
  color: #17120e !important;
}

body.setup-required .setup-content .setup-copy,
body.setup-required .setup-content .setup-choice-detail,
body.setup-required .setup-content .setup-linked-status {
  font-size: 18px;
  line-height: 1.5;
}

body.setup-required .setup-content .input {
  background: #fffdf8 !important;
  color: #17120e !important;
  border-color: rgba(26,22,18,0.24) !important;
  font-size: 16px;
  min-height: 44px;
}

body.setup-required .setup-choice {
  background: #fffaf0 !important;
  color: #17120e !important;
  border-color: rgba(26,22,18,0.16) !important;
}

body.setup-required .setup-choice.active {
  background: rgba(212,160,23,0.14) !important;
  border-color: #b8860b !important;
  box-shadow: inset 0 -3px 0 rgba(184,134,11,0.36);
}

body.setup-required .setup-actions .nav-btn,
body.setup-required .dashboard-close {
  background: #17120e !important;
  color: #fffaf0 !important;
  border-color: #17120e !important;
}

.onboarding-content {
  width: min(860px, calc(100vw - 32px));
}

.onboarding-tour {
  grid-template-columns: minmax(190px, .42fr) minmax(0, 1fr);
  gap: 22px;
}

.onboarding-step-tab {
  font-size: 12px;
  line-height: 1.35;
  min-height: 44px;
  padding: 12px 14px;
}

.onboarding-kicker,
.onboarding-progress {
  font-size: 12px;
}

.onboarding-step-title {
  font-size: clamp(32px, 3.8vw, 42px);
}

.onboarding-step-copy {
  font-size: 22px;
  line-height: 1.48;
}

.onboarding-preview-row {
  font-size: 12.5px;
  line-height: 1.45;
}

.onboarding-actions .nav-btn {
  min-width: 104px;
}

@media (max-width: 760px) {
  .nav-bar {
    padding: 10px 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-bar::-webkit-scrollbar { display: none; }
  .onboarding-tour,
  .setup-fields,
  .setup-template-grid {
    grid-template-columns: 1fr;
  }
}

/* Premium calendar and deadline form layout */
#deadline-form-modal .dashboard-content.deadline-form-content,
#calendar-modal .dashboard-content.calendar-form-content {
  width: min(720px, calc(100vw - 28px));
  max-height: min(86vh, 760px);
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--border2) 70%, transparent 30%);
  background: var(--paper3);
  box-shadow: 0 18px 42px rgba(14,12,10,0.16);
}

#deadline-form-modal .deadline-form-content > .timeline-subtitle,
#deadline-form-modal .deadline-form-content > .dashboard-title,
#calendar-modal .calendar-form-content > .timeline-subtitle,
#calendar-modal .calendar-form-content > .dashboard-title {
  padding-left: 28px;
  padding-right: 62px;
}

#deadline-form-modal .deadline-form-content > .timeline-subtitle,
#calendar-modal .calendar-form-content > .timeline-subtitle {
  padding-top: 26px;
  margin-bottom: 6px;
  font-size: 11px;
  color: color-mix(in srgb, var(--muted) 82%, var(--sumi) 18%);
}

#deadline-form-modal .deadline-form-content > .dashboard-title,
#calendar-modal .calendar-form-content > .dashboard-title {
  margin: 0;
  padding-bottom: 18px;
  font-family: "Shippori Mincho", serif;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--sumi);
  border-bottom: 1px solid var(--border);
}

#deadline-form-modal .deadline-form-grid,
#calendar-modal .deadline-form-grid {
  display: grid;
  gap: 16px;
  padding: 22px 28px 26px;
  overflow: auto;
  max-height: calc(86vh - 118px);
  scrollbar-width: thin;
}

#deadline-form-modal .deadline-form-content .field,
#calendar-modal .calendar-form-content .field {
  display: grid;
  gap: 7px;
}

#deadline-form-modal .deadline-form-content .field > label,
#calendar-modal .calendar-form-content .field > label {
  margin-bottom: 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: color-mix(in srgb, var(--muted) 82%, var(--sumi) 18%);
}

#deadline-form-modal .deadline-form-content .input,
#deadline-form-modal .deadline-form-content .nav-select,
#calendar-modal .calendar-form-content .input,
#calendar-modal .calendar-form-content .nav-select {
  min-height: 44px;
  border-radius: 12px;
  border-color: color-mix(in srgb, var(--border2) 68%, transparent 32%);
  background: rgba(255,255,255,0.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.36);
}

#deadline-form-modal .deadline-form-content .input:focus,
#deadline-form-modal .deadline-form-content .nav-select:focus,
#calendar-modal .calendar-form-content .input:focus,
#calendar-modal .calendar-form-content .nav-select:focus {
  border-color: color-mix(in srgb, var(--gold2) 70%, var(--border2) 30%);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.12), inset 0 1px 0 rgba(255,255,255,0.42);
}

#deadline-form-type-pill {
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(26,22,18,0.045);
  color: color-mix(in srgb, var(--muted) 78%, var(--sumi) 22%);
  border-color: color-mix(in srgb, var(--border2) 68%, transparent 32%);
}

#deadline-calendar-fields {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 42px 16px 16px;
  border: 1px solid color-mix(in srgb, var(--border2) 68%, transparent 32%);
  border-radius: 16px;
  background: rgba(26,22,18,0.022);
}

#deadline-calendar-fields::before {
  content: "Event details";
  position: absolute;
  top: 15px;
  left: 16px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

#deadline-form-modal .deadline-title-module-row,
#deadline-form-modal .deadline-form-row,
#calendar-modal .deadline-form-row {
  gap: 14px;
}

#deadline-form-modal .deadline-title-module-row {
  grid-template-columns: minmax(0, 1.25fr) minmax(190px, .75fr);
}

.deadline-priority-row {
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(26,22,18,0.026);
  gap: 4px;
}

.priority-choice {
  min-height: 38px;
  border-radius: 10px;
  border-color: transparent;
  background: transparent;
  font-size: 10px;
}

.priority-choice.active {
  background: rgba(255,255,255,0.58);
  box-shadow: 0 8px 20px rgba(14,12,10,0.07), inset 0 -3px 0 var(--priority-colour, var(--border2));
}

#deadline-form-modal .timeline-notes,
#calendar-modal .timeline-notes {
  min-height: 96px;
  height: 96px;
  max-height: 96px;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--border2) 68%, transparent 32%);
  border-radius: 14px;
  background: rgba(255,255,255,0.42);
  font-style: normal;
}

.deadline-form-actions {
  margin-top: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  gap: 10px;
}

.deadline-form-actions .nav-btn {
  min-height: 40px;
  border-radius: 999px;
  padding: 10px 16px;
}

#deadline-calendar-btn,
#deadline-save-btn,
#calendar-modal .calendar-btn {
  box-shadow: 0 10px 24px rgba(26,44,74,0.14);
}

#deadline-form-modal .dashboard-close,
#calendar-modal .dashboard-close {
  top: 20px;
  right: 22px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255,255,255,0.42);
  font-size: 19px;
  line-height: 1;
}

.timeline-content {
  width: min(780px, calc(100vw - 32px));
  overflow-x: hidden;
}

#timeline-list {
  width: 100%;
  min-height: 120px;
  will-change: height, opacity, transform;
  contain: layout paint;
}

#timeline-list.is-switching {
  pointer-events: none;
}

.deadline-view-shell {
  width: 100%;
  display: grid;
  gap: 16px;
}

.deadline-choice-grid.deadline-view-shell {
  grid-template-columns: 1fr;
  gap: 12px;
}

.deadline-choice-card {
  min-height: 96px;
  border-radius: 16px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.38);
}

.deadline-choice-card:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.42);
}

body.theme-dark #deadline-form-modal .dashboard-content.deadline-form-content,
body.theme-dark #calendar-modal .dashboard-content.calendar-form-content {
  background: #1b1b1e;
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 18px 42px rgba(0,0,0,0.34);
}

body.theme-dark #deadline-form-modal .deadline-form-content > .dashboard-title,
body.theme-dark #calendar-modal .calendar-form-content > .dashboard-title {
  color: #f1ede4;
  border-bottom-color: rgba(255,255,255,0.08);
}

body.theme-dark #deadline-calendar-fields,
body.theme-dark .deadline-priority-row,
body.theme-dark #deadline-form-modal .deadline-form-content .input,
body.theme-dark #deadline-form-modal .deadline-form-content .nav-select,
body.theme-dark #calendar-modal .calendar-form-content .input,
body.theme-dark #calendar-modal .calendar-form-content .nav-select,
body.theme-dark #deadline-form-modal .timeline-notes,
body.theme-dark #calendar-modal .timeline-notes,
body.theme-dark #deadline-form-modal .dashboard-close,
body.theme-dark #calendar-modal .dashboard-close {
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.12);
  color: #f4efe7;
}

body.theme-dark .priority-choice.active {
  background: rgba(255,255,255,0.09);
}

body.theme-dark .deadline-form-actions {
  border-top-color: rgba(255,255,255,0.08);
}

body.theme-dark .deadline-choice-card {
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.1);
}

body.theme-dark .deadline-choice-card:hover {
  background: rgba(255,255,255,0.075);
}

@media (max-width: 700px) {
  #deadline-form-modal .dashboard-content.deadline-form-content,
  #calendar-modal .dashboard-content.calendar-form-content {
    width: calc(100vw - 18px);
    border-radius: 16px;
  }

  #deadline-form-modal .deadline-form-grid,
  #calendar-modal .deadline-form-grid {
    padding: 18px;
    max-height: calc(86vh - 112px);
  }

  #deadline-form-modal .deadline-title-module-row,
  #deadline-form-modal .deadline-form-row,
  #calendar-modal .deadline-form-row {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Deadline modal cleanup, font preference compliance,
   and scroll lock
   ========================================================= */

/* No animation between Upcoming and Add New. Instant switch only. */
#timeline-list.is-switching,
#timeline-list.is-switching * {
  transition: none !important;
  animation: none !important;
}

#timeline-list.is-switching {
  opacity: 1 !important;
  transform: none !important;
  height: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
}

/* Keep Add New compact and aligned with the site language. */
.deadline-choice-grid.deadline-view-shell {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
  min-height: 0 !important;
}

.deadline-choice-card {
  min-height: 118px !important;
  height: auto !important;
  align-self: start !important;
  display: grid !important;
  align-content: end !important;
  padding: 18px 20px !important;
  border-radius: 3px !important;
  border: 1px solid var(--border) !important;
  background: rgba(26,22,18,0.025) !important;
  box-shadow: none !important;
  color: var(--sumi) !important;
}

.deadline-choice-card:hover {
  transform: none !important;
  background: rgba(26,22,18,0.045) !important;
  border-color: var(--border2) !important;
}

.deadline-choice-title {
  color: var(--sumi) !important;
  line-height: 1.08 !important;
}

.deadline-choice-copy {
  margin-top: 8px !important;
  color: var(--muted) !important;
  line-height: 1.35 !important;
}

/* Deadline timeline hierarchy: scan-first work queue, not a decorative card stack. */
#timeline-list .deadline-view-shell {
  gap: 12px !important;
}

#timeline-list .timeline-item {
  grid-template-columns: 20px minmax(0, 1fr) !important;
  gap: 12px !important;
}

#timeline-list .timeline-rail::before {
  background: color-mix(in srgb, var(--border) 78%, transparent 22%) !important;
}

#timeline-list .timeline-dot.complete-toggle {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  margin-top: 24px !important;
  border-width: 2px !important;
  background: var(--paper3) !important;
}

.timeline-card.deadline-card-clickable {
  display: grid !important;
  gap: 14px !important;
  padding: 18px 18px 14px !important;
  border-radius: 8px !important;
  border: 1px solid color-mix(in srgb, var(--border) 86%, transparent 14%) !important;
  border-left: 4px solid var(--deadline-edge-colour, var(--border2)) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 86%, transparent 14%) !important;
  background: color-mix(in srgb, var(--paper3) 72%, white 28%) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.55) inset, 0 10px 30px rgba(26,22,18,0.055) !important;
}

.timeline-card.deadline-card-clickable:hover {
  border-color: color-mix(in srgb, var(--border2) 76%, transparent 24%) !important;
  border-left-color: var(--deadline-edge-colour, var(--border2)) !important;
  background: color-mix(in srgb, var(--paper3) 82%, white 18%) !important;
}

.deadline-card-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 18px !important;
}

.deadline-card-copy {
  min-width: 0 !important;
  display: grid !important;
  gap: 8px !important;
}

.deadline-card-title-line {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
}

.deadline-card-clickable .timeline-title {
  font-size: 17px !important;
  line-height: 1.22 !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
}

.deadline-status-pill {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 22px !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--deadline-edge-colour, var(--border2)) 54%, transparent 46%) !important;
  background: color-mix(in srgb, var(--deadline-edge-colour, var(--border2)) 10%, transparent 90%) !important;
  color: color-mix(in srgb, var(--deadline-edge-colour, var(--muted)) 72%, var(--sumi) 28%) !important;
  font-family: "DM Mono", monospace !important;
  font-size: 9.5px !important;
  line-height: 1 !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
}

.deadline-meta-line {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  font-family: "Segoe UI", Arial, sans-serif !important;
  font-size: 12.5px !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  color: var(--muted) !important;
}

.deadline-meta-line span {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 24px !important;
  padding: 3px 8px !important;
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent 16%) !important;
  border-radius: 6px !important;
  background: rgba(26,22,18,0.022) !important;
}

.deadline-note-preview {
  max-width: 64ch !important;
  color: color-mix(in srgb, var(--muted) 90%, var(--sumi) 10%) !important;
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  font-weight: 400 !important;
}

.deadline-card-countdown {
  justify-self: end !important;
  min-width: 124px !important;
  padding: 8px 10px !important;
  border-radius: 7px !important;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent 22%) !important;
  background: rgba(26,22,18,0.035) !important;
  text-align: center !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  color: var(--sumi) !important;
  text-transform: uppercase !important;
}

.deadline-card-countdown.urgent {
  border-color: color-mix(in srgb, var(--vermillion) 45%, transparent 55%) !important;
  background: color-mix(in srgb, var(--vermillion) 10%, transparent 90%) !important;
  color: var(--vermillion) !important;
}

.deadline-card-lower {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  margin-top: 0 !important;
  padding-top: 12px !important;
  border-top: 1px solid color-mix(in srgb, var(--border) 78%, transparent 22%) !important;
}

.deadline-details {
  border: 0 !important;
  background: transparent !important;
}

.deadline-details summary {
  width: fit-content !important;
  padding: 0 !important;
  color: var(--muted) !important;
  font-size: 10px !important;
  letter-spacing: 0.08em !important;
}

.deadline-details[open] summary {
  margin-bottom: 10px !important;
  color: var(--sumi) !important;
}

.deadline-detail-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  padding: 0 !important;
  font-size: 12.5px !important;
  line-height: 1.35 !important;
}

.deadline-detail-grid > div {
  display: grid !important;
  gap: 3px !important;
  min-width: 0 !important;
  padding: 8px 10px !important;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent 24%) !important;
  border-radius: 6px !important;
  background: rgba(26,22,18,0.018) !important;
}

.deadline-detail-grid span {
  font-family: "DM Mono", monospace !important;
  font-size: 9px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--muted) !important;
}

.deadline-detail-grid strong {
  min-width: 0 !important;
  color: var(--sumi) !important;
  font-weight: 500 !important;
  overflow-wrap: anywhere !important;
}

.deadline-card-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
}

.deadline-card-actions .mini-btn {
  min-height: 32px !important;
  border-radius: 6px !important;
  padding: 7px 12px !important;
  font-size: 10px !important;
}

body.theme-dark .timeline-card.deadline-card-clickable {
  background: #1b1b1e !important;
  border-color: rgba(255,255,255,0.1) !important;
  border-left-color: var(--deadline-edge-colour, rgba(255,255,255,0.26)) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 14px 34px rgba(0,0,0,0.22) !important;
}

body.theme-dark .timeline-card.deadline-card-clickable:hover {
  background: #202024 !important;
  border-color: rgba(255,255,255,0.15) !important;
  border-left-color: var(--deadline-edge-colour, rgba(255,255,255,0.3)) !important;
}

body.theme-dark .deadline-card-clickable .timeline-title,
body.theme-dark .deadline-detail-grid strong {
  color: #f1ede4 !important;
}

body.theme-dark .deadline-status-pill {
  background: color-mix(in srgb, var(--deadline-edge-colour, #f1ede4) 16%, transparent 84%) !important;
  border-color: color-mix(in srgb, var(--deadline-edge-colour, #f1ede4) 44%, transparent 56%) !important;
  color: #f4efe7 !important;
}

body.theme-dark .deadline-meta-line,
body.theme-dark .deadline-note-preview,
body.theme-dark .deadline-details summary,
body.theme-dark .deadline-detail-grid span {
  color: rgba(241,237,228,0.68) !important;
}

body.theme-dark .deadline-meta-line span,
body.theme-dark .deadline-detail-grid > div {
  background: rgba(255,255,255,0.035) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

body.theme-dark .deadline-card-countdown {
  background: rgba(255,255,255,0.055) !important;
  border-color: rgba(255,255,255,0.11) !important;
  color: #f4efe7 !important;
}

body.theme-dark .deadline-card-countdown.urgent {
  background: rgba(240,139,128,0.12) !important;
  border-color: rgba(240,139,128,0.28) !important;
  color: #f08b80 !important;
}

body.theme-dark .deadline-card-lower {
  border-top-color: rgba(255,255,255,0.08) !important;
}

/* Make Track a Date truly simple. Calendar-only fields stay hidden. */
.deadline-field-hidden,
#deadline-calendar-fields.deadline-field-hidden,
#deadline-calendar-btn.deadline-field-hidden,
#deadline-priority-field.deadline-field-hidden {
  display: none !important;
}

#deadline-calendar-fields.deadline-field-hidden * {
  display: none !important;
}

/* Calendar fields should read as one guided section, not a weird nested card. */
#deadline-calendar-fields:not(.deadline-field-hidden) {
  display: grid !important;
  padding: 16px !important;
  margin: 0 !important;
  border: 1px solid color-mix(in srgb, var(--deadline-edge-colour, var(--border2)) 28%, var(--border) 72%) !important;
  background: rgba(26,22,18,0.018) !important;
  box-shadow: none !important;
}

#deadline-calendar-fields::before,
#deadline-calendar-fields::after {
  display: none !important;
  content: none !important;
}

/* Remove the glow/halo. Keep the normal UniTrack paper modal feel. */
#deadline-form-modal.dashboard-modal,
#calendar-modal.dashboard-modal {
  background: rgba(8,8,8,0.42) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#deadline-form-modal .dashboard-content.deadline-form-content,
#calendar-modal .dashboard-content.calendar-form-content {
  width: min(720px, calc(100vw - 42px)) !important;
  max-height: min(88vh, 760px) !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  overflow: hidden !important;
  background: var(--paper3) !important;
  border: 1px solid var(--border2) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 28px rgba(14,12,10,0.18) !important;
}

#deadline-form-modal .deadline-form-content > .timeline-subtitle,
#calendar-modal .calendar-form-content > .timeline-subtitle {
  padding: 24px 28px 4px !important;
  margin: 0 !important;
  color: var(--muted) !important;
}

#deadline-form-modal .deadline-form-content > .dashboard-title,
#calendar-modal .calendar-form-content > .dashboard-title {
  padding: 0 28px 18px !important;
  margin: 0 !important;
  color: var(--sumi) !important;
  border-bottom: 1px solid var(--border) !important;
}

#deadline-form-modal .deadline-form-grid,
#calendar-modal .deadline-form-grid {
  gap: 14px !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 20px 28px 22px !important;
  scrollbar-width: thin;
}

#deadline-form-modal .deadline-form-section {
  display: grid !important;
  gap: 12px !important;
  padding: 14px !important;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%) !important;
  border-radius: 7px !important;
  background: rgba(255,255,255,0.18) !important;
}

#deadline-form-modal .deadline-form-section-primary {
  background: color-mix(in srgb, var(--paper3) 70%, white 30%) !important;
}

#deadline-form-modal .deadline-section-title {
  color: var(--sumi) !important;
  font-family: "DM Mono", monospace !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}

#deadline-form-modal .deadline-form-row,
#calendar-modal .deadline-form-row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: start !important;
}

#deadline-form-modal .deadline-title-module-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.75fr) !important;
  gap: 12px !important;
  align-items: start !important;
}

#deadline-form-modal .timeline-notes,
#calendar-modal .timeline-notes {
  min-height: 72px !important;
  height: 72px !important;
  max-height: 72px !important;
  resize: none !important;
}

#deadline-form-modal .deadline-form-actions,
#calendar-modal .deadline-form-actions {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 5 !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  margin: 6px -28px -22px !important;
  padding: 14px 28px 16px !important;
  background: var(--paper3) !important;
  border-top: 1px solid var(--border) !important;
}

/* Lock background page scrolling while edit/calendar modals are open. */
body.modal-scroll-locked {
  position: fixed !important;
  width: 100% !important;
  overflow: hidden !important;
  left: 0 !important;
  right: 0 !important;
}

body.modal-scroll-locked .dashboard-modal:not(.hidden),
body.modal-scroll-locked .deadline-splash:not(.hidden) {
  overscroll-behavior: contain !important;
}

body.modal-scroll-locked .deadline-form-grid,
body.modal-scroll-locked .dashboard-content {
  overscroll-behavior: contain !important;
}

@media (max-width: 760px) {
  body.modal-scroll-locked {
    position: static !important;
    top: auto !important;
    width: auto !important;
  }
}

/* Final state rules: checked topics must stay visually complete across themes and layouts. */
.topic-row .topic-label.done,
.topic-row.subtopic-row .topic-label.done,
body.compact-ui .topic-row .topic-label.done,
body.compact-ui .topic-row.subtopic-row .topic-label.done {
  color: color-mix(in srgb, var(--muted) 62%, transparent 38%) !important;
  opacity: 0.58 !important;
  text-decoration: line-through !important;
  text-decoration-color: currentColor !important;
}

.topic-row:has(input[type="checkbox"]:checked) {
  opacity: 0.72;
}

body.theme-dark .topic-row .topic-label.done,
body.theme-dark .topic-row.subtopic-row .topic-label.done,
body.theme-dark.compact-ui .topic-row .topic-label.done,
body.theme-dark.compact-ui .topic-row.subtopic-row .topic-label.done {
  color: rgba(241,237,228,0.42) !important;
}

body.theme-dark .final-cls.cls-s-first,
body.theme-dark .classification-badge.cls-first {
  background: rgba(240,123,111,0.16) !important;
  color: #f0a196 !important;
  border-color: rgba(240,161,150,0.42) !important;
}

body.theme-dark .final-cls.cls-s-21,
body.theme-dark .classification-badge.cls-21 {
  background: rgba(229,182,76,0.15) !important;
  color: #e6c97a !important;
  border-color: rgba(230,201,122,0.4) !important;
}

body.theme-dark .final-cls.cls-s-22,
body.theme-dark .classification-badge.cls-22 {
  background: rgba(99,167,223,0.14) !important;
  color: #8fc4ef !important;
  border-color: rgba(143,196,239,0.38) !important;
}

body.theme-dark .final-cls.cls-s-third,
body.theme-dark .classification-badge.cls-third {
  background: rgba(255,255,255,0.08) !important;
  color: rgba(241,237,228,0.82) !important;
  border-color: rgba(255,255,255,0.22) !important;
}

body.theme-dark .module-major-toggle {
  background: rgba(255,255,255,0.05) !important;
  color: rgba(241,237,228,0.76) !important;
  border-color: rgba(255,255,255,0.14) !important;
}

/* Font preferences: titles and deadline UI must follow selected style. */
.timeline-page-title,
.deadline-choice-title,
#deadline-form-modal .dashboard-title,
#calendar-modal .dashboard-title,
#timeline-modal .dashboard-title {
  font-family: "Shippori Mincho", serif !important;
}

body.font-sans .timeline-page-title,
body.font-sans .deadline-choice-title,
body.font-sans .deadline-choice-copy,
body.font-sans #deadline-form-modal .dashboard-title,
body.font-sans #calendar-modal .dashboard-title,
body.font-sans #timeline-modal .dashboard-title,
body.font-sans #deadline-form-modal .timeline-subtitle,
body.font-sans #calendar-modal .timeline-subtitle,
body.font-sans #deadline-form-modal .field label,
body.font-sans #calendar-modal .field label,
body.font-sans #deadline-form-modal .input,
body.font-sans #deadline-form-modal .nav-select,
body.font-sans #calendar-modal .input,
body.font-sans #calendar-modal .nav-select,
body.font-sans #deadline-form-modal .timeline-notes,
body.font-sans #calendar-modal .timeline-notes {
  font-family: "Segoe UI", Arial, sans-serif !important;
}

body.font-mono .timeline-page-title,
body.font-mono .deadline-choice-title,
body.font-mono .deadline-choice-copy,
body.font-mono #deadline-form-modal .dashboard-title,
body.font-mono #calendar-modal .dashboard-title,
body.font-mono #timeline-modal .dashboard-title,
body.font-mono #deadline-form-modal .timeline-subtitle,
body.font-mono #calendar-modal .timeline-subtitle,
body.font-mono #deadline-form-modal .field label,
body.font-mono #calendar-modal .field label,
body.font-mono #deadline-form-modal .input,
body.font-mono #deadline-form-modal .nav-select,
body.font-mono #calendar-modal .input,
body.font-mono #calendar-modal .nav-select,
body.font-mono #deadline-form-modal .timeline-notes,
body.font-mono #calendar-modal .timeline-notes {
  font-family: "DM Mono", Consolas, monospace !important;
  letter-spacing: 0 !important;
}

/* Dark mode readability. */
body.theme-dark .deadline-choice-card {
  background: rgba(255,255,255,0.045) !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: #f1ede4 !important;
}

body.theme-dark .deadline-choice-card:hover {
  background: rgba(255,255,255,0.075) !important;
}

body.theme-dark .deadline-choice-title,
body.theme-dark #deadline-form-modal .deadline-form-content > .dashboard-title,
body.theme-dark #calendar-modal .calendar-form-content > .dashboard-title {
  color: #f1ede4 !important;
}

body.theme-dark .deadline-choice-copy,
body.theme-dark #deadline-form-modal .deadline-form-content > .timeline-subtitle,
body.theme-dark #calendar-modal .calendar-form-content > .timeline-subtitle,
body.theme-dark #deadline-form-modal .field label,
body.theme-dark #calendar-modal .field label {
  color: rgba(241,237,228,0.70) !important;
}

body.theme-dark #deadline-form-modal .dashboard-content.deadline-form-content,
body.theme-dark #calendar-modal .dashboard-content.calendar-form-content {
  background: #1b1b1e !important;
  border-color: rgba(255,255,255,0.12) !important;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28) !important;
}

body.theme-dark #deadline-form-modal .input,
body.theme-dark #deadline-form-modal .nav-select,
body.theme-dark #calendar-modal .input,
body.theme-dark #calendar-modal .nav-select,
body.theme-dark #deadline-form-modal .timeline-notes,
body.theme-dark #calendar-modal .timeline-notes {
  background: #202024 !important;
  border-color: rgba(255,255,255,0.14) !important;
  color: #f4efe7 !important;
}

body.theme-dark #deadline-form-modal .deadline-form-actions,
body.theme-dark #calendar-modal .deadline-form-actions {
  background: #1b1b1e !important;
  border-top-color: rgba(255,255,255,0.1) !important;
}

body.theme-dark #deadline-form-modal .deadline-form-section,
body.theme-dark #deadline-calendar-fields:not(.deadline-field-hidden) {
  background: rgba(255,255,255,0.035) !important;
  border-color: rgba(255,255,255,0.09) !important;
}

body.theme-dark #deadline-form-modal .deadline-section-title {
  color: #f1ede4 !important;
}

/* Module card hierarchy: title first, controls second, dropdown content calm. */
@media (min-width: 761px) {
  .module {
    margin-bottom: 14px !important;
    border-radius: 6px !important;
    padding-top: 0 !important;
    box-shadow: none !important;
  }

  .module:hover {
    box-shadow: 0 8px 20px rgba(26,22,18,0.055) !important;
  }

  .module::before {
    width: 4px !important;
  }

  .module-header {
    grid-template-columns: minmax(260px, 1.7fr) minmax(190px, 0.9fr) minmax(220px, 0.95fr) minmax(72px, auto) 18px !important;
    gap: 20px !important;
    padding: 18px 22px 18px 24px !important;
    align-items: center !important;
  }

  .module-header .mod-stripe,
  .module-header .module-actions {
    display: none !important;
  }

  .module-summary {
    min-width: 0 !important;
  }

  .mod-name {
    font-size: 19px !important;
    line-height: 1.18 !important;
    margin-bottom: 5px !important;
    color: var(--ink) !important;
  }

  .mod-kanji {
    font-family: "DM Mono", monospace !important;
    font-size: 10.5px !important;
    font-weight: 500 !important;
    letter-spacing: 0.08em !important;
    line-height: 1.35 !important;
    margin-bottom: 10px !important;
    color: var(--muted) !important;
  }

  .module-links {
    gap: 7px !important;
  }

  .module-links .bb-link,
  .module-links .formula-btn {
    min-height: 30px !important;
    padding: 6px 10px !important;
    border-radius: 5px !important;
    font-size: 9.5px !important;
    letter-spacing: 0.06em !important;
  }

  .progress-section {
    padding: 12px 14px !important;
    border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%) !important;
    border-radius: 7px !important;
    background: rgba(26,22,18,0.018) !important;
  }

  .prog-header {
    align-items: baseline !important;
    margin-bottom: 9px !important;
  }

  .prog-done {
    font-size: 24px !important;
    line-height: 1 !important;
  }

  .prog-pct,
  .prog-of {
    font-size: 10px !important;
    letter-spacing: 0.04em !important;
  }

  .prog-track {
    height: 5px !important;
    margin-bottom: 8px !important;
  }

  .module-header > .inputs-grid {
    padding: 12px !important;
    border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%) !important;
    border-radius: 7px !important;
    background: rgba(26,22,18,0.014) !important;
  }

  .module-header .field label {
    font-size: 9px !important;
    letter-spacing: 0.09em !important;
    margin-bottom: 5px !important;
  }

  .module-header .input {
    min-height: 38px !important;
    padding: 8px 10px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
  }

  .module-header .nav-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
  }

  .final-col {
    min-width: 68px !important;
    text-align: right !important;
  }

  .final-mark {
    font-size: 30px !important;
    line-height: 0.95 !important;
    margin-bottom: 5px !important;
  }

  .final-cls {
    max-width: 112px !important;
    font-size: 9px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
  }

  .chevron {
    justify-self: end !important;
    opacity: 0.72 !important;
  }

  .topic-list {
    background: color-mix(in srgb, var(--paper2) 92%, white 8%) !important;
  }

  .module-edit-tools,
  .notes-area-wrap,
  .formula-links-wrap,
  .relevant-links-wrap,
  .module-section-head,
  .module-section-body {
    padding-left: 28px !important;
    padding-right: 22px !important;
  }

  .module-edit-tools {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    background: rgba(26,22,18,0.018) !important;
  }

  .module-section-head {
    padding-top: 13px !important;
    padding-bottom: 13px !important;
  }

  .module-section-title,
  .topic-tools-title,
  .formula-links-title,
  .relevant-links-title {
    font-size: 10px !important;
    letter-spacing: 0.11em !important;
    font-weight: 700 !important;
    color: color-mix(in srgb, var(--muted) 82%, var(--sumi) 18%) !important;
  }

  .module-section.coursework-section .module-section-title {
    font-size: 10.5px !important;
    letter-spacing: 0.12em !important;
  }

  .module-section-controls .mini-btn,
  .module-edit-tools .bb-edit-btn,
  .module-edit-tools .mini-btn,
  .topic-entry-row .mini-btn {
    min-height: 30px !important;
    border-radius: 5px !important;
    padding: 6px 10px !important;
    font-size: 9.5px !important;
  }

  .topic-entry-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
  }

  .topic-entry-help {
    max-width: 78ch !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-size: 12.5px !important;
    line-height: 1.42 !important;
    color: var(--muted) !important;
  }

  .topic-row {
    min-height: 40px !important;
    padding: 9px 12px !important;
    gap: 10px !important;
  }

  .topic-label {
    font-size: 14px !important;
    line-height: 1.34 !important;
    font-weight: 500 !important;
    color: var(--ink) !important;
  }

  .subtopic-row .topic-label {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: color-mix(in srgb, var(--ink) 84%, var(--muted) 16%) !important;
  }

  .subtopic-list {
    margin-left: 26px !important;
    border-left: 1px solid color-mix(in srgb, var(--border) 78%, transparent 22%) !important;
  }
}

body.theme-dark .progress-section,
body.theme-dark .module-header > .inputs-grid,
body.theme-dark .module-edit-tools {
  background: rgba(255,255,255,0.03) !important;
  border-color: rgba(255,255,255,0.09) !important;
}

body.theme-dark .topic-list {
  background: #171719 !important;
}

body.theme-dark .module-section-title,
body.theme-dark .topic-tools-title,
body.theme-dark .formula-links-title,
body.theme-dark .relevant-links-title {
  color: rgba(241,237,228,0.7) !important;
}

@media (min-width: 761px) {
  body.compact-ui .module {
    margin-bottom: 7px !important;
  }

  body.compact-ui .module-header {
    grid-template-columns: minmax(180px, 1.15fr) minmax(145px, 0.72fr) minmax(164px, 0.68fr) minmax(78px, auto) 14px !important;
    gap: 10px !important;
    padding: 8px 14px 8px 18px !important;
  }

  body.compact-ui .module-summary {
    min-width: 0 !important;
  }

  body.compact-ui .mod-name {
    font-size: 15px !important;
    line-height: 1.12 !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.compact-ui .mod-kanji {
    font-size: 9px !important;
    line-height: 1.2 !important;
    margin-bottom: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.compact-ui .module-links {
    display: none !important;
  }

  body.compact-ui .progress-section {
    padding: 7px 9px !important;
    border-radius: 5px !important;
  }

  body.compact-ui .prog-header {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    margin-bottom: 5px !important;
  }

  body.compact-ui .prog-done {
    display: block !important;
    font-size: 18px !important;
  }

  body.compact-ui .prog-pct {
    font-size: 9px !important;
    justify-self: auto !important;
  }

  body.compact-ui .prog-track {
    height: 3px !important;
    margin-bottom: 4px !important;
  }

  body.compact-ui .prog-of {
    display: block !important;
    font-size: 8.5px !important;
  }

  body.compact-ui .module-header > .inputs-grid {
    display: grid !important;
    gap: 6px !important;
    padding: 7px !important;
    border-radius: 5px !important;
  }

  body.compact-ui .module-header .field label {
    font-size: 8px !important;
    margin-bottom: 3px !important;
  }

  body.compact-ui .module-header .input {
    min-height: 30px !important;
    padding: 5px 7px !important;
    border-radius: 5px !important;
    font-size: 12px !important;
  }

  body.compact-ui .module-header > .final-col {
    display: block !important;
    min-width: 72px !important;
  }

  body.compact-ui .final-mark {
    font-size: 24px !important;
    margin-bottom: 2px !important;
  }

  body.compact-ui .final-cls {
    max-width: 84px !important;
    padding: 2px 5px !important;
    font-size: 8px !important;
    line-height: 1.18 !important;
  }

  body.compact-ui .chevron {
    width: 14px !important;
  }

  body.compact-ui .compact-marks-wrap {
    display: none !important;
  }

  body.compact-ui .module-edit-tools,
  body.compact-ui .notes-area-wrap,
  body.compact-ui .formula-links-wrap,
  body.compact-ui .relevant-links-wrap,
  body.compact-ui .module-section-head,
  body.compact-ui .module-section-body {
    padding-left: 18px !important;
    padding-right: 14px !important;
  }

  body.compact-ui .module-edit-tools {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  body.compact-ui .module-section-head {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  body.compact-ui .topic-row {
    min-height: 30px !important;
    padding: 5px 9px !important;
    gap: 7px !important;
  }

  body.compact-ui .topic-label,
  body.compact-ui .subtopic-row .topic-label {
    font-size: 12.5px !important;
    line-height: 1.25 !important;
  }
}

/* Calendar composer polish */
#calendar-modal .dashboard-content.calendar-form-content {
  width: min(760px, calc(100vw - 42px)) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.36), rgba(255,255,255,0) 128px),
    var(--paper3) !important;
}

#calendar-modal .calendar-form-content > .timeline-subtitle {
  display: none !important;
}

#calendar-modal .calendar-form-content > .dashboard-title {
  position: relative !important;
  padding: 28px 70px 20px 30px !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent 28%) !important;
  font-size: clamp(30px, 3vw, 40px) !important;
  line-height: 1 !important;
}

#calendar-modal .calendar-form-content > .dashboard-title::before {
  content: "Calendar";
  display: block;
  margin-bottom: 7px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

#calendar-modal .deadline-form-grid {
  padding: 22px 30px 24px !important;
  gap: 14px !important;
}

#calendar-modal .calendar-form-content .field {
  gap: 6px !important;
}

#calendar-modal .calendar-form-content .field > label {
  font-size: 9px !important;
  letter-spacing: 0.13em !important;
}

#calendar-modal .calendar-form-content .input,
#calendar-modal .calendar-form-content .nav-select,
#calendar-modal .calendar-form-content .timeline-notes {
  border-radius: 6px !important;
  border-color: color-mix(in srgb, var(--border2) 62%, transparent 38%) !important;
  background: color-mix(in srgb, var(--paper) 72%, white 28%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.38) !important;
}

#calendar-modal .calendar-form-content .input,
#calendar-modal .calendar-form-content .nav-select {
  min-height: 42px !important;
}

#calendar-modal .deadline-form-row {
  grid-template-columns: minmax(0, 1fr) minmax(128px, 0.48fr) !important;
  padding: 12px !important;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent 18%) !important;
  border-radius: 8px !important;
  background: rgba(26,22,18,0.018) !important;
}

#calendar-modal .deadline-form-row:nth-of-type(4) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

#calendar-modal .timeline-notes {
  min-height: 92px !important;
  height: 92px !important;
  max-height: 92px !important;
  line-height: 1.42 !important;
}

#calendar-modal .deadline-form-actions {
  margin-top: 2px !important;
  padding-top: 14px !important;
}

#calendar-modal .deadline-form-actions .nav-btn {
  border-radius: 6px !important;
  min-height: 42px !important;
}

#calendar-modal .deadline-form-actions .calendar-btn {
  min-width: 168px !important;
  background: var(--sumi) !important;
  border-color: var(--sumi) !important;
  color: var(--paper3) !important;
}

#calendar-modal .deadline-form-actions .calendar-btn:hover {
  background: color-mix(in srgb, var(--sumi) 88%, var(--gold2) 12%) !important;
  border-color: color-mix(in srgb, var(--sumi) 82%, var(--gold2) 18%) !important;
}

#calendar-modal .dashboard-close {
  border-radius: 6px !important;
}

#deadline-form-modal.is-event-mode .dashboard-content.deadline-form-content {
  max-height: min(96dvh, 760px) !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}

#deadline-form-modal.is-event-mode .deadline-form-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  overflow: visible !important;
  padding: 10px 28px 0 !important;
}

#deadline-form-modal.is-event-mode .deadline-form-section {
  gap: 6px !important;
  padding: 8px 12px !important;
}

#deadline-form-modal.is-event-mode .deadline-form-content > .timeline-subtitle {
  padding-top: 16px !important;
}

#deadline-form-modal.is-event-mode .deadline-form-content > .dashboard-title {
  padding-bottom: 10px !important;
}

#deadline-form-modal.is-event-mode .deadline-form-type-pill {
  padding: 3px 9px !important;
}

#deadline-form-modal.is-event-mode .deadline-form-row,
#deadline-form-modal.is-event-mode .deadline-title-module-row {
  gap: 8px !important;
}

#deadline-form-modal.is-event-mode .deadline-form-content .field {
  gap: 5px !important;
}

#deadline-form-modal.is-event-mode .deadline-form-content .input,
#deadline-form-modal.is-event-mode .deadline-form-content .nav-select {
  min-height: 34px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

#deadline-form-modal.is-event-mode .timeline-notes {
  min-height: 44px !important;
  height: 44px !important;
  max-height: 44px !important;
}

#deadline-form-modal.is-event-mode .deadline-form-actions {
  position: static !important;
  margin: auto -28px 0 !important;
  padding: 11px 28px 13px !important;
  flex-shrink: 0 !important;
}

#deadline-form-modal.is-event-mode .deadline-form-actions .nav-btn {
  min-height: 38px !important;
}

body.theme-dark #calendar-modal .dashboard-content.calendar-form-content {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0) 128px),
    #1b1b1e !important;
}

body.theme-dark #calendar-modal .deadline-form-row {
  background: rgba(255,255,255,0.026) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

body.theme-dark #calendar-modal .calendar-form-content .input,
body.theme-dark #calendar-modal .calendar-form-content .nav-select,
body.theme-dark #calendar-modal .calendar-form-content .timeline-notes {
  background: #202024 !important;
  border-color: rgba(255,255,255,0.13) !important;
}

body.theme-dark #calendar-modal .deadline-form-actions .calendar-btn {
  background: #f1ede4 !important;
  border-color: #f1ede4 !important;
  color: #171719 !important;
}

@media (max-width: 700px) {
  .deadline-choice-grid.deadline-view-shell {
    grid-template-columns: 1fr !important;
  }

  .deadline-choice-card {
    min-height: 104px !important;
  }

  #deadline-form-modal .dashboard-content.deadline-form-content,
  #calendar-modal .dashboard-content.calendar-form-content {
    width: calc(100vw - 18px) !important;
    max-height: 90vh !important;
  }

  #deadline-form-modal .deadline-form-row,
  #deadline-form-modal .deadline-title-module-row,
  #calendar-modal .deadline-form-row {
    grid-template-columns: 1fr !important;
  }

  #deadline-form-modal .deadline-form-grid,
  #calendar-modal .deadline-form-grid {
    padding: 18px !important;
  }

  #deadline-form-modal .deadline-form-actions,
  #calendar-modal .deadline-form-actions {
    margin: 6px -18px -18px !important;
    padding: 12px 18px 14px !important;
    flex-direction: column-reverse !important;
  }

  #deadline-form-modal .deadline-form-actions .nav-btn,
  #calendar-modal .deadline-form-actions .nav-btn {
    width: 100% !important;
  }

  #calendar-modal .calendar-form-content > .dashboard-title {
    padding: 24px 58px 18px 20px !important;
  }

  #calendar-modal .deadline-form-grid {
    padding: 18px 20px 20px !important;
  }

  #calendar-modal .deadline-form-row,
  #calendar-modal .deadline-form-row:nth-of-type(4) {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile app shell */
@media (max-width: 760px) {
  body:not(.auth-required):not(.auth-loading):not(.setup-required) {
    padding-top: 118px !important;
  }

  body.countdown-header-hidden:not(.auth-required):not(.auth-loading):not(.setup-required) {
    padding-top: 58px !important;
  }

  .sticky-exams {
    height: 58px !important;
    padding: 0 10px !important;
    scroll-snap-type: x proximity;
  }

  .exam-ticker {
    min-width: 210px !important;
    padding: 0 14px !important;
    scroll-snap-align: start;
  }

  .ticker-time {
    font-size: 15px !important;
  }

  .nav-bar {
    top: 58px !important;
    min-height: 60px !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    overflow-x: auto !important;
    align-items: center !important;
    scrollbar-width: none;
  }

  body.countdown-header-hidden .nav-bar {
    top: 0 !important;
  }

  .nav-bar::-webkit-scrollbar {
    display: none;
  }

  .nav-brand {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
  }

  .year-controls {
    min-width: 132px !important;
    flex: 0 0 132px !important;
  }

  .nav-btn,
  .nav-select,
  .pref-toggle-pill,
  .mini-btn,
  .bb-link,
  .bb-edit-btn,
  .formula-btn {
    min-height: 38px;
    font-size: 10px;
  }

  .nav-bar > .nav-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 12px !important;
  }

  .prefs-toggle-btn {
    margin-left: 0 !important;
  }

  .hero {
    margin-top: 0 !important;
    padding: 20px 14px 18px !important;
    overflow-x: hidden !important;
  }

  .hero-inner {
    max-width: none !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  h1 {
    max-width: 100% !important;
    font-size: clamp(28px, 12vw, 38px) !important;
    line-height: 1 !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    margin-bottom: 12px !important;
  }

  .eyebrow {
    font-size: 9px !important;
    margin-bottom: 10px !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    letter-spacing: 0.12em !important;
  }

  .hero-grid,
  .stats {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }

  .stat-card,
  .washi-card,
  .dash-launch {
    min-width: 0 !important;
    border-radius: 6px !important;
  }

  .hero-grid > .washi-card {
    padding: 14px !important;
  }

  .dash-actions-card {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    gap: 8px !important;
    min-height: 0 !important;
  }

  .dash-hero-btn {
    min-height: 70px !important;
    height: auto !important;
    padding: 12px 10px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .dash-hero-btn .dash-launch-icon {
    font-size: clamp(15px, 5.2vw, 20px) !important;
    line-height: 1.1 !important;
    overflow-wrap: anywhere !important;
  }

  .dash-launch::after {
    display: none !important;
    content: none !important;
  }

  .global-big {
    font-size: clamp(30px, 11vw, 42px) !important;
    line-height: 1 !important;
    overflow-wrap: anywhere !important;
  }

  .meta-row,
  .hero-summary {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }

  .predictor-hero-number {
    font-size: clamp(42px, 16vw, 64px) !important;
    line-height: 0.95 !important;
  }

  .content {
    padding: 14px 10px 58px !important;
  }

  .module {
    margin-bottom: 10px !important;
    border-radius: 6px !important;
  }

  .module-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 16px 14px !important;
    align-items: stretch !important;
  }

  .module-header .mod-stripe,
  .module-header .module-actions,
  .module-header .chevron {
    display: none !important;
  }

  .module-summary,
  .progress-section,
  .inputs-grid,
  .final-col {
    grid-column: 1 / -1 !important;
  }

  .module-summary {
    min-width: 0 !important;
  }

  .mod-name {
    font-size: 18px !important;
    padding-right: 34px !important;
  }

  .mod-kanji {
    font-size: 10px !important;
    line-height: 1.4 !important;
    overflow-wrap: anywhere !important;
  }

  .progress-section {
    width: 100% !important;
    padding: 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    background: rgba(26,22,18,0.025) !important;
  }

  .prog-header {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: end !important;
    gap: 10px !important;
    margin-bottom: 10px !important;
  }

  .prog-done {
    font-size: 32px !important;
    line-height: 0.9 !important;
  }

  .prog-pct {
    justify-self: end !important;
    text-align: right !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .prog-track {
    height: 8px !important;
    margin-bottom: 9px !important;
    border-radius: 999px !important;
  }

  .prog-of {
    font-size: 10px !important;
    line-height: 1.25 !important;
    color: var(--muted) !important;
  }

  .module-header > .inputs-grid {
    padding: 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    background: rgba(26,22,18,0.018) !important;
  }

  .module-header > .final-col {
    text-align: left !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    background: rgba(26,22,18,0.018) !important;
  }

  .final-mark {
    font-size: 34px !important;
    margin-bottom: 0 !important;
  }

  .final-cls {
    justify-self: start !important;
    text-align: left !important;
    line-height: 1.3 !important;
  }

  body.compact-ui .module-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 16px 14px !important;
  }

  body.compact-ui .module-header > .inputs-grid,
  body.compact-ui .module-header > .final-col {
    display: grid !important;
  }

  body.compact-ui .prog-header {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    justify-content: initial !important;
    margin-bottom: 10px !important;
  }

  body.compact-ui .prog-done,
  body.compact-ui .prog-of {
    display: block !important;
  }

  body.compact-ui .prog-pct {
    font-size: 10px !important;
    justify-self: end !important;
  }

  .module-links,
  .module-edit-tools,
  .module-edit-primary,
  .module-edit-secondary {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .module-edit-tools,
  .notes-area-wrap,
  .formula-links-wrap,
  .relevant-links-wrap,
  .module-section-head {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .inputs-grid,
  .deadline-title-module-row,
  .deadline-card-lower,
  .coursework-component-row,
  .topic-entry-row {
    grid-template-columns: 1fr !important;
  }

  .topic-entry-row {
    display: grid !important;
  }

  .topic-row {
    padding: 9px 12px 9px 14px !important;
    gap: 8px !important;
  }

  .topic-row.subtopic-row {
    padding-left: 34px !important;
  }

  .subtopic-list {
    margin-left: 0 !important;
  }

  .topic-prefix {
    width: 18px !important;
    min-width: 18px !important;
  }

  .dashboard-modal {
    align-items: stretch !important;
    justify-content: stretch !important;
    padding: 8px !important;
  }

  .dashboard-content,
  .timeline-content,
  .deadline-form-content,
  .calendar-form-content,
  .module-library-content,
  .onboarding-content,
  .setup-content {
    width: 100% !important;
    max-width: none !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 10px !important;
  }

  .dashboard-content {
    padding: 18px !important;
  }

  .timeline-head,
  #todo-modal .timeline-head {
    padding-right: 44px !important;
  }

  .timeline-topline {
    align-items: flex-start !important;
  }

  .timeline-page-title,
  .dashboard-title {
    font-size: 30px !important;
    line-height: 1 !important;
  }

  .timeline-item {
    grid-template-columns: 18px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .timeline-card {
    padding: 12px !important;
  }

  .deadline-card-top {
    gap: 6px !important;
  }

  .deadline-card-actions,
  .deadline-form-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  #todo-modal .todo-content {
    inset: 8px !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    min-width: 0 !important;
    border-radius: 10px !important;
  }

  #todo-modal .timeline-head {
    padding: 16px !important;
  }

  #todo-modal .todo-toolbar,
  #todo-modal.todo-compact-mode .todo-toolbar {
    grid-template-columns: 1fr !important;
  }

  #todo-modal .todo-add-btn,
  #todo-view-toggle {
    width: 100% !important;
  }

  #todo-modal .todo-list {
    padding: 12px 14px 18px !important;
  }

  .todo-view-row {
    align-items: stretch !important;
    flex-direction: column !important;
    padding: 12px 14px !important;
  }

  .todo-summary {
    justify-content: center !important;
    width: 100% !important;
  }

  .todo-expanded-card,
  .todo-task-row {
    grid-template-columns: 22px minmax(0,1fr) 48px !important;
    gap: 8px !important;
  }

  .todo-expanded-card {
    grid-template-columns: 22px minmax(0,1fr) !important;
  }

  .todo-expanded-head {
    grid-template-columns: minmax(0,1fr) 48px !important;
  }

  .todo-delete-btn {
    width: 48px !important;
    padding: 0 !important;
    justify-self: end !important;
  }

  #deadline-form-modal .deadline-form-grid,
  #calendar-modal .deadline-form-grid {
    padding: 16px !important;
  }

  #deadline-form-modal .deadline-form-actions,
  #calendar-modal .deadline-form-actions {
    position: static !important;
    margin: 8px 0 0 !important;
    padding: 12px 0 0 !important;
  }

  #timeline-list .timeline-item {
    grid-template-columns: 18px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  #timeline-list .timeline-dot.complete-toggle {
    margin-top: 22px !important;
  }

  .timeline-card.deadline-card-clickable {
    padding: 14px !important;
    gap: 12px !important;
  }

  .deadline-card-main,
  .deadline-card-lower,
  .deadline-detail-grid {
    grid-template-columns: 1fr !important;
  }

  .deadline-card-countdown {
    justify-self: stretch !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  .deadline-meta-line span {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }

  .deadline-card-actions {
    justify-content: stretch !important;
  }

  .deadline-card-actions .mini-btn {
    width: 100% !important;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: clamp(25px, 11vw, 32px) !important;
  }

  .dash-actions-card {
    grid-template-columns: 1fr !important;
  }

  .dash-hero-btn {
    min-height: 54px !important;
  }

  .module-header {
    padding: 14px 12px !important;
  }

  .module-delete-corner {
    top: 12px !important;
    right: 12px !important;
  }

  .dashboard-modal {
    padding: 0 !important;
  }

  .dashboard-content,
  .timeline-content,
  .deadline-form-content,
  .calendar-form-content {
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
  }
}

@media (max-width: 760px) {
  body.compact-ui .module {
    margin-bottom: 6px !important;
  }

  body.compact-ui .module-header {
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  body.compact-ui .module-links {
    display: none !important;
  }

  body.compact-ui .mod-name {
    font-size: 15px !important;
    margin-bottom: 2px !important;
  }

  body.compact-ui .mod-kanji {
    font-size: 9px !important;
    margin-bottom: 0 !important;
  }

  body.compact-ui .progress-section,
  body.compact-ui .module-header > .inputs-grid,
  body.compact-ui .module-header > .final-col {
    padding: 8px !important;
  }

  body.compact-ui .module-header > .inputs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  body.compact-ui .module-header .input {
    min-height: 32px !important;
    padding: 5px 7px !important;
    font-size: 12px !important;
  }

  body.compact-ui .final-mark {
    font-size: 26px !important;
  }

  body.compact-ui .compact-marks-wrap {
    display: none !important;
  }

  body.compact-ui .module-edit-tools,
  body.compact-ui .notes-area-wrap,
  body.compact-ui .formula-links-wrap,
  body.compact-ui .relevant-links-wrap,
  body.compact-ui .module-section-head,
  body.compact-ui .module-section-body {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.compact-ui .module-section-head {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  body.compact-ui .topic-row {
    min-height: 30px !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }
}
/* Only show focus styling for keyboard navigation, not mouse clicks */
:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 44, 74, 0.22);
}

body.theme-dark :focus-visible {
  box-shadow: 0 0 0 2px rgba(241, 237, 228, 0.28);
}

/* 10-account-panel.css */
/* UniTrack account panel UI
   Theme-aware account layout, privacy controls, and backup actions. */

#auth-modal .deadline-splash-card.deadline-form-content {
  width: min(860px, calc(100vw - 28px));
  max-width: 860px;
  max-height: 86vh;
  overflow: auto;
  scrollbar-width: none;
  background: color-mix(in srgb, var(--paper) 90%, white 10%);
  border-color: color-mix(in srgb, var(--border) 78%, var(--gold2) 22%);
  background-image: none !important;
}

#auth-modal .deadline-splash-card.deadline-form-content::before,
#auth-modal .deadline-splash-card.deadline-form-content::after {
  display: none !important;
  content: none !important;
}

#auth-modal .deadline-splash-card.deadline-form-content > .deadline-splash-label {
  display: none !important;
}

#auth-modal .deadline-splash-card.deadline-form-content::-webkit-scrollbar {
  display: none;
}

.account-clean-panel {
  display: grid;
  gap: 14px;
  color: var(--sumi);
  background: transparent;
  font-family: inherit;
}

.account-clean-panel,
.account-clean-panel * {
  box-sizing: border-box;
}

.account-clean-section {
  border: 1px solid color-mix(in srgb, var(--border) 78%, var(--gold2) 22%);
  background: color-mix(in srgb, var(--paper2) 82%, white 18%);
}

.account-clean-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.5fr);
  gap: 20px;
  align-items: stretch;
  padding: 4px 0 10px;
  border: 0;
  background: transparent;
}

.account-clean-kicker {
  display: block;
  font-family: "DM Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.account-clean-header h2,
.account-clean-section h3 {
  margin: 0;
  color: var(--sumi);
  font-family: inherit;
}

.account-clean-header h2 {
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.account-clean-section h3 {
  font-size: 22px;
  line-height: 1.08;
  font-weight: 600;
}

.account-clean-header p,
.account-clean-section p {
  margin: 9px 0 0;
  color: color-mix(in srgb, var(--sumi) 78%, var(--muted) 22%);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
}

.account-clean-header p {
  font-size: 17px;
  line-height: 1.55;
}

.account-clean-header-copy {
  max-width: 640px;
}

.account-clean-status {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px 0 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}

.account-clean-status-label {
  font-family: "DM Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-clean-status span {
  font-family: inherit;
  font-size: 24px;
  font-weight: 600;
  color: var(--sumi);
  line-height: 1.1;
}

.account-clean-status small {
  font-family: "DM Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--muted);
  word-break: break-word;
}

.account-clean-section {
  display: grid;
  min-height: 0;
}

.account-clean-section-head {
  padding: 15px 16px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, var(--gold2) 18%);
  background: rgba(255,255,255,0.18);
}

.account-clean-rows {
  display: grid;
  padding: 12px 16px 16px;
  gap: 8px;
}

.account-clean-row {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 14px;
  border: 1px solid color-mix(in srgb, var(--border2) 75%, var(--gold2) 25%);
  background: color-mix(in srgb, var(--paper) 92%, white 8%);
  color: var(--sumi);
  text-align: left;
  cursor: pointer;
  font: inherit;
  border-radius: 2px;
}

.account-clean-row:hover {
  border-color: var(--gold2);
  background: color-mix(in srgb, var(--paper) 80%, white 20%);
  box-shadow: 0 8px 18px rgba(26,22,18,0.08);
}

.account-clean-row strong {
  display: block;
  font-family: inherit;
  font-size: 20px;
  line-height: 1.1;
  color: var(--sumi);
}

.account-clean-row small {
  display: block;
  margin-top: 4px;
  font-family: "DM Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}

.account-clean-row em {
  font-style: normal;
  font-family: "DM Mono", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--border2) 72%, var(--gold2) 28%);
  padding: 6px 9px;
  background: rgba(255,255,255,0.28);
  border-radius: 2px;
}

.account-clean-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px 16px;
}

.account-clean-actions button,
.account-clean-session button,
.account-clean-danger-toggle,
.account-clean-danger-body button {
  appearance: none;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--border2) 75%, var(--gold2) 25%);
  background: color-mix(in srgb, var(--paper) 92%, white 8%);
  color: var(--sumi);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  border-radius: 2px;
  padding: 0 14px;
}

.account-clean-actions button:last-child {
  grid-column: 1 / -1;
}

.account-clean-actions button:hover,
.account-clean-session button:hover,
.account-clean-danger-toggle:hover,
.account-clean-danger-body button:hover {
  border-color: var(--gold2);
  background: color-mix(in srgb, var(--paper) 80%, white 20%);
  box-shadow: 0 8px 18px rgba(26,22,18,0.08);
}

.account-clean-privacy {
  overflow: hidden;
}

.account-clean-privacy-toggle {
  appearance: none;
  width: 100%;
  border: 0;
  background: rgba(255,255,255,0.18);
  color: var(--sumi);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 15px 16px;
  cursor: pointer;
  font: inherit;
}

.account-clean-privacy-link {
  appearance: none;
  width: 100%;
  border: 0;
  background: rgba(255,255,255,0.18);
  color: var(--sumi);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 15px 16px;
  cursor: pointer;
  font: inherit;
}

.account-clean-privacy-toggle strong {
  display: block;
  font-family: inherit;
  font-size: 24px;
  line-height: 1.08;
  font-weight: 600;
  color: var(--sumi);
}

.account-clean-privacy-link strong {
  display: block;
  font-family: inherit;
  font-size: 24px;
  line-height: 1.08;
  font-weight: 600;
  color: var(--sumi);
}

.account-clean-privacy-link small {
  display: block;
  margin-top: 8px;
  max-width: 700px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.account-clean-toggle-label {
  font-family: "DM Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--border2) 72%, var(--gold2) 28%);
  padding: 6px 9px;
  background: rgba(255,255,255,0.22);
  border-radius: 2px;
}

.account-clean-chevron {
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  color: var(--muted);
  transition: transform 0.18s ease;
}

.account-clean-chevron.open {
  transform: rotate(225deg);
}

.account-clean-privacy-body {
  display: none;
  padding: 2px 16px 16px;
  border-top: 1px solid color-mix(in srgb, var(--border) 82%, var(--gold2) 18%);
}

.account-clean-privacy-body.open {
  display: block;
}

.account-clean-privacy-body p {
  max-width: 760px;
  font-size: 17px;
  line-height: 1.52;
  margin-top: 12px;
}

.account-clean-session {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background-image: none !important;
}

.account-clean-session-copy {
  max-width: 520px;
}

.account-clean-session button {
  min-width: 128px;
}

.account-clean-session p {
  font-size: 16px;
}

.account-clean-danger {
  border-color: color-mix(in srgb, var(--vermillion) 28%, var(--border) 72%);
  background: color-mix(in srgb, var(--paper2) 92%, var(--vermillion) 8%);
  overflow: hidden;
}

.account-clean-danger-toggle {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--vermillion) 22%, var(--border) 78%);
  padding: 15px 16px;
  color: var(--vermillion);
  background: color-mix(in srgb, var(--paper) 94%, white 6%);
}

.account-clean-danger-body {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 16px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--vermillion) 22%, var(--border) 78%);
}

.account-clean-danger-body.open {
  display: grid;
}

.account-clean-danger:not(.open) .account-clean-danger-toggle {
  border-top: 0;
}

.account-clean-danger-body p {
  margin-top: 6px;
  padding: 0;
  max-width: 560px;
}

.account-clean-danger-body button {
  color: var(--paper3);
  background: var(--vermillion);
  border-color: var(--vermillion);
  min-width: 190px;
}

.account-clean-danger-body button:hover {
  background: color-mix(in srgb, var(--vermillion) 84%, black 16%);
  box-shadow: 0 10px 22px rgba(192,57,43,0.20);
}

/* Reduced motion utility */
html.reduce-motion *,
@media (prefers-reduced-motion: reduce) {
  .account-clean-row,
  .account-clean-actions button,
  .account-clean-session button,
  .account-clean-danger-toggle,
  .account-clean-danger-body button,
  .account-clean-chevron {
    transition: none !important;
  }
}

/* Dark mode */
body.theme-dark #auth-modal .deadline-splash-card.deadline-form-content,
body.theme-charcoal #auth-modal .deadline-splash-card.deadline-form-content {
  background: #161618;
  border-color: rgba(255,255,255,0.08);
  background-image: none !important;
}

body.theme-dark .account-clean-header,
body.theme-dark .account-clean-section,
body.theme-charcoal .account-clean-header,
body.theme-charcoal .account-clean-section {
  background: rgba(255,255,255,0.028);
  border-color: rgba(255,255,255,0.08);
}

body.theme-dark .account-clean-header,
body.theme-charcoal .account-clean-header {
  background: transparent;
  border-color: transparent;
}

body.theme-dark .account-clean-section-head,
body.theme-dark .account-clean-privacy-toggle,
body.theme-dark .account-clean-privacy-link,
body.theme-charcoal .account-clean-section-head,
body.theme-charcoal .account-clean-privacy-toggle,
body.theme-charcoal .account-clean-privacy-link {
  background: rgba(255,255,255,0.018);
  border-bottom-color: rgba(255,255,255,0.08);
}

body.theme-dark .account-clean-header h2,
body.theme-dark .account-clean-section h3,
body.theme-dark .account-clean-status span,
body.theme-dark .account-clean-row strong,
body.theme-dark .account-clean-privacy-toggle strong,
body.theme-dark .account-clean-privacy-link strong,
body.theme-charcoal .account-clean-header h2,
body.theme-charcoal .account-clean-section h3,
body.theme-charcoal .account-clean-status span,
body.theme-charcoal .account-clean-row strong,
body.theme-charcoal .account-clean-privacy-toggle strong,
body.theme-charcoal .account-clean-privacy-link strong {
  color: #f2ece0;
}

body.theme-dark .account-clean-header p,
body.theme-dark .account-clean-section p,
body.theme-charcoal .account-clean-header p,
body.theme-charcoal .account-clean-section p {
  color: rgba(242,236,224,0.76);
}

body.theme-dark .account-clean-privacy-link small,
body.theme-charcoal .account-clean-privacy-link small {
  color: rgba(242,236,224,0.76);
}

body.theme-dark .account-clean-kicker,
body.theme-dark .account-clean-status small,
body.theme-dark .account-clean-row small,
body.theme-charcoal .account-clean-kicker,
body.theme-charcoal .account-clean-status small,
body.theme-charcoal .account-clean-row small {
  color: #b8b1a4;
}

body.theme-dark .account-clean-status,
body.theme-dark .account-clean-row,
body.theme-dark .account-clean-actions button,
body.theme-dark .account-clean-session button,
body.theme-dark .account-clean-danger-toggle,
body.theme-dark .account-clean-privacy-link,
body.theme-charcoal .account-clean-status,
body.theme-charcoal .account-clean-row,
body.theme-charcoal .account-clean-actions button,
body.theme-charcoal .account-clean-session button,
body.theme-charcoal .account-clean-danger-toggle,
body.theme-charcoal .account-clean-privacy-link {
  color: #f2ece0;
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.09);
}

body.theme-dark .account-clean-status,
body.theme-charcoal .account-clean-status {
  background: transparent;
  border-color: transparent;
}

body.theme-dark .account-clean-row:hover,
body.theme-dark .account-clean-actions button:hover,
body.theme-dark .account-clean-session button:hover,
body.theme-dark .account-clean-danger-toggle:hover,
body.theme-dark .account-clean-privacy-link:hover,
body.theme-charcoal .account-clean-row:hover,
body.theme-charcoal .account-clean-actions button:hover,
body.theme-charcoal .account-clean-session button:hover,
body.theme-charcoal .account-clean-danger-toggle:hover,
body.theme-charcoal .account-clean-privacy-link:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(216,200,176,0.44);
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}

body.theme-dark .account-clean-row em,
body.theme-dark .account-clean-toggle-label,
body.theme-charcoal .account-clean-row em,
body.theme-charcoal .account-clean-toggle-label {
  color: #d8c8b0;
  border-color: rgba(216,200,176,0.24);
  background: rgba(255,255,255,0.04);
}

body.theme-dark .account-clean-privacy-body,
body.theme-charcoal .account-clean-privacy-body {
  border-top-color: rgba(255,255,255,0.08);
}

body.theme-dark .account-clean-danger,
body.theme-charcoal .account-clean-danger {
  background: rgba(192,57,43,0.035);
  border-color: rgba(240,139,128,0.20);
}

body.theme-dark .account-clean-danger-toggle,
body.theme-charcoal .account-clean-danger-toggle {
  color: #f08b80;
}

@media (max-width: 760px) {
  #auth-modal .deadline-splash-card.deadline-form-content {
    width: calc(100vw - 18px);
  }

  .account-clean-header,
  .account-clean-session,
  .account-clean-danger-body {
    grid-template-columns: 1fr;
  }

  .account-clean-actions {
    grid-template-columns: 1fr;
  }

  .account-clean-actions button:last-child {
    grid-column: auto;
  }

  .account-clean-session button,
  .account-clean-danger-body button {
    width: 100%;
  }

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

  .account-clean-row em {
    width: fit-content;
  }

  .account-clean-privacy-toggle {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .account-clean-privacy-link {
    grid-template-columns: 1fr;
  }

  .account-clean-chevron {
    display: none;
  }
}