:root {
  color-scheme: light;
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --panel-strong: #eaf2ff;
  --text: #172033;
  --muted: #64748b;
  --line: #d8e2ee;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --cyan: #0f766e;
  --success: #15803d;
  --amber: #b45309;
  --danger: #dc2626;
  --radius: 8px;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
  --soft-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --card-border: rgba(203, 213, 225, 0.92);
  --surface-hover: #f1f6fd;
  --focus-ring: rgba(37, 99, 235, 0.16);
  --sidebar-bg: #101827;
  --sidebar-soft: #172235;
  --sidebar-line: #28384e;
}

/* Professional visual polish */
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --panel-strong: #eef4fb;
  --text: #111827;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #2f5f9f;
  --primary-dark: #244b7d;
  --cyan: #2f6f73;
  --success: #277a55;
  --amber: #a16207;
  --danger: #b42318;
  --shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  --soft-shadow: 0 4px 14px rgba(16, 24, 40, 0.06);
  --card-border: #d9e0ea;
  --surface-hover: #f5f7fa;
  --focus-ring: rgba(47, 95, 159, 0.18);
  --sidebar-bg: #111827;
  --sidebar-soft: #1f2937;
  --sidebar-line: #2f3a4a;
}

body[data-theme="dark"] {
  --bg: #0f141d;
  --panel: #161d29;
  --panel-soft: #1b2432;
  --panel-strong: #222d3d;
  --text: #eef2f7;
  --muted: #a2adbd;
  --line: #303b4c;
  --primary: #8aa7d6;
  --primary-dark: #7191c6;
  --cyan: #80b8b7;
  --success: #75b798;
  --amber: #d0a557;
  --danger: #f08a7c;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  --soft-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  --card-border: #303b4c;
  --surface-hover: #202938;
  --focus-ring: rgba(138, 167, 214, 0.18);
}

body,
.landing-shell,
body[data-theme="dark"],
body[data-theme="dark"] .landing-shell {
  background: var(--bg);
}

h1,
h2,
h3,
.hero-motto,
.metric strong,
.timer,
.focus-timer {
  font-weight: 800;
}

h1,
.hero-motto {
  line-height: 1.05;
}

.eyebrow,
.panel-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.landing-nav,
.topbar {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--line);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

body[data-theme="dark"] .landing-nav,
body[data-theme="dark"] .topbar {
  background: rgba(15, 20, 29, 0.94);
  border-color: var(--line);
}

.landing-nav-links a {
  border-radius: 6px;
  font-weight: 700;
}

.landing-hero {
  min-height: min(660px, calc(100vh - 86px));
  background: #ffffff;
}

.landing-hero > img {
  filter: saturate(0.88) contrast(0.96);
}

.landing-hero::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.82) 50%, rgba(255, 255, 255, 0.38));
}

body[data-theme="dark"] .landing-hero::after {
  background: linear-gradient(90deg, rgba(15, 20, 29, 0.96), rgba(15, 20, 29, 0.84) 50%, rgba(15, 20, 29, 0.44));
}

.hero-logo,
.auth-mark,
.logo {
  box-shadow: none;
}

.hero-points span,
.auth-highlights span,
.status-badge,
.pill,
.task-chip,
.due-pill,
.priority,
.status-pill,
.overdue-label {
  border-radius: 6px;
  font-weight: 700;
}

.hero-points span,
.status-badge,
.task-chip,
.pill {
  color: #344054;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.landing-section {
  padding-top: clamp(42px, 5vw, 70px);
  padding-bottom: clamp(42px, 5vw, 70px);
}

.product-preview-section,
.how-section,
.value-section,
body[data-theme="dark"] .product-preview-section,
body[data-theme="dark"] .how-section,
body[data-theme="dark"] .value-section {
  background: var(--bg);
}

.product-preview,
.preview-panel,
.feature-card,
.step-card,
.value-card,
.auth-panel,
.auth-card,
.metric,
.panel,
.session-card,
.planned-assignment,
.class-card,
.class-form,
.study-home,
.calendar-grid {
  background: var(--panel);
  border-color: var(--card-border);
  box-shadow: var(--soft-shadow);
}

.product-preview,
.auth-panel {
  padding: 0;
}

