:root {
  --mint: #eef2ff;
  --green: #2ad4c8;
  --navy: #0c1628;
  --peach: #e8ecf8;
  --blush: #d9e2ff;
  --white: #ffffff;
  --ink: #1a2340;
  --muted: #7b849c;
  --line: rgba(16, 22, 58, 0.08);
  --navy-2: #152338;
  --cream: #eef1f6;
  --paper: #ffffff;
  --accent: #6d5efc;
  --accent-deep: #5546e8;
  --purple: #6d5efc;
  --purple-deep: #5546e8;
  --card: #ffffff;
  --shadow: 0 16px 40px rgba(16, 22, 58, 0.08);
  --radius: 28px;
  --serif: "Plus Jakarta Sans", sans-serif;
  --sidebar-bg: #0c1628;
  --sidebar-text: #f4f7fb;
  --sidebar-muted: rgba(244, 247, 251, 0.62);
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --banner-bg: linear-gradient(135deg, #10173a 0%, #1c2460 48%, #3a2780 100%);
  --banner-text: #ffffff;
  --btn: #6d5efc;
  --btn-text: #ffffff;
  --ghost-bg: #eef2ff;
  --ghost-text: #5546e8;
  --highlight: #ddd6fe;
  --auth-bg: #0c1628;
  --auth-text: #ffffff;
  --nav-active-bg: #2ad4c8;
  --nav-active-text: #ffffff;
  --scroll: #c4c8ce;
  --glass: #ffffff;
  --glass-strong: #ffffff;
  --glass-border: rgba(16, 22, 58, 0.08);
  --glass-shadow: 0 12px 32px rgba(16, 22, 58, 0.07);
  --glow: 0 10px 28px rgba(42, 212, 200, 0.28);
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #c4c8ce transparent;
  scrollbar-width: thin;
}

button, input, textarea, select { font-family: inherit; }

::selection {
  background: var(--highlight);
  color: var(--ink);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #c4c8ce;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-track { background: transparent; }
.nav-menu::-webkit-scrollbar-thumb {
  background: #9aa3ad;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef1f6;
  color: var(--ink);
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -0.012em;
}
body::before { display: none; }

.desktop-layout,
.auth-shell {
  position: relative;
  z-index: 1;
}

.desktop-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: 248px;
  min-width: 248px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid color-mix(in srgb, var(--sidebar-text) 8%, transparent);
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 4;
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  left: 8%;
  bottom: -8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 212, 200, 0.22), transparent 72%);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}
.sidebar > * { position: relative; z-index: 1; }

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}
.sidebar-top .brand { margin-bottom: 0; flex: 1; min-width: 0; }
.nav-toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.nav-drop { display: contents; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--sidebar-text);
  margin-bottom: 0;
  padding: 0 8px;
  text-decoration: none;
  cursor: pointer;
}

a.brand:hover { color: var(--sidebar-text); opacity: 0.8; }

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  box-shadow: none;
  position: relative;
  overflow: visible;
}
.brand-mark .ss-mascot {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-item i { width: 18px; text-align: center; }

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--sidebar-text);
  box-shadow: none;
}

.nav-item.active {
  background: linear-gradient(90deg, #1fd6c9, #3ecfff);
  color: #fff;
  box-shadow: 0 0 22px rgba(45, 220, 210, 0.42);
}
.nav-item.active:hover {
  transform: none;
  background: linear-gradient(90deg, #1fd6c9, #3ecfff);
}

.add-task-btn {
  background: var(--btn);
  color: var(--btn-text);
  border: none;
  border-radius: 999px;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.add-task-btn:hover {
  transform: scale(1.02);
  box-shadow: var(--glow);
}

.main-content {
  flex: 1;
  padding: 28px 40px 48px;
  width: 100%;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  width: 100%;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  width: min(560px, 100%);
  border: 1px solid var(--glass-border);
  color: #9aa0b5;
  box-shadow: 0 8px 22px rgba(16, 22, 58, 0.04);
}
.top-bar .search-bar {
  flex: 1;
}

.search-bar input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.92rem;
  background: transparent;
  font-family: inherit;
  color: #1e1630;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-chip {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #5c6484;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}
.icon-chip:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 18%, transparent);
}
.notify-wrap { position: relative; }
.notify-btn {
  position: relative;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  font: inherit;
}
.notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
}
.notify-badge.hidden { display: none; }
.notify-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(320px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(16, 22, 58, 0.16);
  z-index: 40;
  overflow: hidden;
}
.notify-panel.hidden { display: none; }
.notify-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 8px;
  font-weight: 800;
  font-size: 0.88rem;
}
.notify-panel-head a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.notify-item {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--glass-border);
}
.notify-item:hover { background: #f7f8fc; }
.notify-item strong { display: block; font-size: 0.88rem; }
.notify-item span { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.notify-item.is-overdue span { color: #e11d48; font-weight: 700; }
.notify-empty { padding: 14px; color: var(--muted); font-size: 0.88rem; }

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  box-shadow: none;
}

.avatar-letter { font-size: 0.92rem; }
.user-profile .avatar:not(.has-photo) .fa-user { display: none; }
.avatar.has-photo .avatar-letter { display: none; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(220px, 0.85fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 28px;
}
.home-hero .welcome-banner {
  margin-bottom: 0;
  height: 100%;
}

.sticky-pad-anchor {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 4px 0;
}
.sticky-pad-stack {
  position: relative;
  width: min(260px, 100%);
  height: 168px;
}
.sticky-pad-stack i {
  position: absolute;
  inset: 0;
  background: #f6f0e6;
  border-radius: 22px;
  box-shadow: 0 14px 32px rgba(16, 22, 58, 0.08);
}
.sticky-pad-stack i:nth-child(1) { transform: translate(8px, 8px); opacity: 0.5; }
.sticky-pad-stack i:nth-child(2) { transform: translate(4px, 4px); opacity: 0.75; }
.sticky-pad-stack i:nth-child(3) { transform: none; }
.sticky-board {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
.sticky-note {
  position: absolute;
  width: min(260px, calc(100% - 24px));
  pointer-events: auto;
  background: linear-gradient(180deg, #fbf7f0 0%, #f4eee4 100%);
  color: var(--ink);
  border-radius: 22px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(16, 22, 58, 0.06);
  box-shadow: 0 16px 36px rgba(16, 22, 58, 0.1);
  min-height: 168px;
  display: flex;
  flex-direction: column;
  touch-action: none;
}
.sticky-note::before {
  display: none;
}
.sticky-note.is-dragging {
  cursor: grabbing;
  box-shadow: 0 22px 44px rgba(27, 27, 58, 0.2);
  z-index: 40 !important;
}
.sticky-note-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 8px 0 10px;
  cursor: grab;
}
.sticky-note-head strong {
  font-size: 0.92rem;
  font-weight: 800;
}
.sticky-note-del {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(44, 44, 50, 0.12);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.sticky-note-del:hover {
  background: #9f1239;
  color: #fff;
}
.sticky-pad-anchor .ss-muted {
  font-size: 0.72rem;
}
.sticky-note textarea {
  flex: 1;
  width: 100%;
  min-height: 110px;
  border: none;
  resize: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  line-height: 1.45;
  color: inherit;
  outline: none;
  touch-action: auto;
}

.welcome-banner {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--banner-bg);
  color: #fff;
  border-radius: 28px;
  padding: 34px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  width: 100%;
  min-height: 176px;
  border: 0;
  box-shadow: 0 18px 40px rgba(16, 22, 58, 0.16);
}
.welcome-banner::before {
  display: none;
}
.welcome-banner::after {
  display: block;
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12, 18, 48, 0.72) 0%, rgba(12, 18, 48, 0.28) 42%, transparent 72%);
  z-index: 0;
  pointer-events: none;
}

.welcome-text { position: relative; z-index: 1; max-width: 36rem; }
.welcome-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  pointer-events: none;
  z-index: 0;
}

.welcome-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.78;
  font-weight: 700;
  margin-bottom: 10px;
}

.welcome-text h1 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 2.35rem;
  margin-bottom: 8px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.welcome-text p {
  opacity: 0.82;
  font-size: 1.02rem;
}

.welcome-orb { display: none; }

.tools-section {
  margin-bottom: 28px;
  width: 100%;
}

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

.tool-card {
  position: relative;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--glass-shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
  min-height: 168px;
}

.tool-card:hover {
  transform: scale(1.02);
  box-shadow: 0 22px 44px color-mix(in srgb, var(--accent) 16%, rgba(28, 35, 71, 0.08));
  border-color: color-mix(in srgb, var(--accent) 28%, var(--glass-border));
}

.tool-card h3 {
  font-size: 1.02rem;
  font-weight: 800;
  margin-top: 6px;
}

.tool-card p {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.45;
  max-width: 86%;
}

