@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #4f46e5;
  --accent-rgb: 79, 70, 229;
  --accent-soft: #eef2ff;
  --accent-light: #6366f1;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(15,23,42,0.06), 0 4px 14px rgba(15,23,42,0.04);
  --shadow-hover: 0 8px 24px rgba(15,23,42,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --tap-min: 44px;
  --sidebar: 210px;
  --sidebar-bg: #0f172a;
  --sidebar-border: rgba(255,255,255,0.08);
  --sidebar-text: #94a3b8;
  --sidebar-text-bright: #f1f5f9;

  --class: #4f46e5; --class-bg: #eef2ff;
  --assignment: #e11d48; --assignment-bg: #fff1f2;
  --club: #9333ea; --club-bg: #faf5ff;
  --social: #059669; --social-bg: #ecfdf5;
  --study: #0891b2; --study-bg: #ecfeff;
  --squad: #7c3aed; --squad-bg: #f5f3ff;
  --campus: #059669; --campus-bg: #ecfdf5;
  --subject: #6366f1; --subject-bg: #eef2ff;
  --today: #d97706;
  --urgent: #dc2626;
  --topbar-height: 56px;
  --squad-chat-fab-h: 48px;
  --squad-chat-gap: 0.75rem;
  --squad-chat-inset: 1.25rem;
  --squad-chat-left: var(--squad-chat-inset);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 14px rgba(0,0,0,0.2);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.35);
  --accent-soft: rgba(99, 102, 241, 0.15);
  --class-bg: rgba(79, 70, 229, 0.15);
  --assignment-bg: rgba(225, 29, 72, 0.12);
  --club-bg: rgba(147, 51, 234, 0.12);
  --social-bg: rgba(5, 150, 105, 0.12);
  --study-bg: rgba(8, 145, 178, 0.12);
  --squad-bg: rgba(124, 58, 237, 0.12);
  --campus-bg: rgba(5, 150, 105, 0.12);
  --subject-bg: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(var(--accent-rgb), 0.08) 0, transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(124, 58, 237, 0.06) 0, transparent 50%);
}

[data-theme="dark"] .card {
  background-image: linear-gradient(180deg, rgba(30,41,59,0.95) 0%, var(--surface) 100%);
}

[data-theme="dark"] .landing-hero {
  background: linear-gradient(135deg, #1e293b 0%, rgba(79,70,229,0.15) 45%, #1e1b4b 100%);
  border-color: rgba(var(--accent-rgb), 0.25);
}

[data-theme="dark"] .stat-card--highlight {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(217, 119, 6, 0.12) 100%);
}

[data-theme="dark"] .week-cal-col--today .week-cal-col__header {
  background: rgba(217, 119, 6, 0.12);
}

html { scroll-behavior: smooth; }

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(var(--accent-rgb), 0.12) 0, transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(124, 58, 237, 0.08) 0, transparent 50%),
    linear-gradient(to right, rgba(var(--accent-rgb), 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--accent-rgb), 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 1000;
  padding: 0.6rem 1rem; background: var(--accent); color: #fff;
  font-weight: 600; text-decoration: none; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.status-region {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  background-image: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, var(--surface) 100%);
}

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

.card--lift:hover { transform: translateY(-2px); }

/* Header + sidebar nav */
.header {
  background: var(--sidebar-bg);
  background-image:
    radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.18) 0, transparent 55%),
    radial-gradient(at 0% 100%, rgba(124, 58, 237, 0.14) 0, transparent 50%);
  border-bottom: 1px solid var(--sidebar-border);
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.header-tool-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 36px;
  min-height: 36px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-bright);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.header-tool-btn:hover { background: rgba(255,255,255,0.12); }

.header-tool-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--urgent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-tool-btn--signin { padding: 0.35rem 0.65rem; }

.account-menu { position: relative; }

.account-menu__trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem 0.3rem 0.35rem;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-bright);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  max-width: 140px;
}

.account-menu__avatar { font-size: 1rem; line-height: 1; }

.account-menu__avatar--icon { display: none; }
.account-menu__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu__chevron { font-size: 0.65rem; opacity: 0.7; flex-shrink: 0; transform: rotate(180deg); }

.account-menu__panel {
  position: absolute;
  bottom: calc(100% + 6px);
  top: auto;
  right: 0;
  z-index: 200;
  min-width: 200px;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.12);
}

.account-menu--topbar .account-menu__panel {
  top: calc(100% + 6px);
  bottom: auto;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
}

.account-menu--topbar .account-menu__chevron { transform: none; }

.account-menu__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.65rem 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.account-menu__info strong { color: var(--text); font-size: 0.85rem; }

.account-menu__link {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.account-menu__link:hover { background: var(--accent-soft); }
.account-menu__logout { color: var(--urgent); }

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

.brand__mark {
  position: relative; width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent-light) 0%, var(--accent) 55%, #4338ca 100%);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45), inset 0 1px 0 rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}

.brand__mark-icon { font-size: 1.35rem; line-height: 1; }

.brand__mark-abbr {
  position: absolute; bottom: -4px; right: -4px;
  font-size: 0.55rem; font-weight: 800; letter-spacing: 0.04em;
  background: #fff; color: var(--accent); padding: 0.1rem 0.3rem;
  border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.brand__name {
  display: block; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--sidebar-text-bright); line-height: 1.2;
}

.brand__tagline {
  display: block; font-size: 0.72rem; color: var(--sidebar-text);
  margin-top: 0.15rem; line-height: 1.3;
}

/* Compact app sidebar */
.header .brand { gap: 0.6rem; }
.header .brand__mark { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 3px 12px rgba(79, 70, 229, 0.38), inset 0 1px 0 rgba(255,255,255,0.2); }
.header .brand__mark-icon { font-size: 1.1rem; }
.header .brand__mark-abbr { font-size: 0.52rem; bottom: -3px; right: -3px; padding: 0.08rem 0.28rem; }
.header .brand__name { font-size: 0.96rem; letter-spacing: -0.02em; }
.header .brand__tagline { display: block; font-size: 0.62rem; margin-top: 0.1rem; line-height: 1.25; opacity: 0.85; }

.header .site-nav { gap: 0.28rem; }
.header .site-nav__link {
  min-height: 38px; padding: 0.42rem 0.7rem;
  font-size: 0.84rem; gap: 0.55rem;
}
.header .site-nav__icon {
  width: 26px; height: 26px; font-size: 0.9rem; border-radius: 7px;
}
.header .site-nav__link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent-light); }

.header__user {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 600; color: var(--sidebar-text);
  padding: 0.5rem 0.65rem; border-radius: var(--radius-sm);
  background: var(--sidebar-border);
}

.header__avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
}

.header__footer { margin-top: auto; display: flex; flex-direction: column; gap: 0.75rem; }

.header__utilities {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.header__footer--login {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--sidebar-border);
}

.header__footer--login .header__utilities {
  border-bottom: none;
  padding-bottom: 0;
}

.site-nav {
  display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none;
  flex-direction: column;
}

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

.site-nav__link {
  display: flex; align-items: center; gap: 0.65rem;
  min-height: 44px; padding: 0.55rem 0.85rem;
  font-size: 0.875rem; font-weight: 600;
  color: var(--sidebar-text); text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.site-nav__icon {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; border-radius: 8px;
  background: rgba(255,255,255,0.06);
}

.site-nav__link:hover {
  color: var(--sidebar-text-bright);
  background: rgba(255,255,255,0.06);
  border-color: var(--sidebar-border);
}

.site-nav__link[aria-current="page"] {
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(79, 70, 229, 0.2) 100%);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: inset 3px 0 0 var(--accent-light);
}

.site-nav__link[aria-current="page"] .site-nav__icon {
  background: rgba(255,255,255,0.12);
}

.main { max-width: 860px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

/* Public landing (index.html) — full-width site, not app panel */
body.page-home {
  display: block;
}

body.page-home .main--landing {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.landing-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 3rem;
}

/* Public landing header (root index only) */
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand--landing .brand__name { color: var(--sidebar-text-bright); }
.brand--landing .brand__tagline { color: var(--sidebar-text); }

.landing-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-tool-btn--landing {
  border-color: var(--sidebar-border);
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-bright);
}

.landing-section__intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1.25rem;
}

.dashboard-quick { padding: 1.25rem 1.35rem; margin-top: 1.5rem; }
.dashboard-quick__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

@media (min-width: 769px) {
  body:not(.page-home):not(.page-login) { display: flex; flex-wrap: wrap; --squad-chat-left: calc(var(--sidebar) + var(--squad-chat-inset)); }
  body:not(.page-home):not(.page-login) .header {
    position: fixed; top: 0; left: 0; width: var(--sidebar); height: 100vh;
    border-right: 1px solid var(--sidebar-border); border-bottom: none;
    padding: 1.1rem 0.8rem;
    z-index: 120;
    overflow: hidden;
    gap: 0.65rem;
  }
  body:not(.page-home):not(.page-login) .site-nav {
    flex: 1; min-height: 0; margin-top: 0.25rem;
    overflow-y: auto; overflow-x: hidden;
    padding-right: 0.2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.22) transparent;
  }
  body:not(.page-home):not(.page-login) .site-nav::-webkit-scrollbar { width: 4px; display: block; }
  body:not(.page-home):not(.page-login) .site-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 99px; }
  body:not(.page-home):not(.page-login) .topbar {
    position: fixed; top: 0; left: var(--sidebar); right: 0;
    height: var(--topbar-height, 56px); z-index: 130;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  body:not(.page-home):not(.page-login) .main {
    flex: 1; width: calc(100% - var(--sidebar));
    margin-left: var(--sidebar); max-width: none;
    padding: calc(var(--topbar-height, 56px) + 2rem) 3rem 4rem;
  }
}