.preview-panel,
.feature-card,
.step-card,
.value-card,
.metric,
.panel,
.session-card,
.planned-assignment,
.class-card {
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.feature-card:hover,
.metric:hover,
.panel:hover,
.session-card:hover,
.planned-assignment:hover,
.class-card:hover {
  border-color: #bcc7d6;
  box-shadow: var(--soft-shadow);
}

.feature-card strong {
  margin-top: 30px;
}

.step-icon {
  color: var(--primary);
  background: #eef4fb;
  border: 1px solid #d6e2f1;
  border-radius: 8px;
}

.landing-footer {
  margin: 0;
  color: #c5cedb;
  background: #111827;
  border-radius: 0;
  box-shadow: none;
}

.footer-mission h2 span,
.text-button:hover {
  color: #a9c2e8;
}

.auth-copy {
  background: #111827;
}

.auth-card,
.auth-panel {
  backdrop-filter: none;
}

input,
select {
  background: var(--panel);
  border-color: var(--card-border);
  border-radius: 6px;
}

input:focus,
select:focus {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.primary,
.ghost,
.success {
  min-height: 40px;
  border-radius: 6px;
  font-weight: 700;
}

.primary,
.success {
  background: var(--primary);
  box-shadow: none;
}

.primary:hover,
.success:hover {
  background: var(--primary-dark);
}

.ghost {
  background: var(--panel);
}

.ghost:hover {
  background: var(--surface-hover);
  box-shadow: none;
}

.segmented {
  background: var(--panel-soft);
  border-color: var(--line);
}

.segmented .active {
  box-shadow: none;
}

.sidebar {
  background: var(--sidebar-bg);
}

.nav-icon {
  background: transparent;
  border-color: transparent;
  border-radius: 6px;
}

.nav-item:hover,
.nav-item.active {
  background: #1f2937;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon,
.sidebar-collapsed .nav-item.active .nav-icon {
  color: #ffffff;
  background: #2f5f9f;
  border-color: transparent;
  box-shadow: none;
}

.sidebar-toggle {
  border-radius: 6px;
  box-shadow: none;
}

.content {
  background: var(--bg);
}

.page-info-box {
  background: var(--panel);
  box-shadow: none;
}

.study-home {
  background: var(--panel);
  border-left-color: var(--primary);
}

.metric {
  min-height: 90px;
}

.metric::before {
  height: 3px;
}

.metric-teal::before,
.progress span,
.focus-progress span {
  background: var(--primary);
}

.metric-label small,
.due-main span,
.planned-main span,
.planned-meta,
.assignment-overview-row span,
.settings-grid span {
  font-weight: 650;
}

.streak-ring {
  border-width: 1px;
  background: var(--panel-soft);
  box-shadow: none;
}

.due-soon-item,
.task-row,
.empty,
.profile-preview-row,
.settings-grid div,
.assignment-overview-row,
.calendar-toolbar,
.assignment-filters,
.preview-metrics div,
.preview-progress,
.preview-task {
  background: var(--panel-soft);
  border-color: var(--card-border);
  box-shadow: none;
}

.empty {
  border-style: solid;
}

.avatar-preview {
  background: #20324d;
  box-shadow: none;
}

.timer,
.compact-timer,
.focus-timer {
  color: var(--text);
  font-weight: 750;
}

.focus-overlay {
  background: #0f141d;
}

.focus-core {
  background: #161d29;
  box-shadow: none;
  backdrop-filter: none;
}

.calendar-day,
.calendar-assignment,
.mini-day,
.mini-event {
  background: var(--panel);
}

.calendar-day.today,
.mini-day.today {
  background: #f0f5fb;
  box-shadow: inset 0 0 0 1px var(--primary);
}

body[data-theme="dark"] .calendar-day.today,
body[data-theme="dark"] .mini-day.today {
  background: #1b2432;
}

.priority-high {
  color: #912018;
  background: #fef3f2;
  border-color: #fecdca;
}

.priority-medium {
  color: #7a4d00;
  background: #fffaeb;
  border-color: #fedf89;
}

.priority-low {
  color: #244b7d;
  background: #eff4fb;
  border-color: #d6e2f1;
}

.status-pill,
.filter-chip.active {
  color: var(--primary);
  background: #eff4fb;
  border: 1px solid #d6e2f1;
}

.danger-button,
.overdue-label {
  color: var(--danger);
}

/* Playful FocusRoom polish */
:root {
  --bg: #f6f8ff;
  --panel: #ffffff;
  --panel-soft: #fbfcff;
  --panel-strong: #eef6ff;
  --text: #172033;
  --muted: #647188;
  --line: #dce5f3;
  --primary: #4169e1;
  --primary-dark: #3152b7;
  --cyan: #0e9f9a;
  --success: #2f9f66;
  --amber: #d08a18;
  --danger: #d94a3a;
  --shadow: 0 18px 44px rgba(44, 66, 130, 0.13);
  --soft-shadow: 0 8px 22px rgba(44, 66, 130, 0.08);
  --card-border: #dbe5f4;
  --surface-hover: #f1f6ff;
  --focus-ring: rgba(65, 105, 225, 0.2);
  --sidebar-bg: #151f35;
  --sidebar-soft: #223251;
  --sidebar-line: #314362;
  --play-coral: #ff6f61;
  --play-mint: #38bda4;
  --play-sun: #f3b33d;
  --play-sky: #59a9ff;
}

body[data-theme="dark"] {
  --bg: #101827;
  --panel: #172033;
  --panel-soft: #1d2940;
  --panel-strong: #243653;
  --text: #f2f7ff;
  --muted: #aab8cf;
  --line: #314362;
  --primary: #9eb6ff;
  --primary-dark: #7f9ff0;
  --cyan: #6ed7ca;
  --success: #7dd9a5;
  --amber: #efc46b;
  --danger: #ff9a85;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  --card-border: #314362;
  --surface-hover: #25344e;
  --focus-ring: rgba(158, 182, 255, 0.22);
  --sidebar-bg: #0f1726;
  --sidebar-soft: #1b2941;
  --sidebar-line: #2c3b58;
}

body {
  background:
    linear-gradient(180deg, rgba(246, 248, 255, 0.96), rgba(239, 246, 255, 0.96)),
    repeating-linear-gradient(135deg, rgba(65, 105, 225, 0.05) 0 1px, transparent 1px 18px);
}

body[data-theme="dark"] {
  background:
    linear-gradient(180deg, rgba(16, 24, 39, 0.98), rgba(18, 27, 45, 0.98)),
    repeating-linear-gradient(135deg, rgba(158, 182, 255, 0.05) 0 1px, transparent 1px 18px);
}

.landing-shell,
body[data-theme="dark"] .landing-shell {
  background: transparent;
}

.landing-nav,
.topbar,
.panel,
.metric,
.auth-card,
.feature-card,
.step-card,
.value-card,
.preview-panel,
.session-card,
.planned-assignment,
.class-card,
.calendar-day {
  border-color: var(--card-border);
  box-shadow: var(--soft-shadow);
}

.panel,
.metric,
.auth-card,
.feature-card,
.step-card,
.value-card,
.preview-panel,
.session-card,
.planned-assignment,
.class-card {
  border-radius: 10px;
}

.landing-nav,
.topbar {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(44, 66, 130, 0.08);
}

body[data-theme="dark"] .landing-nav,
body[data-theme="dark"] .topbar {
  background: rgba(23, 32, 51, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.landing-hero {
  border-bottom: 1px solid var(--line);
}

.landing-hero > img,
.auth-copy {
  filter: saturate(1.08) contrast(1.02);
}

.auth-copy,
.sidebar {
  background:
    linear-gradient(180deg, rgba(21, 31, 53, 0.98), rgba(24, 43, 74, 0.98)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 18px);
}

.primary,
.success {
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(65, 105, 225, 0.2);
}

.primary:hover,
.success:hover,
.ghost:hover,
.google-auth-button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.ghost {
  background: #ffffff;
  border-color: var(--line);
}

body[data-theme="dark"] .ghost {
  background: var(--panel-soft);
}

.metric {
  overflow: hidden;
  border-top: 0;
}

.metric::before {
  height: 5px;
}

.metric-blue::before,
.feature-card:nth-child(1) {
  border-top-color: var(--play-sky);
}

.metric-amber::before,
.feature-card:nth-child(2) {
  border-top-color: var(--play-sun);
}

.metric-green::before,
.feature-card:nth-child(3) {
  border-top-color: var(--play-mint);
}

.metric-teal::before,
.feature-card:nth-child(4) {
  border-top-color: var(--play-coral);
}

.feature-card,
.step-card,
.value-card,
.onboarding-step {
  border-top: 4px solid var(--play-sky);
}

.step-card:nth-child(2),
.value-card:nth-child(2),
.onboarding-step:nth-child(2) {
  border-top-color: var(--play-sun);
}

.step-card:nth-child(3),
.value-card:nth-child(3),
.onboarding-step:nth-child(3) {
  border-top-color: var(--play-mint);
}

.value-card:nth-child(4) {
  border-top-color: var(--play-coral);
}

.hero-points span,
.auth-highlights span,
.status-badge,
.pill,
.task-chip,
.due-pill,
.priority,
.status-pill,
.overdue-label {
  border-radius: 999px;
}

.hero-points span:nth-child(1),
.auth-highlights span:nth-child(1) {
  color: #205f84;
  background: #eaf7ff;
  border-color: #bbe5ff;
}

.hero-points span:nth-child(2),
.auth-highlights span:nth-child(2) {
  color: #87530d;
  background: #fff8df;
  border-color: #f8dfa1;
}

.hero-points span:nth-child(3),
.auth-highlights span:nth-child(3) {
  color: #1f6d55;
  background: #eafbf5;
  border-color: #bdebdc;
}

.hero-points span:nth-child(4) {
  color: #9c2f25;
  background: #fff0ed;
  border-color: #ffc9c1;
}

.hero-logo,
.auth-mark,
.landing-brand .logo {
  background: #ffffff;
  border: 2px solid #e3ecff;
  box-shadow: 0 10px 22px rgba(65, 105, 225, 0.16);
}

.hero-motto {
  max-width: 780px;
}

.hero-copy .eyebrow,
.panel-kicker,
.eyebrow {
  color: var(--primary-dark);
}

.landing-actions .primary,
.hero-actions .primary,
#authSubmit {
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.preview-task.done {
  border-left: 4px solid var(--play-mint);
}

.preview-task.urgent {
  border-left: 4px solid var(--play-coral);
}

.preview-task:not(.done):not(.urgent) {
  border-left: 4px solid var(--play-sky);
}

.mini-event.priority-border-high,
.calendar-assignment.priority-border-high {
  border-left-color: var(--play-coral);
}

.mini-event.priority-border-medium,
.calendar-assignment.priority-border-medium {
  border-left-color: var(--play-sun);
}

.mini-event.priority-border-low,
.calendar-assignment.priority-border-low {
  border-left-color: var(--play-sky);
}

.current-session-card {
  border-top: 4px solid var(--play-sky);
}

.streak-card {
  border-top: 4px solid var(--play-sun);
}

.due-soon-panel {
  border-top: 4px solid var(--play-mint);
}

button:disabled:hover {
  transform: none;
}

.priority-high,
.due-overdue .due-pill:first-child {
  color: #9c2f25;
  background: #fff0ed;
  border-color: #ffc9c1;
}

.priority-medium {
  color: #87530d;
  background: #fff8df;
  border-color: #f8dfa1;
}

.priority-low {
  color: #205f84;
  background: #eaf7ff;
  border-color: #bbe5ff;
}

.status-pill,
.filter-chip.active,
.segmented .active {
  color: var(--primary-dark);
  background: #edf4ff;
  border-color: #cbdcff;
}

body[data-theme="dark"] .status-pill,
body[data-theme="dark"] .filter-chip.active,
body[data-theme="dark"] .segmented .active {
  color: #dce6ff;
  background: #253a62;
  border-color: #3f5d94;
}

.onboarding-check {
  background: var(--play-sun);
}

.onboarding-step.done .onboarding-check,
.progress span,
.focus-progress span {
  background: var(--play-mint);
}

.calendar-day.today,
.mini-day.today {
  background: #edf7ff;
  box-shadow: inset 0 0 0 2px rgba(89, 169, 255, 0.42);
}

body[data-theme="dark"] .calendar-day.today,
body[data-theme="dark"] .mini-day.today {
  background: #203450;
}

.calendar-assignment,
.planned-assignment,
.due-soon-item,
.task-row,
.empty {
  border-radius: 10px;
}

.class-card {
  border-left-color: var(--play-mint);
}

.nav-item.active,
.nav-item:hover {
  background: #263653;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon,
.sidebar-collapsed .nav-item.active .nav-icon {
  background: var(--primary);
}

.timer,
.focus-timer,
.compact-timer {
  color: var(--primary-dark);
}

body[data-theme="dark"] .timer,
body[data-theme="dark"] .focus-timer,
body[data-theme="dark"] .compact-timer {
  color: #cddaff;
}

@media (prefers-reduced-motion: no-preference) {
  .panel,
  .metric,
  .feature-card,
  .step-card,
  .value-card,
  .planned-assignment,
  .class-card,
  .calendar-assignment,
  button {
    transition:
      transform 160ms ease,
      border-color 160ms ease,
      box-shadow 160ms ease,
      background 160ms ease;
  }

  .panel:hover,
  .metric:hover,
  .feature-card:hover,
  .step-card:hover,
  .value-card:hover,
  .planned-assignment:hover,
  .class-card:hover {
    transform: translateY(-2px);
  }
}

.onboarding-card {
  margin-top: 18px;
}

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

.onboarding-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.onboarding-ready {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 108px;
  padding: 16px;
  background: linear-gradient(180deg, #f0fdf4, #f8fbff);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
}

body[data-theme="dark"] .onboarding-ready {
  background: linear-gradient(180deg, #17281f, #172132);
  border-color: #315846;
}

.onboarding-ready strong,
.onboarding-ready span {
  display: block;
}

.onboarding-ready strong {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1.02rem;
}

.onboarding-ready span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.onboarding-step strong {
  display: block;
  min-width: 0;
  margin-bottom: 4px;
  line-height: 1.3;
}

.onboarding-step span:not(.onboarding-check) {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.onboarding-step button {
  grid-column: 1 / -1;
}

.onboarding-step.done {
  color: var(--muted);
  background: #f8fafc;
  border-color: #dce7f5;
}

body[data-theme="dark"] .onboarding-step.done {
  background: #151f2e;
  border-color: var(--line);
}

.onboarding-check {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #ffffff;
  border-radius: 999px;
  background: var(--line);
  font-weight: 900;
}

.onboarding-step.done .onboarding-check {
  background: var(--success);
}

@media (max-width: 720px) {
  .onboarding-list {
    grid-template-columns: 1fr;
  }
}

.checkbox-control {
  min-height: 45px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  padding-top: 22px;
  font-weight: 700;
}

.checkbox-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.next-up-actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 8px;
}

.next-up-actions .small-button {
  flex: 1 1 auto;
}

.due-soon-item {
  align-items: start;
}

.due-meta {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

/* Simplified settings page */
.settings-page {
  display: grid;
  gap: 16px;
  width: min(980px, 100%);
}

.settings-section {
  display: grid;
  gap: 16px;
}

.settings-section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.settings-section-header h3 {
  margin-bottom: 0;
}

.settings-form {
  gap: 14px;
}

.settings-profile-row,
.settings-meta-row,
.settings-email-box,
.settings-preferences-row {
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.settings-profile-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.settings-profile-row .avatar-preview {
  width: 76px;
  height: 76px;
  font-size: 1.25rem;
}

.settings-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-meta-row,
.settings-preferences-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.settings-meta-row span {
  color: var(--muted);
  font-weight: 700;
}

.settings-meta-row strong {
  color: var(--text);
}

.settings-security-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.85fr);
  gap: 16px;
}

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

.settings-email-box {
  display: grid;
  align-content: start;
  gap: 12px;
}

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

.settings-preferences-row .theme-segmented {
  width: min(320px, 100%);
}

@media (max-width: 780px) {
  .settings-section-header,
  .settings-preferences-row {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-security-grid,
  .settings-card-grid,
  .settings-profile-row,
  .form-two {
    grid-template-columns: 1fr;
  }
}

/* True final overrides */
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --panel-strong: #eef4fb;
  --text: #111827;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #2f5f9f;
  --primary-dark: #244b7d;
  --cyan: #2f6f73;
  --success: #277a55;
  --amber: #a16207;
  --danger: #b42318;
  --shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  --soft-shadow: 0 4px 14px rgba(16, 24, 40, 0.06);
  --card-border: #d9e0ea;
  --surface-hover: #f5f7fa;
  --focus-ring: rgba(47, 95, 159, 0.18);
  --sidebar-bg: #111827;
  --sidebar-soft: #1f2937;
  --sidebar-line: #2f3a4a;
}

body[data-theme="dark"] {
  --bg: #0f141d;
  --panel: #161d29;
  --panel-soft: #1b2432;
  --panel-strong: #222d3d;
  --text: #eef2f7;
  --muted: #a2adbd;
  --line: #303b4c;
  --primary: #8aa7d6;
  --primary-dark: #7191c6;
  --cyan: #80b8b7;
  --success: #75b798;
  --amber: #d0a557;
  --danger: #f08a7c;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  --soft-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  --card-border: #303b4c;
  --surface-hover: #202938;
  --focus-ring: rgba(138, 167, 214, 0.18);
}

.page-info-box {
  display: none !important;
}

@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr;
  }
}

:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --panel-strong: #eef4fb;
  --text: #111827;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #2f5f9f;
  --primary-dark: #244b7d;
  --cyan: #2f6f73;
  --success: #277a55;
  --amber: #a16207;
  --danger: #b42318;
  --shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  --soft-shadow: 0 4px 14px rgba(16, 24, 40, 0.06);
  --card-border: #d9e0ea;
  --surface-hover: #f5f7fa;
  --focus-ring: rgba(47, 95, 159, 0.18);
  --sidebar-bg: #111827;
  --sidebar-soft: #1f2937;
  --sidebar-line: #2f3a4a;
}

body[data-theme="dark"] {
  --bg: #0f141d;
  --panel: #161d29;
  --panel-soft: #1b2432;
  --panel-strong: #222d3d;
  --text: #eef2f7;
  --muted: #a2adbd;
  --line: #303b4c;
  --primary: #8aa7d6;
  --primary-dark: #7191c6;
  --cyan: #80b8b7;
  --success: #75b798;
  --amber: #d0a557;
  --danger: #f08a7c;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  --soft-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  --card-border: #303b4c;
  --surface-hover: #202938;
  --focus-ring: rgba(138, 167, 214, 0.18);
}

.page-info-box {
  display: none !important;
}

@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr;
  }
}

.page-info-box {
  display: none;
}

@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-home {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr;
  }
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1521;
  --panel: #171f2d;
  --panel-soft: #1d2737;
  --panel-strong: #263247;
  --text: #f0f5fc;
  --muted: #aebbd0;
  --line: #344258;
  --primary: #7c9cff;
  --primary-dark: #6386ee;
  --cyan: #5ec7dd;
  --success: #62c99a;
  --amber: #e0b15d;
  --danger: #ff9a76;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  --card-border: rgba(64, 80, 106, 0.92);
  --surface-hover: #202b3d;
  --focus-ring: rgba(124, 156, 255, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 42%, #e8eef6 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="dark"] {
  background: linear-gradient(180deg, #101826 0%, var(--bg) 48%, #0c111b 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: box-shadow 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

button:hover {
  transform: none;
}

button:active {
  transform: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.landing-shell {
  min-height: 100vh;
  background: linear-gradient(180deg, #fbfcff, #f5f8fc 58%, #ffffff);
  scroll-behavior: smooth;
}

body[data-theme="dark"] .landing-shell {
  background: var(--bg);
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 13px clamp(18px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(217, 226, 239, 0.8);
  backdrop-filter: blur(18px);
}

body[data-theme="dark"] .landing-nav {
  background: rgba(16, 20, 31, 0.88);
  border-color: var(--line);
}

.landing-brand,
.landing-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.landing-brand strong {
  font-size: 1rem;
}

.landing-nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.landing-nav-links a {
  padding: 8px 10px;
  color: #52657f;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: none;
}

.landing-nav-links a:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.07);
}

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

.landing-hero {
  position: relative;
  display: grid;
  min-height: min(720px, calc(100vh - 86px));
  align-items: center;
  overflow: hidden;
}

.landing-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-hero::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.82) 43%, rgba(255, 255, 255, 0.14)),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(248, 251, 255, 0.54));
  content: "";
}

body[data-theme="dark"] .landing-hero::after {
  background: linear-gradient(90deg, rgba(16, 20, 31, 0.95), rgba(16, 20, 31, 0.78) 48%, rgba(16, 20, 31, 0.24));
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(700px, 100%);
  padding: clamp(42px, 6vw, 76px) clamp(22px, 5.5vw, 76px);
  animation: heroRise 420ms ease;
}

.hero-brand-lockup {
  display: flex;
  gap: clamp(14px, 1.8vw, 22px);
  align-items: center;
  max-width: 680px;
  margin-bottom: 10px;
}

.hero-logo {
  flex: 0 0 auto;
  width: clamp(56px, 5.4vw, 76px);
  height: clamp(56px, 5.4vw, 76px);
  object-fit: contain;
  padding: 3px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(49, 87, 213, 0.16);
  border-radius: 50%;
  box-shadow: 0 16px 32px rgba(30, 99, 214, 0.18);
}

.hero-copy h1 {
  max-width: 680px;
  margin-bottom: 0;
  font-size: clamp(2.35rem, 4.3vw, 4.1rem);
  line-height: 1;
  text-wrap: balance;
}

.hero-motto {
  max-width: 680px;
  margin-bottom: 14px;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 3.55rem);
  font-weight: 950;
  line-height: 1.02;
  text-wrap: balance;
}

.hero-copy p:not(.eyebrow):not(.hero-motto) {
  max-width: 590px;
  color: #3d4e68;
  font-size: clamp(1rem, 1.2vw, 1.14rem);
  line-height: 1.68;
}

body[data-theme="dark"] .hero-copy p:not(.eyebrow):not(.hero-motto) {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-points span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  color: #27405f;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(198, 215, 237, 0.95);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
}

body[data-theme="dark"] .hero-points span {
  color: #d8e7ff;
  background: rgba(20, 27, 40, 0.82);
  border-color: #324259;
}

.landing-section {
  padding: clamp(46px, 6vw, 84px) clamp(18px, 5vw, 72px);
}

.product-preview-section {
  background: linear-gradient(180deg, #ffffff, #f6f9fd 74%, #ffffff);
}

.section-heading {
  max-width: 790px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.08;
  text-wrap: balance;
}

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

.feature-card {
  position: relative;
  min-height: 210px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #dbe7f7;
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(28, 39, 65, 0.07);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.feature-card:hover {
  border-color: #c6daf3;
  box-shadow: 0 14px 30px rgba(28, 39, 65, 0.12);
}

body[data-theme="dark"] .feature-card {
  background: #1b2433;
  border-color: #2e3b52;
}

.feature-card strong {
  display: block;
  margin: 34px 0 9px;
  font-size: 1.05rem;
}

.feature-card > span {
  position: absolute;
  top: 18px;
  left: 20px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 950;
}

.feature-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.product-preview {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 16px;
  align-items: stretch;
  padding: clamp(12px, 1.8vw, 16px);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.07), transparent 44%),
    linear-gradient(315deg, rgba(15, 118, 110, 0.07), transparent 46%),
    rgba(255, 255, 255, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.1);
}

.preview-panel {
  display: grid;
  gap: 12px;
  min-height: 320px;
  padding: clamp(16px, 2.2vw, 22px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
}

body[data-theme="dark"] .product-preview-section {
  background: #111827;
}

body[data-theme="dark"] .product-preview,
body[data-theme="dark"] .preview-panel {
  background: #1b2433;
  border-color: var(--line);
}

.preview-topline,
.preview-metrics,
.preview-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.preview-topline span,
.preview-metrics span,
.preview-progress span,
.preview-task small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.preview-topline strong {
  font-size: 1.05rem;
}

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

.preview-metrics div,
.preview-progress {
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.preview-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 1.55rem;
  line-height: 1;
}

.preview-task-list {
  display: grid;
  gap: 10px;
}

.preview-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.preview-task > span {
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 999px;
}

.preview-task.done > span {
  background: var(--success);
}

.preview-task.urgent > span {
  background: var(--amber);
}

.preview-task strong,
.preview-task small {
  display: block;
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.mini-weekday {
  min-height: 28px;
  padding: 7px 4px;
  color: var(--muted);
  background: #f1f5f9;
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  font-size: 0.66rem;
  font-weight: 950;
  text-align: center;
}

.mini-weekday:nth-child(7) {
  border-right: 0;
}

.mini-day {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 74px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

.mini-day:nth-child(7n) {
  border-right: 0;
}

.mini-day strong {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  align-items: center;
  color: var(--text);
  font-size: 0.72rem;
}

.mini-day em {
  color: var(--primary);
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.mini-day.outside strong {
  color: var(--muted);
}

.mini-day.today {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.mini-event {
  display: grid;
  gap: 4px;
  padding: 5px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-left: 3px solid #c7dbf9;
  border-radius: 7px;
}

.mini-event b {
  overflow: hidden;
  color: var(--text);
  font-size: 0.62rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-event .priority {
  width: max-content;
  min-height: 18px;
  padding: 0 6px;
  font-size: 0.58rem;
}

.preview-progress {
  align-self: end;
  display: grid;
  gap: 12px;
}

.preview-progress strong {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.preview-progress .priority {
  min-height: 24px;
  font-size: 0.72rem;
}

.preview-progress .priority-high {
  color: #991b1b;
}

.preview-progress .priority-medium {
  color: #854d0e;
}

.preview-progress .priority-low {
  color: #1d4ed8;
}

.how-section {
  background: #ffffff;
}

.steps-grid,
.value-grid {
  display: grid;
  gap: 14px;
}

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

.step-card,
.value-card {
  padding: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.step-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: 999px;
  font-weight: 950;
}

.step-card strong,
.value-card strong {
  display: block;
  margin-bottom: 9px;
  font-size: 1.02rem;
}

.step-card p,
.value-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.value-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(20px, 4vw, 36px);
  align-items: start;
  padding-bottom: clamp(46px, 7vw, 84px);
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.value-copy {
  position: sticky;
  top: 92px;
}

.value-copy h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

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

.value-card:last-child {
  grid-column: 1 / -1;
}

body[data-theme="dark"] .how-section,
body[data-theme="dark"] .value-section {
  background: #111827;
}

body[data-theme="dark"] .preview-task,
body[data-theme="dark"] .preview-metrics div,
body[data-theme="dark"] .preview-progress,
body[data-theme="dark"] .step-card,
body[data-theme="dark"] .value-card {
  background: #1b2433;
  border-color: var(--line);
}

body[data-theme="dark"] .mini-calendar {
  background: #172033;
  border-color: var(--line);
}

body[data-theme="dark"] .mini-weekday {
  background: #182234;
  border-color: var(--line);
}

body[data-theme="dark"] .mini-day {
  background: #172033;
  border-color: var(--line);
}

body[data-theme="dark"] .mini-day.today {
  background: #162641;
}

body[data-theme="dark"] .mini-event {
  background: #1b2433;
  border-color: var(--line);
}

.landing-footer {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(420px, 1.05fr);
  gap: clamp(22px, 4vw, 46px);
  align-items: center;
  margin: 6px clamp(14px, 3vw, 34px) 0;
  padding: clamp(24px, 3.2vw, 36px) clamp(22px, 5vw, 52px) 18px;
  color: #b9c6d8;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent 42%),
    linear-gradient(135deg, #08111f, #0d1728 58%, #0a1c2a);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.12);
}

.footer-mission {
  display: grid;
  gap: 10px;
}

.footer-mission h2 {
  max-width: 520px;
  color: #f8fbff;
  font-size: clamp(1.45rem, 2.5vw, 2.25rem);
  line-height: 1.08;
}

.footer-mission h2 span {
  color: #5eead4;
}

.footer-mission p {
  max-width: 560px;
  margin: 0;
  color: #b9c6d8;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.55;
}

.footer-logo-row {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: #f8fbff;
}

.footer-logo-row .logo {
  width: 30px;
  height: 30px;
}

.footer-link-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr 0.85fr;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius);
}

.footer-link-group {
  display: grid;
  align-content: start;
  gap: 7px;
}

.footer-link-group strong {
  color: #e6edf7;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-link-group span,
.footer-link-group .text-button {
  color: #a8b6ca;
  font-size: 0.8rem;
  font-weight: 800;
}

.text-button {
  padding: 0;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.text-button:hover {
  color: #5eead4;
  transform: none;
}

.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.footer-bottom p {
  margin: 0;
  color: #8493aa;
  font-size: 0.86rem;
  font-weight: 800;
}

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

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 430px);
  gap: 42px;
  width: min(1100px, 100%);
  min-height: 640px;
  align-items: stretch;
  padding: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(217, 226, 239, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  padding: clamp(28px, 6vw, 64px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(22, 32, 51, 0.94), rgba(49, 87, 213, 0.88)),
    linear-gradient(45deg, rgba(8, 145, 178, 0.28), rgba(183, 121, 31, 0.2));
  border-radius: var(--radius);
  overflow: hidden;
}

.auth-mark,
.logo {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 50%;
}

.auth-mark {
  margin-bottom: 28px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.auth-card {
  position: relative;
  align-self: center;
  padding: clamp(20px, 3vw, 30px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

.auth-back-button {
  width: fit-content;
  min-height: 34px;
  margin-bottom: 14px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 850;
}

.auth-back-button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.google-auth-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.google-auth-button span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #ffffff;
  background: #4285f4;
  border-radius: 999px;
  font-weight: 900;
}

.google-auth-button:hover {
  background: var(--panel-soft);
  border-color: var(--primary);
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.form-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}

.form-heading strong {
  font-size: 1.35rem;
}

.form-heading span {
  color: var(--muted);
  font-size: 0.92rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 5vw, 5.2rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 2rem;
}

h3 {
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.eyebrow,
.panel-kicker {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-copy .eyebrow,
.auth-copy .muted {
  color: rgba(255, 255, 255, 0.78);
}

.auth-copy .muted {
  max-width: 560px;
  font-size: 1.08rem;
  line-height: 1.65;
}

.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.auth-highlights span,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.auth-highlights span {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.status-badge {
  color: #31507d;
  background: #eaf2ff;
  border: 1px solid #d7e6ff;
}

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

.form {
  display: grid;
  gap: 15px;
}

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

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 800;
}

body[data-theme="dark"] label {
  color: #d5deec;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  outline: none;
  transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #111827;
  border-color: var(--line);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b9c7dd;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

textarea {
  min-height: 92px;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
}

.subtask-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

body[data-theme="dark"] .subtask-editor {
  border-color: var(--line);
}

.subtask-editor-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.subtask-editor-heading span,
.subtask-editor-heading small {
  display: block;
}

.subtask-editor-heading span {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
}

.subtask-editor-heading small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.subtask-inputs {
  display: grid;
  gap: 8px;
}

.subtask-input-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.subtask-input-row input {
  min-height: 38px;
}

.subtask-check-label {
  display: grid;
  width: 36px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  place-items: center;
}

.subtask-check-label input {
  width: 16px;
  min-height: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  background: #eef3fb;
  border: 1px solid #e3eaf5;
  border-radius: var(--radius);
}

.segmented button {
  min-height: 40px;
  color: var(--muted);
  background: transparent;
  border-radius: 7px;
  font-weight: 900;
}

.segmented .active {
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(28, 39, 65, 0.12);
}

.primary,
.ghost,
.success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  border-radius: var(--radius);
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #0f766e);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.22);
}

.primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #0d665f);
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--card-border);
}

body[data-theme="dark"] .ghost {
  background: #151e2c;
}

.ghost:hover {
  border-color: #b9c7dd;
  background: var(--surface-hover);
  box-shadow: 0 8px 20px rgba(28, 39, 65, 0.08);
}

button:disabled,
.ghost[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
}

.success {
  color: #fff;
  background: var(--success);
  box-shadow: 0 12px 24px rgba(22, 129, 95, 0.2);
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 800;
}

.inline-helper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 800;
}

.inline-helper .small-button {
  min-height: 32px;
}

.success-message {
  min-height: 20px;
  margin: 0;
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 258px 1fr;
  min-height: 100vh;
  min-width: 0;
  transition: grid-template-columns 220ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 58px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 11px;
  color: #c5d2e6;
  background:
    linear-gradient(180deg, rgba(31, 41, 55, 0.42), rgba(16, 24, 39, 0) 28%),
    var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-line);
  transition: padding 220ms ease, width 220ms ease;
}

body[data-theme="dark"] .sidebar {
  color: #c5d2e6;
  background: #111a28;
  border-color: #2a3950;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.logo {
  padding: 2px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(49, 87, 213, 0.14);
  box-shadow: 0 10px 20px rgba(30, 99, 214, 0.12);
}

.brand-logo-frame {
  display: block;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  overflow: hidden;
  background: var(--sidebar-bg);
  border: 2px solid #2f5f9f;
  border-radius: 50%;
}

.brand .logo {
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: scale(1.28);
  transform-origin: center;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.sidebar-copy,
.brand small {
  min-width: 0;
}

.brand small {
  display: block;
  max-width: 178px;
  overflow: hidden;
  color: #8ea6c8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  gap: 4px;
  background: var(--sidebar-soft);
  border: 1px solid #344862;
  border-radius: var(--radius);
}

.sidebar-toggle:hover {
  background: #223550;
}

body[data-theme="dark"] .sidebar-toggle:hover {
  background: #223550;
}

.sidebar-toggle span {
  display: block;
  width: 15px;
  height: 2px;
  background: #9ab4d5;
  border-radius: 999px;
  transition: background 160ms ease, width 160ms ease;
}

body[data-theme="dark"] .sidebar-toggle span {
  background: #9ab4d5;
}

.side-nav {
  display: grid;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid var(--sidebar-line);
}

body[data-theme="dark"] .side-nav {
  border-top-color: #2c3f57;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 9px;
  color: #b4c5dc;
  text-align: left;
  background: transparent;
  border-radius: var(--radius);
  font-weight: 800;
  overflow: hidden;
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #98aed0;
  background: #18253a;
  border-radius: 7px;
  border: 1px solid #314a67;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label,
.sidebar-copy {
  opacity: 1;
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
  color: #f2f7ff;
  background: #20324b;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: #d9e9ff;
  background: #1e63d6;
  border-color: #60a5fa;
  box-shadow: 0 10px 24px rgba(30, 99, 214, 0.34);
}

.sidebar-collapsed .sidebar {
  padding: 22px 7px 8px;
}

.sidebar-collapsed .sidebar-header {
  display: grid;
  gap: 0;
  justify-content: center;
  justify-items: center;
  margin-bottom: 26px;
}

.sidebar-collapsed .sidebar-copy,
.sidebar-collapsed .nav-label {
  width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
}

.sidebar-collapsed .logo {
  display: none;
}

.sidebar-collapsed .brand {
  display: none;
  gap: 0;
}

.sidebar-collapsed .sidebar-toggle {
  position: static;
  transform: none;
  width: 40px;
  height: 36px;
}

.sidebar-collapsed .side-nav {
  gap: 3px;
  margin-top: 0;
  border-top: 1px solid #2c3f57;
  padding-top: 8px;
}

.sidebar-collapsed .nav-item {
  grid-template-columns: 34px;
  justify-content: center;
  align-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0 4px;
  margin: 0 auto;
  overflow: visible;
}

.sidebar-collapsed .nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
}

.sidebar-collapsed .nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-collapsed .nav-item::after {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 80;
  padding: 7px 10px;
  color: #eaf3ff;
  background: #0d1726;
  border: 1px solid #2e4563;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.sidebar-collapsed .nav-item:hover::after,
.sidebar-collapsed .nav-item:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar-collapsed .nav-item.active {
  background: transparent;
}

.sidebar-collapsed .nav-item.active .nav-icon {
  color: #d9e9ff;
  background: #1e63d6;
  border-color: #60a5fa;
  box-shadow: 0 10px 24px rgba(30, 99, 214, 0.34);
}

.content {
  grid-column: 2;
  min-width: 0;
  padding: clamp(18px, 3vw, 32px);
}

.view {
  width: min(1400px, 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  margin: calc(clamp(18px, 3vw, 32px) * -1) calc(clamp(18px, 3vw, 32px) * -1) 20px;
  padding: clamp(15px, 2.4vw, 22px) clamp(18px, 3vw, 32px) 14px;
  background: rgba(238, 243, 248, 0.9);
  border-bottom: 1px solid rgba(203, 213, 225, 0.78);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(16px);
}

body[data-theme="dark"] .topbar {
  background: rgba(15, 21, 33, 0.88);
  border-bottom-color: rgba(52, 66, 88, 0.72);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.topbar-title {
  min-width: 0;
}

.page-title-row {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.page-info-box {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  width: min(460px, 44vw);
  max-width: min(480px, 46vw);
  min-height: 32px;
  gap: 8px;
  padding: 6px 10px;
  color: #52657f;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
  transform: translateY(-50%);
}

.page-info-box::before {
  position: absolute;
  left: -5px;
  width: 9px;
  height: 9px;
  background: inherit;
  border-left: 1px solid rgba(148, 163, 184, 0.42);
  border-bottom: 1px solid rgba(148, 163, 184, 0.42);
  content: "";
  transform: rotate(45deg);
}

.page-info-toggle {
  display: inline-grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border: 0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 950;
}

.page-info-toggle:hover {
  transform: none;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.page-info-box.collapsed {
  width: auto;
  max-width: 38px;
  gap: 0;
  padding: 6px 9px;
  box-shadow: none;
}

.page-info-box.collapsed::before {
  display: none;
}

.page-info-box.collapsed #pageInfoText {
  display: none;
}

body[data-theme="dark"] .page-info-box {
  color: #b8c5d7;
  background: rgba(29, 39, 55, 0.68);
  border-color: rgba(100, 116, 139, 0.5);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"] .page-info-box::before {
  border-color: rgba(100, 116, 139, 0.5);
}

@media (min-width: 1000px) {
  .content {
    padding: 20px 24px;
  }

  .topbar {
    margin: -20px -24px 14px;
    padding: 14px 24px 12px;
  }

  .topbar h2 {
    font-size: 1.72rem;
  }

  .topbar .eyebrow {
    margin-bottom: 5px;
  }

  .topbar-actions .ghost,
  .topbar-actions .status-badge {
    min-height: 38px;
  }
}

#dashboardView {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

#dashboardView .study-home,
#dashboardView .metrics {
  margin-bottom: 0;
}

#dashboardView .focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-bottom: 0;
  min-height: 0;
}

#dashboardView .current-session-card {
  grid-column: auto;
  grid-row: auto;
}

#dashboardView .streak-card {
  grid-column: auto;
  grid-row: auto;
}

#dashboardView .due-soon-panel {
  grid-column: auto;
  grid-row: auto;
  min-height: 0;
}

@media (min-width: 1000px) {
  #dashboardView .panel,
  #dashboardView .metric,
  #dashboardView .study-home {
    box-shadow: 0 8px 22px rgba(28, 39, 65, 0.07);
  }
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.study-home {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 18px;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent 48%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

body[data-theme="dark"] .study-home {
  background: linear-gradient(135deg, #191f2c, #172234);
  border-color: var(--line);
}

.study-home h3 {
  margin-bottom: 4px;
  font-size: 1.12rem;
}

.study-home .muted {
  max-width: 620px;
  margin-bottom: 0;
}

.study-home .primary {
  flex: 0 0 auto;
}

.metric,
.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

.panel-heading h3,
.panel h3 {
  line-height: 1.15;
}

body[data-theme="dark"] .metric,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .session-card {
  background: rgba(23, 29, 42, 0.94);
  border-color: var(--line);
}

.metric {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 16px 18px;
  overflow: hidden;
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.metric:hover,
.panel:hover {
  border-color: #c8d8ec;
}

.metric:hover {
  box-shadow: 0 14px 32px rgba(28, 39, 65, 0.1);
}

.metric::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  width: auto;
  content: "";
}

.metric-blue::before {
  background: var(--primary);
}

.metric-green::before {
  background: var(--success);
}

.metric-amber::before {
  background: var(--amber);
}

.metric-teal::before {
  background: linear-gradient(90deg, var(--primary), var(--success));
}

.metric span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.metric-label {
  display: grid;
  gap: 4px;
}

.metric-label small {
  color: #8a98ad;
  font-size: 0.78rem;
  font-weight: 800;
}

.metric strong {
  font-size: 1.9rem;
  line-height: 1;
}

.panel {
  padding: 17px;
}

.panel h3,
.metric strong,
.session-card strong,
.calendar-assignment-main strong,
.due-main strong {
  overflow-wrap: anywhere;
}

.dashboard-grid,
.focus-grid,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: 14px;
}

.focus-grid {
  margin-bottom: 16px;
}

.current-session-card {
  min-height: 0;
}

.compact-timer {
  margin-top: 8px;
  font-size: clamp(2.45rem, 5vw, 3.55rem);
}

.streak-card {
  display: grid;
  align-content: start;
}

.streak-ring {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  margin: 0 auto 12px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(var(--success), var(--primary), #f59e0b, var(--success)) border-box;
  border: 7px solid transparent;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #edf1f7;
}

body[data-theme="dark"] .streak-ring {
  background:
    linear-gradient(#171d2a, #171d2a) padding-box,
    conic-gradient(var(--success), var(--primary), #39445a, var(--success)) border-box;
  box-shadow: inset 0 0 0 1px #303a4d;
}

.streak-ring strong {
  margin-top: 8px;
  font-size: 1.9rem;
  line-height: 0.8;
}

.streak-ring span {
  margin-top: -18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.streak-summary {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.streak-summary div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 8px 10px;
  background: var(--panel-soft);
  border: 1px solid #e4ebf5;
  border-radius: var(--radius);
}

.streak-summary span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.streak-summary strong {
  font-size: 0.95rem;
}

.streak-details-button {
  width: 100%;
  margin-top: 10px;
}

.due-soon-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  overflow: hidden;
}

.due-soon-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

.due-soon-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 11px 12px;
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
  border: 1px solid var(--card-border);
  border-left: 3px solid #c9d8ef;
  border-radius: var(--radius);
  transition: background 160ms ease, border-color 160ms ease;
}

.due-soon-item:hover {
  background: var(--surface-hover);
}

.due-soon-item .small-button {
  grid-column: 1 / -1;
  justify-self: start;
}

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

.due-main strong,
.due-main span {
  display: block;
}

.due-main span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.due-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.due-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
  color: #31507d;
  background: #eaf2ff;
}

.due-overdue {
  border-left-color: var(--danger);
  background: #fff8f1;
}

.due-overdue .due-pill {
  color: #9a3412;
  background: #ffedd5;
}

.due-urgent {
  border-left-color: #b7791f;
  background: #fffdf3;
}

.due-urgent .due-pill {
  color: #8a5a16;
  background: #fef3c7;
}

body[data-theme="dark"] .streak-summary div,
body[data-theme="dark"] .task-row {
  background: var(--panel-soft);
  border-color: var(--line);
}

body[data-theme="dark"] .due-soon-item {
  background: linear-gradient(180deg, #1d2737, #182234);
  border-color: var(--line);
  border-left-color: #4a5f81;
}

body[data-theme="dark"] .due-overdue {
  background: #2a1f1c;
}

body[data-theme="dark"] .due-urgent {
  background: #2b281f;
}

body[data-theme="dark"] .due-pill {
  color: #dbe8ff;
  background: #202a3b;
}

.upcoming-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.task-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  color: #31507d;
  background: #eaf2ff;
  border: 1px solid #d7e6ff;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.muted-chip {
  color: var(--muted);
  background: var(--panel-soft);
  border-color: var(--line);
}

body[data-theme="dark"] .task-chip,
body[data-theme="dark"] .pill,
body[data-theme="dark"] .status-badge {
  color: #dbe8ff;
  background: #202a3b;
  border-color: #334056;
}

@media (min-width: 1000px) and (max-height: 820px) {
  .landing-hero {
    min-height: calc(100vh - 84px);
  }

  .hero-copy {
    width: min(760px, 100%);
    padding-top: clamp(28px, 4.2vw, 54px);
    padding-bottom: clamp(24px, 4vw, 46px);
  }

  .hero-copy h1 {
    max-width: 620px;
    font-size: clamp(2.25rem, 3.9vw, 3.75rem);
    line-height: 1.02;
  }

  .hero-logo {
    width: clamp(54px, 5.2vw, 76px);
    height: clamp(54px, 5.2vw, 76px);
  }

  .hero-motto {
    max-width: 600px;
    font-size: clamp(1.85rem, 3.35vw, 3.25rem);
    line-height: 1.05;
  }

  .hero-copy p:not(.eyebrow):not(.hero-motto) {
    max-width: 540px;
    line-height: 1.5;
  }
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
}

.stack {
  display: grid;
  gap: 12px;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 42px;
  gap: 10px;
  align-items: end;
  padding: 13px;
  background: var(--panel-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.icon-button {
  width: 42px;
  height: 42px;
  color: var(--danger);
  background: #fff7ed;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 900;
}

.timer-panel {
  min-height: 420px;
}

#startView.study-active .split {
  grid-template-columns: minmax(0, 1fr);
}

#startView.study-active .split > article:first-child {
  display: none;
}

.focus-setup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: end;
  margin: 10px 0;
}

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

.custom-minutes-field {
  gap: 5px;
  font-size: 0.78rem;
}

.custom-minutes-field input {
  min-height: 38px;
}

.focus-phase-label,
.focus-progress-label {
  margin: 0 0 10px;
  font-size: 0.84rem;
  font-weight: 850;
}

.focus-task-checklist,
.session-reflection-panel {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

body[data-theme="dark"] .focus-task-checklist,
body[data-theme="dark"] .session-reflection-panel {
  border-color: var(--line);
}

.focus-checklist-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.focus-checklist-heading strong {
  color: var(--text);
}

.focus-check-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-weight: 850;
}

.focus-check-item input {
  width: 16px;
  min-height: 16px;
}

.focus-check-item.done {
  color: var(--muted);
}

.focus-check-item.done span {
  text-decoration: line-through;
}

.focus-checklist-empty {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.distraction-notes-label {
  margin-top: 12px;
}

.session-reflection-panel h4 {
  margin: 0;
}

.session-summary-grid,
.session-detail-grid {
  display: grid;
  gap: 8px;
}

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

.session-summary-grid div,
.session-detail-grid span {
  padding: 9px 10px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

body[data-theme="dark"] .session-summary-grid div,
body[data-theme="dark"] .session-detail-grid span {
  background: #151f2e;
  border-color: var(--line);
}

.session-summary-grid span,
.session-detail-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.session-summary-grid strong {
  display: block;
  margin-top: 3px;
}

.session-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0;
}

.session-reflection-text,
.session-distraction-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.5;
}

.empty {
  display: grid;
  min-height: 170px;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: linear-gradient(135deg, #f8fafc, #f0f7ff);
  border: 1px dashed #c8d6ea;
  border-radius: var(--radius);
}

.action-empty {
  align-content: center;
  gap: 9px;
}

.action-empty strong {
  color: var(--text);
  font-size: 1rem;
}

.action-empty span {
  max-width: 28ch;
  line-height: 1.45;
}

.guided-empty {
  justify-items: center;
}

.guided-empty .small-button {
  margin-top: 2px;
}

.empty-icon {
  width: 38px;
  height: 38px;
  padding: 7px;
  object-fit: contain;
  background: #eaf2ff;
  border: 1px solid #d7e6ff;
  border-radius: 999px;
}

body[data-theme="dark"] .empty-icon {
  color: #dbe8ff;
  background: #202a3b;
  border-color: #334056;
}

body[data-theme="dark"] .empty {
  background: linear-gradient(135deg, #172033, #1b273a);
  border-color: #40536f;
}

.timer {
  margin: 22px 0 10px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.2rem, 9vw, 5.8rem);
  font-weight: 950;
  line-height: 1;
}

.current-task {
  min-height: 30px;
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 950;
}

.progress {
  height: 9px;
  overflow: hidden;
  background: #e8eef8;
  border-radius: 999px;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

body.focus-open {
  overflow: hidden;
}

.focus-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.18), transparent 42%),
    linear-gradient(315deg, rgba(8, 145, 178, 0.18), transparent 44%),
    #070d16;
}

.focus-overlay-shell {
  display: grid;
  gap: 20px;
  width: min(980px, 100%);
}

.focus-exit-button {
  justify-self: end;
  min-height: 38px;
  padding: 0 14px;
  color: #c7d7ef;
  background: rgba(17, 28, 46, 0.7);
  border: 1px solid rgba(112, 146, 194, 0.4);
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 800;
}

.focus-core {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: min(78vh, 760px);
  padding: clamp(24px, 6vw, 56px);
  text-align: center;
  color: #f4f8ff;
  background: rgba(10, 18, 31, 0.74);
  border: 1px solid rgba(88, 124, 174, 0.36);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
  animation: focusFade 220ms ease;
}

.focus-session-name {
  margin: 0;
  color: #a9bbd8;
  font-size: 0.88rem;
  font-weight: 800;
}

.focus-task-name {
  max-width: 760px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.4rem, 3.3vw, 2.35rem);
  line-height: 1.14;
  text-wrap: balance;
}

.focus-timer {
  font-variant-numeric: tabular-nums;
  font-size: clamp(4.2rem, 14vw, 9.2rem);
  font-weight: 950;
  line-height: 0.9;
}

.focus-progress {
  width: min(720px, 100%);
  height: 14px;
  overflow: hidden;
  background: rgba(148, 181, 228, 0.2);
  border: 1px solid rgba(104, 141, 193, 0.48);
  border-radius: 999px;
}

.focus-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  border-radius: inherit;
  transition: width 220ms ease;
}

.focus-progress-label {
  margin: 0;
  color: #c7d7ef;
  font-size: 0.9rem;
  font-weight: 800;
}

.focus-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

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

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.panel-heading > * {
  min-width: 0;
}

.sessions-list {
  display: grid;
  gap: 14px;
}

.session-card {
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(28, 39, 65, 0.05);
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.session-card:hover {
  border-color: #c8d8ec;
  box-shadow: 0 14px 30px rgba(28, 39, 65, 0.08);
}

body[data-theme="dark"] .session-card {
  background: linear-gradient(180deg, #171f2d, #151d2a);
}

.session-action {
  margin-bottom: 12px;
}

.session-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.assignment-overview,
.settings-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.settings-stack {
  display: grid;
  gap: 18px;
}

.account-card {
  display: grid;
  gap: 16px;
}

.settings-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.settings-card-header h3,
.account-card h3 {
  margin-bottom: 0;
}

.settings-card-header .panel-kicker {
  margin-bottom: 6px;
}

.account-card .form {
  gap: 14px;
}

.profile-preview-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.avatar-preview {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  overflow: hidden;
  color: #d9e9ff;
  background: linear-gradient(135deg, #22385a, #0f766e);
  border: 1px solid #426289;
  border-radius: var(--radius);
  font-size: 1.6rem;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(15, 35, 62, 0.16);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-controls {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.file-control-label {
  color: #344054;
  font-size: 0.9rem;
  font-weight: 900;
}

body[data-theme="dark"] .file-control-label {
  color: #d5deec;
}

.file-control {
  width: 100%;
}

.file-control input {
  display: none;
}

.account-note {
  margin-bottom: 0;
  line-height: 1.6;
}

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

.settings-actions > * {
  width: 100%;
}

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

.status-pill.verified,
#profileStatusPill {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

body[data-theme="dark"] .status-pill.verified,
body[data-theme="dark"] #profileStatusPill {
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.28);
  border-color: rgba(74, 222, 128, 0.3);
}

.danger-zone {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.assignment-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.assignment-form-panel {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  border-color: var(--card-border);
  box-shadow: 0 14px 30px rgba(20, 33, 57, 0.08);
}

.assignment-board-panel {
  min-width: 0;
}

body[data-theme="dark"] .assignment-form-panel {
  border-color: #303a4d;
}

.assignment-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 22px;
  padding: 6px;
  background: var(--panel-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

body[data-theme="dark"] .assignment-filters {
  border-color: #303a4d;
}

.filter-chip {
  min-height: 32px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.82rem;
}

.filter-chip.active {
  color: #31507d;
  background: #eaf2ff;
  border-color: #d7e6ff;
  box-shadow: 0 8px 18px rgba(28, 39, 65, 0.06);
}

body[data-theme="dark"] .filter-chip.active {
  color: #dbe8ff;
  background: #202a3b;
  border-color: #334056;
}

.deadline-board,
.deadline-group {
  display: grid;
  gap: 12px;
}

.deadline-board {
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-color: #b8c7dc transparent;
}

.deadline-board-empty {
  display: grid;
  gap: 12px;
}

.deadline-board-empty .guided-empty {
  min-height: 150px;
}

.deadline-group h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 10px;
  padding: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

body[data-theme="dark"] .calendar-toolbar {
  background: #162033;
  border-color: var(--line);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(116px, 1fr));
  min-width: 820px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.calendar-weekday {
  min-height: 38px;
  padding: 10px;
  color: var(--muted);
  background: #f1f5f9;
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

body[data-theme="dark"] .calendar-weekday {
  background: #182234;
}

.calendar-weekday:nth-child(7) {
  border-right: 0;
}

.calendar-day {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  min-height: 142px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.86);
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}

body[data-theme="dark"] .calendar-day {
  background: rgba(23, 31, 45, 0.72);
}

.calendar-day.outside-month {
  color: var(--muted);
  background: rgba(248, 250, 252, 0.54);
}

body[data-theme="dark"] .calendar-day.outside-month {
  background: rgba(17, 24, 36, 0.58);
}

.calendar-day.today {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.22);
}

body[data-theme="dark"] .calendar-day.today {
  background: #1d2b41;
  box-shadow: inset 0 0 0 2px rgba(124, 156, 255, 0.3);
}

.calendar-day-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  min-height: 22px;
  font-size: 0.82rem;
  font-weight: 900;
}

.calendar-day-head strong {
  color: var(--primary);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.calendar-items {
  display: grid;
  align-content: start;
  gap: 6px;
}

.calendar-empty-dot {
  width: 5px;
  height: 5px;
  margin-top: 4px;
  background: transparent;
  border-radius: 999px;
}

.calendar-assignment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 5px;
  align-items: stretch;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-left: 3px solid #c7dbf9;
  border-radius: var(--radius);
}

.calendar-assignment-main,
.calendar-status-button,
.calendar-delete-button {
  min-height: 24px;
}

.calendar-assignment.overdue {
  background: #fff8f1;
  border-left-color: var(--danger);
}

body[data-theme="dark"] .calendar-assignment {
  background: #202a3b;
}

body[data-theme="dark"] .calendar-assignment.overdue {
  background: #2a1f1c;
}

.calendar-assignment.nearly-done,
.planned-assignment.nearly-done {
  border-left-color: var(--success);
}

.calendar-assignment.nearly-done {
  background: #f0fdf4;
}

body[data-theme="dark"] .calendar-assignment.nearly-done {
  background: #17281f;
}

.priority-border-high {
  border-left-color: #fca5a5;
}

.priority-border-medium {
  border-left-color: #facc15;
}

.priority-border-low {
  border-left-color: #93c5fd;
}

.calendar-assignment-main {
  min-width: 0;
  padding: 0;
  color: var(--text);
  text-align: left;
  background: transparent;
}

.calendar-assignment-main:hover {
  transform: none;
}

.calendar-assignment-main strong,
.calendar-assignment-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-assignment-main strong {
  font-size: 0.76rem;
}

.calendar-assignment-main span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.calendar-assignment-main p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.calendar-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.calendar-status-button,
.calendar-delete-button {
  min-width: 30px;
  padding: 0 6px;
  color: #31507d;
  background: #eaf2ff;
  border-radius: 7px;
  font-size: 0.65rem;
  font-weight: 950;
}

body[data-theme="dark"] .calendar-status-button {
  color: #dbe8ff;
  background: #294266;
}

.calendar-delete-button {
  min-width: 26px;
  color: var(--danger);
  background: #fff1ed;
}

body[data-theme="dark"] .calendar-delete-button {
  color: #ffb49b;
  background: #3a2522;
}

.planned-assignment {
  display: grid;
  gap: 11px;
  padding: 14px;
  background: linear-gradient(180deg, #fbfdff, #f8fbff);
  border: 1px solid var(--card-border);
  border-left: 3px solid #c7dbf9;
  border-radius: var(--radius);
  transition: box-shadow 140ms ease, border-color 140ms ease;
}

body[data-theme="dark"] .planned-assignment {
  background: linear-gradient(180deg, #1b2535, #182233);
  border-color: var(--line);
  border-left-color: #4f6ea8;
}

.planned-assignment:hover {
  box-shadow: 0 10px 20px rgba(20, 33, 57, 0.08);
  border-color: #c8d8ec;
}

.planned-assignment.overdue {
  background: #fff8f1;
  border-left-color: var(--danger);
}

body[data-theme="dark"] .planned-assignment.overdue {
  background: #2a1e1b;
}

.planned-assignment.nearly-done {
  background: #f0fdf4;
}

body[data-theme="dark"] .planned-assignment.nearly-done {
  background: #17281f;
}

.planned-main,
.planned-meta,
.planned-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.planned-main {
  justify-content: space-between;
}

.planned-main > div {
  min-width: 0;
}

.planned-main strong,
.planned-main span {
  display: block;
}

.planned-main span,
.planned-meta {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.planned-actions {
  justify-content: flex-start;
  gap: 8px;
}

.priority,
.status-pill,
.detail-pill,
.overdue-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.priority-high {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.priority-medium {
  color: #854d0e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.priority-low {
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
}

.status-pill {
  color: #31507d;
  background: #eaf2ff;
}

.detail-pill {
  color: #31507d;
  background: #eaf2ff;
  border: 1px solid #d7e6ff;
}

.detail-status {
  color: #14532d;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.difficulty-hard {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.difficulty-medium {
  color: #854d0e;
  background: #fef3c7;
  border-color: #fde68a;
}

.difficulty-easy,
.detail-ready {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.detail-progress {
  color: #0f766e;
  background: #ccfbf1;
  border-color: #99f6e4;
}

body[data-theme="dark"] .detail-pill {
  color: #dbe8ff;
  background: #202a3b;
  border-color: #334056;
}

.assignment-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.5;
}

.assignment-subtasks {
  display: grid;
  gap: 7px;
}

.calendar-assignment .assignment-subtasks {
  grid-column: 1 / -1;
}

.assignment-subtask {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 850;
}

.assignment-subtask input {
  width: 15px;
  min-height: 15px;
}

.assignment-subtask.done {
  color: var(--muted);
}

.assignment-subtask.done span {
  text-decoration: line-through;
}

.compact-subtasks {
  gap: 4px;
  padding-top: 2px;
  border-top: 1px solid rgba(203, 213, 225, 0.72);
}

.compact-subtasks .assignment-subtask {
  font-size: 0.68rem;
}

.compact-subtasks .assignment-subtask:nth-child(n + 4) {
  display: none;
}

.overdue-label,
.danger-button {
  color: var(--danger);
}

body[data-theme="dark"] .status-pill {
  color: #dbe8ff;
  background: #202a3b;
}

body[data-theme="dark"] .priority-high {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.38);
  border-color: rgba(248, 113, 113, 0.34);
}

body[data-theme="dark"] .priority-medium {
  color: #fde68a;
  background: rgba(113, 63, 18, 0.38);
  border-color: rgba(250, 204, 21, 0.28);
}

body[data-theme="dark"] .priority-low {
  color: #bfdbfe;
  background: rgba(30, 58, 138, 0.38);
  border-color: rgba(96, 165, 250, 0.28);
}

.assignment-board-panel .panel-heading h3 {
  margin-bottom: 6px;
}

#assignmentCount {
  font-size: 0.84rem;
  font-weight: 900;
}

.classes-panel {
  min-height: min(620px, calc(100vh - 136px));
}

.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(8px);
}

.modal-panel {
  width: min(460px, 100%);
  max-height: min(640px, calc(100vh - 40px));
  overflow: auto;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

body[data-theme="dark"] .modal-panel {
  background: var(--panel);
  border-color: var(--line);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin-bottom: 0;
}

.modal-close-button {
  flex: 0 0 36px;
  width: 36px;
}

.empty-modal-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
}

.empty-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.empty-modal-content {
  margin: 0;
  padding: 24px 12px 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.modal-form-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 100;
  width: min(560px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 20px;
  transform: translate(-50%, -50%);
}

.modal-form-panel::before {
  position: fixed;
  inset: -100vmax;
  z-index: -1;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(8px);
  content: "";
}

.assignment-form-panel.modal-form-panel,
.session-plan-panel.modal-form-panel {
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.modal-form-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-form-header h3 {
  margin-bottom: 0;
}

.panel-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.class-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

body[data-theme="dark"] .class-card {
  border-color: var(--line);
}

body[data-theme="dark"] .class-card {
  border-left-color: var(--primary);
}

body[data-theme="dark"] .class-card:hover {
  border-color: #40536f;
  border-left-color: var(--primary);
}

.class-form .error {
  grid-column: 1 / -1;
}

.classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.class-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.class-card:hover {
  border-color: #bfd0e5;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.class-card strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.class-remove-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 8px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  font-weight: 900;
  cursor: pointer;
}

.class-remove-button:hover {
  border-color: rgba(239, 68, 68, 0.44);
  background: rgba(239, 68, 68, 0.14);
}

.classes-empty,
.classes-grid > .guided-empty {
  grid-column: 1 / -1;
  min-height: 180px;
}

@media (min-width: 1000px) {
  #assignmentsView {
    height: calc(100vh - 104px);
    min-height: 0;
  }

  .assignment-layout {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 16px;
    height: 100%;
    min-height: 0;
    align-items: stretch;
  }

  .assignment-form-panel {
    position: static;
    height: 100%;
    max-height: none;
    min-height: 0;
    overflow: auto;
    padding: 15px;
  }

  .assignment-form-panel .form {
    gap: 9px;
  }

  .assignment-form-panel h3 {
    margin-bottom: 8px;
  }

  .assignment-form-panel .panel-kicker {
    margin-bottom: 6px;
  }

  .assignment-form-panel label {
    gap: 6px;
    font-size: 0.84rem;
  }

  .assignment-form-panel input,
  .assignment-form-panel select {
    min-height: 38px;
    padding: 8px 10px;
  }

  .assignment-board-panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 15px;
  }

  .calendar-toolbar {
    margin: 7px 0;
  }

  .assignment-filters {
    margin: 7px 0 10px;
  }

  .deadline-board {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    overflow: hidden;
  }

  .calendar-grid {
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: 34px repeat(6, minmax(0, 1fr));
  }

  .calendar-weekday {
    min-height: 0;
    padding: 6px 8px;
  }

  .calendar-day {
    min-height: 0;
    gap: 4px;
    padding: 6px;
  }

  .calendar-day-head {
    min-height: 18px;
    font-size: 0.76rem;
  }

  .calendar-day-head strong {
    font-size: 0.62rem;
  }

  .calendar-items {
    gap: 4px;
    min-height: 0;
    overflow: hidden;
  }

  .calendar-assignment {
    gap: 4px;
    padding: 4px;
  }

  .calendar-assignment-main strong {
    font-size: 0.7rem;
  }

  .calendar-assignment-main span {
    font-size: 0.62rem;
  }

  .calendar-status-button,
  .calendar-delete-button {
    min-width: 24px;
    padding: 0 5px;
    font-size: 0.6rem;
  }
}

.compact-empty {
  min-height: 190px;
}

.assignment-overview-row,
.settings-grid div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

body[data-theme="dark"] .assignment-overview-row,
body[data-theme="dark"] .settings-grid div,
body[data-theme="dark"] .profile-preview-row {
  border-color: var(--line);
}

.assignment-overview-row div,
.settings-grid div {
  min-width: 0;
}

.assignment-overview-row strong,
.assignment-overview-row span,
.settings-grid strong,
.settings-grid span {
  display: block;
}

.assignment-overview-row span,
.settings-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.assignment-line,
.rank-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.assignment-line span:last-child,
.rank-line span {
  color: var(--muted);
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #31507d;
  background: #eaf2ff;
  border: 1px solid #d7e6ff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

@media (min-width: 1200px) {
  .split {
    grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  }

  .timer-panel {
    position: sticky;
    top: 92px;
  }
}

/* Launch-readiness refinements */
.hero-trust,
.auth-trust {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
}

.hero-trust {
  margin-top: 16px;
}

.auth-trust {
  margin: 18px 0 0;
  color: #c8d4e8;
}

.footer-link-group a {
  color: inherit;
  text-decoration: none;
}

.footer-link-group a:hover,
.footer-link-group a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .landing-hero {
    min-height: auto;
    display: grid;
    background: #f7f9fd;
  }

  .landing-hero > img {
    position: relative;
    order: 2;
    width: 100%;
    height: 230px;
    object-fit: cover;
    object-position: center;
    opacity: 0.72;
  }

  .landing-hero::after,
  body[data-theme="dark"] .landing-hero::after {
    display: none;
  }

  .hero-copy {
    position: relative;
    z-index: 2;
    order: 1;
    padding: 34px 20px 26px;
    color: var(--text);
    background: #f7f9fd;
  }

  .hero-brand-lockup {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .hero-logo {
    width: 48px;
    height: 48px;
  }

  .hero-copy h1 {
    font-size: 2.35rem;
  }

  .hero-motto {
    max-width: 12ch;
    font-size: clamp(2rem, 10vw, 2.75rem);
    line-height: 1.02;
  }

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

  .hero-points {
    display: none;
  }

  .hero-trust {
    color: #5a6679;
  }

  .auth-shell {
    align-items: start;
  }

  .auth-panel {
    display: flex;
    flex-direction: column;
  }

  .auth-card {
    order: 1;
  }

  .auth-copy {
    order: 2;
    padding: 18px 20px;
  }

  .auth-copy h1,
  .auth-copy > .muted,
  .auth-copy .auth-highlights,
  .auth-copy .eyebrow {
    display: none;
  }

  .auth-copy .auth-mark {
    width: 42px;
    height: 42px;
  }

  .auth-trust {
    margin: 10px 0 0;
  }
}

/* Landing page refresh: accurately reflects the redesigned product */
.product-preview-section {
  background:
    radial-gradient(circle at 12% 8%, rgba(52, 95, 219, 0.09), transparent 27%),
    linear-gradient(180deg, #f8fbff, #f4f7fb);
}

.product-preview-section .section-heading {
  max-width: 780px;
}

.product-preview {
  gap: 18px;
}

.preview-panel {
  padding: 20px;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
  border-color: rgba(203, 213, 225, 0.78);
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.075);
}

.preview-topline {
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.preview-topline > div {
  display: grid;
  gap: 3px;
}

.preview-topline small {
  color: #8a98ab;
  font-size: 0.68rem;
  font-weight: 750;
}

.preview-topline strong {
  color: #315bc7;
  font-size: 0.72rem;
}

.preview-metrics {
  gap: 8px;
  margin: 14px 0;
}

.preview-metrics div {
  position: relative;
  min-height: 82px;
  padding: 12px;
  overflow: hidden;
  background: #f9fbfe;
  border-color: #e1e7f0;
  border-radius: 10px;
}

.preview-metrics div::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #345fdb;
  content: "";
}

.preview-metrics div:nth-child(2)::before { background: #c58a37; }
.preview-metrics div:nth-child(3)::before { background: #3f8f68; }
.preview-metrics div:nth-child(4)::before { background: #4f79db; }

.preview-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(150px, 0.7fr);
  gap: 10px;
}

.preview-focus-card,
.preview-streak-card {
  padding: 14px;
  background: #f9fbfe;
  border: 1px solid #e0e7f0;
  border-radius: 11px;
}

.preview-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.preview-card-heading > div,
.preview-focus-card > small,
.preview-streak-card > span,
.preview-streak-card div small,
.preview-streak-card div strong {
  display: block;
}

.preview-card-heading span,
.preview-streak-card > span {
  color: #315bc7;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-card-heading strong {
  display: block;
  margin-top: 4px;
  color: #1f2937;
  font-size: 0.78rem;
}

.preview-card-heading em {
  padding: 4px 7px;
  color: #26734d;
  background: #eaf8f0;
  border-radius: 999px;
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 850;
}

.preview-timer {
  display: block;
  margin: 18px 0 9px;
  color: #111827;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
  line-height: 1;
}

.preview-timer-progress {
  height: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #e4ebf5;
  border-radius: 999px;
}

.preview-timer-progress span {
  display: block;
  width: 68%;
  height: 100%;
  background: linear-gradient(90deg, #345fdb, #6991ec);
}

.preview-focus-card > small,
.preview-streak-card div small {
  color: #8391a5;
  font-size: 0.62rem;
  font-weight: 750;
}

.preview-streak-card {
  display: grid;
  gap: 8px;
}

.preview-streak-ring {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 5px auto;
  place-content: center;
  text-align: center;
  background: #ffffff;
  border: 6px solid #d8e5ff;
  border-top-color: #345fdb;
  border-radius: 50%;
}

.preview-streak-ring strong,
.preview-streak-ring small {
  display: block;
}

.preview-streak-ring strong {
  color: #111827;
  font-size: 1.3rem;
  line-height: 1;
}

.preview-streak-card > div:not(.preview-streak-ring) {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid #e6ebf2;
}

.preview-streak-card div strong {
  color: #344054;
  font-size: 0.66rem;
}

.preview-calendar .mini-calendar {
  margin-top: 14px;
  border-color: #dce4ef;
  border-radius: 11px;
}

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

.preview-workspaces article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 11px;
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.045);
}

.preview-workspace-number {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #315bc7;
  background: #eaf1ff;
  border-radius: 9px;
  font-size: 0.66rem;
  font-weight: 900;
}

.preview-workspaces strong,
.preview-workspaces small,
.preview-workspaces em {
  display: block;
}

.preview-workspaces strong {
  color: #1f2937;
  font-size: 0.78rem;
}

.preview-workspaces small {
  margin-top: 3px;
  color: #7b899d;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.35;
}

.preview-workspaces em {
  grid-column: 2;
  color: #315bc7;
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 850;
}

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

body[data-theme="dark"] .product-preview-section,
body[data-theme="dark"] .preview-panel,
body[data-theme="dark"] .preview-workspaces article {
  background: linear-gradient(145deg, rgba(25, 33, 48, 0.98), rgba(19, 27, 41, 0.98));
  border-color: rgba(71, 85, 105, 0.62);
}

@media (max-width: 900px) {
  .preview-workspaces {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .preview-dashboard-grid,
  .preview-workspaces,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .preview-workspaces article {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .preview-workspaces em {
    grid-column: 3;
    grid-row: 1;
  }
}

/* Settings: dashboard-aligned account workspace */
#settingsView {
  width: min(1240px, 100%);
}

#settingsView .settings-page {
  width: 100%;
  gap: 18px;
}

#settingsView .settings-section {
  gap: 15px;
  padding: 22px;
  background: linear-gradient(145deg, #ffffff, #f9fbfe);
  border-color: rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  box-shadow: 0 9px 26px rgba(15, 23, 42, 0.055);
}

#settingsView .settings-section-header {
  align-items: flex-start;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.68);
}

#settingsView .panel-kicker {
  margin-bottom: 7px;
  color: #315bc7;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

#settingsView .settings-section-header h3 {
  color: #111827;
  font-size: 1.14rem;
  letter-spacing: -0.02em;
}

.settings-card-intro {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

#settingsView .status-pill {
  min-height: 28px;
  padding-inline: 10px;
  border-radius: 999px;
  font-size: 0.7rem;
}

#settingsView .settings-profile-card {
  padding: 24px;
  background:
    radial-gradient(circle at 96% 5%, rgba(52, 95, 219, 0.09), transparent 25%),
    linear-gradient(145deg, #ffffff, #f8fbff);
}

#settingsView .settings-profile-card .settings-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: 16px 20px;
}

#settingsView .settings-profile-row {
  grid-row: 1 / span 2;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  align-content: center;
  padding: 16px;
  background: #f5f8fd;
  border-color: #dfe7f1;
  border-radius: 12px;
}

#settingsView .settings-profile-row .avatar-preview {
  width: 84px;
  height: 84px;
  color: #ffffff;
  background: linear-gradient(145deg, #243b63, #345fdb);
  border: 3px solid #ffffff;
  border-radius: 18px;
  box-shadow: 0 9px 22px rgba(36, 59, 99, 0.2);
}

#settingsView .settings-profile-actions {
  display: grid;
  gap: 8px;
}

#settingsView .settings-profile-actions .file-control,
#settingsView .settings-profile-actions button {
  width: auto;
  min-height: 34px;
  justify-content: center;
  padding: 6px 10px;
  font-size: 0.72rem;
}

#settingsView .settings-profile-card .form-two {
  grid-column: 2;
  gap: 12px;
}

#settingsView .settings-profile-card .settings-meta-row {
  grid-column: 2;
  padding: 11px 13px;
  background: #f7f9fc;
  border-color: #e1e8f1;
  border-radius: 10px;
  font-size: 0.78rem;
}

#settingsView .settings-profile-card > form > .button-row,
#settingsView .settings-profile-card .success-message,
#settingsView .settings-profile-card .error {
  grid-column: 2;
}

#settingsView .settings-profile-card > form > .button-row {
  margin-top: -2px;
}

#settingsView .settings-profile-card > form > .button-row .primary {
  width: fit-content;
  min-width: 128px;
}