.tool-go {
  margin-top: auto;
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--accent);
  font-size: 0.72rem;
  position: relative;
  z-index: 1;
}

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  background: var(--mint);
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.tool-icon.notes { background: #e8efff; color: #4f6ef7; }
.tool-icon.cards { background: #efe8ff; color: #7c5cfc; }
.tool-icon.quiz { background: #fff1e6; color: #e07a3d; }
.tool-icon.todo { background: var(--mint); color: var(--accent); }
.tool-icon.subjects { background: var(--mint); color: var(--accent); }

.banner {
  background: var(--glass);
  border-radius: 24px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 32px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.banner-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ink);
}

.banner-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 3px;
}

.banner-btn {
  padding: 12px 22px;
  background: var(--accent);
  color: white;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 10px 18px rgba(109, 40, 217, 0.22);
}

.banner-btn {
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.25s ease;
}
.banner-btn:hover {
  background: var(--accent-deep);
  transform: scale(1.02);
  box-shadow: var(--glow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i { color: var(--accent); font-size: 0.95rem; }

.section-link {
  font-size: 0.84rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1.5px;
  transition: background-size 0.28s ease, color 0.2s ease;
}
.section-link:hover { background-size: 100% 1.5px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.95fr;
  gap: 18px;
  width: 100%;
}
.home-dash {
  grid-template-columns: 1.2fr 1fr minmax(200px, 0.72fr);
  align-items: stretch;
}
.home-dash .dash-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.home-dash .task-list,
.home-dash .continue-list,
.home-dash .home-insight-list {
  flex: 1;
}
.home-dash .home-insight-list {
  justify-content: space-evenly;
}
.home-insights {
  padding: 14px 16px 12px;
}
.home-insight-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-insights .stat-row {
  padding: 8px 10px;
  box-shadow: none;
  gap: 10px;
}
.home-insights .stat-icon {
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
  border-radius: 10px;
}

.dash-panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 20px 20px 16px;
  box-shadow: var(--glass-shadow);
  min-width: 0;
}

.dash-date {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  margin: -6px 0 12px;
}

.plan-row {
  display: grid;
  grid-template-columns: 10px 52px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f2f7;
}

.plan-row:last-child { border-bottom: none; }
.plan-row.is-done { opacity: 0.45; }
.plan-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.plan-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: #8b90a5;
}
.plan-empty { padding: 12px 0 18px; }
.plan-add {
  width: 100%;
  margin-top: 8px;
  border: 1px dashed #d9dce8;
  background: #fafbff;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8b90a5;
  cursor: pointer;
  font-weight: 600;
}
.plan-add span { flex: 1; text-align: left; }
.plan-add:hover { border-color: var(--accent); color: var(--ink); }

.continue-list { display: flex; flex-direction: column; gap: 12px; }
.continue-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 62%, transparent);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--glass-border);
  transition: transform 0.2s ease, box-shadow 0.22s ease;
}
.continue-card:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 12%, transparent);
}
.continue-card strong { display: block; font-size: 0.92rem; }
.continue-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}
.continue-icon.note { background: #7c5cfc; }
.continue-icon.deck { background: #3b82f6; }
.continue-more { display: inline-flex; margin-top: 14px; }

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.overview-tile {
  border-radius: 24px;
  padding: 14px;
  min-height: 112px;
  transition: transform 0.2s ease, box-shadow 0.22s ease;
}
.overview-tile:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 14%, transparent);
}
.overview-tile i { margin-bottom: 10px; }
.overview-tile .stat-number { font-size: 1.35rem; margin-top: 2px; }
.overview-tile.notes { background: var(--mint); color: var(--ink); }
.overview-tile.cards { background: var(--peach); color: var(--ink); }
.overview-tile.tasks { background: var(--mint); color: var(--ink); }
.overview-tile.streak { background: var(--peach); color: var(--ink); }
.overview-tile .stat-label { color: inherit; opacity: 0.7; }

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--glass-shadow);
  transition: transform 0.2s ease, box-shadow 0.22s ease;
}

.task-card:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--accent) 14%, transparent);
}