@media (max-width: 768px) {
  body:not(.page-home):not(.page-login) {
    --topbar-height: 56px;
  }

  body.nav-open { overflow: hidden; }

  /* App pages: slide-in sidebar drawer */
  body:not(.page-home):not(.page-login) .header {
    position: fixed;
    top: 0;
    left: 0;
    width: min(280px, 86vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    z-index: 140;
    border-bottom: none;
    border-right: 1px solid var(--sidebar-border);
    overflow: hidden;
    flex-direction: column;
    padding: 1rem 0.85rem;
    gap: 0.75rem;
  }

  body.nav-open:not(.page-home):not(.page-login) .header {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.28);
  }

  body:not(.page-home):not(.page-login) .site-nav {
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 0.5rem;
    gap: 0.25rem;
  }

  body:not(.page-home):not(.page-login) .site-nav__link {
    flex-direction: row;
    gap: 0.65rem;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    font-size: 0.84rem;
  }

  body:not(.page-home):not(.page-login) .site-nav__link[aria-current="page"] {
    box-shadow: inset 3px 0 0 var(--accent-light);
  }

  body:not(.page-home):not(.page-login) .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height, 56px);
    z-index: 130;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  body:not(.page-home):not(.page-login) .main {
    width: 100%;
    margin-left: 0;
    max-width: none;
    padding: calc(var(--topbar-height, 56px) + 1rem) 1rem 3rem;
  }

  .header { gap: 1rem; }
  .brand__tagline { display: none; }
  body.page-login .header--login .brand__tagline { display: block; }
  body.page-login .main--login { min-height: calc(100vh - 56px); padding: 1.5rem 1rem 2rem; }

  /* Topbar utilities — compact on mobile */
  .topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.75rem;
    height: 100%;
  }

  .topbar__week { display: none; }

  .topbar__actions {
    flex: 1;
    min-width: 0;
    gap: 0.35rem;
    margin-left: 0;
    justify-content: flex-end;
  }

  .topbar__utilities { gap: 0.3rem; flex-shrink: 0; }

  .topbar-gamify {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding: 0.35rem 0.55rem;
    gap: 0.4rem;
  }

  .topbar-gamify__title { display: none; }

  .topbar-gamify__xp {
    display: inline;
    font-size: 0.6rem;
    font-weight: 600;
    flex-shrink: 0;
  }

  .topbar-gamify__bar {
    flex: 1;
    width: auto;
    min-width: 56px;
    max-width: none;
    height: 5px;
  }

  .topbar-tool-btn,
  .account-menu__trigger--topbar {
    min-width: 40px;
    min-height: 40px;
    padding: 0.35rem;
  }

  .topbar-tool-btn--signin { padding: 0.35rem 0.5rem; }
  .topbar-tool-btn--signin > span:last-child { display: none; }

  .account-menu__trigger--topbar {
    max-width: none;
    padding: 0.3rem 0.45rem;
    gap: 0;
  }

  .account-menu__name { display: none; }
  .account-menu__chevron { display: none; }

  .account-menu--topbar .account-menu__avatar--profile { display: none; }
  .account-menu--topbar .account-menu__avatar--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
  }

  .account-menu--topbar .account-menu__trigger {
    justify-content: center;
    min-width: 40px;
    width: 40px;
    padding: 0;
  }

  .account-menu--topbar .account-menu__panel {
    position: fixed;
    top: calc(var(--topbar-height, 56px) + 6px);
    right: 0.75rem;
    left: auto;
    bottom: auto;
    min-width: min(240px, calc(100vw - 1.5rem));
    max-width: calc(100vw - 1.5rem);
    z-index: 150;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
  }

  .login-header__tools .account-menu__name,
  .login-header__tools .account-menu__chevron { display: inline; }
  .login-header__tools .account-menu__trigger--topbar { gap: 0.35rem; padding: 0.3rem 0.55rem; }

  .scroll-top {
    bottom: 1rem;
    right: 1rem;
  }

  .landing-header {
    padding: 0.75rem 1rem;
    gap: 0.65rem;
  }

  .landing-header__actions {
    gap: 0.4rem;
  }

  .landing-header__actions .btn--sm {
    padding: 0.45rem 0.7rem;
    font-size: 0.82rem;
  }

  .landing-wrap {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Page header */
.page-header { margin-bottom: 1.5rem; }

.page-header__row {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem;
}

.page-header__title {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.page-header--squad .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, var(--squad));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.page-header--campus .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, var(--campus));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.page-header--classes .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, var(--class));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.page-header--life .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, #d97706);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.page-header--clubs .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, var(--club));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.page-header--library .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, var(--study));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.page-header--notif .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, #ef4444);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.page-header__stats { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

.page-progress { display: flex; align-items: center; gap: 0.75rem; }

.progress { flex: 1; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }

.progress__bar {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 99px; transition: width 0.35s ease;
}

.progress__label { font-size: 0.8rem; font-weight: 700; color: var(--accent); min-width: 36px; text-align: right; }

/* Landing (Home) */
.landing-hero {
  position: relative; overflow: hidden;
  padding: 0; margin-bottom: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 45%, #faf5ff 100%);
}

.landing-hero--full {
  border-left: none;
  border-right: none;
  border-top: none;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
}

.landing-hero--full .landing-hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 4vw, 3rem);
}

.landing-hero__glow {
  position: absolute; top: -40%; right: -15%; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.2) 0, transparent 65%);
  pointer-events: none;
}

.landing-hero__inner {
  position: relative; display: grid; grid-template-columns: 1fr; gap: 2rem;
  align-items: center;
}

@media (min-width: 640px) {
  .landing-hero__inner { grid-template-columns: auto 1fr; gap: 2.5rem; }
  .landing-hero--full .landing-hero__inner { grid-template-columns: auto 1fr; }
}

.landing-logo {
  position: relative; width: 140px; height: 140px; margin: 0 auto;
}

.landing-logo__ring {
  position: absolute; border-radius: 50%;
  border: 2px solid rgba(var(--accent-rgb), 0.15);
}

.landing-logo__ring--outer { inset: 0; animation: pulse-ring 4s ease-in-out infinite; }
.landing-logo__ring--inner { inset: 14px; border-color: rgba(124, 58, 237, 0.2); }

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-logo__ring--outer { animation: none; }
}

.landing-logo__mark {
  position: absolute; inset: 28px;
  border-radius: 22px;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35), inset 0 1px 0 rgba(255,255,255,0.1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
}

.landing-logo__icon { font-size: 2rem; line-height: 1; }
.landing-logo__abbr {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.12em;
  color: var(--accent-light); text-transform: uppercase;
}

.landing-eyebrow {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin-bottom: 0.5rem;
}

.landing-title {
  font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05;
  background: linear-gradient(135deg, var(--text) 20%, var(--accent) 70%, var(--squad));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.landing-lead { font-size: 1rem; color: var(--text-muted); max-width: 52ch; margin-bottom: 0.75rem; }

.landing-week {
  font-size: 0.82rem; font-weight: 600; color: var(--accent);
  margin-bottom: 1.25rem;
}

.landing-cta { display: flex; flex-wrap: wrap; gap: 0.65rem; }

.btn--hero {
  padding: 0.7rem 1.5rem; font-size: 0.95rem;
  background: linear-gradient(135deg, var(--accent) 0%, #4338ca 100%);
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.35);
}

.landing-section { margin-bottom: 2rem; padding-top: 2.5rem; }

.landing-section__title {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.landing-section__title--inset { margin-bottom: 0.85rem; }

.feature-grid {
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}

@media (min-width: 640px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
}

.feature-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1.35rem; text-decoration: none; color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden; position: relative;
}

.feature-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent); opacity: 0.6;
}