#settingsView .settings-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

#settingsView .settings-password-card {
  grid-column: span 2;
}

#settingsView .settings-section .account-note {
  margin: 0;
  color: #708096;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
}

#settingsView .settings-form label {
  gap: 7px;
  color: #52647d;
  font-size: 0.78rem;
  font-weight: 850;
}

#settingsView input,
#settingsView select {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.9);
  border-color: #d9e2ee;
  border-radius: 9px;
}

#settingsView input[readonly] {
  color: #718096;
  background: #f3f6fa;
}

#settingsView .settings-actions {
  gap: 8px;
}

#settingsView .success-message:empty,
#settingsView .error:empty {
  display: none;
}

#settingsView .settings-actions button,
#settingsView .settings-reminder-card > button,
#settingsView .settings-signout-card > button {
  min-height: 38px;
  font-size: 0.76rem;
}

#settingsView .theme-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  padding: 5px;
  background: #f4f7fb;
  border: 1px solid #dfe6ef;
  border-radius: 10px;
}

#settingsView .theme-segmented button {
  min-height: 36px;
  border-radius: 7px;
  font-size: 0.76rem;
}

#settingsView .theme-segmented button.active {
  color: #ffffff;
  background: #345fdb;
  box-shadow: 0 7px 16px rgba(52, 95, 219, 0.18);
}