.task-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.calc-icon { background: var(--mint); color: var(--accent); }
.physics-icon { background: #dcfce7; color: #16a34a; }
.english-icon { background: #dbeafe; color: #2563eb; }

.task-info { flex: 1; min-width: 0; }
.task-title { font-weight: 700; font-size: 0.98rem; }
.task-sub { font-size: 0.84rem; color: #8b83a0; margin-top: 3px; }
.task-time { font-size: 0.78rem; color: #8b83a0; font-weight: 600; }
.check-mark { color: #10b981; font-size: 1.3rem; }
.check-outline { width: 22px; height: 22px; border: 2px solid #d6d3e0; border-radius: 50%; }

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-row {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(81, 24, 133, 0.07);
  border-radius: 20px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 26px rgba(29, 9, 56, 0.05);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stat-icon.purple { background: var(--mint); color: var(--accent); }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.orange { background: #ffedd5; color: #ea580c; }

.stat-label {
  font-size: 0.72rem;
  color: #8b83a0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-number {
  font-size: 1rem;
  font-weight: 800;
  color: #1e1630;
}

.hidden { display: none !important; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b90a5;
  margin-bottom: 6px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(28, 35, 71, 0.06);
  width: fit-content;
}

.back-btn:hover { background: var(--mint); }

button.back-btn {
  cursor: pointer;
  font-family: inherit;
}

.page-header-stack {
  align-items: flex-start;
  flex-direction: column;
  gap: 14px;
}

a.add-task-btn,
a.banner-btn,
a.avatar {
  text-decoration: none;
}

a.add-task-btn,
a.banner-btn {
  color: #fff;
}

a.avatar {
  color: #fff;
}

.task-card.is-done {
  opacity: 0.55;
}

.ss-check {
  border: none;
  background: transparent;
  color: #cbd5e0;
  font-size: 1.3rem;
  cursor: pointer;
}

.ss-check.on {
  color: #10b981;
}

/* Buttons, forms, chrome */
.ss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--btn);
  color: var(--btn-text);
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  box-shadow: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ss-btn:hover {
  transform: scale(1.02);
  box-shadow: var(--glow);
}
.ss-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.ss-btn.ghost {
  background: color-mix(in srgb, var(--ghost-bg) 78%, transparent);
  color: var(--ghost-text);
  box-shadow: none;
}

.ss-btn.ghost:hover {
  background: var(--highlight);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 18%, transparent);
}

.ss-btn.danger,
.ss-btn.ghost.danger {
  background: #fff1f2;
  color: #e11d48;
}

.ss-icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, #f7f5fb 80%, transparent);
  color: #4a5568;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.22s ease;
}

.ss-icon-btn:hover {
  background: var(--highlight);
  color: var(--ink);
  transform: scale(1.02);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 16%, transparent);
}
.ss-icon-btn.danger { color: #e11d48; }
.ss-icon-btn.danger:hover { background: #fff1f2; color: #be123c; }

.ss-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ss-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a5568;
}

.ss-field input,
.ss-field textarea,
.ss-field select,
.note-toolbar input,
.note-toolbar select,
.note-editor textarea {
  border: 1px solid #e8e0f4;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: #2d3748;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ss-field input:focus,
.ss-field textarea:focus,
.ss-field select:focus,
.search-bar:focus-within {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(28, 25, 23, 0.08);
}

.ss-field textarea { resize: vertical; }
.ss-muted { color: #718096; font-size: 0.9rem; }
.text-link {
  margin-top: 16px;
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

#guest-continue {
  display: inline-block;
}

.guest-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 18px;
  background: #152038;
  color: #e8eef8;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.guest-banner a {
  color: #1fd6c9;
  font-weight: 800;
  text-decoration: none;
}
.guest-banner a:hover {
  text-decoration: underline;
}

.ss-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #d9dce8;
  border-radius: 20px;
}

.ss-empty i {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 12px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--mint);
  display: inline-grid;
  place-items: center;
}

.ss-empty h3 {
  color: #2d3748;
  margin-bottom: 6px;
}

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

.page-header > div:not(.page-header-actions) {
  min-width: 0;
  flex: 1 1 220px;
}

.page-header h1 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.page-header-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
  justify-content: flex-end;
  align-items: center;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.subject-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

.subject-tile {
  position: relative;
}

.tile-delete {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: #e11d48;
  cursor: pointer;
  opacity: 0;
  box-shadow: 0 6px 14px rgba(29, 9, 56, 0.1);
  transition: opacity 0.15s ease;
  z-index: 1;
}

.subject-tile:hover .tile-delete,
.tile-delete:focus {
  opacity: 1;
}

.library-card {
  width: 100%;
  min-height: 164px;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: left;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.22s ease;
}

.library-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 7px;
  background: var(--card-color, #7c3aed);
}

.library-card:hover {
  transform: scale(1.02);
  box-shadow: 0 18px 36px color-mix(in srgb, var(--card-color, var(--accent)) 18%, transparent);
}

.library-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: 6px;
  background: color-mix(in srgb, var(--card-color, #7c3aed) 16%, white);
  color: var(--card-color, #7c3aed);
  font-size: 1.15rem;
}

.library-card-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: #1e1630;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.library-card-kind {
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b83a0;
}

.library-card.add {
  border: 2px dashed color-mix(in srgb, var(--peach) 70%, #c9cde8);
  box-shadow: none;
  justify-content: center;
  align-items: center;
  color: var(--accent);
  background: #fafbff;
}

.library-card.add::before { display: none; }

.library-card.add .library-card-icon {
  background: var(--mint);
  color: var(--accent);
}

.library-card.add .library-card-name {
  color: var(--accent);
}

.library-card.add:hover {
  background: var(--mint);
  box-shadow: none;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
  cursor: pointer;
}

.color-swatch.selected {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #1d0938;
}

.icon-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-swatch {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: var(--mint);
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
}

.icon-swatch.selected {
  background: var(--mint);
  border-color: var(--accent);
  color: var(--accent);
}

.workspace-header .back-btn { margin-bottom: 10px; }
.workspace-header h1 { margin-top: 4px; }

.workspace-create {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 8px 0 32px;
}

.create-option {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(81, 24, 133, 0.07);
  border-radius: 22px;
  padding: 20px 18px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #1e1630;
  box-shadow: 0 10px 24px rgba(29, 9, 56, 0.04);
  font-family: inherit;
}

.create-option i {
  color: var(--accent);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.create-option span {
  color: #718096;
  font-size: 0.85rem;
}

.create-option:hover {
  border-color: #c9cde8;
  background: #ffffff;
}

.workspace-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  min-width: 0;
}
.workspace-columns > section {
  min-width: 0;
}

.text-open {
  flex: 1 1 12rem;
  min-width: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  font: inherit;
  color: inherit;
}
.text-open strong {
  overflow-wrap: anywhere;
}
.text-open span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ss-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  padding: 20px;
  box-shadow: var(--glass-shadow);
}

.ss-card h3 { margin-bottom: 8px; }
.ss-card-meta { margin: 12px 0; font-size: 0.85rem; color: #718096; }
.ss-card-actions,
.item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.item-actions {
  flex: 1 1 14rem;
  min-width: 0;
  max-width: 100%;
}

.item-actions .ss-btn {
  padding: 8px 12px;
  font-size: 0.82rem;
}
.subject-card-top,
.ss-row-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ss-row-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--glass-shadow);
  flex-wrap: wrap;
  min-width: 0;
  overflow: hidden;
}

.workspace-columns .ss-row-card {
  flex-direction: column;
  align-items: stretch;
}
.workspace-columns .text-open,
.workspace-columns .item-actions {
  flex: 0 0 auto;
  width: 100%;
}
.workspace-columns .item-actions {
  justify-content: flex-start;
}

.stack { display: flex; flex-direction: column; gap: 12px; }

.notes-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  min-height: calc(100vh - 140px);
}

.notes-sidebar {
  background: #fff;
  border: 1px solid #edf2f7;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.note-item {
  text-align: left;
  border: none;
  background: #f7fafc;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.note-item.active { background: var(--mint); }
.note-item span { font-size: 0.8rem; color: #718096; }

.note-editor {
  background: #fff;
  border: 1px solid #edf2f7;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.note-editor textarea {
  min-height: 420px;
  resize: vertical;
}

.study-board {
  width: 100%;
  max-width: 680px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
}

.flash-card {
  width: 100%;
  min-height: 420px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
  border: 1px solid rgba(81, 24, 133, 0.08);
  border-radius: 28px;
  box-shadow: 0 22px 50px rgba(81, 24, 133, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px;
  font-size: 1.35rem;
  font-weight: 600;
  cursor: pointer;
}

.study-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.study-studio .study-controls {
  width: min(680px, 100%);
  flex-direction: column;
  align-items: stretch;
}

.study-studio .study-controls .ss-btn {
  width: 100%;
}

.answer-reveal {
  background: var(--mint);
  color: var(--accent);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
}

.profile-card { max-width: 560px; }
.profile-card#insights { max-width: 920px; }
.profile-card#insights .section-header {
  margin-bottom: 16px;
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  font-size: 1.3rem;
}
.profile-hero h2 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.profile-stat {
  background: var(--mint);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-stat strong { font-size: 1.05rem; color: #1e1630; }

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.insight-grid h2 { font-size: 1.7rem; color: var(--ink); letter-spacing: -0.03em; }

.metric-card {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(81, 24, 133, 0.08);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 14px 32px rgba(29, 9, 56, 0.06);
}

.ss-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--ink);
  color: #fff;
  padding: 14px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  box-shadow: 0 18px 40px rgba(29, 9, 56, 0.28);
  font-weight: 600;
}

.ss-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.ss-toast.error { background: #9f1239; }

.ss-loading {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -12px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff8f3;
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  border: 2px solid color-mix(in srgb, var(--peach) 70%, #fff);
  box-shadow: 0 10px 0 color-mix(in srgb, var(--peach) 45%, transparent);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ss-loading.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.ss-loading i {
  animation: ss-spin 0.8s linear infinite;
}
@keyframes ss-spin {
  to { transform: rotate(360deg); }
}

.ss-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
}

.ss-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 40, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ss-modal-card {
  position: relative;
  width: min(480px, calc(100% - 32px));
  background: var(--glass-strong);
  border-radius: 28px;
  padding: 26px;
  z-index: 1;
  box-shadow: 0 40px 90px rgba(90, 60, 48, 0.18), inset 0 1px 0 rgba(255,255,255,0.7);
  border: 1px solid var(--glass-border);
}

.note-pop-card {
  width: min(560px, calc(100% - 32px));
  max-height: min(84vh, 740px);
  display: flex;
  flex-direction: column;
  padding: 22px 22px 16px;
}
.note-pop-card .ss-modal-header {
  align-items: flex-start;
  margin-bottom: 12px;
}
.note-pop-card .ss-modal-header h3 { margin: 0; }
.note-pop-body {
  overflow: auto;
  min-height: 140px;
  max-height: min(56vh, 480px);
  line-height: 1.6;
  padding-right: 4px;
}
.note-pop-body h3 { font-size: 0.95rem; margin: 0 0 8px; }
.note-pop-body p,
.note-pop-body ul,
.note-pop-body ol { margin: 0 0 10px; }
.note-pop.chat-mode .note-pop-body { max-height: min(46vh, 400px); }
.note-pop-chat {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.note-pop-chat.hidden { display: none !important; }
.note-pop-chat input,
.note-pop-chat textarea {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
}

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

.ss-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.auth-body {
  min-height: 100vh;
  background: var(--auth-bg);
}

.auth-body::before { display: none; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

.auth-hero {
  color: var(--auth-text);
  padding: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.auth-orbs {
  position: absolute;
  inset: 12% 8% auto auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.28), rgba(167,139,250,0.08) 55%, transparent 70%);
  pointer-events: none;
}

.auth-hero .brand { color: var(--auth-text); margin-bottom: 36px; }
.auth-hero h1 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 2.55rem;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.auth-hero p { max-width: 460px; opacity: 0.86; }

.auth-points {
  list-style: none;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 460px;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.92;
}

.auth-points i {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.14);
  font-size: 0.72rem;
}

.auth-card {
  background: var(--glass-strong);
  margin: 28px;
  border-radius: 32px;
  padding: 40px;
  overflow: auto;
  box-shadow: 0 40px 90px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.7);
  border: 1px solid var(--glass-border);
}

.auth-card-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.auth-hero .brand-mark {
  background: transparent;
  box-shadow: none;
}
.auth-hero .brand-mark .ss-mascot {
  width: 52px;
  height: 52px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  flex: 1;
  border: none;
  background: var(--mint);
  border-radius: 14px;
  padding: 12px;
  font-weight: 700;
  color: #718096;
  cursor: pointer;
}

.auth-tabs button.active {
  background: linear-gradient(180deg, var(--accent), var(--accent));
  color: #fff;
  box-shadow: none;
}

.setup-panel { margin-bottom: 28px; }
.setup-panel h2 { margin-bottom: 12px; }
.setup-steps {
  margin: 0 0 16px 18px;
  color: #4a5568;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-steps a { color: var(--accent); }

@media (max-width: 900px) {
  .desktop-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 12px 14px 10px;
    border-right: none;
    border-bottom: 1px solid rgba(81, 24, 133, 0.08);
    box-shadow: 0 10px 28px rgba(16, 22, 58, 0.18);
    background: var(--sidebar-bg);
    overflow: visible;
  }
  .sidebar-top { margin-bottom: 0; }
  .brand { margin-bottom: 0; padding: 0; }
  .nav-toggle { display: grid; }
  .nav-drop {
    display: none;
    position: absolute;
    left: 10px;
    right: 10px;
    top: calc(100% + 8px);
    flex-direction: column;
    background: var(--sidebar-bg);
    border-radius: 18px;
    padding: 8px;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
    z-index: 50;
    max-height: min(72vh, 560px);
    overflow: auto;
  }
  .sidebar.is-nav-open .nav-drop { display: flex; }
  .nav-menu {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 4px;
    padding-bottom: 0;
  }
  .nav-item {
    flex: 0 0 auto;
    width: 100%;
    padding: 11px 14px;
    font-size: 0.92rem;
    border-radius: 12px;
    background: transparent;
  }
  .nav-item.active { box-shadow: none; background: linear-gradient(90deg, #1fd6c9, #3ecfff); color: #fff; }
  .add-task-btn { display: none; }
  .dashboard-grid,
  .notes-layout,
  .auth-shell,
  .note-toolbar,
  .workspace-columns,
  .set-card-sides,
  .insight-grid,
  .profile-stats {
    grid-template-columns: 1fr;
  }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .auth-hero { display: none; }
  .search-bar { width: 100%; }
  .main-content { padding: 16px 16px 40px; }
  .tile-delete { opacity: 1; }
  .home-hero { grid-template-columns: 1fr; }
  .sticky-pad-anchor { min-height: 72px; }
  .welcome-banner {
    padding: 24px 20px;
    border-radius: 22px;
    flex-direction: column;
    align-items: flex-start;
  }
  .welcome-text h1 { font-size: 1.45rem; }
  .welcome-orb { display: none; }
  .banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
  }
  .page-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
  }
  .page-header h1 { font-size: 1.5rem; }
  .page-header-actions {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
    justify-content: flex-end;
  }
  .top-bar { gap: 12px; margin-bottom: 18px; }
  .studio-bar {
    padding: 12px 14px;
    flex-wrap: wrap;
  }
  .studio-title-row { padding: 12px 16px 0; }
  .studio-title-row input,
  .studio-title-row textarea,
  .studio-title-field { font-size: 1.3rem; }
  .rich-toolbar { padding: 10px 14px; }
  .studio-scroll { padding: 16px; }
  .note-side {
    position: absolute;
    inset: 0;
    width: 100%;
    z-index: 4;
    border-left: none;
  }
  .rich-doc { padding: 22px 16px; min-height: calc(100vh - 180px); }
  .flash-flip-wrap,
  .flash-flip,
  .flash-stack,
  .flash-card { min-height: 320px; height: min(58vh, 440px); }
  .rate-row { flex-direction: column; }
  .cal-week { min-width: 680px; }
  .planner-layout { gap: 16px; }
  input, select, textarea, button { font-size: 16px; }
  .ss-helper { right: 10px; left: auto; bottom: 10px; }
  .ss-helper-bot,
  .ss-helper .ss-mascot { width: 76px; }
  .ss-helper-bubble { font-size: 0.78rem; max-width: 130px; }
  #note-studio .studio-scroll { padding-bottom: 120px; }
}

body.studio-open { overflow: hidden; }

.studio {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 248px;
  z-index: 60;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}

.studio-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: color-mix(in srgb, #fff 88%, transparent);
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.studio-bar h2 {
  flex: 1 1 120px;
  min-width: 0;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.studio-bar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 1 auto;
}

.note-view-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 28px 12px;
  background: color-mix(in srgb, var(--mint) 55%, #fff);
  border-bottom: 1px solid var(--glass-border);
}
.note-view-tools.hidden { display: none !important; }

.ai-result-card { width: min(640px, calc(100% - 32px)); }
.ai-result-body {
  max-height: min(60vh, 480px);
  overflow: auto;
  line-height: 1.6;
}
.ai-result-body p { margin: 0 0 10px; }

.scan-card { width: min(560px, calc(100% - 32px)); }
.scan-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.scan-thumb {
  width: 92px;
  height: 92px;
  padding: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #ddd;
}
.scan-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notes-subject { margin-bottom: 28px; }
.notes-subject-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.notes-subject-head i {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--card-color, #6e926d) 18%, white);
  color: var(--card-color, #6e926d);
}
.notes-subject-head h2 {
  font-size: 1.15rem;
  font-weight: 800;
  flex: 1;
}
.notes-subject-head .ss-btn { flex-shrink: 0; }
.notes-subject-empty { margin: 0 0 0 44px; }
.note-figure-slot {
  width: 100%;
  pointer-events: none;
}
.note-figure {
  position: relative;
  display: block;
  max-width: 100% !important;
  margin: 18px auto;
  vertical-align: top;
  box-sizing: border-box;
  cursor: grab;
  touch-action: none;
}
.note-figure.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  z-index: 4;
}
.note-figure.is-dragging {
  cursor: grabbing;
  opacity: 0.45;
}
.note-figure-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 1px;
  display: none;
  z-index: 3;
  box-sizing: border-box;
}
.note-figure-handle::after {
  content: "";
  position: absolute;
  inset: -8px;
}
.note-figure.is-selected .note-figure-handle { display: block; }
.note-figure-handle[data-handle="nw"] { top: -6px; left: -6px; cursor: nwse-resize; }
.note-figure-handle[data-handle="ne"] { top: -6px; right: -6px; cursor: nesw-resize; }
.note-figure-handle[data-handle="sw"] { bottom: -6px; left: -6px; cursor: nesw-resize; }
.note-figure-handle[data-handle="se"] { bottom: -6px; right: -6px; cursor: nwse-resize; }
.note-figure-handle[data-handle="n"] { top: -6px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.note-figure-handle[data-handle="s"] { bottom: -6px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.note-figure-handle[data-handle="e"] { right: -6px; top: 50%; margin-top: -5px; cursor: ew-resize; }
.note-figure-handle[data-handle="w"] { left: -6px; top: 50%; margin-top: -5px; cursor: ew-resize; }
#note-studio.is-readonly .note-figure-handle,
#note-studio.is-readonly .note-pic-bar {
  display: none !important;
}
.note-figure img,
.rich-doc img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  border: 1px solid var(--line);
  background: #fff;
  pointer-events: none;
}
.note-figure[data-w] img {
  width: 100%;
}
.note-pic-bar {
  position: fixed;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--peach) 50%, #ccc);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(90, 60, 48, 0.16);
}
.note-pic-bar.hidden { display: none; }
.note-pic-bar button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
}
.note-pic-bar button:hover,
.note-pic-bar button.is-on {
  background: var(--mint);
}
.note-pic-bar .toolbar-sep {
  width: 1px;
  height: 18px;
  background: color-mix(in srgb, var(--peach) 45%, #ddd);
  margin: 0 4px;
}
.note-drop-caret {
  position: fixed;
  z-index: 81;
  width: 2px;
  background: var(--accent);
  pointer-events: none;
}
.note-drop-caret.hidden { display: none; }
.note-figure figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.studio-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 28px 0;
}

.studio-title-row input,
.studio-title-row textarea,
.studio-title-field {
  flex: 1;
  min-width: 180px;
  width: 100%;
  max-width: 100%;
  border: none;
  background: transparent;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1d0938;
  outline: none;
  resize: none;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.25;
  min-height: 1.4em;
  font-family: inherit;
  box-sizing: border-box;
}

.studio-title-row select {
  max-width: 240px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  background: color-mix(in srgb, #fff 78%, transparent);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.rich-toolbar button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #f7fafc;
  color: #4a5568;
  cursor: pointer;
}
.rich-toolbar button.toolbar-wide {
  width: auto;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.rich-toolbar button {
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.22s ease;
}
.rich-toolbar button:hover {
  background: var(--peach);
  color: var(--ink);
  transform: scale(1.02);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--peach) 55%, transparent);
}
.rich-toolbar button:focus {
  outline: none;
  background: #f7fafc;
  color: #4a5568;
}
.rich-toolbar button:focus-visible {
  outline: 2px solid #d6d3d1;
  background: #f7fafc;
  color: #4a5568;
}

.toolbar-sep {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  margin: 0 4px;
}

.hl-dot {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 1px #e2e8f0;
}

.studio-scroll {
  flex: 1;
  overflow: auto;
  padding: 28px;
}
#note-studio .studio-scroll {
  padding-bottom: 140px;
}

.ss-helper {
  position: absolute;
  right: 18px;
  left: auto;
  bottom: 16px;
  z-index: 8;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  cursor: pointer;
  max-width: 200px;
  transition: transform 0.28s ease;
}
.ss-helper:hover {
  transform: translateY(-18px);
}
.ss-helper-bubble {
  background: #fff8f3;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 10px 22px rgba(90, 60, 48, 0.12);
  border: 1px solid color-mix(in srgb, var(--peach) 55%, #fff);
  line-height: 1.25;
  max-width: 150px;
  text-align: left;
  pointer-events: none;
  animation: helper-pop 0.35s ease;
}
.ss-helper-bot,
.ss-helper .ss-mascot {
  width: 96px;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 16px rgba(90, 60, 48, 0.16));
  transform-origin: 50% 100%;
  animation: robot-bob 3.2s ease-in-out infinite;
}
.ss-helper:hover .ss-helper-bot,
.ss-helper:hover .ss-mascot {
  animation-play-state: paused;
}
.ss-helper.is-busy .ss-helper-bot,
.ss-helper.is-busy .ss-mascot {
  animation: robot-think 0.7s ease-in-out infinite;
}
@keyframes robot-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes robot-think {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}
@keyframes helper-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.note-draw-wrap {
  position: relative;
}
.note-ink {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.note-draw-wrap.is-drawing .note-ink {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}
.note-draw-wrap.is-erasing .note-ink {
  cursor: cell;
}
.rich-toolbar button.is-on,
.note-draw-tools button.is-on {
  background: var(--accent);
  color: #fff;
}
.note-draw-tools {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.note-draw-tools.hidden { display: none; }
.draw-swatch {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 1px #e2e8f0;
}
.draw-swatch.is-on {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}
#note-studio.is-readonly .note-draw-tools,
#note-studio.is-readonly #note-draw-toggle {
  display: none;
}

.note-studio-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}
.note-side {
  width: min(380px, 42vw);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--glass-strong);
  border-left: 1px solid var(--glass-border);
}
.note-side-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.note-side-head h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}
.note-side-head p {
  margin: 6px 0 0;
  font-size: 0.85rem;
}
.note-side-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
  line-height: 1.6;
}
.note-side-body h3 { font-size: 0.95rem; margin: 0 0 8px; }
.note-side-body p,
.note-side-body ul,
.note-side-body ol { margin: 0 0 10px; }
.note-chat-msg {
  padding: 10px 12px;
  border-radius: 14px;
  margin-bottom: 10px;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.note-chat-msg.assistant {
  background: var(--mint);
  color: var(--ink);
}
.note-chat-msg.assistant p { margin: 0 0 8px; }
.note-chat-msg.assistant p:last-child { margin-bottom: 0; }
.note-chat-msg.assistant ul,
.note-chat-msg.assistant ol { margin: 0 0 8px; padding-left: 1.2em; }
.note-chat-msg.assistant.muted {
  color: var(--muted);
  font-style: italic;
}
.note-chat-msg.user {
  background: var(--peach);
  color: var(--ink);
  margin-left: 18px;
}
.note-side-chat {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.note-side-chat input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
}

.rich-doc {
  position: relative;
  min-height: calc(100vh - 220px);
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  padding: 40px 48px;
  outline: none;
  font-size: 1.08rem;
  line-height: 1.75;
  color: #2d3748;
  box-shadow: 0 10px 30px rgba(29, 9, 56, 0.06);
  overflow: visible;
}

.note-added {
  margin: 22px 0 12px;
  padding: 16px 18px 10px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--mint) 42%, #fff);
  border-radius: 0 16px 16px 0;
}
.note-added h2,
.note-added h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.note-added p {
  margin: 0 0 10px;
  line-height: 1.6;
}
.note-added ul,
.note-added ol {
  margin: 0 0 10px;
  padding-left: 1.25em;
}
.note-added li {
  margin: 0 0 6px;
  line-height: 1.5;
}
.note-added li:last-child { margin-bottom: 0; }