.feature-card--week::before { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.feature-card--study::before { background: linear-gradient(90deg, var(--study), #22d3ee); }
.feature-card--squad::before { background: linear-gradient(90deg, var(--squad), #a78bfa); }
.feature-card--campus::before { background: linear-gradient(90deg, var(--campus), #34d399); }
.feature-card--classes::before { background: linear-gradient(90deg, var(--class), var(--accent-light)); }

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

.feature-card__icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; border-radius: 12px; margin-bottom: 0.25rem;
}

.feature-card--week .feature-card__icon { background: var(--accent-soft); }
.feature-card--study .feature-card__icon { background: var(--study-bg); }
.feature-card--squad .feature-card__icon { background: var(--squad-bg); }
.feature-card--campus .feature-card__icon { background: var(--campus-bg); }
.feature-card--classes .feature-card__icon { background: var(--class-bg); }

.feature-card__title { font-size: 1.05rem; font-weight: 800; }
.feature-card__desc { font-size: 0.85rem; color: var(--text-muted); flex: 1; line-height: 1.5; }

.feature-card__link {
  font-size: 0.8rem; font-weight: 700; color: var(--accent); margin-top: 0.35rem;
}

.feature-card--study .feature-card__link { color: var(--study); }
.feature-card--squad .feature-card__link { color: var(--squad); }
.feature-card--campus .feature-card__link { color: var(--campus); }
.feature-card--classes .feature-card__link { color: var(--class); }
.feature-card--life::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.feature-card--life .feature-card__icon { background: #fffbeb; }
.feature-card--life .feature-card__link { color: #d97706; }

.feature-card--clubs::before { background: linear-gradient(90deg, var(--club), #c084fc); }
.feature-card--clubs .feature-card__icon { background: var(--club-bg); }
.feature-card--clubs .feature-card__link { color: var(--club); }

.feature-card--library::before { background: linear-gradient(90deg, var(--study), #22d3ee); }
.feature-card--library .feature-card__icon { background: var(--study-bg); }
.feature-card--library .feature-card__link { color: var(--study); }

.landing-steps {
  padding: 2rem 0 0;
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .steps-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 2rem;
  }
}

.landing-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 0;
  margin-top: 1rem;
}

.landing-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.landing-footer__inner a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.landing-footer__inner a:hover { text-decoration: underline; }

.steps-list { list-style: none; display: flex; flex-direction: column; gap: 1.15rem; }

.steps-list__item {
  display: flex; gap: 1rem; align-items: flex-start;
}

.steps-list__num {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 10px; box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.steps-list__item strong { display: block; font-size: 0.95rem; margin-bottom: 0.15rem; }
.steps-list__item p { font-size: 0.85rem; color: var(--text-muted); }

.landing-profile { padding: 1.5rem 1.75rem; }

.landing-profile__header {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem;
}

.landing-profile__sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

.profile-chip {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.65rem 0.45rem 0.45rem;
  background: var(--accent-soft); border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
}

.profile-chip__avatar { font-size: 1.25rem; }
.profile-chip__name { font-size: 0.875rem; font-weight: 700; }

.profile-chip__edit {
  font: inherit; font-size: 0.72rem; font-weight: 700; color: var(--accent);
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 0.25rem 0.5rem; cursor: pointer; margin-left: 0.25rem;
}

.profile-chip__edit:hover { background: var(--accent-soft); }

.setup-form__row {
  display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .setup-form__row { grid-template-columns: repeat(3, 1fr); }
  .setup-form__row--actions { grid-template-columns: 1fr auto; align-items: end; }
}

.setup-form { display: flex; flex-direction: column; }
.setup-form__label { display: flex; flex-direction: column; gap: 0.35rem; }
.setup-form__title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}
.setup-form input {
  font: inherit; padding: 0.65rem 0.85rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg);
}
.setup-form input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.12); }

.avatar-selector { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.avatar-chip {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
}
.avatar-chip.is-selected { border-color: var(--accent); background: var(--accent-soft); }

/* Forms */
.add-section { padding: 1.35rem; margin-bottom: 1.25rem; }

.add-section__title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }

.add-form__row { display: flex; gap: 0.85rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 0.85rem; }
.add-form__row:last-child { margin-bottom: 0; }

.add-form__field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 130px; }
.add-form__field--grow { flex: 1; min-width: 160px; }

.add-form__label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}

.add-form input, .add-form select {
  font: inherit; font-size: 0.9rem; padding: 0.55rem 0.75rem; min-height: 42px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); width: 100%;
}
.add-form input:focus, .add-form select:focus {
  border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.12);
}

.category-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.category-chip-btn {
  padding: 0.4rem 0.75rem; font: inherit; font-size: 0.78rem; font-weight: 600;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.category-chip-btn.is-active[data-value="class"] { background: var(--class-bg); color: var(--class); border-color: var(--class); }
.category-chip-btn.is-active[data-value="assignment"] { background: var(--assignment-bg); color: var(--assignment); border-color: var(--assignment); }
.category-chip-btn.is-active[data-value="club"] { background: var(--club-bg); color: var(--club); border-color: var(--club); }
.category-chip-btn.is-active[data-value="social"] { background: var(--social-bg); color: var(--social); border-color: var(--social); }

.segmented { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.segmented__btn {
  flex: 1; padding: 0.5rem; font: inherit; font-size: 0.8rem; font-weight: 600;
  border: none; border-right: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer;
}
.segmented__btn:last-child { border-right: none; }
.segmented__btn.is-selected { background: var(--study-bg); color: var(--study); font-weight: 700; }

.btn {
  font: inherit; font-size: 0.875rem; font-weight: 700; min-height: 42px;
  padding: 0.55rem 1.2rem; border: none; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--accent-light); transform: translateY(-1px); }

.btn--squad { background: var(--squad); box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25); }
.btn--squad:hover { background: #6d28d9; }

.btn--campus { background: var(--campus); box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25); }
.btn--campus:hover { background: #047857; }
.btn--class { background: var(--class); box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25); }
.btn--class:hover { background: #4338ca; }

.btn--life { background: #d97706; box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25); }
.btn--life:hover { background: #b45309; }

.btn--club { background: var(--club); box-shadow: 0 2px 8px rgba(147, 51, 234, 0.25); }
.btn--club:hover { background: #7e22ce; }

.btn--library { background: var(--study); box-shadow: 0 2px 8px rgba(8, 145, 178, 0.25); }
.btn--library:hover { background: #0e7490; }

.btn--sm { min-height: 34px; padding: 0.35rem 0.75rem; font-size: 0.78rem; box-shadow: none; }

.btn--ghost {
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--accent-soft); border-color: var(--accent); }

/* Filters */
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.filter-btn {
  font: inherit; font-size: 0.8rem; font-weight: 600; padding: 0.4rem 0.85rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }

.view-toggle { margin-top: -0.5rem; margin-bottom: 1.25rem; }

/* Day groups */
.week-list { display: flex; flex-direction: column; gap: 1rem; }

.day-group { overflow: hidden; }
.day-group--today { border-left: 4px solid var(--today); }
.day-group--past .day-group__header { opacity: 0.6; }

.day-group__header {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); padding: 0.7rem 1.1rem; background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.day-group--today .day-group__header { color: var(--today); }

.day-group__badge {
  font-size: 0.65rem; padding: 0.12rem 0.45rem; border-radius: 4px;
  background: #fef3c7; color: var(--today); font-weight: 800;
}

.day-group__count {
  margin-left: auto; font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
  text-transform: none; letter-spacing: 0;
}

.day-group__items { list-style: none; }
.day-group__empty { padding: 1rem 1.1rem; font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

/* Items */
.item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border);
}
.item:last-child { border-bottom: none; }
.item:hover { background: #fafbfc; }
.item--done { opacity: 0.55; }
.item--done .item__title { text-decoration: line-through; color: var(--text-muted); }
.item.is-selected { background: var(--accent-soft); }

.item__checkbox { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.item__body { flex: 1; min-width: 0; }
.item__title { font-size: 0.95rem; font-weight: 600; }
.item__meta { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.2rem; }
.item__note { font-size: 0.8rem; color: var(--text-muted); }

.item__delete {
  background: none; border: none; color: #cbd5e1; font-size: 1.3rem; cursor: pointer;
  min-width: 36px; min-height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.item__delete:hover { color: var(--assignment); background: var(--assignment-bg); }

.item__actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }

.badge {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 0.12rem 0.45rem; border-radius: 4px;
}
.badge--class { background: var(--class-bg); color: var(--class); }
.badge--assignment { background: var(--assignment-bg); color: var(--assignment); }
.badge--club { background: var(--club-bg); color: var(--club); }
.badge--social { background: var(--social-bg); color: var(--social); }
.badge--study { background: var(--study-bg); color: var(--study); }
.badge--subject { background: var(--subject-bg); color: var(--subject); }
.badge--urgent { background: #fef2f2; color: var(--urgent); }
.badge--soon { background: #fff7ed; color: var(--today); }

.assignee-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
}
.assignee-chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Study layout */
.study-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .study-layout { grid-template-columns: 1fr 340px; align-items: start; } }

.study-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.pomodoro-panel {
  padding: 1.35rem;
  background: linear-gradient(160deg, #fff 0%, var(--study-bg) 100%);
  border-color: rgba(8, 145, 178, 0.15);
}
.pomodoro-panel__title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 1rem;
}
.pomodoro-time { font-size: 2.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pomodoro-label { font-size: 0.72rem; font-weight: 700; color: var(--study); text-transform: uppercase; margin-top: 0.15rem; }
.pomodoro-active-task { font-size: 0.82rem; color: var(--text-muted); margin: 1rem 0; }
.pomodoro-controls { display: flex; gap: 0.5rem; }
.pomodoro-btn {
  flex: 1; font: inherit; font-size: 0.8rem; font-weight: 600;
  padding: 0.5rem; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border);
}
.pomodoro-btn--start { background: var(--study); color: #fff; border-color: var(--study); }
.pomodoro-btn--pause { background: var(--today); color: #fff; border-color: var(--today); }

.form-toggle {
  display: none; width: 100%; min-height: var(--tap-min); margin-bottom: 1rem;
  font: inherit; font-weight: 600; padding: 0.65rem; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--accent); cursor: pointer;
}

@media (max-width: 640px) {
  .form-toggle { display: block; }
  .add-section.is-collapsible { display: none; }
  .add-section.is-collapsible.is-open { display: block; }
}

.empty-state { padding: 1.5rem; text-align: center; font-size: 0.9rem; color: var(--text-muted); font-style: italic; }

.helper-tag {
  display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0.2rem 0.5rem; border-radius: 4px;
  background: var(--study-bg); color: var(--study); margin-left: 0.5rem; vertical-align: middle;
}

.helper-tag--squad { background: var(--squad-bg); color: var(--squad); }

/* Squad Hub */
.squad-layout {
  display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}

@media (min-width: 900px) {
  .squad-layout { grid-template-columns: 1fr 1fr; align-items: start; }
}

.squad-panel { overflow: hidden; padding: 0; }

.squad-panel__header {
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid var(--border);
}

.squad-panel--resources .squad-panel__header {
  background: linear-gradient(135deg, var(--subject-bg) 0%, #fff 70%);
}

.squad-panel--tasks .squad-panel__header {
  background: linear-gradient(135deg, var(--squad-bg) 0%, #fff 70%);
}

.squad-panel__title { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.2rem; }
.squad-panel__desc { font-size: 0.82rem; color: var(--text-muted); }

.squad-panel__body { padding: 1.15rem 1.25rem 1.25rem; }

.squad-panel__body .add-section {
  padding: 0; margin-bottom: 1rem; border: none; box-shadow: none; background: transparent;
}

.search-field { display: block; margin-bottom: 0.85rem; }

.search-field input {
  width: 100%; font: inherit; font-size: 0.875rem; padding: 0.55rem 0.85rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
}

.search-field input:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.resource-list { list-style: none; }

.resource-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 0.85rem 0; border-bottom: 1px solid var(--border);
}

.resource-item:last-child { border-bottom: none; }
.resource-item--done { opacity: 0.55; }

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

.resource-item__link {
  font-size: 0.95rem; font-weight: 700; color: var(--accent);
  text-decoration: none; word-break: break-word;
}

.resource-item__link:hover { text-decoration: underline; }
.resource-item__link--done { text-decoration: line-through; color: var(--text-muted); }

.resource-item__url {
  font-size: 0.72rem; color: var(--text-muted); word-break: break-all;
}

.squad-columns {
  display: grid; grid-template-columns: 1fr; gap: 0.85rem;
}

@media (min-width: 520px) {
  .squad-columns { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

.squad-column { overflow: hidden; padding: 0; }

.squad-column__header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 0.85rem; background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.squad-column__avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--squad-bg); color: var(--squad);
  font-size: 0.75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.squad-column__name { font-size: 0.85rem; font-weight: 700; flex: 1; min-width: 0; }

.squad-column__count {
  font-size: 0.68rem; font-weight: 600; color: var(--text-muted);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* Campus Guide */
.campus-layout {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-bottom: 1.5rem;
}

@media (min-width: 900px) {
  .campus-layout { grid-template-columns: 1.4fr 1fr; align-items: start; }
}

.campus-map-panel { overflow: hidden; padding: 0; }

.campus-map-panel__header {
  padding: 1.15rem 1.25rem;
  background: linear-gradient(135deg, var(--campus-bg) 0%, #fff 70%);
  border-bottom: 1px solid var(--border);
}

.campus-map-panel__title { font-size: 1.05rem; font-weight: 800; }
.campus-map-panel__desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }

.campus-map {
  position: relative; aspect-ratio: 4 / 3; min-height: 280px;
  background:
    radial-gradient(circle at 30% 70%, rgba(5, 150, 105, 0.12) 0, transparent 45%),
    radial-gradient(circle at 70% 30%, rgba(79, 70, 229, 0.08) 0, transparent 40%),
    linear-gradient(180deg, #ecfdf5 0%, #f0fdf4 40%, #f8fafc 100%);
  overflow: hidden;
}

.campus-map__ground { position: absolute; inset: 0; pointer-events: none; }

.campus-map__path {
  position: absolute; background: rgba(15, 23, 42, 0.06); border-radius: 99px;
}

.campus-map__path--h { left: 10%; right: 10%; top: 50%; height: 8px; transform: translateY(-50%); }
.campus-map__path--v { top: 12%; bottom: 12%; left: 50%; width: 8px; transform: translateX(-50%); }

.campus-map__label {
  position: absolute; font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); opacity: 0.7;
}

.campus-map__label--north { top: 0.65rem; left: 50%; transform: translateX(-50%); }

.campus-map__pins { position: absolute; inset: 0; }

.map-pin {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  background: none; border: none; cursor: pointer; padding: 0.25rem;
  transition: transform 0.15s;
}

.map-pin:hover { transform: translate(-50%, -50%) scale(1.08); }

.map-pin__icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: #fff; border: 2px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.map-pin__label {
  font-size: 0.62rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted);
  background: rgba(255,255,255,0.9); padding: 0.1rem 0.35rem; border-radius: 4px;
}

.map-pin--active .map-pin__icon {
  border-color: var(--campus); background: var(--campus-bg);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.25), var(--shadow-hover);
}

.map-pin--has-class .map-pin__icon { border-color: rgba(5, 150, 105, 0.45); }

.campus-detail { padding: 1.35rem; min-height: 200px; }

.campus-detail__placeholder { font-size: 0.9rem; color: var(--text-muted); font-style: italic; }

.campus-detail__hero { display: flex; gap: 0.85rem; margin-bottom: 1rem; }

.campus-detail__icon {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px;
  background: var(--campus-bg); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.campus-detail__name { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.25rem; }
.campus-detail__desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

.campus-detail__tip {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  background: var(--campus-bg); border: 1px solid rgba(5, 150, 105, 0.15);
  margin-bottom: 1rem;
}

.campus-detail__tip-label {
  display: block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--campus); margin-bottom: 0.35rem;
}

.campus-detail__tip p { font-size: 0.85rem; color: var(--text); line-height: 1.5; }

.campus-detail__rooms { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.85rem; }

.campus-detail__subtitle {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.45rem;
}

.campus-detail__list {
  list-style: none; font-size: 0.85rem; color: var(--text-muted);
  display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem;
}

.campus-detail__list li::before { content: "· "; color: var(--campus); font-weight: 800; }

.campus-detail__class-list {
  list-style: none; display: flex; flex-direction: column; gap: 0.5rem;
}

.campus-detail__class-list li {
  font-size: 0.85rem; padding: 0.5rem 0.65rem; background: var(--bg); border-radius: var(--radius-sm);
}

.campus-detail__class-list strong { display: block; font-size: 0.9rem; }
.campus-detail__class-list span { color: var(--text-muted); font-size: 0.78rem; }

.campus-today { padding: 1.25rem 1.35rem; margin-bottom: 1.5rem; }

.campus-today--first { margin-bottom: 1.25rem; }

.campus-today__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.85rem;
}

.campus-today__header .campus-section__title { margin-bottom: 0; }

.campus-today__link {
  font-size: 0.78rem; font-weight: 700; color: var(--campus); text-decoration: none;
}

.campus-today__link:hover { text-decoration: underline; }

.campus-info-bar { padding: 1.15rem 1.35rem; margin-bottom: 1.25rem; }

.campus-info-bar__header { margin-bottom: 0.85rem; }

.campus-info-chips {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}

.campus-info-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.45rem 0.75rem; font: inherit; font-size: 0.78rem; font-weight: 700;
  border: 1px solid var(--border); border-radius: 99px;
  background: var(--bg); color: var(--text); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.campus-info-chip:hover { background: var(--campus-bg); border-color: rgba(5, 150, 105, 0.35); transform: translateY(-1px); }

.campus-info-chip--active {
  background: var(--campus-bg); border-color: var(--campus); color: var(--campus);
}

.campus-info-chip__icon { font-size: 0.95rem; line-height: 1; }

.campus-map__info-pins { position: absolute; inset: 0; pointer-events: none; }
.campus-map__info-pins > * { pointer-events: auto; }

.map-info-pin {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  background: none; border: none; cursor: pointer; padding: 0.15rem;
  transition: transform 0.15s;
}

.map-info-pin:hover { transform: translate(-50%, -50%) scale(1.1); }

.map-info-pin__dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.map-info-pin__label {
  font-size: 0.75rem; line-height: 1;
  background: rgba(255,255,255,0.95); padding: 0.1rem 0.25rem; border-radius: 4px;
  box-shadow: var(--shadow);
}

.map-info-pin--active .map-info-pin__dot {
  background: var(--accent); border-color: var(--accent-light);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.25);
}

.campus-detail__links { margin-bottom: 1rem; }

.campus-detail__link-list {
  list-style: none; display: flex; flex-direction: column; gap: 0.35rem;
}

.campus-detail__link,
.campus-detail__inline-link {
  font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--campus);
  text-decoration: none; background: none; border: none; cursor: pointer; padding: 0;
}

.campus-detail__link:hover,
.campus-detail__inline-link:hover { text-decoration: underline; }

.campus-detail__map-btn { margin-top: 0.5rem; }

.campus-section__title {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.85rem;
}

.campus-section__sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

.campus-schedule__header { margin-bottom: 1rem; }

.campus-class-list { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }

.campus-class-card {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.85rem 1rem; background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.campus-class-card__time {
  font-size: 0.78rem; font-weight: 700; color: var(--campus);
  min-width: 110px; font-variant-numeric: tabular-nums;
}

.campus-class-card__body { flex: 1; min-width: 160px; }
.campus-class-card__title { font-size: 0.95rem; font-weight: 700; }

/* Gamification widget (sidebar) */
.gamify-widget {
  display: block; padding: 0.65rem 0.75rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06); border: 1px solid var(--sidebar-border);
  text-decoration: none; color: inherit; margin-bottom: 0.5rem;
  transition: background 0.15s;
}

.gamify-widget:hover { background: rgba(255,255,255,0.1); }

.gamify-widget__top { display: flex; align-items: baseline; gap: 0.4rem; margin-bottom: 0.35rem; }
.gamify-widget__level { font-size: 0.72rem; font-weight: 800; color: var(--accent-light); }
.gamify-widget__title { font-size: 0.78rem; font-weight: 700; color: var(--sidebar-text-bright); }

.gamify-widget__bar {
  height: 4px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; margin-bottom: 0.35rem;
}

.gamify-widget__fill { height: 100%; background: linear-gradient(90deg, var(--accent-light), #a78bfa); border-radius: 99px; }
.gamify-widget__meta { font-size: 0.62rem; color: var(--sidebar-text); line-height: 1.3; }

/* Rewards panel (home) */
.rewards-hero { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
@media (min-width: 640px) { .rewards-hero { grid-template-columns: 1.2fr 1fr; align-items: center; } }

.rewards-level { padding: 1.15rem; text-align: center; background: linear-gradient(145deg, #1e293b, #0f172a); color: #f1f5f9; border: none; }
.rewards-level__num { font-size: 2rem; font-weight: 800; display: block; line-height: 1; color: var(--accent-light); }
.rewards-level__title { font-size: 0.85rem; font-weight: 700; color: #94a3b8; }
.rewards-level__meta { font-size: 0.78rem; color: #64748b; margin-top: 0.35rem; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.65rem; }

.badge-card {
  padding: 0.85rem; border-radius: var(--radius-sm); border: 1px dashed var(--border);
  background: var(--bg); text-align: center; opacity: 0.55;
}

.badge-card--earned { opacity: 1; border-style: solid; border-color: rgba(var(--accent-rgb), 0.25); background: var(--accent-soft); }
.badge-card__icon { font-size: 1.5rem; display: block; margin-bottom: 0.35rem; }
.badge-card__name { font-size: 0.78rem; font-weight: 800; display: block; }
.badge-card__desc { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.2rem; display: block; line-height: 1.3; }

/* Life Hub */
.life-panel { margin-bottom: 2rem; }
.life-panel__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.life-panel__toolbar { margin-bottom: 1rem; }

.life-split { display: grid; grid-template-columns: 1fr; gap: 1.25rem; min-width: 0; }
@media (min-width: 900px) { .life-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }

.life-chart-card { padding: 1.25rem; min-width: 0; overflow: hidden; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 0.85rem; margin-bottom: 1.25rem; }

.stat-card { padding: 1rem 1.1rem; min-width: 0; overflow: hidden; }
.stat-card--highlight { background: linear-gradient(135deg, #fff 0%, #fffbeb 100%); border-color: rgba(217, 119, 6, 0.2); }
.stat-card__label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); display: block; word-break: break-word; overflow-wrap: anywhere; }
.stat-card__value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; display: block; line-height: 1.1; margin: 0.25rem 0; }
.stat-card__sub { font-size: 0.75rem; color: var(--text-muted); }

.grade-chart { display: flex; align-items: flex-end; gap: 0.5rem; min-height: 160px; padding-top: 1rem; overflow-x: auto; }
.grade-chart__bar { flex: 1; min-width: 0; max-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.grade-chart__value { font-size: 0.68rem; font-weight: 700; color: var(--accent); }
.grade-chart__track {
  width: 100%; height: 120px; display: flex; align-items: flex-end;
  background: var(--bg); border-radius: 6px 6px 2px 2px; border: 1px solid var(--border);
  overflow: hidden;
}
.grade-chart__fill { width: 100%; background: linear-gradient(180deg, var(--accent-light), var(--accent)); border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.3s ease; }
.grade-chart__label { font-size: 0.62rem; font-weight: 600; color: var(--text-muted); text-align: center; width: 100%; word-break: break-word; }

.activity-feed { padding: 0; overflow: hidden; }

.activity-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }
.activity-item__icon { font-size: 1.1rem; flex-shrink: 0; width: 28px; text-align: center; }
.activity-item__body { flex: 1; font-size: 0.85rem; line-height: 1.4; min-width: 0; }
.activity-item__action { font-weight: 700; color: var(--text-muted); margin-right: 0.25rem; text-transform: capitalize; }
.activity-item__time { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

.club-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .club-grid { grid-template-columns: repeat(2, 1fr); } }

.club-card { padding: 1.25rem; }
.club-card--joined { border-color: rgba(5, 150, 105, 0.3); background: linear-gradient(135deg, #fff 0%, var(--campus-bg) 100%); }
.club-card--full { opacity: 0.65; }

.club-card__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; }
.club-card__name { font-size: 1rem; font-weight: 800; }
.club-card__desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.65rem; line-height: 1.45; }
.club-card__meta { margin-bottom: 0.75rem; }
.club-card__progress { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.5rem; }
.club-card__deadline { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.select-inline, .add-form select.select-inline {
  font: inherit; font-size: 0.875rem; padding: 0.55rem 0.85rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); width: 100%;
}

.resource-filters { display: grid; grid-template-columns: 1fr; gap: 0.65rem; margin-bottom: 0.85rem; }
@media (min-width: 480px) { .resource-filters { grid-template-columns: 1fr auto; align-items: center; } }
.resource-filters .search-field { margin-bottom: 0; }
.resource-item__type-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1; }

/* Week calendar view */
.week-calendar { padding: 1rem; margin-bottom: 1.5rem; overflow-x: auto; }

.week-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 0.65rem;
  min-width: 840px;
}

.week-cal-col {
  display: flex; flex-direction: column; min-height: 200px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); overflow: hidden;
}

.week-cal-col--today {
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.15);
}

.week-cal-col__header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  padding: 0.55rem 0.65rem; background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.week-cal-col--today .week-cal-col__header { background: #fffbeb; }

.week-cal-col__day { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.week-cal-col__date { font-size: 1.1rem; font-weight: 800; color: var(--text); line-height: 1; }

.week-cal-col__body { flex: 1; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.week-cal-col__section { display: flex; flex-direction: column; gap: 0.35rem; }
.week-cal-col__label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.week-cal-col__empty { font-size: 0.75rem; color: var(--text-muted); font-style: italic; padding: 0.5rem 0.25rem; }

.cal-event {
  padding: 0.4rem 0.5rem; border-radius: 6px; border-left: 3px solid var(--accent);
  background: var(--surface); font-size: 0.72rem; line-height: 1.35;
}

.cal-event--class { border-left-color: var(--class); background: var(--class-bg); }
.cal-event--assignment { border-left-color: var(--assignment); background: var(--assignment-bg); }
.cal-event--club { border-left-color: var(--club); background: var(--club-bg); }
.cal-event--social { border-left-color: var(--social); background: var(--social-bg); }
.cal-event--study { border-left-color: var(--study); background: var(--study-bg); }
.cal-event--done { opacity: 0.55; text-decoration: line-through; }

.cal-event__title { display: block; font-weight: 700; color: var(--text); }
.cal-event__meta { display: block; font-size: 0.65rem; color: var(--text-muted); margin-top: 0.1rem; }

/* Club directory */
.club-directory {
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}

@media (min-width: 640px) { .club-directory { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .club-directory { grid-template-columns: repeat(3, 1fr); } }

.club-card__details {
  list-style: none; font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem;
}

.club-card__details strong { color: var(--text); font-weight: 700; }
.club-card__actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.club-card__waitlist { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }

/* Research library */
.library-search { padding: 1.15rem 1.25rem; margin-bottom: 1.25rem; }
.library-search .filters { margin-top: 0.85rem; margin-bottom: 0; }

.library-results {
  display: grid; grid-template-columns: 1fr; gap: 0.85rem;
}

@media (min-width: 768px) { .library-results { grid-template-columns: repeat(2, 1fr); } }

.library-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.85rem;
  align-items: start; padding: 1rem 1.1rem;
}

.library-card--saved { border-color: rgba(8, 145, 178, 0.3); background: linear-gradient(135deg, #fff 0%, var(--study-bg) 100%); }
.library-card--read { opacity: 0.75; }

.library-card__icon { font-size: 1.75rem; line-height: 1; padding-top: 0.15rem; }
.library-card__title { font-size: 0.95rem; font-weight: 800; margin-bottom: 0.2rem; }
.library-card__authors { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.45rem; }
.library-card__link { display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--study); text-decoration: none; margin-top: 0.35rem; }
.library-card__link:hover { text-decoration: underline; }

.library-card__actions {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem;
}

/* Study SOS chat */
.study-sos { padding: 1rem 1.05rem; border-color: rgba(220, 38, 38, 0.2); display: flex; flex-direction: column; min-height: 420px; }
.study-sos__header { display: flex; gap: 0.65rem; align-items: flex-start; margin-bottom: 0.75rem; }
.study-sos__badge { font-size: 1.5rem; line-height: 1; }
.study-sos__title { font-size: 0.95rem; font-weight: 800; margin-bottom: 0.15rem; }
.study-sos__sub { font-size: 0.72rem; color: var(--text-muted); line-height: 1.35; }

.sos-context {
  display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; margin-bottom: 0.65rem;
}
.sos-context__field { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.sos-context__field input,
.sos-context__field select {
  font: inherit; font-size: 0.78rem; padding: 0.4rem 0.55rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
}
.sos-context__field--sm { min-width: 64px; }

.sos-chat {
  flex: 1; min-height: 180px; max-height: 280px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.65rem;
  padding: 0.65rem; margin-bottom: 0.65rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  scroll-behavior: smooth;
}

.sos-msg { display: flex; gap: 0.45rem; align-items: flex-start; max-width: 100%; }
.sos-msg--user { flex-direction: row-reverse; }
.sos-msg--user .sos-msg__bubble {
  background: var(--accent); color: #fff; border-radius: 12px 12px 4px 12px;
}
.sos-msg--assistant .sos-msg__bubble {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px 12px 12px 4px;
}
.sos-msg__avatar { font-size: 1rem; flex-shrink: 0; line-height: 1; padding-top: 0.15rem; }
.sos-msg__bubble {
  font-size: 0.78rem; line-height: 1.45; padding: 0.55rem 0.7rem;
  max-width: calc(100% - 28px); word-break: break-word;
}
.sos-msg__bubble p { margin-bottom: 0.4rem; }
.sos-msg__bubble p:last-child { margin-bottom: 0; }
.sos-msg__lead { font-size: 0.82rem; margin-bottom: 0.35rem !important; }
.sos-msg__meta { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 0.35rem !important; }
.sos-msg--user .sos-msg__meta { color: rgba(255,255,255,0.75); }

.sos-typing { font-style: italic; color: var(--text-muted); }

.sos-shortcuts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin-bottom: 0.65rem;
}
.sos-shortcut {
  display: flex; align-items: center; justify-content: center; gap: 0.3rem;
  padding: 0.4rem 0.35rem; font: inherit; font-size: 0.68rem; font-weight: 700;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sos-shortcut:hover { background: var(--accent-soft); border-color: rgba(var(--accent-rgb), 0.35); }
.sos-shortcut span { font-size: 0.85rem; line-height: 1; }

.sos-upload-panel {
  padding: 0.65rem; margin-bottom: 0.65rem;
  background: var(--study-bg); border: 1px dashed rgba(8, 145, 178, 0.35);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 0.45rem;
}
.sos-upload-panel__label { font-size: 0.72rem; font-weight: 700; color: var(--study); margin-bottom: 0.15rem; }
.sos-upload-panel input[type="text"],
.sos-upload-panel input[type="file"] {
  font: inherit; font-size: 0.78rem; padding: 0.4rem 0.55rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); width: 100%;
}

.sos-chat-input {
  display: flex; gap: 0.35rem; align-items: stretch;
}
.sos-chat-input input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.82rem;
  padding: 0.5rem 0.65rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
}
.sos-chat-input .btn { min-width: 40px; padding: 0.5rem; flex-shrink: 0; }

.sos-highlight {
  background: #fef08a; color: #713f12; padding: 0.05rem 0.2rem;
  border-radius: 3px; font-weight: 600;
}
[data-theme="dark"] .sos-highlight { background: rgba(250, 204, 21, 0.25); color: #fde047; }

.sos-highlight-list { list-style: none; padding: 0; margin: 0.35rem 0; display: flex; flex-direction: column; gap: 0.35rem; }
.sos-highlight-list li { font-size: 0.78rem; line-height: 1.4; }

.sos-report__block { margin-bottom: 0.5rem; }
.sos-report__block h4,
.sos-plan-heading {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin: 0.5rem 0 0.25rem;
}
.sos-report__block ul,
.sos-report__block ol,
.sos-plan-list,
.sos-tip-list { padding-left: 1.1rem; font-size: 0.76rem; margin: 0.2rem 0; }
.sos-report__block li,
.sos-plan-list li,
.sos-tip-list li { margin-bottom: 0.2rem; }

.sos-inline-btn { margin-top: 0.45rem; }

.btn--study-sos { background: #dc2626; box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25); }
.btn--study-sos:hover { background: #b91c1c; }
.btn--study-sos.btn--sm { min-height: 36px; font-size: 0.78rem; }

/* Scroll to top */
.scroll-top {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 500;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--accent); font-size: 1.25rem; font-weight: 800;
  box-shadow: var(--shadow-hover); cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.scroll-top:hover { transform: translateY(-2px); background: var(--accent-soft); }
.scroll-top[hidden] { display: none; }

/* Login */
body.page-login {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(79, 70, 229, 0.14) 0, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 90%, rgba(124, 58, 237, 0.12) 0, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(99, 102, 241, 0.06) 0, transparent 60%),
    linear-gradient(165deg, #eef2ff 0%, var(--bg) 38%, #f1f5f9 100%);
}

[data-theme="dark"] body.page-login {
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(99, 102, 241, 0.18) 0, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 90%, rgba(124, 58, 237, 0.14) 0, transparent 50%),
    linear-gradient(165deg, #1e1b4b 0%, var(--bg) 42%, #0f172a 100%);
}

body.page-login .header--login {
  position: relative;
  width: 100%;
  height: auto;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  border-right: none;
  background-image: none;
}

[data-theme="dark"] body.page-login .header--login {
  background: rgba(15, 23, 42, 0.82);
  border-bottom-color: var(--border);
}

body.page-login .header--login .brand__name { color: var(--text); }
body.page-login .header--login .brand__tagline { color: var(--text-muted); display: block; font-size: 0.62rem; }
body.page-login .header--login .brand__mark {
  width: 36px; height: 36px; border-radius: 10px;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}
body.page-login .header--login .brand__mark-icon { font-size: 1rem; }

body.page-login .login-header__tools {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

body.page-login .login-header__tools .topbar__utilities { gap: 0.4rem; }

body.page-login .main--login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  max-width: none;
  margin: 0;
  padding: 2rem 1.25rem 3rem;
  width: 100%;
}

.login-card {
  width: 100%;
  max-width: 520px;
  padding: 1.65rem 1.5rem 1.45rem;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .login-card {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  margin-bottom: 1.35rem;
}

.login-card__logo {
  position: relative;
  width: 48px; height: 48px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--accent-light) 0%, var(--accent) 55%, #4338ca 100%);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  display: flex; align-items: center; justify-content: center;
}

.login-card__logo-icon { font-size: 1.3rem; line-height: 1; }
.login-card__logo-abbr {
  position: absolute; bottom: -4px; right: -4px;
  font-size: 0.55rem; font-weight: 800; letter-spacing: 0.04em;
  background: #fff; color: var(--accent); padding: 0.1rem 0.3rem;
  border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.login-card__title { font-size: 1.22rem; font-weight: 800; margin-bottom: 0.2rem; letter-spacing: -0.02em; }
.login-card__sub { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }

.login-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 0.85rem;
  margin-bottom: 1.25rem;
}

.login-field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }

.login-field__label {
  font-size: 0.72rem; font-weight: 700; color: var(--text);
}

.login-field__wrap {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0 0.85rem;
  min-height: 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.login-field__wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
  background: var(--surface);
}

.login-field__icon {
  font-size: 0.9rem; line-height: 1; flex-shrink: 0; opacity: 0.65;
}

.login-field__input {
  flex: 1; min-width: 0;
  border: none; background: transparent;
  font: inherit; font-size: 0.85rem; font-weight: 500;
  color: var(--text); padding: 0.5rem 0;
  outline: none;
}

.login-field__input::placeholder { color: var(--text-muted); font-weight: 400; }

.login-form__error { grid-column: 1 / -1; color: var(--urgent); font-size: 0.78rem; font-weight: 600; margin: 0; }
.login-form__submit { grid-column: 1 / -1; width: 100%; margin: 0.25rem 0 0; padding: 0.75rem; font-size: 0.9rem; }

.login-demo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  background: var(--bg);
  margin-bottom: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.login-demo__title {
  flex-shrink: 0;
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin: 0; line-height: 1.25; max-width: none;
}

.login-demo__list { list-style: none; display: flex; flex-direction: column; flex: 1; gap: 0.65rem; min-width: 0; }
.login-demo__list > li { flex: 1; min-width: 0; }

.login-demo__btn {
  width: 100%; text-align: left; padding: 0.65rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.login-demo__btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.login-demo__btn strong { display: block; font-size: 0.82rem; color: var(--text); }
.login-demo__btn span { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }
.login-card__footer { text-align: center; font-size: 0.82rem; margin: 0.4rem 0 0; }

@media (max-width: 480px) {
  .login-card { max-width: 100%; padding: 1.35rem 1.2rem 1.2rem; }
  .login-form { grid-template-columns: 1fr; gap: 0.85rem; }
  .login-demo { gap: 0.65rem; padding: 0.85rem; }
  .login-demo__list { gap: 0.55rem; }
}
.login-card__footer a { color: var(--accent); font-weight: 600; text-decoration: none; }
.login-card__footer a:hover { text-decoration: underline; }

/* Notifications */
.notif-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.25rem; }
.notif-list { display: flex; flex-direction: column; gap: 0.75rem; }
.notif-card { display: grid; grid-template-columns: auto 1fr auto; gap: 0.85rem; align-items: start; padding: 1rem 1.1rem; }
.notif-card--unread { border-color: rgba(var(--accent-rgb), 0.35); background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 100%); }
.notif-card--read { opacity: 0.7; }
.notif-card__icon { font-size: 1.35rem; line-height: 1; padding-top: 0.1rem; }
.notif-card__title { font-size: 0.92rem; font-weight: 800; margin-bottom: 0.2rem; }
.notif-card__text { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; margin-bottom: 0.35rem; }
.notif-card__time { font-size: 0.72rem; color: var(--text-muted); }
.notif-card__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.notif-activity { padding: 0; overflow: hidden; }

.feature-card--notif::before { background: linear-gradient(90deg, #ef4444, #f97316); }
.feature-card--notif .feature-card__icon { background: #fef2f2; }
.feature-card--notif .feature-card__link { color: #dc2626; }

.life-grades-overview { margin-bottom: 1.25rem; min-width: 0; }
.life-chart-wrap { min-width: 0; overflow-x: auto; }
.life-grades-card { padding: 1.25rem; min-width: 0; overflow: hidden; }
.life-grades-list { min-width: 0; }
.life-panel__header { flex-wrap: wrap; gap: 0.5rem; }

/* CGPA calculator */
.cgpa-calculator {
  margin-top: 1.5rem;
  padding: 1.25rem 1.35rem;
  border-color: rgba(217, 119, 6, 0.25);
  background: linear-gradient(135deg, var(--surface) 0%, #fffbeb 100%);
}

[data-theme="dark"] .cgpa-calculator {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(217, 119, 6, 0.08) 100%);
}

.cgpa-calculator__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.cgpa-calculator__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.cgpa-calculator__result {
  text-align: center;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #1e293b, #0f172a);
  color: #f1f5f9;
  min-width: 88px;
}

.cgpa-calculator__value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fbbf24;
}

.cgpa-calculator__label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.cgpa-calculator__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.cgpa-table-wrap { overflow-x: auto; margin-bottom: 1rem; }

.cgpa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.cgpa-table th,
.cgpa-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cgpa-table th {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.cgpa-table td:last-child { width: 36px; text-align: right; }

.cgpa-add-form { margin-bottom: 0.65rem; }
.cgpa-add-form select {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  width: 100%;
}

.cgpa-calculator__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.stat-card--cgpa {
  background: linear-gradient(135deg, #fff 0%, #fef3c7 100%);
  border-color: rgba(217, 119, 6, 0.2);
}

[data-theme="dark"] .stat-card--cgpa {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(217, 119, 6, 0.12) 100%);
}

/* Classes — attendance */
.attendance-hero {
  padding: 1.35rem; margin-bottom: 1.5rem;
  display: grid; grid-template-columns: 1fr; gap: 1.25rem;
}

@media (min-width: 720px) {
  .attendance-hero { grid-template-columns: 1fr 1fr; align-items: start; }
}

.attendance-hero__main {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}

.attendance-hero__ring {
  position: relative; width: 100px; height: 100px; flex-shrink: 0;
}

.attendance-hero__svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.attendance-hero__track {
  fill: none; stroke: var(--border); stroke-width: 10;
}

.attendance-hero__fill {
  fill: none; stroke: var(--class); stroke-width: 10;
  stroke-linecap: round; transition: stroke-dashoffset 0.4s ease;
}

.attendance-hero__pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 800; color: var(--class);
}

.attendance-hero__label { font-size: 1rem; font-weight: 800; margin-bottom: 0.25rem; }
.attendance-hero__meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.attendance-hero__hint { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }

.attendance-hero__today-label {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.65rem;
}

.attendance-hero__empty { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

.attendance-today-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }

.attendance-today-item {
  display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
  padding: 0.65rem 0.75rem; background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.attendance-today-item__name { font-size: 0.88rem; font-weight: 700; flex: 1; min-width: 120px; }
.attendance-today-item__time { font-size: 0.75rem; font-weight: 700; color: var(--class); font-variant-numeric: tabular-nums; }

.attendance-today-item__actions { display: flex; gap: 0.35rem; margin-left: auto; }

.attendance-btn {
  font: inherit; font-size: 0.72rem; font-weight: 700;
  padding: 0.35rem 0.6rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.attendance-btn:hover { border-color: var(--class); color: var(--class); }

.attendance-btn--active {
  background: var(--class-bg); border-color: var(--class); color: var(--class);
}

.attendance-btn--absent.attendance-btn--active {
  background: #fff1f2; border-color: var(--urgent); color: var(--urgent);
}

/* Squad group chat popup */
.squad-chat-fab {
  position: fixed;
  bottom: var(--squad-chat-inset);
  left: var(--squad-chat-left);
  z-index: 200;
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 0.95rem; font: inherit; font-size: 0.82rem; font-weight: 800;
  border: none; border-radius: 99px; cursor: pointer;
  background: var(--squad); color: #fff;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  height: var(--squad-chat-fab-h);
}

.squad-chat-fab:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124, 58, 237, 0.45); }

.squad-chat-fab__icon { font-size: 1.05rem; line-height: 1; }

.squad-chat-fab__badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  font-size: 0.62rem; font-weight: 800; line-height: 18px; text-align: center;
  background: var(--urgent); color: #fff; border-radius: 99px;
}

.squad-chat-backdrop {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(15, 23, 42, 0.35);
}

.squad-chat-panel {
  position: fixed;
  left: var(--squad-chat-left);
  bottom: calc(var(--squad-chat-inset) + var(--squad-chat-fab-h) + var(--squad-chat-gap));
  z-index: 220;
  width: min(calc(100vw - var(--squad-chat-left) - var(--squad-chat-inset)), 300px);
  height: min(50vh, 340px);
  max-height: calc(100vh - var(--topbar-height, 56px) - var(--squad-chat-fab-h) - 3.5rem);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
  transform: scale(0.96) translateY(10px);
  opacity: 0; pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.squad-chat-panel--open {
  transform: scale(1) translateY(0);
  opacity: 1; pointer-events: auto;
}

.squad-chat-panel__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--squad-bg) 0%, var(--surface) 70%);
  flex-shrink: 0;
}

.squad-chat-panel__title { font-size: 0.92rem; font-weight: 800; }
.squad-chat-panel__sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }

.squad-chat-panel__close {
  font: inherit; font-size: 1.3rem; line-height: 1;
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 0.15rem 0.35rem; border-radius: var(--radius-sm);
}

.squad-chat-panel__close:hover { background: var(--bg); color: var(--text); }

.squad-chat-panel__messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 0.7rem 0.85rem;
  display: flex; flex-direction: column; gap: 0.65rem;
  background: var(--bg);
  overscroll-behavior: contain;
}

.squad-msg { display: flex; gap: 0.45rem; align-items: flex-start; max-width: 94%; }
.squad-msg--me { flex-direction: row-reverse; margin-left: auto; }

.squad-msg__avatar { font-size: 1rem; flex-shrink: 0; line-height: 1; }

.squad-msg__bubble {
  padding: 0.5rem 0.65rem; border-radius: 12px 12px 12px 4px;
  background: var(--surface); border: 1px solid var(--border);
}

.squad-msg--me .squad-msg__bubble {
  background: var(--squad); color: #fff; border-color: var(--squad);
  border-radius: 12px 12px 4px 12px;
}

.squad-msg__author {
  display: block; font-size: 0.65rem; font-weight: 800; margin-bottom: 0.15rem;
  color: var(--text-muted);
}

.squad-msg--me .squad-msg__author { color: rgba(255,255,255,0.75); }

.squad-msg__text { font-size: 0.78rem; line-height: 1.45; margin: 0; word-break: break-word; }
.squad-msg__time { display: block; font-size: 0.6rem; margin-top: 0.2rem; opacity: 0.7; }

.squad-chat-panel__input {
  display: flex; gap: 0.35rem; padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--border); background: var(--surface);
  flex-shrink: 0;
}

.squad-chat-panel__input input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.82rem;
  padding: 0.5rem 0.65rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
}

.squad-chat-panel__input .btn { min-width: 38px; padding: 0.5rem; flex-shrink: 0; font-size: 0.85rem; }

/* Sticky topbar */
.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}

.topbar-menu-btn__icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 18px;
}

.topbar-menu-btn__icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.nav-open .topbar-menu-btn__icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .topbar-menu-btn__icon span:nth-child(2) {
  opacity: 0;
}

body.nav-open .topbar-menu-btn__icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 135;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

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

.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 100%; padding: 0 1.25rem;
}

.topbar__week {
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.topbar__actions {
  display: flex; align-items: center; gap: 0.65rem; margin-left: auto;
}

.topbar__utilities { display: flex; align-items: center; gap: 0.45rem; }

.topbar-tool-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; min-height: 36px; padding: 0.35rem 0.55rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-size: 0.78rem; font-weight: 600; text-decoration: none;
  cursor: pointer; font-family: inherit; transition: background 0.15s;
}

.topbar-tool-btn:hover { background: var(--accent-soft); border-color: rgba(var(--accent-rgb), 0.25); }

.topbar-tool-btn__badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--urgent); color: #fff; font-size: 0.6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.topbar-tool-btn--signin { padding: 0.35rem 0.75rem; gap: 0.35rem; }

.account-menu__trigger--topbar {
  border-color: var(--border); background: var(--bg); color: var(--text);
}

.topbar-gamify {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.65rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb), 0.2);
  text-decoration: none; color: inherit; min-width: 0;
}

.topbar-gamify__level { font-size: 0.68rem; font-weight: 800; color: var(--accent); white-space: nowrap; }
.topbar-gamify__title { font-size: 0.72rem; font-weight: 700; white-space: nowrap; display: none; }
.topbar-gamify__bar {
  width: 64px; height: 4px; background: rgba(var(--accent-rgb), 0.15);
  border-radius: 99px; overflow: hidden; flex-shrink: 0;
}
.topbar-gamify__fill { height: 100%; background: linear-gradient(90deg, var(--accent-light), var(--accent)); border-radius: 99px; }
.topbar-gamify__xp { font-size: 0.62rem; color: var(--text-muted); white-space: nowrap; }

@media (min-width: 900px) {
  .topbar-gamify__title { display: inline; }
  .topbar-gamify__bar { width: 80px; }
}

@media (max-width: 768px) {
  .topbar-menu-btn { display: inline-flex; }
}

.page-header--billing .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, #059669);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.page-header--transcript .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, #7c3aed);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.btn--billing { background: #059669; box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25); }
.btn--billing:hover { background: #047857; }
.btn--transcript { background: #7c3aed; box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25); }
.btn--transcript:hover { background: #6d28d9; }

/* Billing */
.billing-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem; margin-bottom: 1.25rem;
}

.stat-card--warn {
  background: linear-gradient(135deg, #fff 0%, #fff1f2 100%);
  border-color: rgba(220, 38, 38, 0.2);
}

.billing-toolbar { margin-bottom: 1.25rem; }
.billing-list { display: flex; flex-direction: column; gap: 0.75rem; }

.billing-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding: 1rem 1.15rem;
}

.billing-card--overdue { border-color: rgba(220, 38, 38, 0.35); background: linear-gradient(135deg, var(--surface) 0%, #fff1f2 100%); }
.billing-card--pending { border-color: rgba(var(--accent-rgb), 0.25); }
.billing-card--paid { opacity: 0.85; }

.billing-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.25rem; }
.billing-card__course { font-size: 0.95rem; font-weight: 800; }
.billing-card__amount { font-size: 1rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.billing-card__title { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.45rem; }
.billing-card__paid-icon { font-size: 1.25rem; color: var(--campus); font-weight: 800; }

.feature-card--billing::before { background: linear-gradient(90deg, #059669, #34d399); }
.feature-card--billing .feature-card__icon { background: var(--campus-bg); }
.feature-card--billing .feature-card__link { color: var(--campus); }

.feature-card--transcript::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.feature-card--transcript .feature-card__icon { background: var(--squad-bg); }
.feature-card--transcript .feature-card__link { color: var(--squad); }

/* Transcript */
.transcript-hero { padding: 1.35rem; margin-bottom: 1.5rem; }

.transcript-hero__main {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}

.transcript-hero__label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.35rem; }
.transcript-hero__value { font-size: 2.5rem; font-weight: 800; line-height: 1; color: var(--squad); }
.transcript-hero__meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem; }

.transcript-hero__stats { display: flex; flex-wrap: wrap; gap: 0.65rem; }

.transcript-stat {
  padding: 0.65rem 0.85rem; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border); min-width: 120px;
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.transcript-stat:hover { border-color: rgba(124, 58, 237, 0.35); }

.transcript-stat--active {
  border-color: var(--squad); background: var(--squad-bg);
}

.transcript-stat__term { display: block; font-size: 0.68rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.transcript-stat__gpa { display: block; font-size: 1.25rem; font-weight: 800; color: var(--squad); line-height: 1.2; }
.transcript-stat__meta { display: block; font-size: 0.68rem; color: var(--text-muted); }

.transcript-view { padding: 1.15rem 1.25rem; margin-bottom: 1.5rem; overflow: hidden; }

.transcript-view__toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 1rem;
}

.transcript-view__toolbar .campus-section__title { margin-bottom: 0; }

.transcript-sem-picker { flex-wrap: wrap; }

.transcript-term--single .transcript-term__header {
  padding: 0 0 1rem; background: none; border-bottom: 1px solid var(--border);
}

.transcript-term--single .cgpa-table-wrap { padding: 0; }

.transcript-term { padding: 0; overflow: hidden; }

.transcript-term__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding: 1.15rem 1.25rem;
  background: linear-gradient(135deg, var(--squad-bg) 0%, var(--surface) 70%);
  border-bottom: 1px solid var(--border);
}

.transcript-term__title { font-size: 1.05rem; font-weight: 800; }
.transcript-term__meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

.transcript-term__gpa { text-align: right; }
.transcript-term__gpa-label { display: block; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.transcript-term__gpa-value { font-size: 1.35rem; font-weight: 800; color: var(--squad); }

.transcript-term .cgpa-table-wrap { padding: 0 1.25rem 1.15rem; }

/* Life Hub extras */
.life-quick-links {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem; padding: 0.85rem; margin-bottom: 1.25rem;
}

.life-quick-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s;
}

.life-quick-link:hover { border-color: rgba(var(--accent-rgb), 0.35); transform: translateY(-1px); }
.life-quick-link__icon { font-size: 1.35rem; line-height: 1; }
.life-quick-link__text { display: flex; flex-direction: column; gap: 0.1rem; }
.life-quick-link__text strong { font-size: 0.88rem; }
.life-quick-link__text span { font-size: 0.75rem; color: var(--text-muted); }

.life-insights { padding: 1.15rem 1.25rem; margin-bottom: 1.25rem; }
.life-insights__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.life-insights__empty { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

.life-insight {
  padding: 0.85rem; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
}

.life-insight--good { border-color: rgba(5, 150, 105, 0.25); background: linear-gradient(135deg, var(--surface) 0%, var(--campus-bg) 100%); }
.life-insight--warn { border-color: rgba(220, 38, 38, 0.25); background: linear-gradient(135deg, var(--surface) 0%, #fff1f2 100%); }

.life-insight__label { display: block; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.25rem; }
.life-insight__value { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.life-insight__sub { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; line-height: 1.35; }
.life-insight__link { color: var(--squad); font-weight: 700; text-decoration: none; }
.life-insight__link:hover { text-decoration: underline; }

/* Feedback */
.page-header--feedback .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, #0891b2);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.btn--feedback { background: #0891b2; box-shadow: 0 2px 8px rgba(8, 145, 178, 0.25); }
.btn--feedback:hover { background: #0e7490; }

.feedback-faq { padding: 1.15rem 1.25rem; margin-bottom: 1.25rem; }

.feedback-faq__list { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.75rem; }

.feedback-faq__item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); overflow: hidden;
}

.feedback-faq__question {
  padding: 0.75rem 0.9rem; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; list-style: none;
}

.feedback-faq__question::-webkit-details-marker { display: none; }

.feedback-faq__item[open] .feedback-faq__question {
  border-bottom: 1px solid var(--border);
  background: var(--study-bg);
}

.feedback-faq__answer {
  padding: 0.75rem 0.9rem; font-size: 0.82rem; color: var(--text-muted); line-height: 1.5;
}

.feedback-layout {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem;
}

@media (min-width: 820px) {
  .feedback-layout { grid-template-columns: 1fr 1fr; align-items: start; }
}

.feedback-form-card,
.feedback-history { padding: 1.15rem 1.25rem; }

.feedback-form-card__sub { font-size: 0.82rem; color: var(--text-muted); margin: 0.35rem 0 1rem; }

.feedback-form-card textarea {
  width: 100%; font: inherit; font-size: 0.85rem;
  padding: 0.65rem 0.75rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
  resize: vertical; min-height: 100px;
}

.feedback-history__list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }

.feedback-item {
  position: relative; padding: 0.85rem 2rem 0.85rem 0.85rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
}

.feedback-item--answered { border-color: rgba(5, 150, 105, 0.25); }

.feedback-item__header { display: flex; gap: 0.65rem; margin-bottom: 0.5rem; }
.feedback-item__icon { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.feedback-item__subject { font-size: 0.9rem; font-weight: 800; margin-bottom: 0.25rem; }
.feedback-item__message { font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; }

.feedback-item__response {
  margin-top: 0.65rem; padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm); background: var(--campus-bg);
  border: 1px solid rgba(5, 150, 105, 0.15);
}

.feedback-item__response-label {
  display: block; font-size: 0.62rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--campus); margin-bottom: 0.25rem;
}

.feedback-item__response p { font-size: 0.82rem; line-height: 1.45; margin: 0; }

.feedback-item .item__delete {
  position: absolute; top: 0.5rem; right: 0.5rem;
}

.feature-card--feedback::before { background: linear-gradient(90deg, #0891b2, #22d3ee); }
.feature-card--feedback .feature-card__icon { background: var(--study-bg); }
.feature-card--feedback .feature-card__link { color: var(--study); }

/* Uni Bulletin */
.page-header--bulletin .page-header__title {
  background: linear-gradient(135deg, var(--text) 30%, #dc2626);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.bulletin-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 1rem;
}

.bulletin-list, .exam-list { display: flex; flex-direction: column; gap: 0.75rem; }

.bulletin-card {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.75rem; padding: 0.95rem 1.05rem; position: relative;
}

.bulletin-card--unread { border-color: rgba(220, 38, 38, 0.25); background: linear-gradient(135deg, var(--surface) 0%, #fff1f2 100%); }
.bulletin-card--read { opacity: 0.82; }
.bulletin-card--pinned { border-color: rgba(217, 119, 6, 0.3); }

.bulletin-card__pin {
  position: absolute; top: 0.65rem; right: 0.65rem; font-size: 0.75rem; line-height: 1;
}

.bulletin-card__title { font-size: 0.92rem; font-weight: 800; margin-bottom: 0.25rem; padding-right: 1.25rem; }
.bulletin-card__text { font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; margin-bottom: 0.45rem; }

.daily-card { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem; align-items: start; }
.daily-card__icon { font-size: 1.35rem; line-height: 1; padding-top: 0.15rem; }

.exam-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem; margin-bottom: 1.25rem;
}

.exam-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap; padding: 0.95rem 1.05rem;
}

.exam-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.2rem; }
.exam-card__course { font-size: 0.95rem; font-weight: 800; }
.exam-card__date { font-size: 0.75rem; font-weight: 700; color: var(--urgent); white-space: nowrap; }
.exam-card__title { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.4rem; }

.feature-card--bulletin::before { background: linear-gradient(90deg, #dc2626, #f97316); }
.feature-card--bulletin .feature-card__icon { background: #fff1f2; }
.feature-card--bulletin .feature-card__link { color: #dc2626; }