#settingsView .settings-signout-card {
  background: linear-gradient(145deg, #ffffff, #fff9f9);
  border-color: rgba(239, 68, 68, 0.2);
}

#settingsView .settings-signout-card .panel-kicker {
  color: #c24141;
}

#settingsView .settings-signout-card .danger-button {
  color: #b42318;
  background: #fff5f5;
  border-color: #f3c7c7;
}

body[data-theme="dark"] #settingsView .settings-section {
  background: linear-gradient(145deg, rgba(25, 33, 48, 0.98), rgba(19, 27, 41, 0.98));
  border-color: rgba(71, 85, 105, 0.62);
}

body[data-theme="dark"] #settingsView .settings-section-header h3 {
  color: #f8fafc;
}

body[data-theme="dark"] #settingsView .settings-profile-row,
body[data-theme="dark"] #settingsView .settings-meta-row,
body[data-theme="dark"] #settingsView .theme-segmented {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(71, 85, 105, 0.58);
}

body[data-theme="dark"] #settingsView input,
body[data-theme="dark"] #settingsView select {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(71, 85, 105, 0.72);
}

body[data-theme="dark"] #settingsView .settings-signout-card {
  background: linear-gradient(145deg, rgba(45, 26, 32, 0.96), rgba(29, 23, 31, 0.98));
  border-color: rgba(248, 113, 113, 0.28);
}