.rich-doc.is-empty::before,
.rich-mini.is-empty::before {
  content: attr(data-placeholder);
  color: #a0aec0;
  pointer-events: none;
}

.rich-doc h2 { font-size: 1.45rem; margin: 0.8em 0 0.4em; color: #1d0938; }
.note-table-box {
  position: relative;
  margin: 12px 0 18px;
}
.note-table-delete {
  position: absolute;
  top: -12px;
  right: -4px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(44, 44, 50, 0.82);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}
.note-table-box:hover .note-table-delete,
.note-table-box:focus-within .note-table-delete {
  opacity: 1;
  pointer-events: auto;
}
.note-table-delete:hover { background: #9f1239; }
#note-studio.is-readonly .note-table-delete { display: none; }
.rich-doc table.note-table,
.rich-mini table.note-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  table-layout: fixed;
  overflow-wrap: anywhere;
}
.rich-doc table.note-table th,
.rich-doc table.note-table td,
.rich-mini table.note-table th,
.rich-mini table.note-table td {
  border: 1px solid color-mix(in srgb, var(--peach) 45%, #ccc);
  padding: 8px 10px;
  min-width: 48px;
  vertical-align: top;
}
.rich-doc table.note-table th {
  background: color-mix(in srgb, var(--peach) 28%, #fff);
  font-weight: 800;
  text-align: left;
}
.rich-doc ul, .rich-doc ol, .rich-mini ul, .rich-mini ol,
.flash-card-html ul, .flash-card-html ol { padding-left: 1.3em; margin: 0.4em 0; }
.rich-doc blockquote, .rich-mini blockquote {
  margin: 0.6em 0;
  padding: 8px 14px;
  border-left: 4px solid var(--accent);
  background: var(--mint);
  color: #1c2347;
}

.rich-doc mark, .rich-mini mark,
.rich-doc [style*="background"], .rich-mini [style*="background"] {
  border-radius: 3px;
  padding: 0 2px;
}

.set-help { max-width: 960px; margin: 0 auto 16px; }
#set-cards {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.set-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 16px 18px;
  box-shadow: var(--shadow);
}

.set-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.set-card-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.set-side label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #718096;
  margin-bottom: 8px;
}
.set-side .face-chip { position: static; }

.rich-mini {
  position: relative;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  background: #ffffff;
  line-height: 1.55;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.05rem;
}
.set-side:last-child .rich-mini {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.98rem;
  background: #ffffff;
}

.add-card-btn {
  display: flex;
  margin: 18px auto 40px;
}

.flash-card {
  width: 100%;
  min-height: 420px;
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}

.planner-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 20px;
}

.planner-side h3 { font-size: 1rem; margin-bottom: 8px; }

.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cal-nav h2 { flex: 1; font-size: 1.1rem; }

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6b6580;
}

.cal-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 99px;
  margin-right: 6px;
}

.cal-legend .school { background: #334155; }
.cal-legend .event { background: #2563eb; }
.cal-legend .homework { background: #ea580c; }
.cal-legend .revision { background: #7c3aed; }
.cal-legend .consolidation { background: #0d9488; }
.cal-legend .planned { background: #fff; box-shadow: inset 0 0 0 2px #7c3aed; }
.cal-legend .todo { background: #4f46e5; }

.cal-week {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(0, 1fr));
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 14px;
  overflow: auto;
  box-shadow: var(--shadow);
}

.cal-day-head {
  min-height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
}

.cal-day-chips {
  min-height: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.cal-chip {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 3px 6px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-chip.exam { background: #dc2626; }
.cal-chip.homework { background: #ea580c; }
.cal-chip.consolidation { background: #0d9488; }
.cal-chip.todo { background: #4f46e5; }

.cal-day.is-today .cal-day-head {
  color: var(--accent);
  font-weight: 800;
}
.cal-day.is-today .cal-day-body {
  background: rgba(28, 25, 23, 0.04);
}
.cal-day-body {
  position: relative;
  border-top: 1px solid var(--mint);
  cursor: crosshair;
}

.cal-hour,
.cal-line {
  height: 52px;
  border-bottom: 1px solid #f3eefc;
  font-size: 0.7rem;
  color: #a097b3;
}

.cal-hour { padding-top: 2px; }

.cal-sleep {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(-45deg, rgba(29, 9, 56, 0.04), rgba(29, 9, 56, 0.04) 6px, transparent 6px, transparent 12px);
  pointer-events: none;
}

.cal-event {
  position: absolute;
  left: 4px;
  right: 4px;
  border: none;
  border-radius: 10px;
  padding: 6px 8px;
  text-align: left;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 14px rgba(29, 9, 56, 0.12);
}

.cal-event strong { display: block; font-size: 0.75rem; }
.cal-event span { font-size: 0.68rem; opacity: 0.9; }

.cal-event.school { background: #334155; }
.cal-event.event { background: #2563eb; }
.cal-event.homework { background: #ea580c; }
.cal-event.revision { background: #7c3aed; }
.cal-event.consolidation { background: #0d9488; }
.cal-event.exam { background: #dc2626; }
.cal-event.todo { background: #4f46e5; }
.cal-event.planned {
  background: rgba(124, 58, 237, 0.14);
  color: #4c1d95;
  box-shadow: inset 0 0 0 1.5px #7c3aed;
}
.cal-event.planned.homework { background: rgba(234, 88, 12, 0.14); color: #9a3412; box-shadow: inset 0 0 0 1.5px #ea580c; }
.cal-event.planned.consolidation { background: rgba(13, 148, 136, 0.14); color: #115e59; box-shadow: inset 0 0 0 1.5px #0d9488; }
.cal-event.planned.todo { background: rgba(79, 70, 229, 0.14); color: #3730a3; box-shadow: inset 0 0 0 1.5px #4f46e5; }
.cal-event.is-done { opacity: 0.45; text-decoration: line-through; }

.cal-event-x {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.7rem;
  opacity: 0.8;
}

@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .home-dash { grid-template-columns: 1fr 1fr minmax(180px, 0.8fr); }
  .overview-panel { grid-column: 1 / -1; }
}

@media (max-width: 1100px) {
  .planner-layout { grid-template-columns: 1fr; }
  .planner-side { position: static; }
  .insight-grid { grid-template-columns: repeat(2, 1fr); }
}

.school-scroll { max-width: 820px; margin: 0 auto; width: 100%; }

.school-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.school-tabs { display: flex; flex-wrap: wrap; gap: 6px; }

.school-tab {
  border: none;
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  color: #6b6580;
  cursor: pointer;
}

.school-tab.active {
  background: linear-gradient(180deg, var(--accent), var(--accent));
  color: #fff;
  box-shadow: none;
}

.school-day-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.school-lesson {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(81, 24, 133, 0.08);
}

.school-lesson label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b6580;
}

.school-lesson input,
.school-lesson select {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  width: 100%;
  color: #1e1630;
}

.suggest-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.suggest-row input[type="datetime-local"] {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}

.ss-field-check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.ss-field-check input { width: 18px; height: 18px; }

.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.quiz-take-board {
  width: min(720px, 100%);
  margin: 0 auto;
}
.quiz-take h3 {
  font-size: 1.25rem;
  margin: 8px 0 16px;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.18s ease;
}
.quiz-option span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}
.quiz-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.quiz-option:hover { transform: scale(1.01); }
.quiz-match {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.quiz-match-pairs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-match-pool-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.quiz-match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  align-items: stretch;
  gap: 4px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid transparent;
}
.quiz-match-row.is-linked {
  background: color-mix(in srgb, var(--mint) 58%, #fff);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--glass-border));
}
.quiz-match-row.is-picked,
.quiz-match.is-placing .quiz-match-row:not(.is-linked) {
  background: color-mix(in srgb, var(--peach) 40%, #fff);
  border-color: color-mix(in srgb, var(--peach) 55%, var(--line));
}
.quiz-match-row.is-ok {
  background: color-mix(in srgb, var(--mint) 80%, #fff);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--glass-border));
}
.quiz-match-row.is-bad {
  background: #fff1f2;
  border-color: #fecdd3;
}
.quiz-match-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.quiz-match-link::before {
  content: "";
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--line);
}
.quiz-match-link::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--line);
}
.quiz-match-row.is-linked .quiz-match-link::before {
  background: var(--accent);
}
.quiz-match-row.is-linked .quiz-match-link::after {
  border-color: var(--accent);
  background: var(--mint);
}
.quiz-match-item {
  text-align: left;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.quiz-match-item.selected,
.quiz-match-item.linked {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--mint) 70%, #fff);
}
.quiz-match-item.def {
  animation: ss-match-in 0.28s ease;
}
.quiz-match-slot {
  text-align: center;
  border: 2px dashed color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, #fff 72%, transparent);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  min-height: 44px;
}
.quiz-match-row.is-picked .quiz-match-slot,
.quiz-match.is-placing .quiz-match-slot {
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--mint) 45%, #fff);
}
.quiz-match-pool-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quiz-match-item.pool,
.quiz-match-item.def {
  cursor: grab;
  width: auto;
  max-width: 100%;
}
.quiz-match-item.def { width: 100%; }
.quiz-match-item.is-dragging {
  opacity: 0.4;
}
.quiz-match-row.is-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--mint) 50%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.quiz-match-pool.is-over {
  border-radius: 16px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
@keyframes ss-match-in {
  from { transform: translateX(12px) scale(0.96); opacity: 0.35; }
  to { transform: none; opacity: 1; }
}
.quiz-diagram {
  margin: 0 0 16px;
}
.quiz-diagram img {
  max-width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.quiz-label-fields { display: grid; gap: 10px; }
.quiz-feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
}
.quiz-feedback.ok { background: color-mix(in srgb, var(--mint) 80%, #fff); }
.quiz-feedback.mid { background: color-mix(in srgb, var(--peach) 55%, #fff); }
.quiz-feedback.bad { background: #fff1f2; }
.quiz-feedback p { margin: 6px 0 0; }
.quiz-results-score {
  text-align: center;
  padding: 18px 12px 8px;
}
.quiz-results-score h3 {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
}
.quiz-results-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 18px;
}
.end-done-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 24px 0 8px;
}
.essay-history {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.essay-draft-card h3 { margin-bottom: 10px; }
.essay-locked,
#essay-text.is-locked {
  white-space: pre-wrap;
  line-height: 1.55;
  background: #f7f8fc;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--ink);
}
#essay-text.is-locked { resize: none; }
.quiz-result-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.quiz-result-row.ok { border-color: color-mix(in srgb, var(--accent) 35%, var(--glass-border)); }
.quiz-result-row.bad { border-color: #fecdd3; }
.quiz-result-marks {
  font-weight: 800;
  font-size: 1.05rem;
  padding-top: 2px;
}
.quiz-revision {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px 18px;
  line-height: 1.55;
}
.quiz-revision h3 { margin: 0 0 8px; font-size: 1rem; }
.quiz-revision ul { margin: 0; padding-left: 1.2em; }
#questions-list .text-open { text-align: left; }
.ss-row-card .kind-pill { display: inline-block; margin: 0 8px 6px 0; }

@media (max-width: 700px) {
  .quiz-match-row {
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
    gap: 2px;
    padding: 4px;
  }
  .quiz-match-item,
  .quiz-match-slot { padding: 8px 10px; font-size: 0.9rem; }
}

@media (max-width: 800px) {
  .school-lesson { grid-template-columns: 1fr 1fr; }
}

.deadline-row .text-open {
  gap: 6px;
}

.kind-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--mint);
  color: var(--accent);
}

.kind-pill.exam { background: #fee2e2; color: #b91c1c; }
.kind-pill.homework { background: #ffedd5; color: #c2410c; }
.kind-pill.consolidation { background: #ccfbf1; color: #0f766e; }
.kind-pill.todo { background: #dbeafe; color: #1d4ed8; }

.todo-lead { max-width: 62ch; margin: -8px 0 22px; }
.todo-composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--glass-shadow);
}
.todo-composer #todo-title,
.todo-title-input {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  outline: none;
  padding: 0;
}
.todo-composer-meta,
.todo-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
}
.todo-composer-meta label,
.todo-inline-meta label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.todo-composer-meta input,
.todo-composer-meta select,
.todo-inline-meta input {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, #fff 82%, transparent);
  border-radius: 10px;
  padding: 8px 10px;
}
.todo-mins-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.todo-mins-wrap input { width: 88px; }
.todo-mins-wrap span {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}
.todo-fields { flex: 1; min-width: 0; }
.todo-done-wrap { margin-top: 32px; }
.todo-card {
  align-items: flex-start;
  flex-wrap: nowrap;
}
.todo-check {
  display: grid;
  place-items: center;
  padding-top: 4px;
  cursor: pointer;
}
.todo-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.todo-body { flex: 1; min-width: 0; }
.todo-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.todo-notes { margin: 8px 0 0; color: var(--muted); }
.todo-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.todo-slot {
  text-align: left;
  border: 1px dashed var(--glass-border);
  background: color-mix(in srgb, var(--mint) 55%, #fff);
  color: var(--ink);
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.todo-card.is-soon { border-color: color-mix(in srgb, var(--peach) 70%, var(--glass-border)); }
.todo-card.is-late { border-color: #fecdd3; }
.todo-card.is-done { opacity: 0.7; }
.cal-legend .dot.todo { background: #4f46e5; }

.ss-row-card {
  transition: transform 0.2s ease, box-shadow 0.22s ease;
}

.ss-row-card:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 12%, transparent);
}

.create-option:hover {
  transform: translateY(-2px);
}

.rich-doc {
  box-shadow: 0 18px 50px rgba(29, 9, 56, 0.08);
}

.cal-nav h2 { letter-spacing: -0.02em; }

.page-header h1 { color: #1a122c; }

.ss-modal-card h3 {
  letter-spacing: -0.02em;
}

.avatar {
  transition: transform 0.15s ease;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.avatar:hover { transform: scale(1.04); }
.avatar.has-photo {
  color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.avatar.has-photo > i { display: none; }

.profile-avatar {
  position: relative;
  overflow: visible;
  border: none;
  cursor: pointer;
}
.profile-photo-hint { font-size: 0.8rem; margin-top: 4px; }
.avatar-camera {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  border: 2px solid #fff;
  box-shadow: none;
}

.saved-cards-panel { margin-top: 36px; }
.quiz-score-panel {
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 18px 20px 10px;
  margin: 0 0 22px;
  box-shadow: 0 12px 28px rgba(16, 22, 58, 0.06);
}
.quiz-score-chart {
  width: 100%;
  min-height: 72px;
}
.quiz-score-chart svg {
  display: block;
  width: 100%;
  height: auto;
}
.quiz-past-panel {
  margin-top: 0;
  margin-bottom: 28px;
}

.deck-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px 18px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 196px;
}
.deck-card::after { display: none; }
.deck-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.deck-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(28, 35, 71, 0.1); }
.deck-card h3 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
}
.deck-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.deck-count {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--mint);
  border-radius: 999px;
  padding: 4px 10px;
}
.deck-card .ss-card-actions { margin-top: auto; position: relative; z-index: 1; }

.starred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.starred-grid > .ss-muted { grid-column: 1 / -1; }
.starred-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 16px 16px;
  min-height: 140px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.starred-card strong {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
}
.starred-card .ss-icon-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #d97706;
  background: #fffbeb;
}

.deck-row { align-items: center; }
.deck-row .tool-icon { width: 40px; height: 40px; font-size: 0.95rem; flex-shrink: 0; }

.study-studio {
  background: var(--cream);
}
.study-studio .studio-bar {
  background: rgba(255,255,255,0.82);
}
.study-studio-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 28px;
}
.study-studio-scroll > .study-board,
.study-studio-scroll > .study-controls,
.study-studio-scroll > .study-hint,
.study-studio-scroll > .study-progress {
  width: min(680px, 100%);
}
.study-progress {
  width: min(680px, 100%);
  height: 8px;
  background: rgba(16, 22, 58, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 18px;
}
.study-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.25s ease;
}
.study-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.flash-stack {
  position: relative;
  width: 100%;
  height: clamp(400px, 52vh, 520px);
  min-height: 400px;
  margin-bottom: 12px;
}
.flash-layer {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 12px;
  height: calc(100% - 12px);
  border-radius: 28px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(28, 35, 71, 0.06);
  transition: opacity 0.3s ease;
}
.flash-layer.l2 { top: 22px; left: 28px; right: 28px; opacity: 0.45; }
.flash-layer.l1 { opacity: 0.75; }
.flash-stack.is-flipped .flash-layer { opacity: 0; }
.flash-flip-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: inherit;
  perspective: 1400px;
}
.flash-flip {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: inherit;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
}
.flash-flip.is-flipped { transform: rotateY(180deg); }
.flash-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 28px;
  padding: 56px 32px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 28px 60px rgba(16, 22, 58, 0.16);
  overflow: auto;
}
.flash-face.back {
  transform: rotateY(180deg);
  background: #ffffff;
}
.face-chip {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--accent);
}
.face-chip.answer {
  background: var(--mint);
  color: var(--accent);
}
.flip-cue {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #9aa0b5;
}
.flash-card-html {
  width: 100%;
  text-align: center;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}
.flash-face.back .flash-card-html {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.18rem;
  font-weight: 500;
}
.star-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: rgba(255,255,255,0.94);
  color: #5c6170;
  box-shadow: 0 8px 18px rgba(16, 22, 58, 0.12);
  cursor: pointer;
  font-size: 1.05rem;
}
.star-btn.on { color: #f59e0b; background: #fffbeb; }
.study-hint { margin-top: 8px; text-align: center; }
.rate-row {
  display: flex;
  gap: 12px;
  width: 100%;
}
.rate-btn {
  flex: 1;
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.rate-btn {
  transition: transform 0.2s ease, box-shadow 0.22s ease, background 0.2s ease;
}
.rate-btn.again { background: #fff1f2; color: #e11d48; }
.rate-btn.again:hover {
  background: #ffe4e6;
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.18);
}
.rate-btn.good { background: var(--mint); color: var(--accent); }
.rate-btn.good:hover {
  background: #d7e6da;
  transform: scale(1.02);
  box-shadow: var(--glow);
}
.study-complete {
  text-align: center;
  max-width: 420px;
  background: #fff;
  border-radius: 28px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
}
.study-complete-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: #dcfce7;
  color: #16a34a;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
}
.study-complete h3 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.study-complete-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 560px) {
  .tools-grid { gap: 10px; }
  .tool-card { padding: 18px 12px 16px; border-radius: 18px; }
  .auth-card { margin: 12px; padding: 24px 18px; }
  .nav-item span { font-size: 0.78rem; }
}

.theme-card-wrap { margin-top: 18px; }
.theme-card-wrap h3 { margin-bottom: 4px; }

.avatar:hover { transform: scale(1.02); }
.plan-add {
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.22s ease;
}
.plan-add:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 12%, transparent);
}

.search-bar,
.tool-card,
.dash-panel,
.banner,
.ss-card,
.library-card,
.deck-card,
.ss-modal-card,
.auth-card,
.studio-bar,
.rich-toolbar,
.note-pop-card {
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow);
}



.ss-btn,
.add-task-btn,
.banner-btn {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 10px 22px color-mix(in srgb, var(--btn) 22%, transparent);
}
.ss-btn.ghost {
  background: color-mix(in srgb, var(--ghost-bg) 78%, transparent);
  border: 1px solid color-mix(in srgb, #fff 55%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.studio {
  background: var(--cream);
}

.rich-doc {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.98));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 28%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar,
  .tool-card,
  .dash-panel,
  .banner,
  .welcome-banner,
  .search-bar,
  .ss-card,
  .ss-row-card,
  .library-card,
  .ss-modal-card,
  .note-side,
  .auth-card,
  .task-card {
    background: var(--card);
  }
}

.tool-card,
.ss-card,
.library-card,
.deck-card,
.dash-panel,
.task-card,
.continue-card,
.banner,
.ss-row-card {
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 28px rgba(16, 22, 58, 0.06);
}
.tool-card:hover,
.ss-card:hover,
.library-card:hover,
.deck-card:hover,
.task-card:hover,
.continue-card:hover {
  box-shadow: 0 18px 36px rgba(16, 22, 58, 0.1);
}
.page-header h1 {
  letter-spacing: -0.04em;
}
.ss-modal-card {
  border: 2px solid color-mix(in srgb, var(--peach) 50%, #fff);
}
.ss-toast {
  border: 2px solid color-mix(in srgb, var(--peach) 55%, #fff);
}

.sidebar-helper {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 8px 0 0;
}
.sidebar-mascot {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  transition: transform 0.28s ease;
}
.sidebar-mascot:hover {
  transform: translateY(-10px);
}
.sidebar-mascot .ss-mascot {
  width: 122px;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.28));
  animation: robot-bob 3.2s ease-in-out infinite;
}
.sidebar-mascot:hover .ss-mascot {
  animation-play-state: paused;
}
.sidebar-bubble {
  position: relative;
  background: #fff;
  color: #1a2340;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 16px;
  border: 0;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.sidebar-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 0;
  transform: translateX(-50%) rotate(45deg);
}
.ask-pop {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
}
.ask-pop.hidden { display: none; }
.ask-pop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 51, 48, 0.28);
}
.ask-pop .ask-box { z-index: 1; }
.ask-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100% - 32px));
  min-width: 0;
  height: min(640px, 86vh);
  overflow: hidden;
  background: #fffdfb;
  border: 2px solid color-mix(in srgb, var(--ink) 82%, var(--peach));
  border-radius: 28px;
  padding: 0;
  box-shadow: 0 18px 40px rgba(90, 60, 48, 0.18);
}
.ask-box.is-embedded {
  width: 100%;
  height: 100%;
  min-height: 420px;
  box-shadow: none;
}
.ask-box-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 16px 8px;
  flex-shrink: 0;
  position: relative;
}
.ss-mascot {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.ask-box-head .ss-mascot,
.ask-box-mascot .ss-mascot {
  width: 72px;
  height: auto;
  display: block;
}
.ask-box-head {
  cursor: text;
}
.ask-box-mascot {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: text;
  flex-shrink: 0;
}
.ask-box-bubble {
  position: relative;
  align-self: center;
  background: #fff8f3;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 18px;
  border: 2px solid color-mix(in srgb, var(--ink) 78%, var(--peach));
  line-height: 1.2;
  white-space: nowrap;
}
.ask-box-bubble::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #fff8f3;
  border-left: 2px solid color-mix(in srgb, var(--ink) 78%, var(--peach));
  border-bottom: 2px solid color-mix(in srgb, var(--ink) 78%, var(--peach));
  transform: translateY(-50%) rotate(45deg);
}
.ask-box-close {
  position: absolute;
  top: 10px;
  right: 10px;
}
.ask-box-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 16px 12px;
}
.ask-box-body .note-chat-msg { margin-bottom: 0; }
.ask-box-form,
.home-ask-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  min-width: 0;
  flex-shrink: 0;
  padding: 10px 14px 16px;
  margin: 0;
  border: 0;
}
.ask-box-form input,
.ask-box-form textarea,
.ask-grow,
.home-ask-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  border: 2px solid color-mix(in srgb, var(--ink) 78%, var(--peach));
  border-radius: 14px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  background: #fff;
  resize: none;
  overflow-x: hidden;
  overflow-y: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-height: 40px;
  max-height: 168px;
  box-sizing: border-box;
}
.ask-send {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--ink) 78%, var(--peach));
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
}
.ask-send:hover { background: var(--mint); }
.ask-send:disabled { opacity: 0.55; cursor: not-allowed; }
.ask-box.is-busy .ask-bot {
  animation: robot-think 0.7s ease-in-out infinite;
}
.home-help {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.home-help-bot { width: 120px; height: auto; }
.home-tools { grid-template-columns: repeat(3, 1fr); }
button.tool-card {
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: inherit;
}
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}
.list-toolbar .search-bar { width: min(360px, 100%); margin: 0; }
.list-toolbar select {
  border: 2px solid color-mix(in srgb, var(--peach) 45%, #fff);
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
}
.create-menu { position: relative; }
.create-menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--peach) 45%, #fff);
  border-radius: 18px;
  min-width: 200px;
  z-index: 8;
  box-shadow: 0 12px 28px rgba(90, 60, 48, 0.12);
  overflow: hidden;
}
.create-menu-pop button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
}
.create-menu-pop button:hover { background: var(--mint); }
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.lib-card {
  position: relative;
  border-radius: 24px;
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--peach) 40%, #fff);
  min-height: 180px;
  overflow: hidden;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--peach) 28%, transparent);
}
.lib-card-main {
  width: 100%;
  min-height: 168px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 18px 44px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  min-width: 0;
}
.lib-card-main strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.lib-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--card-color, var(--accent)) 18%, #fff);
  color: var(--card-color, var(--accent));
}
.lib-card-meta { font-size: 0.78rem; color: var(--muted); margin-top: auto; }
.lib-card-desc {
  font-size: 0.84rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
}
.lib-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border: 1.5px solid color-mix(in srgb, var(--card-color, var(--peach)) 55%, #fff);
  background: color-mix(in srgb, var(--card-color, var(--peach)) 16%, #fff);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.studio-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  min-height: 28px;
}
.studio-chips .lib-chip { font-size: 0.78rem; padding: 4px 12px; }
button.studio-place-chip {
  font-family: inherit;
  cursor: pointer;
}
button.studio-place-chip.is-empty {
  border-style: dashed;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
}
.studio-chips.is-readonly button.studio-place-chip { cursor: default; }
.lib-card.is-pinned {
  box-shadow:
    0 8px 0 color-mix(in srgb, var(--peach) 28%, transparent),
    0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
.list-search { width: 100%; margin: 0 0 16px; }
.filter-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.filter-field span { color: var(--muted); font-size: 0.92rem; }
.field-label { font-weight: 800; margin: 8px 0 6px; }
.studio-meta { padding: 0 28px 8px; }
#note-studio.is-readonly #note-studio-title,
#set-studio.is-readonly #set-studio-title {
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1.7rem;
  font-weight: 800;
  padding-left: 0;
  cursor: default;
}
.study-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 0 8px;
}
.study-nav .ss-icon-btn {
  width: 42px;
  height: 42px;
}
.essay-timer {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
#test-topic:disabled,
#test-set:disabled { opacity: 0.55; }
.lib-card-more {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}
.lib-card-menu {
  position: absolute;
  right: 0;
  top: 36px;
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--peach) 45%, #fff);
  border-radius: 14px;
  min-width: 140px;
  box-shadow: 0 10px 22px rgba(90, 60, 48, 0.12);
  overflow: hidden;
}
.lib-card-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}
.lib-card-menu button:hover { background: var(--mint); }
.studio-body {
  display: flex;
  flex: 1;
  min-height: 0;
}
.studio-body .studio-scroll { flex: 1; }
.note-rail {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 12px;
  border-left: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--peach) 18%, #fff);
  min-height: 0;
}
.note-rail .ss-helper {
  position: static;
  transform: none;
}
.note-rail .ss-helper:hover { transform: translateY(-18px); }
#essay-work .studio-body,
#oral-review .studio-body {
  min-height: calc(100vh - 140px);
}
.create-test-form { max-width: 520px; }
.oral-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0 40px;
}
.oral-bot { width: 180px; height: auto; }
.oral-stage .home-ask-form {
  padding: 0;
  max-width: 640px;
  width: 100%;
}
.oral-mic {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--ink) 78%, var(--peach));
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.oral-mic:hover { background: var(--mint); }
.oral-mic.is-on {
  background: #e11d48;
  color: #fff;
  border-color: #e11d48;
  animation: oral-mic-pulse 1.1s ease-in-out infinite;
}
@keyframes oral-mic-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.35); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(225, 29, 72, 0); }
}
.oral-prompt {
  max-width: 640px;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
}
@media (max-width: 900px) {
  .studio { left: 0; }
  .home-tools { grid-template-columns: 1fr; }
  .home-dash { grid-template-columns: 1fr; }
  .studio-body { flex-direction: column; }
  .note-rail { width: 100%; border-left: 0; border-top: 1px solid var(--glass-border); }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-match-item.def { animation: none; }
  .nav-item:hover,
  .tool-card:hover,
  .ss-btn:hover,
  .ss-btn:disabled,
  .add-task-btn:hover,
  .banner-btn:hover,
  .library-card:hover,
  .continue-card:hover,
  .overview-tile:hover,
  .task-card:hover,
  .ss-row-card:hover,
  .rate-btn:hover,
  .plan-add:hover,
  .icon-chip:hover,
  .avatar:hover,
  .rich-toolbar button:hover,
  .ss-icon-btn:hover {
    transform: none;
  }
}