@media (max-width: 980px) {
  #settingsView .settings-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #settingsView .settings-password-card {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  #settingsView .settings-section,
  #settingsView .settings-profile-card {
    padding: 17px;
  }

  #settingsView .settings-profile-card .settings-form,
  #settingsView .settings-card-grid {
    grid-template-columns: 1fr;
  }

  #settingsView .settings-profile-row,
  #settingsView .settings-profile-card .form-two,
  #settingsView .settings-profile-card .settings-meta-row,
  #settingsView .settings-profile-card > form > .button-row,
  #settingsView .settings-profile-card .success-message,
  #settingsView .settings-profile-card .error,
  #settingsView .settings-password-card {
    grid-column: 1;
    grid-row: auto;
  }

  #settingsView .settings-profile-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  #settingsView .settings-profile-row .avatar-preview {
    width: 72px;
    height: 72px;
  }

  #settingsView .settings-section-header {
    gap: 12px;
  }

  #settingsView .settings-profile-card > form > .button-row .primary,
  #settingsView .settings-section button {
    width: 100%;
  }
}

/* Session History: dashboard-aligned progress archive */
#pastView {
  width: min(1240px, 100%);
}

#pastView .history-panel {
  min-height: min(650px, calc(100vh - 136px));
  padding: 24px;
  background:
    radial-gradient(circle at 96% 4%, rgba(52, 95, 219, 0.075), transparent 24%),
    linear-gradient(145deg, #ffffff, #f9fbfe);
  border-color: rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

#pastView .history-panel > .panel-heading {
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.68);
}

#pastView .panel-kicker {
  margin-bottom: 7px;
  color: #315bc7;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

#pastView .panel-heading h3 {
  color: #111827;
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

.history-intro {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
}

.history-heading-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.history-count {
  display: inline-flex;
  min-height: 32px;
  padding: 0 11px;
  align-items: center;
  color: #64748b;
  background: rgba(248, 250, 252, 0.86);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 850;
}

#pastView .sessions-list {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

#pastView .session-card {
  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  background: linear-gradient(145deg, #ffffff, #f7faff);
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 13px;
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.045);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

#pastView .session-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #345fdb, #4f8ef7);
  content: "";
}

#pastView .session-card:hover {
  border-color: #b9cae2;
  box-shadow: 0 13px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

#pastView .session-card header {
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5eaf2;
}

.session-card-title {
  display: flex;
  min-width: 0;
  gap: 11px;
  align-items: center;
}

.session-card-mark {
  display: inline-grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #315bc7;
  background: #eaf1ff;
  border: 1px solid #ceddff;
  border-radius: 10px;
  font-weight: 900;
}

#pastView .session-card-title strong {
  display: block;
  color: #111827;
  font-size: 1rem;
  line-height: 1.25;
}

#pastView .session-card-title p {
  margin: 4px 0 0;
  font-size: 0.74rem;
  font-weight: 750;
}

.session-card-overview {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.3fr);
  gap: 10px;
  margin-bottom: 12px;
}

.session-card-overview div {
  min-width: 0;
  padding: 12px;
  background: #f7f9fc;
  border: 1px solid #e3e9f1;
  border-radius: 10px;
}

.session-card-overview span,
.session-card-overview strong {
  display: block;
}

.session-card-overview span {
  margin-bottom: 5px;
  color: #8795a9;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.session-card-overview strong {
  color: #263448;
  font-size: 0.9rem;
  line-height: 1.3;
}

#pastView .session-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

#pastView .session-detail-grid span {
  padding: 8px;
  color: #64748b;
  background: #fbfcfe;
  border-color: #e5eaf2;
  border-radius: 8px;
  font-size: 0.7rem;
  text-align: center;
}

#pastView .session-reflection-text,
#pastView .session-distraction-text {
  margin: 10px 0;
  padding: 10px 12px;
  color: #53637a;
  background: #f7f9fc;
  border-left: 3px solid #8aa9ef;
  border-radius: 0 8px 8px 0;
  font-size: 0.78rem;
  line-height: 1.5;
}

.session-assignment-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

#pastView .assignment-line {
  padding: 9px 10px;
  background: rgba(248, 250, 252, 0.74);
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  font-size: 0.76rem;
}

.history-inline-empty {
  display: grid;
  grid-column: 1 / -1;
  min-height: 410px;
  padding: 38px;
  place-content: center;
  justify-items: center;
  text-align: center;
  background: rgba(248, 250, 252, 0.62);
  border: 1px dashed #cbd8ea;
  border-radius: 14px;
}

.history-empty-mark {
  display: inline-grid;
  width: 66px;
  height: 66px;
  margin-bottom: 18px;
  place-items: center;
  color: #315bc7;
  background: #edf3ff;
  border: 1px solid #d6e2ff;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(52, 95, 219, 0.1);
}

.history-empty-mark svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-inline-empty > strong {
  margin-bottom: 7px;
  color: #111827;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
}

.history-inline-empty > span:not(.history-empty-mark) {
  max-width: 430px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.55;
}

body[data-theme="dark"] #pastView .history-panel,
body[data-theme="dark"] #pastView .session-card {
  background: linear-gradient(145deg, rgba(25, 33, 48, 0.98), rgba(19, 27, 41, 0.98));
  border-color: rgba(71, 85, 105, 0.62);
}

body[data-theme="dark"] #pastView .panel-heading h3,
body[data-theme="dark"] #pastView .session-card-title strong,
body[data-theme="dark"] .history-inline-empty > strong {
  color: #f8fafc;
}

body[data-theme="dark"] .session-card-mark,
body[data-theme="dark"] .history-empty-mark {
  color: #8fb6ff;
  background: rgba(49, 91, 199, 0.18);
  border-color: rgba(96, 165, 250, 0.28);
}

body[data-theme="dark"] .session-card-overview div,
body[data-theme="dark"] #pastView .session-detail-grid span,
body[data-theme="dark"] #pastView .assignment-line {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(71, 85, 105, 0.58);
}

@media (max-width: 760px) {
  #pastView .history-panel {
    min-height: 0;
    padding: 17px;
  }

  #pastView .history-panel > .panel-heading {
    gap: 14px;
    align-items: stretch;
  }

  .history-heading-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  #pastView .sessions-list {
    grid-template-columns: 1fr;
    margin-top: 14px;
  }

  .history-inline-empty {
    min-height: 320px;
    padding: 30px 18px;
  }
}

@media (max-width: 480px) {
  #pastView .session-detail-grid,
  .session-card-overview {
    grid-template-columns: 1fr;
  }
}

/* Focus Session: dashboard-aligned deep-work workspace */
#startView {
  width: min(1240px, 100%);
}

#startView > .split {
  display: block;
}

#startView .timer-panel {
  min-height: min(650px, calc(100vh - 136px));
  padding: 24px;
  background:
    radial-gradient(circle at 94% 5%, rgba(52, 95, 219, 0.1), transparent 25%),
    linear-gradient(145deg, #ffffff, #f8fbff);
  border-color: rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.focus-session-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.68);
}

#startView .panel-kicker {
  margin-bottom: 7px;
  color: #315bc7;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.focus-session-header h3 {
  margin-bottom: 0;
  color: #111827;
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

.focus-session-header p {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
}

.focus-workspace-badge {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  align-items: center;
  color: #315bc7;
  background: #edf3ff;
  border: 1px solid #d6e2ff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
}

#startView #activeSessionEmpty {
  min-height: 430px;
  margin-top: 20px;
  padding: 42px 24px;
  background: rgba(248, 250, 252, 0.62);
  border: 1px dashed #cbd8ea;
  border-radius: 14px;
  box-shadow: none;
}

#startView #activeSessionEmpty .empty-icon {
  width: 64px;
  height: 64px;
  padding: 12px;
  background: #edf3ff;
  border: 1px solid #d6e2ff;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(52, 95, 219, 0.1);
}

#startView #activeSessionEmpty strong {
  margin-top: 5px;
  color: #111827;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

#startView #activeSessionEmpty > span {
  max-width: 430px;
  line-height: 1.55;
}

#startView #activeSession {
  width: min(920px, 100%);
  margin: 0 auto;
  padding-top: 22px;
}

#startView #activeSessionName {
  margin-bottom: 16px;
  color: #52647d;
  font-size: 0.84rem;
  font-weight: 850;
  text-align: center;
}

#startView .focus-setup-row {
  justify-content: center;
  gap: 12px;
  padding: 8px;
  background: rgba(247, 249, 253, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 12px;
}

#startView .timer-mode-control {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

#startView .timer-mode-control button {
  min-height: 36px;
  border-radius: 8px;
  font-size: 0.78rem;
}

#startView .timer-mode-control button.active {
  color: #ffffff;
  background: #345fdb;
  box-shadow: 0 7px 16px rgba(52, 95, 219, 0.2);
}

#startView .custom-minutes-field {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  color: #64748b;
  font-size: 0.76rem;
}

#startView #customFocusMinutes {
  width: 80px;
  min-height: 36px;
  padding: 6px 9px;
}

#startView #timerDisplay {
  margin: 34px 0 4px;
  color: #111827;
  font-size: clamp(4.8rem, 10vw, 8rem);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.07em;
  line-height: 0.95;
  text-align: center;
}

#startView .focus-phase-label {
  margin: 8px 0 24px;
  color: #315bc7;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-align: center;
  text-transform: uppercase;
}

#startView .current-task {
  margin: 0 0 14px;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 850;
  text-align: center;
}

#startView .progress {
  height: 9px;
  background: #e6edf7;
  border-radius: 999px;
}

#startView .focus-progress-label {
  margin: 9px 0 16px;
  font-size: 0.76rem;
  font-weight: 750;
  text-align: center;
}

#startView .focus-task-checklist,
#startView .session-reflection-panel {
  margin-top: 16px;
  padding: 16px;
  background: #f7f9fc;
  border: 1px solid #e1e8f1;
  border-radius: 12px;
}

#startView .distraction-notes-label {
  margin-top: 16px;
  color: #52647d;
  font-size: 0.8rem;
  font-weight: 850;
}

#startView #distractionNotes {
  min-height: 82px;
  margin-top: 7px;
  background: rgba(255, 255, 255, 0.84);
  border-color: #dce4ef;
  border-radius: 10px;
}

#startView #activeSession > .button-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e3e9f1;
}

#startView #activeSession > .button-row button {
  min-height: 42px;
  padding-inline: 10px;
  font-size: 0.78rem;
}

#startTimerButton {
  box-shadow: 0 9px 20px rgba(52, 95, 219, 0.2);
}

#sessionPlanPanel {
  border-radius: 14px;
}

#sessionPlanPanel .modal-form-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