.page-home .top-bar .search-bar {
  max-width: none;
}
.page-home .avatar {
  background-color: var(--accent);
}

.tool-card.tool-subjects {
  background: linear-gradient(180deg, #f3fbf6 0%, #e8f6ee 100%);
}
.tool-icon.subjects { background: #e7f6ee; color: #2f9e6b; }
.tool-card.tool-notes {
  background: linear-gradient(180deg, #f7f9ff 0%, #eef4ff 100%);
}
.tool-card.tool-cards {
  background: linear-gradient(180deg, #f8f5ff 0%, #f3eeff 100%);
}
.tool-card.tool-quiz {
  background: linear-gradient(180deg, #fffaf5 0%, #fff3ea 100%);
}
.home-tools .tool-card {
  min-height: 176px;
  border-radius: 24px;
}
.home-tools .tool-go {
  background: transparent;
  color: #9aa3b8;
  width: auto;
  height: auto;
}

.dash-panel {
  background: #fff;
  border-radius: 24px;
}
.continue-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(16, 22, 58, 0.04);
}
.home-insights .stat-row {
  background: #f7f8fc;
  border: 0;
  border-radius: 16px;
  box-shadow: none;
}

.ask-box {
  background: #fff;
  border: 1px solid rgba(16, 22, 58, 0.1);
  box-shadow: 0 24px 60px rgba(16, 22, 58, 0.22);
}
.ask-box-bubble {
  background: #fff;
  border: 1px solid rgba(16, 22, 58, 0.12);
  color: #1a2340;
}
.ask-box-bubble::after {
  background: #fff;
  border-left: 1px solid rgba(16, 22, 58, 0.12);
  border-bottom: 1px solid rgba(16, 22, 58, 0.12);
}
.ask-box-form input,
.ask-box-form textarea,
.ask-grow,
.home-ask-form textarea {
  border: 1px solid rgba(16, 22, 58, 0.14);
}
.ask-send {
  border: 1px solid rgba(16, 22, 58, 0.14);
  background: var(--accent);
  color: #fff;
}
.ss-helper-bubble {
  background: #fff;
  border: 0;
  box-shadow: 0 10px 22px rgba(16, 22, 58, 0.12);
}

.brand-mark .ss-mascot {
  width: 40px;
  height: 40px;
}
.auth-hero .brand-mark .ss-mascot {
  width: 56px;
  height: 56px;
}

@media (max-width: 900px) {
  .welcome-art { object-position: 72% center; }
  .page-home .top-bar .search-bar { width: 100%; }
  .sidebar-helper {
    flex-direction: row;
    justify-content: flex-start;
    margin-top: 8px;
    padding: 6px 8px 4px;
  }
  .sidebar-mascot {
    flex-direction: row-reverse;
    gap: 8px;
  }
  .sidebar-mascot .ss-mascot { width: 58px; }
  .sidebar-mascot:hover { transform: none; }
  .sidebar-bubble { font-size: 0.72rem; padding: 6px 10px; }
}