body[data-theme="dark"] #startView .timer-panel {
  background: linear-gradient(145deg, rgba(25, 33, 48, 0.98), rgba(19, 27, 41, 0.98));
  border-color: rgba(71, 85, 105, 0.62);
}

body[data-theme="dark"] .focus-session-header h3,
body[data-theme="dark"] #startView #activeSessionEmpty strong,
body[data-theme="dark"] #startView #timerDisplay,
body[data-theme="dark"] #startView .current-task {
  color: #f8fafc;
}

body[data-theme="dark"] .focus-workspace-badge,
body[data-theme="dark"] #startView #activeSessionEmpty .empty-icon {
  color: #8fb6ff;
  background: rgba(49, 91, 199, 0.18);
  border-color: rgba(96, 165, 250, 0.28);
}

body[data-theme="dark"] #startView .focus-setup-row,
body[data-theme="dark"] #startView .focus-task-checklist,
body[data-theme="dark"] #startView .session-reflection-panel {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(71, 85, 105, 0.58);
}

@media (max-width: 820px) {
  #startView #activeSession > .button-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #startView #focusModeButton {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  #startView .timer-panel {
    min-height: 0;
    padding: 17px;
  }

  .focus-session-header {
    gap: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  #startView #activeSessionEmpty {
    min-height: 330px;
    padding: 30px 18px;
  }

  #startView .focus-setup-row {
    align-items: stretch;
    flex-direction: column;
  }

  #startView .timer-mode-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #startView .custom-minutes-field {
    justify-content: space-between;
  }

  #startView #timerDisplay {
    margin-top: 28px;
    font-size: clamp(4rem, 23vw, 5.6rem);
  }

  #startView #activeSession > .button-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Assignment Calendar: dashboard-aligned deadline workspace */
#assignmentsView {
  width: min(1400px, 100%);
}

#assignmentsView .assignment-layout {
  display: block;
}

#assignmentsView .assignment-board-panel {
  min-height: min(720px, calc(100vh - 136px));
  padding: 24px;
  background:
    radial-gradient(circle at 96% 3%, rgba(52, 95, 219, 0.075), transparent 22%),
    linear-gradient(145deg, #ffffff, #f9fbfe);
  border-color: rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

#assignmentsView .assignment-board-panel > .panel-heading {
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.68);
}

#assignmentsView .panel-kicker {
  margin-bottom: 7px;
  color: #315bc7;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

#assignmentsView .panel-heading h3 {
  color: #111827;
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

.calendar-intro {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
}

.calendar-count {
  display: inline-flex;
  min-height: 32px;
  padding: 0 11px;
  align-items: center;
  color: #64748b;
  background: rgba(248, 250, 252, 0.86);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 850;
}

.calendar-controls {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 18px 0 14px;
  padding: 8px;
  background: rgba(247, 249, 253, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 12px;
}

#assignmentsView .calendar-toolbar,
#assignmentsView .assignment-filters {
  display: flex;
  width: auto;
  gap: 5px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#assignmentsView .calendar-toolbar button,
#assignmentsView .assignment-filters button {
  width: auto;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
}

#assignmentsView .calendar-arrow {
  width: 36px;
  padding: 0;
  font-size: 1rem;
}

#assignmentsView .filter-chip {
  color: #64748b;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

#assignmentsView .filter-chip:hover {
  color: #315bc7;
  background: #eef4ff;
}

#assignmentsView .filter-chip.active {
  color: #ffffff;
  background: #345fdb;
  border-color: #345fdb;
  box-shadow: 0 6px 14px rgba(52, 95, 219, 0.2);
}

#assignmentsView .deadline-board {
  display: grid;
  gap: 12px;
  align-items: stretch;
  justify-content: stretch;
  overflow: auto;
  border-radius: 12px;
}

.calendar-empty-note {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  color: #53637a;
  background: #f4f7fc;
  border: 1px dashed #c9d6e8;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.calendar-empty-note strong {
  color: #1f2937;
}

#assignmentsView .calendar-grid {
  min-width: 980px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d8e1ed;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.045);
}

#assignmentsView .calendar-weekday {
  min-height: 38px;
  padding: 10px;
  color: #718096;
  background: #f5f7fb;
  border-color: #dfe6ef;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#assignmentsView .calendar-day {
  min-height: 112px;
  padding: 9px;
  background: #ffffff;
  border-color: #e3e8f0;
  transition: background 140ms ease, box-shadow 140ms ease;
}

#assignmentsView .calendar-day:hover {
  position: relative;
  z-index: 1;
  background: #fafcff;
  box-shadow: inset 0 0 0 1px #c5d5ee;
}

#assignmentsView .calendar-day.outside-month {
  background: #f8fafc;
  opacity: 0.7;
}

#assignmentsView .calendar-day.today {
  background: #f1f6ff;
  box-shadow: inset 0 0 0 2px #5b83e8;
}

#assignmentsView .calendar-day-head {
  color: #5d6c82;
  font-size: 0.76rem;
}

#assignmentsView .calendar-day.today .calendar-day-head strong {
  color: #315bc7;
}

#assignmentsView .calendar-assignment {
  padding: 8px;
  background: #f8faff;
  border-color: #dce5f2;
  border-radius: 8px;
  box-shadow: none;
}

#assignmentsView .calendar-assignment:hover {
  border-color: #b8c9e2;
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.07);
}

#assignmentFormPanel {
  border-radius: 14px;
}

#assignmentFormPanel .modal-form-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

body[data-theme="dark"] #assignmentsView .assignment-board-panel,
body[data-theme="dark"] #assignmentsView .calendar-grid,
body[data-theme="dark"] #assignmentsView .calendar-day {
  background: linear-gradient(145deg, rgba(25, 33, 48, 0.98), rgba(19, 27, 41, 0.98));
  border-color: rgba(71, 85, 105, 0.62);
}

body[data-theme="dark"] #assignmentsView .panel-heading h3,
body[data-theme="dark"] .calendar-empty-note strong {
  color: #f8fafc;
}

body[data-theme="dark"] .calendar-controls,
body[data-theme="dark"] .calendar-empty-note {
  color: #b8c5d7;
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(71, 85, 105, 0.58);
}

@media (max-width: 760px) {
  #assignmentsView .assignment-board-panel {
    min-height: 0;
    padding: 17px;
  }

  #assignmentsView .assignment-board-panel > .panel-heading {
    gap: 14px;
    align-items: stretch;
  }

  #assignmentsView .panel-heading-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .calendar-controls {
    align-items: stretch;
    flex-direction: column;
  }

  #assignmentsView .calendar-toolbar,
  #assignmentsView .assignment-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #assignmentsView .assignment-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #assignmentsView .calendar-toolbar button,
  #assignmentsView .assignment-filters button {
    width: 100%;
    padding-inline: 6px;
  }

  .calendar-empty-note {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-empty-note .primary {
    width: 100%;
  }

  #assignmentsView .calendar-grid {
    min-width: 760px;
  }
}

/* Classes page: dashboard-aligned course workspace */
#classesView {
  width: min(1240px, 100%);
}

#classesView .classes-panel {
  min-height: min(620px, calc(100vh - 136px));
  padding: 24px;
  background:
    radial-gradient(circle at 96% 4%, rgba(52, 95, 219, 0.075), transparent 24%),
    linear-gradient(145deg, #ffffff, #f9fbfe);
  border-color: rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

#classesView .panel-heading {
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.68);
}

#classesView .panel-kicker {
  margin-bottom: 7px;
  color: #315bc7;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

#classesView .panel-heading h3 {
  color: #111827;
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

.classes-intro {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
}

.classes-heading-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.classes-count {
  display: inline-flex;
  min-height: 32px;
  padding: 0 11px;
  align-items: center;
  color: #64748b;
  background: rgba(248, 250, 252, 0.86);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 850;
}

#classesView .classes-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

#classesView .class-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 104px;
  gap: 13px;
  padding: 18px;
  background: linear-gradient(145deg, #ffffff, #f7faff);
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-left: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 13px;
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.045);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

#classesView .class-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #345fdb, #4f8ef7);
  border-radius: 13px 0 0 13px;
  content: "";
}

#classesView .class-card:hover {
  border-color: #b9cae2;
  box-shadow: 0 13px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.class-card-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #315bc7;
  background: #eaf1ff;
  border: 1px solid #ceddff;
  border-radius: 11px;
  font-size: 1rem;
  font-weight: 900;
}

.class-card-copy {
  min-width: 0;
}

#classesView .class-card-copy strong {
  display: block;
  margin: 2px 0 5px;
  color: #111827;
  font-size: 1rem;
  line-height: 1.25;
}

.class-card-copy span {
  color: #8795a9;
  font-size: 0.75rem;
  font-weight: 750;
}

#classesView .class-remove-button {
  width: 32px;
  height: 32px;
  opacity: 0.66;
  background: transparent;
  border-color: transparent;
  border-radius: 9px;
  font-size: 1.15rem;
}

#classesView .class-remove-button:hover,
#classesView .class-remove-button:focus-visible {
  opacity: 1;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.classes-inline-empty {
  display: grid;
  grid-column: 1 / -1;
  min-height: 390px;
  padding: 36px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.classes-inline-empty.guided-empty {
  background: rgba(248, 250, 252, 0.62);
  border: 1px dashed #cbd8ea;
  border-radius: 14px;
  box-shadow: none;
}

.classes-empty-mark {
  display: inline-grid;
  width: 66px;
  height: 66px;
  margin-bottom: 18px;
  place-items: center;
  color: #315bc7;
  background: #edf3ff;
  border: 1px solid #d6e2ff;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(52, 95, 219, 0.1);
}

.classes-empty-mark svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.classes-inline-empty strong {
  margin-bottom: 7px;
  color: #111827;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
}

.classes-inline-empty > span:not(.classes-empty-mark) {
  max-width: 410px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.55;
}

.class-modal-panel {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 14px;
}

.class-modal-panel .modal-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

body[data-theme="dark"] #classesView .classes-panel,
body[data-theme="dark"] #classesView .class-card {
  background: linear-gradient(145deg, rgba(25, 33, 48, 0.98), rgba(19, 27, 41, 0.98));
  border-color: rgba(71, 85, 105, 0.62);
}

body[data-theme="dark"] #classesView .panel-heading h3,
body[data-theme="dark"] #classesView .class-card-copy strong,
body[data-theme="dark"] .classes-inline-empty strong {
  color: #f8fafc;
}

body[data-theme="dark"] .class-card-mark,
body[data-theme="dark"] .classes-empty-mark {
  color: #8fb6ff;
  background: rgba(49, 91, 199, 0.18);
  border-color: rgba(96, 165, 250, 0.28);
}

@media (max-width: 640px) {
  #classesView .classes-panel {
    min-height: 0;
    padding: 17px;
  }

  #classesView .panel-heading {
    gap: 14px;
    align-items: stretch;
  }

  .classes-heading-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  #classesView .classes-grid {
    grid-template-columns: 1fr;
    margin-top: 14px;
  }

  #classesView .class-card {
    min-height: 92px;
    padding: 15px;
  }

  .classes-inline-empty {
    min-height: 310px;
    padding: 28px 14px;
  }
}

@media (max-width: 1120px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-nav-links {
    display: none;
  }
}

@media (max-width: 900px) {
  #dashboardView {
    grid-template-columns: 1fr;
  }

  #dashboardView .focus-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .dashboard-grid,
  .focus-grid,
  .assignment-layout,
  .settings-layout,
  .form-two,
  .feature-grid,
  .product-preview,
  .steps-grid,
  .value-section,
  .value-grid,
  .split,
  .metrics {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    min-height: 0;
    padding: 10px;
  }

  .auth-copy {
    min-height: 360px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    width: 270px;
    height: 100vh;
    box-shadow: var(--shadow);
  }

  .sidebar:not(:hover):not(:focus-within) {
    width: 58px;
    padding: 22px 7px 8px;
  }

  .app-shell {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .app-shell:not(.sidebar-collapsed) {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: 58px;
  }

  .content {
    padding: 18px 16px 24px;
  }

  .topbar {
    margin: -18px -16px 18px;
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-title-row {
    display: inline-flex;
  }

  .page-info-box {
    left: 0;
    top: calc(100% + 8px);
    width: min(320px, calc(100vw - 32px));
    max-width: 100%;
    transform: none;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .landing-hero {
    min-height: 660px;
    align-items: end;
  }

  .hero-copy {
    width: 100%;
    padding: 28px 22px 34px;
  }

  .hero-copy h1 {
    font-size: clamp(2.1rem, 8.5vw, 3.4rem);
    line-height: 0.98;
  }

  .hero-brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .hero-logo {
    width: 58px;
    height: 58px;
  }

  .hero-motto {
    font-size: clamp(1.65rem, 7vw, 2.7rem);
  }

  .hero-copy p:not(.eyebrow):not(.hero-motto) {
    max-width: 100%;
  }

  .feature-grid {
    gap: 10px;
  }

  .product-preview {
    padding: 10px;
  }

  .preview-panel {
    min-height: 0;
  }

  .value-copy {
    position: static;
  }

  .landing-hero::after,
  body[data-theme="dark"] .landing-hero::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.96) 58%);
  }

  body[data-theme="dark"] .landing-hero::after {
    background: linear-gradient(180deg, rgba(16, 20, 31, 0.16), rgba(16, 20, 31, 0.97) 58%);
  }

  .study-home {
    align-items: flex-start;
    flex-direction: column;
  }

  .study-home .primary {
    width: 100%;
  }

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

  .focus-setup-row,
  .session-summary-grid,
  .session-detail-grid {
    grid-template-columns: 1fr;
  }

  .subtask-editor-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .subtask-editor-heading .small-button {
    width: 100%;
  }

  .due-soon-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

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

  .assignment-form-panel,
  .timer-panel {
    position: static;
    max-height: none;
  }

  .due-meta {
    justify-content: flex-start;
  }

  .icon-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .auth-shell {
    padding: 12px;
  }

  .landing-nav,
  .landing-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-footer {
    grid-template-columns: 1fr;
    margin-inline: 10px;
    gap: 18px;
    padding: 24px 18px 18px;
    border-radius: 20px 20px 0 0;
  }

  .footer-link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
    gap: 16px 12px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-actions button,
  .hero-actions button {
    width: 100%;
  }

  .hero-points {
    gap: 6px;
  }

  .hero-points span {
    font-size: 0.76rem;
  }

  .auth-copy,
  .auth-card,
  .panel,
  .metric {
    padding: 18px;
  }

  .content {
    padding: 14px 12px 22px;
  }

  .topbar {
    margin: -14px -12px 16px;
    padding: 14px 12px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .ghost,
  .topbar-actions .status-badge {
    flex: 1 1 auto;
    justify-content: center;
  }

  h2 {
    font-size: 1.65rem;
  }

  .timer {
    font-size: clamp(3rem, 18vw, 4.8rem);
  }

  nav {
    grid-template-columns: 1fr;
  }

  .button-row > button {
    width: 100%;
  }

  .focus-overlay {
    padding: 12px;
  }

  .focus-overlay-shell {
    gap: 12px;
  }

  .focus-exit-button {
    justify-self: stretch;
  }

  .focus-core {
    min-height: calc(100vh - 86px);
    gap: 12px;
  }

  .focus-actions {
    width: 100%;
  }

  .focus-actions button {
    flex: 1 1 100%;
  }

  .assignment-line,
  .rank-line,
  .session-card header,
  .settings-card-header,
  .profile-preview-row,
  .danger-zone {
    grid-template-columns: 1fr;
  }

  .settings-card-header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Final visual system override */
body,
.landing-shell,
body[data-theme="dark"],
body[data-theme="dark"] .landing-shell,
.content {
  background: var(--bg);
}

.landing-nav,
.topbar,
body[data-theme="dark"] .landing-nav,
body[data-theme="dark"] .topbar {
  border-color: var(--line);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.landing-nav {
  background: rgba(255, 255, 255, 0.94);
}

.topbar {
  background: rgba(243, 245, 248, 0.94);
}

body[data-theme="dark"] .landing-nav,
body[data-theme="dark"] .topbar {
  background: rgba(15, 20, 29, 0.94);
}

.landing-hero::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.82) 50%, rgba(255, 255, 255, 0.38));
}

body[data-theme="dark"] .landing-hero::after {
  background: linear-gradient(90deg, rgba(15, 20, 29, 0.96), rgba(15, 20, 29, 0.84) 50%, rgba(15, 20, 29, 0.44));
}

.product-preview,
.preview-panel,
.feature-card,
.step-card,
.value-card,
.auth-panel,
.auth-card,
.metric,
.panel,
.session-card,
.planned-assignment,
.class-card,
.class-form,
.study-home,
.calendar-grid {
  background: var(--panel);
  border-color: var(--card-border);
  box-shadow: var(--soft-shadow);
}

.feature-card:hover,
.metric:hover,
.panel:hover,
.session-card:hover,
.planned-assignment:hover,
.class-card:hover {
  border-color: #bcc7d6;
  box-shadow: var(--soft-shadow);
}

.product-preview,
.auth-panel {
  padding: 0;
}

.auth-copy {
  background: #111827;
}

.landing-footer {
  margin: 0;
  background: #111827;
  border-radius: 0;
  box-shadow: none;
}

.primary,
.success {
  background: var(--primary);
  box-shadow: none;
}

.primary:hover,
.success:hover {
  background: var(--primary-dark);
}

.ghost,
body[data-theme="dark"] .ghost {
  background: var(--panel);
}

.ghost:hover {
  background: var(--surface-hover);
  box-shadow: none;
}

.primary,
.ghost,
.success,
input,
select,
.segmented button,
.nav-icon,
.sidebar-toggle {
  border-radius: 6px;
}

input,
select {
  background: var(--panel);
  border-color: var(--card-border);
}

.segmented {
  background: var(--panel-soft);
  border-color: var(--line);
}

.segmented .active {
  box-shadow: none;
}

.sidebar {
  background: var(--sidebar-bg);
}

.nav-icon {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.nav-item:hover,
.nav-item.active {
  background: #1f2937;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon,
.sidebar-collapsed .nav-item.active .nav-icon {
  color: #ffffff;
  background: #2f5f9f;
  border-color: transparent;
  box-shadow: none;
}

.page-info-box {
  background: var(--panel);
  box-shadow: none;
}

.study-home {
  background: var(--panel);
  border-left-color: var(--primary);
}

.metric::before {
  height: 3px;
}

.metric-teal::before,
.progress span,
.focus-progress span {
  background: var(--primary);
}

.streak-ring {
  border-width: 1px;
  background: var(--panel-soft);
  box-shadow: none;
}

.due-soon-item,
.task-row,
.empty,
.profile-preview-row,
.settings-grid div,
.assignment-overview-row,
.calendar-toolbar,
.assignment-filters,
.preview-metrics div,
.preview-progress,
.preview-task,
body[data-theme="dark"] .due-soon-item,
body[data-theme="dark"] .task-row {
  background: var(--panel-soft);
  border-color: var(--card-border);
  box-shadow: none;
}

.empty {
  border-style: solid;
}

.avatar-preview {
  background: #20324d;
  box-shadow: none;
}

.focus-overlay {
  background: #0f141d;
}

.focus-core {
  background: #161d29;
  box-shadow: none;
  backdrop-filter: none;
}

.calendar-day,
.calendar-assignment,
.mini-day,
.mini-event {
  background: var(--panel);
}

.calendar-day.today,
.mini-day.today {
  background: #f0f5fb;
  box-shadow: inset 0 0 0 1px var(--primary);
}

body[data-theme="dark"] .calendar-day.today,
body[data-theme="dark"] .mini-day.today {
  background: #1b2432;
}

.hero-points span,
.auth-highlights span,
.status-badge,
.pill,
.task-chip,
.due-pill,
.priority,
.status-pill,
.overdue-label {
  border-radius: 6px;
  font-weight: 700;
}

.hero-points span,
.status-badge,
.task-chip,
.pill,
body[data-theme="dark"] .task-chip,
body[data-theme="dark"] .pill,
body[data-theme="dark"] .status-badge {
  color: #344054;
  background: #f8fafc;
  border: 1px solid var(--line);
}

body[data-theme="dark"] .hero-points span,
body[data-theme="dark"] .task-chip,
body[data-theme="dark"] .pill,
body[data-theme="dark"] .status-badge {
  color: #d9e2ef;
  background: #1b2432;
}

/* Final cascade guard */
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --panel-strong: #eef4ff;
  --text: #141925;
  --muted: #647086;
  --line: #dce3ee;
  --primary: #345fdb;
  --primary-dark: #2448af;
  --cyan: #148c8a;
  --success: #25885a;
  --amber: #b86d12;
  --danger: #c73d2f;
  --shadow: 0 18px 46px rgba(21, 32, 56, 0.1);
  --soft-shadow: 0 8px 22px rgba(21, 32, 56, 0.07);
  --card-border: #dce3ee;
  --surface-hover: #eef3fb;
  --focus-ring: rgba(52, 95, 219, 0.18);
  --sidebar-bg: #121a2a;
  --sidebar-soft: #1d2a42;
  --sidebar-line: #2a3a57;
}

body[data-theme="dark"] {
  --bg: #0f1521;
  --panel: #171f2d;
  --panel-soft: #1d2737;
  --panel-strong: #263247;
  --text: #f3f7fd;
  --muted: #aab7c9;
  --line: #344258;
  --primary: #88a4ff;
  --primary-dark: #6f90f1;
  --cyan: #66cbc6;
  --success: #73c99c;
  --amber: #e4b965;
  --danger: #ff9a82;
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  --card-border: #344258;
  --surface-hover: #243044;
  --focus-ring: rgba(136, 164, 255, 0.2);
}

.page-info-box {
  position: static;
  display: inline-flex !important;
  width: min(520px, 46vw);
  max-width: 520px;
  min-height: 34px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  transform: none;
}

.page-info-box.hidden {
  display: none !important;
}

.page-info-box::before {
  display: none;
}

@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #dashboardView .metrics,
  .metrics {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: auto;
  }
}

.priority-high {
  color: #912018;
  background: #fef3f2;
  border-color: #fecdca;
}

.priority-medium {
  color: #7a4d00;
  background: #fffaeb;
  border-color: #fedf89;
}

.priority-low {
  color: #244b7d;
  background: #eff4fb;
  border-color: #d6e2f1;
}

.status-pill,
.filter-chip.active {
  color: var(--primary);
  background: #eff4fb;
  border: 1px solid #d6e2f1;
}

.danger-button,
.overdue-label {
  color: var(--danger);
}

body {
  background:
    radial-gradient(circle at top left, rgba(52, 95, 219, 0.08), transparent 34rem),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 48%, #edf2f8 100%);
}

.landing-shell {
  background: transparent;
}

.hero-copy {
  width: min(720px, 100%);
}

.hero-brand-lockup {
  margin-bottom: 12px;
}

.hero-copy h1 {
  margin-bottom: 0;
}

.hero-motto {
  max-width: 700px;
  margin-bottom: 16px;
  color: var(--text);
  font-size: clamp(2.15rem, 4.2vw, 3.85rem);
  line-height: 1.02;
}

.hero-copy p:not(.eyebrow):not(.hero-motto) {
  max-width: 620px;
}

.hero-points {
  max-width: 620px;
}

.landing-nav,
.topbar {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(205, 215, 230, 0.82);
  box-shadow: 0 10px 28px rgba(21, 32, 56, 0.06);
}

body[data-theme="dark"] .landing-nav,
body[data-theme="dark"] .topbar {
  background: rgba(15, 21, 33, 0.86);
  border-color: rgba(52, 66, 88, 0.74);
}

.panel,
.metric,
.feature-card,
.step-card,
.value-card,
.preview-panel,
.session-card,
.planned-assignment,
.class-card,
.calendar-day,
.due-soon-item,
.task-row {
  background: var(--panel);
  border-color: var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

.app-shell {
  grid-template-columns: 270px 1fr;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 68px 1fr;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(71, 101, 173, 0.18), transparent 34%),
    var(--sidebar-bg);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.page-info-box.collapsed {
  width: 34px;
  padding: 6px;
}

.primary {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 12px 24px rgba(52, 95, 219, 0.2);
}

.progress span,
.focus-progress span {
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}

@media (max-width: 1040px) {
  .page-title-row {
    display: grid;
  }

  .page-info-box {
    width: min(100%, 620px);
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .page-info-box {
    display: none !important;
  }

  .hero-motto {
    font-size: clamp(2rem, 11vw, 2.8rem);
  }
}

/* Dashboard polish: restrained, high-contrast workspace hierarchy */
#dashboardView {
  width: min(1240px, 100%);
  gap: 18px;
}

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

#dashboardView .metric {
  isolation: isolate;
  min-height: 126px;
  padding: 19px 20px 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.96));
  border-color: rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
}

#dashboardView .metric::before {
  inset: 0 auto 0 0;
  width: 4px;
  height: auto;
}

#dashboardView .metric::after {
  position: absolute;
  right: -24px;
  bottom: -34px;
  z-index: -1;
  width: 96px;
  height: 96px;
  background: radial-gradient(circle, rgba(52, 95, 219, 0.09), transparent 68%);
  border-radius: 50%;
  content: "";
}

#dashboardView .metric-label {
  align-content: start;
  min-height: 48px;
}

#dashboardView .metric-label > span {
  color: #3e4c62;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

#dashboardView .metric-label small {
  overflow: hidden;
  color: #8a98ab;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashboardView .metric strong {
  margin-top: auto;
  color: #111827;
  font-size: clamp(1.75rem, 2.6vw, 2.15rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
}

#dashboardView .focus-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 18px;
}

#dashboardView .current-session-card,
#dashboardView .streak-card,
#dashboardView .due-soon-panel,
#dashboardView .onboarding-card {
  border-color: rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

#dashboardView .current-session-card {
  position: relative;
  min-height: 344px;
  padding: 23px 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 10%, rgba(52, 95, 219, 0.11), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
}

#dashboardView .current-session-card::after {
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(52, 95, 219, 0.09);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

#dashboardView .panel-kicker {
  margin-bottom: 7px;
  color: #315bc7;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

#dashboardView .panel-heading h3,
#dashboardView .streak-card > h3 {
  color: #111827;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

#dashboardView .compact-timer {
  margin: 30px 0 16px;
  color: #111827;
  font-size: clamp(3.5rem, 6vw, 5.15rem);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.065em;
}

#dashboardView .current-session-card .progress {
  height: 8px;
  background: #e8eef8;
  border-radius: 999px;
}

#dashboardView .current-session-card .button-row {
  position: relative;
  z-index: 1;
  margin-top: 22px;
}

#dashboardView .current-session-card .primary {
  min-height: 44px;
  padding-inline: 20px;
  box-shadow: 0 10px 22px rgba(52, 95, 219, 0.2);
}

#dashboardView .streak-card {
  padding: 23px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

#dashboardView .streak-ring {
  width: 108px;
  height: 108px;
  margin: 18px auto 16px;
  border-width: 8px;
  box-shadow: inset 0 0 0 1px #e8edf5, 0 9px 24px rgba(37, 99, 235, 0.08);
}

#dashboardView .streak-summary {
  gap: 7px;
}

#dashboardView .streak-summary div {
  padding: 10px 12px;
  background: #f7f9fc;
  border-color: #e5eaf2;
}

#dashboardView .due-soon-panel {
  padding: 22px 24px;
}

#dashboardView .due-soon-item {
  padding: 13px 14px;
  background: #fbfcfe;
  border-left-width: 4px;
}

body[data-theme="dark"] #dashboardView .metric,
body[data-theme="dark"] #dashboardView .current-session-card,
body[data-theme="dark"] #dashboardView .streak-card {
  background: linear-gradient(145deg, rgba(25, 33, 48, 0.98), rgba(19, 27, 41, 0.98));
  border-color: rgba(71, 85, 105, 0.62);
}

body[data-theme="dark"] #dashboardView .metric-label > span,
body[data-theme="dark"] #dashboardView .metric strong,
body[data-theme="dark"] #dashboardView .panel-heading h3,
body[data-theme="dark"] #dashboardView .streak-card > h3,
body[data-theme="dark"] #dashboardView .compact-timer {
  color: #f8fafc;
}

body[data-theme="dark"] #dashboardView .streak-summary div {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(71, 85, 105, 0.58);
}

@media (max-width: 1050px) {
  #dashboardView .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #dashboardView .focus-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  }
}

@media (max-width: 760px) {
  #dashboardView .focus-grid {
    grid-template-columns: 1fr;
  }

  #dashboardView .current-session-card {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  #dashboardView {
    gap: 14px;
  }

  #dashboardView .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  #dashboardView .metric {
    min-height: 118px;
    padding: 15px 14px;
  }

  #dashboardView .metric-label > span {
    font-size: 0.74rem;
  }

  #dashboardView .metric-label small {
    font-size: 0.68rem;
  }

  #dashboardView .current-session-card,
  #dashboardView .streak-card,
  #dashboardView .due-soon-panel {
    padding: 18px;
  }

  #dashboardView .compact-timer {
    margin-top: 22px;
    font-size: clamp(3.15rem, 19vw, 4.35rem);
  }

  #dashboardView .onboarding-card {
    padding: 16px;
  }

  #dashboardView .onboarding-list {
    gap: 8px;
  }

  #dashboardView .onboarding-step {
    min-height: 0;
    padding: 11px 12px;
  }

  #dashboardView .onboarding-step span:not(.onboarding-check) {
    display: none;
  }

  #dashboardView .onboarding-step button {
    grid-column: 2;
    width: fit-content;
    min-height: 32px;
    padding: 5px 12px;
  }
}

/* FocusRoom polish pass */
:root {
  --radius: 8px;
}

.content {
  gap: 18px;
}

#dashboardView,
.settings-page,
.settings-card-grid,
.classes-panel,
.sessions-list,
.assignment-board-panel,
.timer-panel {
  gap: 18px;
}

.panel,
.metric,
.session-card,
.planned-assignment,
.class-card {
  padding: 20px;
}

.panel-heading,
.settings-section-header {
  align-items: flex-start;
  padding-bottom: 2px;
}

.panel-heading h3,
.settings-section-header h3,
.panel h3 {
  margin-bottom: 0;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.panel-kicker,
.eyebrow {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 850;
}

.primary,
.ghost,
.success,
.google-auth-button,
.auth-back-button,
.filter-chip,
.segmented button {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

.small-button,
.filter-chip,
.calendar-status-button,
.calendar-delete-button {
  min-height: 34px;
}

.primary,
.success {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(52, 95, 219, 0.14);
}

.primary:hover,
.success:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 22px rgba(52, 95, 219, 0.18);
}

.ghost,
body[data-theme="dark"] .ghost {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--card-border);
}

.ghost:hover {
  background: var(--surface-hover);
  border-color: #b8c5d8;
}

input,
select,
textarea {
  min-height: 44px;
  border-radius: 8px;
}

::placeholder {
  color: #94a3b8;
}

body[data-theme="dark"] ::placeholder {
  color: #7f8ea4;
}

.topbar {
  padding-top: 12px;
  padding-bottom: 12px;
}

.topbar-actions {
  gap: 8px;
}

.topbar-actions .ghost,
.topbar-actions .status-badge {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 750;
}

body[data-theme="dark"] .topbar-actions .ghost,
body[data-theme="dark"] .topbar-actions .status-badge {
  background: rgba(23, 31, 45, 0.66);
  border-color: rgba(100, 116, 139, 0.36);
}

.study-home,
.onboarding-card,
.current-session-card,
.streak-card,
.due-soon-panel,
.timer-panel,
.assignment-form-panel,
.assignment-board-panel,
.classes-panel {
  border-radius: 10px;
}

.empty,
.guided-empty {
  min-height: 150px;
  padding: 22px;
  border-radius: 10px;
}

.empty-icon {
  width: 42px;
  height: 42px;
}

.calendar-toolbar,
.assignment-filters {
  margin: 12px 0;
  padding: 7px;
}

.calendar-grid {
  min-width: 900px;
  border-radius: 10px;
}

.calendar-weekday {
  min-height: 34px;
  padding: 8px;
  font-size: 0.72rem;
  letter-spacing: 0;
}

.calendar-day {
  gap: 7px;
  min-height: 132px;
  padding: 8px;
}

.calendar-day-head {
  color: var(--muted);
  font-size: 0.78rem;
}

.calendar-day.today {
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.calendar-assignment {
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
}

.calendar-assignment-main strong {
  margin-bottom: 2px;
  font-size: 0.78rem;
}

.calendar-assignment-main span,
.calendar-assignment-main p {
  font-size: 0.7rem;
}

.calendar-card-meta {
  gap: 5px;
}

.priority,
.status-pill,
.detail-pill,
.overdue-label,
.due-pill,
.task-chip,
.pill {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.planned-assignment {
  gap: 13px;
}

.planned-main {
  align-items: flex-start;
}

.planned-main strong {
  font-size: 1rem;
  line-height: 1.25;
}

.planned-main span,
.planned-meta {
  font-size: 0.84rem;
}

.assignment-description,
.session-reflection-text,
.session-distraction-text {
  max-width: 74ch;
}

.assignment-subtasks,
.focus-task-checklist,
.session-reflection-panel,
.subtask-editor {
  border-radius: 10px;
}

.class-form {
  align-items: end;
}

@media (max-width: 900px) {
  .content {
    padding: 14px;
  }

  .topbar {
    gap: 12px;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .assignment-form-panel {
    position: static;
    max-height: none;
  }

  .calendar-grid {
    min-width: 760px;
  }
}

@media (max-width: 640px) {
  .panel,
  .metric,
  .session-card,
  .planned-assignment,
  .class-card {
    padding: 16px;
  }

  .topbar-actions .ghost,
  .topbar-actions .status-badge {
    min-height: 30px;
    font-size: 0.74rem;
  }

  .calendar-grid {
    min-width: 680px;
  }

  .calendar-day {
    min-height: 120px;
  }

  .planned-main,
  .planned-meta,
  .planned-actions,
  .due-meta {
    align-items: flex-start;
    justify-content: flex-start;
  }
}

/* Mobile app compatibility pass */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

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

@media (max-width: 720px) {
  .landing-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 14px;
  }

  .landing-brand {
    justify-content: center;
  }

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

  .landing-actions button {
    width: 100%;
    min-height: 38px;
    padding-inline: 10px;
  }

  .landing-hero {
    min-height: calc(100svh - 108px);
  }

  .hero-copy {
    padding: 24px 16px 28px;
  }

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

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

  .hero-points span {
    justify-content: center;
    min-width: 0;
    padding-inline: 8px;
    text-align: center;
  }

  .landing-section {
    padding: 36px 14px;
  }

  .section-heading h2,
  .value-copy h2 {
    font-size: clamp(1.55rem, 8vw, 2.15rem);
  }

  .product-preview,
  .preview-metrics,
  .steps-grid,
  .value-grid,
  .footer-link-grid {
    grid-template-columns: 1fr;
  }

  .preview-calendar {
    overflow-x: auto;
  }

  .mini-calendar {
    min-width: 560px;
  }

  .landing-footer {
    grid-template-columns: 1fr;
    margin-inline: 0;
    padding: 24px 16px 18px;
    border-radius: 0;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-shell {
    min-height: 100svh;
    padding: 12px;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .auth-copy {
    min-height: 0;
    padding: 20px;
  }

  .auth-copy .auth-highlights {
    margin-top: 18px;
  }
}

@media (max-width: 640px) {
  body.focus-open {
    overflow: hidden;
  }

  .app-shell,
  .app-shell.sidebar-collapsed,
  .app-shell:not(.sidebar-collapsed) {
    display: block;
    min-height: 100svh;
  }

  .sidebar,
  .sidebar:not(:hover):not(:focus-within),
  .app-shell.sidebar-collapsed .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    width: 100%;
    height: auto;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--sidebar-line);
    border-right: 0;
    box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.18);
  }

  .sidebar-header,
  .sidebar-collapsed .sidebar-header {
    display: none;
  }

  .side-nav,
  .sidebar-collapsed .side-nav {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    border-top: 0;
    scrollbar-width: none;
  }

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

  .nav-item,
  .sidebar-collapsed .nav-item {
    flex: 1 0 68px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    width: auto;
    height: 54px;
    min-height: 54px;
    max-height: none;
    margin: 0;
    padding: 6px 4px;
    overflow: hidden;
    text-align: center;
  }

  .nav-icon,
  .sidebar-collapsed .nav-icon {
    width: 26px;
    height: 26px;
  }

  .nav-icon svg,
  .sidebar-collapsed .nav-icon svg {
    width: 16px;
    height: 16px;
  }

  .nav-label,
  .sidebar-collapsed .nav-label {
    width: auto;
    max-width: 64px;
    opacity: 1;
    color: inherit;
    font-size: 0.64rem;
    line-height: 1.1;
    overflow: hidden;
    pointer-events: auto;
    text-overflow: ellipsis;
    transform: none;
    white-space: nowrap;
  }

  .sidebar-collapsed .nav-item::after {
    display: none;
  }

  .content {
    grid-column: auto;
    width: 100%;
    min-width: 0;
    padding: 12px 12px calc(88px + env(safe-area-inset-bottom));
  }

  .view {
    width: 100%;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    margin: -12px -12px 14px;
    padding: 12px;
  }

  .topbar-title,
  .topbar-title h2,
  .page-title-row {
    width: 100%;
    min-width: 0;
  }

  .topbar h2 {
    font-size: clamp(1.24rem, 7vw, 1.62rem);
    overflow-wrap: anywhere;
  }

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

  .topbar-actions .ghost,
  .topbar-actions .status-badge {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    white-space: normal;
  }

  #todayLabel {
    grid-column: 1 / -1;
  }

  #dashboardView,
  .dashboard-grid,
  .focus-grid,
  .assignment-layout,
  .settings-page,
  .settings-card-grid,
  .settings-security-grid,
  .classes-panel,
  .sessions-list {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .study-home,
  .panel-heading,
  .settings-section-header,
  .subtask-editor-heading,
  .calendar-toolbar,
  .assignment-filters,
  .planned-assignment,
  .session-card header,
  .settings-meta-row,
  .settings-preferences-row {
    align-items: stretch;
    flex-direction: column;
  }

  .study-home .primary,
  .panel-heading button,
  .settings-section-header button,
  .calendar-toolbar button,
  .assignment-filters button,
  .planned-actions button,
  .settings-actions button {
    width: 100%;
  }

  .class-form,
  .planned-main,
  .planned-meta,
  .planned-actions,
  .assignment-overview,
  .assignment-overview-row,
  .session-summary-grid,
  .session-detail-grid,
  .focus-setup-row,
  .subtask-input-row,
  .classes-panel .panel-heading {
    grid-template-columns: 1fr;
  }

  .subtask-check-label {
    width: 100%;
  }

  .metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .metric,
  .panel,
  .session-card,
  .planned-assignment,
  .class-card {
    padding: 14px;
  }

  .assignment-board-panel,
  .calendar-shell {
    min-width: 0;
    overflow-x: auto;
  }

  .calendar-grid {
    min-width: 640px;
  }

  .calendar-toolbar,
  .assignment-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .focus-core {
    width: 100%;
    min-height: calc(100svh - 80px);
    padding: 18px;
  }

  .focus-timer {
    font-size: clamp(3rem, 19vw, 5.2rem);
  }
}

@media (max-width: 380px) {
  .hero-points,
  .landing-actions,
  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .nav-item,
  .sidebar-collapsed .nav-item {
    flex-basis: 62px;
  }

  .nav-label,
  .sidebar-collapsed .nav-label {
    max-width: 58px;
  }
}

.sidebar-collapsed .nav-item.active,
.sidebar-collapsed .nav-item:hover {
  background: transparent;
  box-shadow: none;
}

.sidebar-collapsed .nav-item.active .nav-icon,
.sidebar-collapsed .nav-item:hover .nav-icon {
  color: #ffffff;
  background: var(--primary);
}

@media (max-width: 640px) {
  .nav-item.active,
  .nav-item:hover {
    background: transparent;
    box-shadow: none;
  }
}

/* Final UI optimization pass */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  background: var(--bg);
}

.sidebar {
  overflow: hidden;
}

.sidebar-header {
  min-height: 58px;
}

.brand {
  gap: 14px;
}

.brand-logo-frame {
  box-shadow: 0 8px 18px rgba(47, 95, 159, 0.22);
}

.sidebar-copy strong {
  display: block;
  color: #f2f7ff;
  font-size: 1.22rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.sidebar-toggle {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.nav-item {
  min-width: 0;
}

.nav-label,
.topbar h2,
.panel-heading h3,
.planned-main strong,
.session-card strong {
  overflow-wrap: anywhere;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(47, 95, 159, 0.18);
  box-shadow: none;
}

.nav-item.active {
  color: #ffffff;
}

.nav-icon {
  border-radius: 999px;
}

.content {
  min-height: 100vh;
}

.view {
  margin-inline: auto;
}

.topbar {
  min-height: 72px;
}

.topbar-actions {
  flex: 0 0 auto;
}

.topbar-actions .ghost {
  min-width: 104px;
}

.panel,
.metric,
.study-home,
.session-card,
.planned-assignment,
.class-card,
.calendar-toolbar,
.assignment-filters {
  border: 1px solid var(--card-border);
}

.panel,
.metric,
.session-card,
.planned-assignment,
.class-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-soft));
}

.panel-heading {
  gap: 12px;
}

.button-row,
.planned-actions,
.settings-profile-actions,
.settings-actions {
  gap: 10px;
}

.button-row > button,
.planned-actions button,
.settings-actions button {
  min-width: 0;
}

.empty,
.guided-empty {
  border-style: dashed;
}

.calendar-card-meta,
.planned-meta,
.due-meta,
.next-up-actions {
  gap: 7px;
}

.calendar-grid,
.mini-calendar {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.calendar-grid::-webkit-scrollbar,
.mini-calendar::-webkit-scrollbar,
.side-nav::-webkit-scrollbar {
  height: 8px;
}

.calendar-grid::-webkit-scrollbar-thumb,
.mini-calendar::-webkit-scrollbar-thumb,
.side-nav::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 999px;
}

@media (min-width: 901px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    height: 100vh;
  }

  .sidebar-collapsed .sidebar {
    width: 68px;
  }

  .sidebar-collapsed .nav-item.active,
  .sidebar-collapsed .nav-item:hover {
    background: transparent;
  }

  .sidebar-collapsed .nav-icon {
    margin-inline: auto;
  }

  .content {
    padding: 20px 24px 28px;
  }
}

@media (max-width: 900px) {
  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions .ghost {
    min-width: 0;
    width: 100%;
  }

  .auth-copy h1 {
    font-size: clamp(2rem, 9vw, 3rem);
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 0;
  }

  .topbar-actions {
    gap: 8px;
  }

  .side-nav {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    scroll-snap-type: none;
  }

  .nav-item,
  .sidebar-collapsed .nav-item {
    flex: 1 1 0;
    min-width: 0;
    scroll-snap-align: start;
  }

  .nav-label {
    white-space: nowrap;
  }

  .panel-heading,
  .calendar-toolbar,
  .assignment-filters {
    gap: 10px;
  }

  .button-row,
  .next-up-actions,
  .planned-actions,
  .settings-profile-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-copy p:not(.eyebrow):not(.hero-motto),
  .section-heading .muted,
  .value-copy .muted {
    font-size: 0.96rem;
    line-height: 1.55;
  }
}

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

.modal-form-panel:not(.hidden) {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  z-index: 100 !important;
  width: min(560px, calc(100vw - 40px)) !important;
  max-height: min(760px, calc(100vh - 40px)) !important;
  overflow: auto !important;
  transform: translate(-50%, -50%) !important;
}

@media (max-width: 640px) {
  .modal-form-panel:not(.hidden) {
    width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    padding: 16px;
  }
}

/* Assignment Calendar: keep the form modal-only and give the calendar the full page width. */
#assignmentsView.view {
  width: 100%;
  max-width: none;
}

#assignmentsView .assignment-layout {
  display: block;
  width: 100%;
  max-width: none;
}

#assignmentsView .assignment-board-panel {
  width: 100%;
  max-width: none;
}

#assignmentsView .deadline-board {
  width: 100%;
}

#assignmentsView .calendar-grid {
  width: 100%;
  min-width: 980px;
}

@media (min-width: 1180px) {
  #assignmentsView .calendar-grid {
    min-width: 0;
  }
}

/* Floating AI study assistant */
.floating-ai-button {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 70;
  min-height: 48px;
  padding: 0 18px 0 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(43, 83, 145, 0.25);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 220ms ease, opacity 220ms ease, box-shadow 220ms ease;
}

.floating-ai-button svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floating-ai-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(43, 83, 145, 0.4);
}

.floating-ai-button.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.92);
}

.chat-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 78;
  background: rgba(15, 23, 42, 0.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.chat-popup-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.chat-popup {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  top: 84px;
  bottom: 20px;
  z-index: 80;
  width: min(425px, calc(100vw - 40px));
  height: auto;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18), 0 4px 16px rgba(15, 23, 42, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(32px) scale(0.985);
  transform-origin: right center;
  transition: opacity 240ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1), visibility 240ms ease;
}

.chat-popup.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) translateY(0) scale(1);
}

.chat-page {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.chat-header h3,
.chat-header p,
.chat-message p {
  margin: 0;
}

.chat-header-copy {
  min-width: 0;
  flex: 1;
}

.chat-header-copy h3 {
  font-size: 0.96rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.chat-header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.assistant-mark {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  border-radius: 11px;
  font-size: 0.78rem;
  font-weight: 800;
}

.assistant-status-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 5px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 12%, transparent);
}

.chat-window-actions {
  display: flex;
  gap: 4px;
}

#minimizeChatButton {
  display: none;
}

.chat-window-button {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font: inherit;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.chat-window-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.chat-window-button:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--line);
}

.chat-messages {
  flex: 1;
  min-height: 0;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 32%, transparent) transparent;
  background: color-mix(in srgb, var(--panel-soft) 72%, var(--panel));
}

.chat-messages.is-empty-state {
  justify-content: flex-end;
  gap: 14px;
  padding: 32px 20px 24px;
}

.chat-messages.is-empty-state .chat-welcome {
  width: min(100%, 330px);
  max-width: 330px;
  margin: auto auto 10px;
  align-self: center;
}

.chat-message {
  flex: 0 0 auto;
  width: fit-content;
  height: auto;
  min-height: 0;
  max-width: 82%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.assistant-message {
  align-self: flex-start;
  background: var(--panel);
}

.chat-welcome {
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
  box-shadow: none;
  background: transparent;
}

.chat-welcome p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.chat-welcome > strong {
  display: block;
  font-size: 1.05rem;
}

.chat-empty-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  border-radius: 15px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 24%, transparent);
}

.chat-empty-mark svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-message {
  align-self: flex-end;
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 16%, transparent);
}

.user-message {
  border-bottom-right-radius: 5px;
}

.chat-role {
  display: block;
  margin-bottom: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  opacity: 0.78;
}

.chat-rich-text {
  display: block;
  white-space: normal;
}

.chat-rich-text .chat-paragraph,
.chat-rich-text .chat-heading {
  display: block;
}

.chat-rich-text .chat-paragraph + .chat-paragraph,
.chat-rich-text ul + .chat-paragraph,
.chat-rich-text ol + .chat-paragraph {
  margin-top: 10px;
}

.chat-rich-text .chat-heading {
  margin: 2px 0 6px;
  color: var(--text);
  font-size: 0.92rem;
}

.chat-rich-text ul,
.chat-rich-text ol {
  margin: 7px 0 9px;
  padding-left: 20px;
}

.chat-rich-text li + li {
  margin-top: 5px;
}

.chat-rich-text code {
  padding: 2px 5px;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 5px;
  font: 0.85em ui-monospace, SFMono-Regular, Menlo, monospace;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
  max-width: 96%;
}

.chat-messages.is-empty-state .chat-suggestions {
  width: 100%;
  max-width: none;
  display: flex;
  justify-content: center;
  align-self: center;
}

.chat-messages.is-empty-state .chat-suggestions button {
  width: auto;
  white-space: normal;
  text-align: center;
}

.chat-suggestions button {
  min-height: 34px;
  padding: 7px 11px;
  color: var(--primary);
  background: color-mix(in srgb, var(--panel) 94%, var(--primary));
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
  border-radius: 999px;
  font: inherit;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  text-align: left;
}

.chat-suggestions button:hover {
  background: color-mix(in srgb, var(--primary) 13%, var(--panel));
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  transform: translateY(-1px);
}

.chat-typing {
  min-width: 38px;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: chat-dot 1.1s ease-in-out infinite;
}

.chat-typing span:nth-child(2) {
  animation-delay: 140ms;
}

.chat-typing span:nth-child(3) {
  animation-delay: 280ms;
}

.chat-error {
  margin: 0 18px 10px;
  padding: 10px 12px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: 6px;
}

.chat-form {
  padding: 13px 16px 7px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  box-shadow: none;
}

.chat-form textarea {
  width: 100%;
  min-height: 46px;
  max-height: 150px;
  padding: 12px 14px;
  resize: none;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 11px;
  font: inherit;
}

.chat-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.chat-send {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  border-radius: 11px;
}

.chat-send svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-send:disabled,
.chat-form textarea:disabled {
  cursor: wait;
  opacity: 0.65;
}

.chat-note {
  margin: 0;
  padding: 2px 18px 12px;
  text-align: center;
  font-size: 0.7rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes chat-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 640px) {
  body.chat-popup-mobile-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .floating-ai-button {
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: 48px;
    padding: 0;
    justify-content: center;
  }

  .floating-ai-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .chat-popup {
    top: auto;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(92dvh, 760px);
    max-height: none;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
    transform-origin: bottom center;
  }

  .chat-popup.is-open {
    transform: translateY(0);
  }

  .chat-header,
  .chat-messages {
    padding: 16px;
  }

  .chat-form {
    padding: 12px 16px 6px;
  }

  .chat-message {
    max-width: 88%;
  }

  .chat-messages.is-empty-state {
    padding-bottom: 20px;
  }

  .chat-messages.is-empty-state .chat-suggestions {
    width: min(100%, 320px);
  }

  .chat-messages.is-empty-state .chat-welcome {
    width: min(100%, 320px);
  }

  .chat-note {
    padding: 4px 16px 12px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .chat-popup {
    top: 72px;
    width: 390px;
    height: auto;
    right: 20px;
    bottom: 20px;
  }
}

@media (min-width: 1200px) {
  .chat-popup {
    width: 425px;
    top: 88px;
    right: 28px;
    bottom: 28px;
  }
}

/* Final mobile launch overrides; kept last so legacy responsive rules cannot reduce contrast. */
@media (max-width: 640px) {
  .landing-hero {
    min-height: auto !important;
    display: grid !important;
    align-items: stretch !important;
    background: #f7f9fd !important;
  }

  .landing-hero > img {
    position: relative !important;
    inset: auto !important;
    order: 2;
    width: 100%;
    height: 220px !important;
    object-fit: cover;
    opacity: 0.72;
  }

  .landing-hero::after,
  body[data-theme="dark"] .landing-hero::after {
    display: none !important;
  }

  .hero-copy {
    position: relative !important;
    z-index: 2;
    order: 1;
    width: 100%;
    padding: 32px 20px 26px !important;
    color: #141925 !important;
    background: #f7f9fd !important;
  }

  .hero-copy .eyebrow,
  .hero-copy p,
  .hero-copy h1,
  .hero-copy .hero-motto {
    color: #141925 !important;
    opacity: 1 !important;
  }

  .hero-brand-lockup {
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
  }

  .hero-logo { width: 48px; height: 48px; }
  .hero-copy h1 { font-size: 2.35rem !important; }
  .hero-motto { max-width: 12ch; font-size: clamp(2rem, 10vw, 2.75rem) !important; line-height: 1.02; }
  .hero-actions { grid-template-columns: 1fr 1fr !important; }
  .hero-points { display: none !important; }
  .hero-trust { color: #5a6679 !important; }

  .auth-panel { display: flex !important; flex-direction: column; }
  .auth-card { order: 1; }
  .auth-copy { order: 2; min-height: 0 !important; padding: 18px 20px !important; }
  .auth-copy h1,
  .auth-copy > .muted,
  .auth-copy .auth-highlights,
  .auth-copy .eyebrow { display: none !important; }
  .auth-copy .auth-mark { width: 42px; height: 42px; }
}

/* Conversion-focused landing layout */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(203, 213, 225, 0.8);
  backdrop-filter: blur(16px);
}

.landing-section {
  padding-block: clamp(48px, 5vw, 72px);
}

.landing-section[id] {
  scroll-margin-top: 82px;
}

.product-preview-section .section-heading,
.feature-section .section-heading,
.how-section .section-heading {
  margin-bottom: 32px;
}

.feature-card {
  min-height: 176px;
  padding: 24px;
}

.feature-card strong {
  font-size: 1.04rem;
}

.step-card {
  padding: 24px;
}

.landing-cta {
  display: flex;
  width: min(1120px, calc(100% - 36px));
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin: 24px auto 64px;
  padding: clamp(30px, 5vw, 56px);
  color: #f8fbff;
  background:
    radial-gradient(circle at 85% 20%, rgba(97, 157, 255, 0.3), transparent 32%),
    linear-gradient(135deg, #111a2d, #1d3158);
  border: 1px solid #30466f;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.landing-cta > div:first-child {
  max-width: 670px;
}

.landing-cta .eyebrow {
  color: #9fc0ff;
}

.landing-cta h2 {
  margin: 8px 0 12px;
  color: white;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 1.08;
  text-wrap: balance;
}

.landing-cta p:not(.eyebrow) {
  margin: 0;
  color: #cbd8eb;
  line-height: 1.65;
}

.landing-cta-actions {
  display: grid;
  flex: 0 0 240px;
  gap: 10px;
}

.landing-cta-actions button {
  width: 100%;
}

.landing-cta .ghost {
  color: white;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.24);
}

@media (max-width: 760px) {
  .landing-cta {
    display: grid;
    gap: 26px;
    margin-bottom: 36px;
    border-radius: 18px;
  }

  .landing-cta-actions {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .landing-section {
    padding-block: 42px;
  }

  .product-preview-section .section-heading,
  .feature-section .section-heading,
  .how-section .section-heading {
    margin-bottom: 22px;
  }

  .feature-card,
  .step-card {
    min-height: 0;
    padding: 20px;
  }

  .landing-cta {
    width: calc(100% - 28px);
    margin-top: 12px;
    padding: 28px 22px;
  }

  .landing-cta-actions {
    flex-basis: auto;
  }
}
