/* ============================================================
   ACADEMIC DASHBOARD v2 — stylesheet
   ------------------------------------------------------------
   Single stylesheet for the v2 prototype. Completely isolated
   from the original app's CSS: every selector lives under the
   .v2 namespace or a v2- prefixed class, and no variable names
   are shared with css/base.css.

   Design direction (deliberately different from v1's dark amber):
     · Slate/ink base with a violet→cyan accent ramp
     · Light and dark themes, switchable, remembered
     · One rail + one content column, generous whitespace
     · Type scale driven by a single --v2-fs step
   ============================================================ */

/* ------------------------------------------------------------
   TOKENS
------------------------------------------------------------ */

.v2,
.v2-root {
  /* Accent ramp */
  --v2-accent: #6d5efc;
  --v2-accent-soft: #8b7dff;
  --v2-accent-ink: #ffffff;
  --v2-cyan: #18b8d4;
  --v2-mint: #12b886;
  --v2-amber: #e8a33d;
  --v2-rose: #e5484d;
  --v2-violet: #8b5cf6;

  /* Radii */
  --v2-r-xs: 6px;
  --v2-r-sm: 9px;
  --v2-r-md: 13px;
  --v2-r-lg: 18px;
  --v2-r-xl: 26px;
  --v2-r-full: 999px;

  /* Motion */
  --v2-t-fast: 130ms cubic-bezier(0.32, 0.72, 0, 1);
  --v2-t: 220ms cubic-bezier(0.32, 0.72, 0, 1);
  --v2-t-spring: 420ms cubic-bezier(0.22, 1.2, 0.36, 1);

  /* Layout */
  --v2-rail: 252px;
  --v2-rail-collapsed: 68px;
  --v2-max: 1360px;
}

/* --- dark (default) --- */

.v2-root {
  --v2-bg: #0a0c12;
  --v2-bg-2: #0e111a;
  --v2-surface: #141824;
  --v2-surface-2: #1a1f2e;
  --v2-surface-3: #222839;
  --v2-line: rgba(255, 255, 255, 0.075);
  --v2-line-2: rgba(255, 255, 255, 0.14);

  --v2-text: #eef1f8;
  --v2-text-2: #a8b0c4;
  --v2-text-3: #6b7489;

  --v2-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.32);
  --v2-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
  --v2-shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.55);

  --v2-glow: radial-gradient(120% 90% at 18% 0%,
      rgba(109, 94, 252, 0.16),
      transparent 62%);
}

/* --- light --- */

.v2-root[data-v2-theme="light"] {
  --v2-bg: #f6f7fb;
  --v2-bg-2: #eef0f7;
  --v2-surface: #ffffff;
  --v2-surface-2: #f4f5fa;
  --v2-surface-3: #e9ebf3;
  --v2-line: rgba(16, 20, 38, 0.09);
  --v2-line-2: rgba(16, 20, 38, 0.17);

  --v2-text: #131728;
  --v2-text-2: #4e566e;
  --v2-text-3: #8890a6;

  --v2-shadow-sm: 0 2px 6px rgba(16, 20, 38, 0.06);
  --v2-shadow: 0 12px 32px rgba(16, 20, 38, 0.1);
  --v2-shadow-lg: 0 26px 60px rgba(16, 20, 38, 0.16);

  --v2-glow: radial-gradient(120% 90% at 18% 0%,
      rgba(109, 94, 252, 0.09),
      transparent 62%);
}

/* ------------------------------------------------------------
   RESET / BASE
------------------------------------------------------------ */

.v2-root *,
.v2-root *::before,
.v2-root *::after {
  box-sizing: border-box;
}

html.v2-html,
body.v2-body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.v2-body {
  background: var(--v2-bg);
  background-image: var(--v2-glow);
  background-attachment: fixed;

  color: var(--v2-text);

  font-family:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;

  transition: background-color var(--v2-t), color var(--v2-t);
}

.v2-root button,
.v2-root input,
.v2-root select,
.v2-root textarea {
  font: inherit;
  color: inherit;
}

.v2-root h1,
.v2-root h2,
.v2-root h3,
.v2-root h4,
.v2-root p {
  margin: 0;
}

/* :not(.v2-btn) matters: this rule (0,1,1) used to out-rank
   .v2-btn-primary (0,1,0) on <a class="v2-btn ..."> elements, which
   turned the white label of "Open link" / "Open PDF" a dull lavender. */
.v2-root a:not(.v2-btn) {
  color: var(--v2-accent-soft);
  text-decoration: none;
}

/* Links auto-detected inside email bodies and notes. */
.v2-root a.v2-link {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--v2-accent-soft) 45%, transparent);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.v2-root a.v2-link:hover {
  color: var(--v2-text);
  text-decoration-color: currentColor;
}

.v2-hidden {
  display: none !important;
}

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

.v2-root ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.v2-root ::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: var(--v2-r-full);
  background-clip: content-box;
  background-color: var(--v2-line-2);
}

.v2-root ::-webkit-scrollbar-track {
  background: transparent;
}

/* ------------------------------------------------------------
   APP SHELL
------------------------------------------------------------ */

.v2-shell {
  display: grid;
  grid-template-columns: var(--v2-rail) minmax(0, 1fr);

  min-height: 100vh;
}

.v2-shell[data-collapsed="true"] {
  grid-template-columns: var(--v2-rail-collapsed) minmax(0, 1fr);
}

/* ------------------------------------------------------------
   RAIL (sidebar)
------------------------------------------------------------ */

.v2-rail {
  position: sticky;
  top: 0;

  display: flex;
  flex-direction: column;

  height: 100vh;

  padding: 16px 12px;

  border-right: 1px solid var(--v2-line);
  background: var(--v2-bg-2);

  transition: width var(--v2-t);
}

.v2-brand {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 6px 8px 16px;
}

.v2-brand-mark {
  display: block;
  flex: 0 0 auto;

  width: 34px;
  height: 34px;

  border-radius: 10px;
}

.v2-brand-text {
  min-width: 0;
}

.v2-brand-title {
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: -0.01em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-brand-sub {
  overflow: hidden;

  color: var(--v2-text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.v2-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;

  flex: 1;
  overflow-y: auto;

  margin: 0 -4px;
  padding: 0 4px;
}

.v2-nav-group-label {
  padding: 14px 10px 6px;

  color: var(--v2-text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.v2-nav-item {
  position: relative;

  display: flex;
  align-items: center;
  gap: 11px;

  width: 100%;
  padding: 9px 10px;

  border: 0;
  border-radius: var(--v2-r-sm);

  background: transparent;

  color: var(--v2-text-2);
  font-size: 13px;
  font-weight: 600;
  text-align: left;

  cursor: pointer;

  transition:
    background var(--v2-t-fast),
    color var(--v2-t-fast);
}

.v2-nav-item:hover {
  background: var(--v2-surface-2);
  color: var(--v2-text);
}

.v2-nav-item.is-active {
  background: linear-gradient(92deg,
      color-mix(in srgb, var(--v2-accent) 22%, transparent),
      color-mix(in srgb, var(--v2-accent) 6%, transparent));
  color: var(--v2-text);
}

.v2-nav-item.is-active::before {
  content: "";

  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);

  width: 3px;
  height: 18px;

  border-radius: var(--v2-r-full);
  background: var(--v2-accent);
}

.v2-nav-icon {
  display: grid;
  place-items: center;

  flex: 0 0 auto;
  width: 18px;
  height: 18px;

  color: currentColor;
}

.v2-nav-label {
  flex: 1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-nav-badge {
  flex: 0 0 auto;

  min-width: 19px;
  padding: 1px 6px;

  border-radius: var(--v2-r-full);

  background: var(--v2-accent);
  color: #fff;

  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.v2-nav-badge[data-tone="quiet"] {
  background: var(--v2-surface-3);
  color: var(--v2-text-2);
}

.v2-nav-badge[data-tone="alert"] {
  background: var(--v2-rose);
  color: #fff;
}

.v2-rail-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;

  padding-top: 12px;
  margin-top: 8px;

  border-top: 1px solid var(--v2-line);
}

.v2-rail-user {
  display: flex;
  align-items: center;
  gap: 9px;

  padding: 7px 8px;

  border-radius: var(--v2-r-sm);
}

.v2-avatar {
  display: grid;
  place-items: center;

  flex: 0 0 auto;
  width: 28px;
  height: 28px;

  border-radius: var(--v2-r-full);

  background: linear-gradient(135deg, var(--v2-violet), var(--v2-cyan));
  color: #fff;

  font-size: 11px;
  font-weight: 800;
}

.v2-rail-user-meta {
  min-width: 0;
  flex: 1;
}

.v2-rail-user-name {
  font-size: 12px;
  font-weight: 700;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-rail-user-sub {
  color: var(--v2-text-3);
  font-size: 10.5px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapsed rail hides text, centres icons. */

.v2-shell[data-collapsed="true"] .v2-brand-text,
.v2-shell[data-collapsed="true"] .v2-nav-label,
.v2-shell[data-collapsed="true"] .v2-nav-badge,
.v2-shell[data-collapsed="true"] .v2-nav-group-label,
.v2-shell[data-collapsed="true"] .v2-rail-user-meta {
  display: none;
}

.v2-shell[data-collapsed="true"] .v2-nav-item,
.v2-shell[data-collapsed="true"] .v2-brand,
.v2-shell[data-collapsed="true"] .v2-rail-user {
  justify-content: center;
}

/* ------------------------------------------------------------
   MAIN COLUMN
------------------------------------------------------------ */

.v2-main {
  display: flex;
  flex-direction: column;

  min-width: 0;
}

.v2-topbar {
  position: sticky;
  top: 0;
  z-index: 40;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 12px 24px;

  border-bottom: 1px solid var(--v2-line);

  background: color-mix(in srgb, var(--v2-bg) 82%, transparent);
  backdrop-filter: blur(14px);
}

.v2-topbar-title {
  flex: 1;
  min-width: 0;
}

.v2-topbar-title h1 {
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.02em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-topbar-title p {
  color: var(--v2-text-3);
  font-size: 11.5px;
}

.v2-view {
  width: 100%;
  max-width: var(--v2-max);

  padding: 24px;
  margin: 0 auto;
}

.v2-view-enter {
  animation: v2FadeUp 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes v2FadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ------------------------------------------------------------
   BUTTONS
------------------------------------------------------------ */

.v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  padding: 8px 14px;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-sm);

  background: var(--v2-surface-2);

  color: var(--v2-text);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;

  cursor: pointer;

  transition:
    background var(--v2-t-fast),
    border-color var(--v2-t-fast),
    transform var(--v2-t-fast),
    opacity var(--v2-t-fast);
}

.v2-btn:hover {
  background: var(--v2-surface-3);
  border-color: var(--v2-line-2);
}

.v2-btn:active {
  transform: scale(0.975);
}

.v2-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.v2-btn-primary {
  border-color: transparent;

  background: linear-gradient(135deg, var(--v2-accent), var(--v2-violet));
  color: var(--v2-accent-ink);

  box-shadow: 0 6px 18px color-mix(in srgb, var(--v2-accent) 32%, transparent);
}

.v2-btn-primary:hover {
  background: linear-gradient(135deg, var(--v2-accent-soft), var(--v2-violet));
}

.v2-btn-danger {
  border-color: color-mix(in srgb, var(--v2-rose) 40%, transparent);
  background: color-mix(in srgb, var(--v2-rose) 14%, transparent);
  color: var(--v2-rose);
}

.v2-btn-danger:hover {
  background: color-mix(in srgb, var(--v2-rose) 24%, transparent);
}

.v2-btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--v2-text-2);
}

.v2-btn-ghost:hover {
  background: var(--v2-surface-2);
  color: var(--v2-text);
}

.v2-btn-sm {
  padding: 5px 10px;
  font-size: 11.5px;
}

.v2-icon-btn {
  display: grid;
  place-items: center;

  flex: 0 0 auto;
  width: 34px;
  height: 34px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-sm);

  background: var(--v2-surface);

  color: var(--v2-text-2);
  cursor: pointer;

  transition:
    background var(--v2-t-fast),
    color var(--v2-t-fast),
    border-color var(--v2-t-fast);
}

.v2-icon-btn:hover {
  background: var(--v2-surface-2);
  color: var(--v2-text);
  border-color: var(--v2-line-2);
}

.v2-icon-btn.is-on {
  border-color: color-mix(in srgb, var(--v2-accent) 45%, transparent);
  background: color-mix(in srgb, var(--v2-accent) 16%, transparent);
  color: var(--v2-accent-soft);
}

/* Search trigger in the topbar */

.v2-search-trigger {
  display: flex;
  align-items: center;
  gap: 9px;

  width: 260px;
  padding: 7px 11px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-sm);

  background: var(--v2-surface);

  color: var(--v2-text-3);
  font-size: 12.5px;

  cursor: pointer;

  transition: border-color var(--v2-t-fast), background var(--v2-t-fast);
}

.v2-search-trigger:hover {
  border-color: var(--v2-line-2);
  background: var(--v2-surface-2);
}

.v2-kbd {
  display: inline-flex;
  align-items: center;
  gap: 1px;

  margin-left: auto;
  padding: 2px 6px;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-xs);

  background: var(--v2-surface-2);

  color: var(--v2-text-3);
  font-size: 10px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ------------------------------------------------------------
   CARD / PANEL PRIMITIVES
------------------------------------------------------------ */

.v2-card {
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-sm);
}

.v2-card-head {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 15px 17px;

  border-bottom: 1px solid var(--v2-line);
}

.v2-card-head h2,
.v2-card-head h3 {
  flex: 1;

  font-size: 13.5px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.v2-card-head p {
  color: var(--v2-text-3);
  font-size: 11.5px;
}

.v2-card-body {
  padding: 17px;
}

.v2-card-body-flush {
  padding: 0;
}

.v2-section {
  margin-bottom: 24px;
}

.v2-section-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;

  margin-bottom: 13px;
}

.v2-section-head h2 {
  flex: 1;

  font-size: 15px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.v2-section-head p {
  color: var(--v2-text-3);
  font-size: 11.5px;
}

.v2-grid {
  display: grid;
  gap: 16px;
}

.v2-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.v2-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.v2-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

/* ------------------------------------------------------------
   STAT TILE
------------------------------------------------------------ */

.v2-stat {
  position: relative;

  padding: 16px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  overflow: hidden;
}

.v2-stat::after {
  content: "";

  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;

  background: linear-gradient(90deg,
      var(--v2-stat-color, var(--v2-accent)),
      transparent 75%);
}

.v2-stat-top {
  display: flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 10px;
}

.v2-stat-icon {
  display: grid;
  place-items: center;

  width: 27px;
  height: 27px;

  border-radius: var(--v2-r-xs);

  background: color-mix(in srgb, var(--v2-stat-color, var(--v2-accent)) 16%, transparent);
  color: var(--v2-stat-color, var(--v2-accent));
}

.v2-stat-label {
  color: var(--v2-text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.v2-stat-value {
  font-size: 26px;
  font-weight: 780;
  line-height: 1.1;
  letter-spacing: -0.03em;

  font-variant-numeric: tabular-nums;
}

.v2-stat-sub {
  margin-top: 3px;

  color: var(--v2-text-3);
  font-size: 11.5px;
}

.v2-stat-delta {
  font-weight: 700;
}

.v2-stat-delta[data-dir="up"] {
  color: var(--v2-mint);
}

.v2-stat-delta[data-dir="down"] {
  color: var(--v2-rose);
}

/* ------------------------------------------------------------
   PROGRESS
------------------------------------------------------------ */

.v2-progress {
  position: relative;

  height: 6px;

  border-radius: var(--v2-r-full);
  background: var(--v2-surface-3);
  overflow: hidden;
}

.v2-progress-fill {
  height: 100%;

  border-radius: var(--v2-r-full);
  background: linear-gradient(90deg, var(--v2-accent), var(--v2-cyan));

  transition: width var(--v2-t-spring);
}

.v2-progress[data-tone="mint"] .v2-progress-fill {
  background: linear-gradient(90deg, var(--v2-mint), var(--v2-cyan));
}

.v2-progress[data-tone="amber"] .v2-progress-fill {
  background: linear-gradient(90deg, var(--v2-amber), #f2c56b);
}

.v2-progress[data-tone="rose"] .v2-progress-fill {
  background: linear-gradient(90deg, var(--v2-rose), #f08387);
}

/* Ring (SVG-driven) */

.v2-ring {
  position: relative;
  display: grid;
  place-items: center;
}

.v2-ring svg {
  transform: rotate(-90deg);
}

.v2-ring-track {
  fill: none;
  stroke: var(--v2-surface-3);
}

.v2-ring-fill {
  fill: none;
  stroke: url(#v2RingGradient);
  stroke-linecap: round;

  transition: stroke-dashoffset var(--v2-t-spring);
}

.v2-ring-label {
  position: absolute;

  text-align: center;
  line-height: 1.15;
}

.v2-ring-value {
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.v2-ring-cap {
  color: var(--v2-text-3);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------
   PILLS / BADGES / TAGS
------------------------------------------------------------ */

.v2-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 3px 9px;

  border-radius: var(--v2-r-full);

  background: var(--v2-surface-3);

  color: var(--v2-text-2);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.v2-pill[data-tone="accent"] {
  background: color-mix(in srgb, var(--v2-accent) 18%, transparent);
  color: var(--v2-accent-soft);
}

.v2-pill[data-tone="mint"] {
  background: color-mix(in srgb, var(--v2-mint) 18%, transparent);
  color: var(--v2-mint);
}

.v2-pill[data-tone="amber"] {
  background: color-mix(in srgb, var(--v2-amber) 20%, transparent);
  color: var(--v2-amber);
}

.v2-pill[data-tone="rose"] {
  background: color-mix(in srgb, var(--v2-rose) 18%, transparent);
  color: var(--v2-rose);
}

.v2-pill[data-tone="cyan"] {
  background: color-mix(in srgb, var(--v2-cyan) 18%, transparent);
  color: var(--v2-cyan);
}

/* Segmented control */

.v2-segment {
  display: inline-flex;
  gap: 2px;

  padding: 3px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-sm);

  background: var(--v2-surface-2);
}

.v2-segment button {
  padding: 5px 12px;

  border: 0;
  border-radius: var(--v2-r-xs);

  background: transparent;

  color: var(--v2-text-3);
  font-size: 11.5px;
  font-weight: 680;

  cursor: pointer;

  transition: background var(--v2-t-fast), color var(--v2-t-fast);
}

.v2-segment button:hover {
  color: var(--v2-text);
}

.v2-segment button.is-on {
  background: var(--v2-surface);
  color: var(--v2-text);
  box-shadow: var(--v2-shadow-sm);
}

/* ------------------------------------------------------------
   FORMS
------------------------------------------------------------ */

.v2-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v2-field>label,
.v2-label {
  color: var(--v2-text-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.v2-input,
.v2-select,
.v2-textarea {
  width: 100%;

  padding: 9px 12px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-sm);

  outline: none;

  background: var(--v2-surface-2);

  color: var(--v2-text);
  font-size: 13px;

  transition:
    border-color var(--v2-t-fast),
    background var(--v2-t-fast),
    box-shadow var(--v2-t-fast);
}

.v2-textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.6;
}

.v2-input::placeholder,
.v2-textarea::placeholder {
  color: var(--v2-text-3);
}

.v2-input:focus,
.v2-select:focus,
.v2-textarea:focus {
  border-color: color-mix(in srgb, var(--v2-accent) 55%, transparent);
  background: var(--v2-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--v2-accent) 14%, transparent);
}

.v2-select {
  appearance: none;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238890a6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;

  padding-right: 32px;
}

.v2-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.v2-form-grid .v2-span-2 {
  grid-column: 1 / -1;
}

.v2-hint {
  color: var(--v2-text-3);
  font-size: 11px;
  line-height: 1.5;
}

/* Switch */

.v2-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;

  cursor: pointer;
}

.v2-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.v2-switch-track {
  position: relative;

  width: 36px;
  height: 20px;

  border-radius: var(--v2-r-full);
  background: var(--v2-surface-3);

  transition: background var(--v2-t);
}

.v2-switch-track::after {
  content: "";

  position: absolute;
  top: 2px;
  left: 2px;

  width: 16px;
  height: 16px;

  border-radius: var(--v2-r-full);
  background: #fff;
  box-shadow: var(--v2-shadow-sm);

  transition: transform var(--v2-t);
}

.v2-switch input:checked+.v2-switch-track {
  background: var(--v2-accent);
}

.v2-switch input:checked+.v2-switch-track::after {
  transform: translateX(16px);
}

/* ------------------------------------------------------------
   TABLE
------------------------------------------------------------ */

.v2-table-wrap {
  overflow-x: auto;
}

.v2-table {
  width: 100%;
  border-collapse: collapse;
}

.v2-table th {
  padding: 10px 14px;

  border-bottom: 1px solid var(--v2-line);

  color: var(--v2-text-3);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.v2-table td {
  padding: 11px 14px;

  border-bottom: 1px solid var(--v2-line);

  font-size: 12.5px;
  vertical-align: middle;
}

.v2-table tbody tr {
  transition: background var(--v2-t-fast);
}

.v2-table tbody tr:hover {
  background: var(--v2-surface-2);
}

.v2-table tbody tr:last-child td {
  border-bottom: 0;
}

.v2-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ------------------------------------------------------------
   EMPTY / LOADING
------------------------------------------------------------ */

.v2-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;

  padding: 44px 24px;

  text-align: center;
}

.v2-empty-icon {
  display: grid;
  place-items: center;

  width: 46px;
  height: 46px;
  margin-bottom: 4px;

  border-radius: var(--v2-r-md);

  background: var(--v2-surface-2);
  color: var(--v2-text-3);
}

.v2-empty-title {
  font-size: 13.5px;
  font-weight: 720;
}

.v2-empty-text {
  max-width: 340px;

  color: var(--v2-text-3);
  font-size: 12px;
  line-height: 1.6;
}

.v2-skeleton {
  border-radius: var(--v2-r-sm);

  background: linear-gradient(90deg,
      var(--v2-surface-2) 25%,
      var(--v2-surface-3) 50%,
      var(--v2-surface-2) 75%);
  background-size: 200% 100%;

  animation: v2Shimmer 1.3s infinite;
}

@keyframes v2Shimmer {
  to {
    background-position: -200% 0;
  }
}

.v2-spinner {
  width: 15px;
  height: 15px;

  border: 2px solid color-mix(in srgb, var(--v2-accent) 25%, transparent);
  border-top-color: var(--v2-accent);
  border-radius: 50%;

  animation: v2Spin 620ms linear infinite;
}

@keyframes v2Spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   OVERVIEW
   ============================================================ */

.v2-hero {
  position: relative;

  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;

  padding: 22px 24px;
  margin-bottom: 22px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-xl);

  background:
    radial-gradient(90% 140% at 100% 0%, color-mix(in srgb, var(--v2-cyan) 14%, transparent), transparent 60%),
    linear-gradient(120deg, color-mix(in srgb, var(--v2-accent) 16%, transparent), transparent 55%),
    var(--v2-surface);

  overflow: hidden;
}

.v2-hero-copy {
  flex: 1 1 280px;
  min-width: 0;
}

.v2-hero-greeting {
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.v2-hero-sub {
  margin-top: 5px;

  color: var(--v2-text-2);
  font-size: 13px;
}

.v2-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.v2-hero-rings {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

/* Focus list (today) */

.v2-focus-item {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 11px 16px;

  border-bottom: 1px solid var(--v2-line);

  cursor: pointer;

  transition: background var(--v2-t-fast);
}

.v2-focus-item:last-child {
  border-bottom: 0;
}

.v2-focus-item:hover {
  background: var(--v2-surface-2);
}

.v2-focus-check {
  display: grid;
  place-items: center;

  flex: 0 0 auto;
  width: 21px;
  height: 21px;

  border: 1.8px solid var(--v2-line-2);
  border-radius: 6px;

  background: transparent;
  color: transparent;

  cursor: pointer;

  transition:
    background var(--v2-t-fast),
    border-color var(--v2-t-fast),
    color var(--v2-t-fast);
}

.v2-focus-check:hover {
  border-color: var(--v2-accent);
}

.v2-focus-check.is-done {
  border-color: var(--v2-mint);
  background: var(--v2-mint);
  color: #04120c;
}

.v2-focus-meta {
  flex: 1;
  min-width: 0;
}

.v2-focus-title {
  font-size: 12.5px;
  font-weight: 680;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-focus-sub {
  display: flex;
  align-items: center;
  gap: 7px;

  margin-top: 2px;

  color: var(--v2-text-3);
  font-size: 11px;
}

.v2-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;
  background: var(--v2-accent);

  flex: 0 0 auto;
}

/* --- exam countdown widget --- */

.v2-countdown-card {
  margin-bottom: 22px;
  padding: 18px 20px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-xl);

  background:
    radial-gradient(70% 140% at 0% 0%, color-mix(in srgb, var(--v2-subject-color, var(--v2-rose)) 12%, transparent), transparent 60%),
    var(--v2-surface);

  cursor: pointer;

  transition: border-color var(--v2-t), transform var(--v2-t);
}

.v2-countdown-card:hover {
  border-color: color-mix(in srgb, var(--v2-subject-color, var(--v2-rose)) 40%, transparent);
  transform: translateY(-2px);
}

.v2-countdown-main {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.v2-countdown-days {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;
  width: 84px;
  height: 84px;

  border-radius: var(--v2-r-lg);

  background: color-mix(in srgb, var(--v2-rose) 12%, transparent);
}

.v2-countdown-days[data-urgent="false"] {
  background: color-mix(in srgb, var(--v2-subject-color, var(--v2-accent)) 12%, transparent);
}

.v2-countdown-num {
  color: var(--v2-text);
  font-size: 26px;
  font-weight: 820;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.v2-countdown-unit {
  margin-top: 2px;

  color: var(--v2-text-3);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.v2-countdown-info {
  flex: 1 1 200px;
  min-width: 0;
}

.v2-countdown-title {
  margin-top: 6px;

  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.v2-countdown-ring {
  flex: 0 0 auto;
}

.v2-countdown-rest {
  display: flex;
  flex-direction: column;

  margin-top: 15px;
  padding-top: 12px;

  border-top: 1px solid var(--v2-line);
}

.v2-countdown-rest-item {
  display: flex;
  align-items: center;
  gap: 9px;

  padding: 6px 0;

  font-size: 12px;
}

.v2-countdown-rest-title {
  flex: 1;
  min-width: 0;

  color: var(--v2-text-2);
  font-weight: 620;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-countdown-rest-cat {
  color: var(--v2-text-3);
  font-size: 10.5px;
  font-weight: 700;
}

.v2-countdown-rest-days {
  color: var(--v2-text);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.v2-countdown-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;

  cursor: default;
}

.v2-countdown-empty-icon {
  display: grid;
  place-items: center;

  width: 46px;
  height: 46px;

  border-radius: var(--v2-r-md);

  background: var(--v2-surface-2);
  color: var(--v2-text-3);
}

.v2-countdown-empty-text {
  flex: 1;
  min-width: 180px;
}

.v2-countdown-empty-title {
  font-size: 14px;
  font-weight: 730;
}

@media (max-width: 560px) {
  .v2-countdown-main {
    align-items: flex-start;
  }

  .v2-countdown-ring {
    display: none;
  }
}

/* ============================================================
   SUBJECTS
   ============================================================ */

.v2-subject-card {
  position: relative;

  display: flex;
  flex-direction: column;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-sm);

  overflow: hidden;

  transition:
    transform var(--v2-t),
    border-color var(--v2-t),
    box-shadow var(--v2-t);
}

.v2-subject-card:hover {
  transform: translateY(-2px);
  border-color: var(--v2-line-2);
  box-shadow: var(--v2-shadow);
}

.v2-subject-drag-handle {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;

  display: grid;
  place-items: center;

  width: 24px;
  height: 24px;
  padding: 0;

  border: none;
  border-radius: var(--v2-r-sm);

  background: transparent;

  color: var(--v2-text-3);

  opacity: 0.45;
  cursor: grab;
  transition: opacity var(--v2-t), background var(--v2-t), color var(--v2-t);
}

.v2-subject-card:hover .v2-subject-drag-handle,
.v2-subject-drag-handle:focus-visible {
  opacity: 1;
}

.v2-subject-drag-handle:hover {
  background: var(--v2-surface-3);
  color: var(--v2-text);
}

.v2-subject-drag-handle:active {
  cursor: grabbing;
}

/* Sortable's placeholder (where the card will drop) and the
   card currently being dragged. */
.v2-subject-card-ghost {
  border: 1px dashed var(--v2-accent);
  border-radius: var(--v2-r-lg);

  background: color-mix(in srgb, var(--v2-accent) 8%, var(--v2-surface));
  box-shadow: none;

  opacity: 0.6;
}

.v2-subject-card-ghost * {
  visibility: hidden;
}

.v2-subject-card-chosen {
  box-shadow: var(--v2-shadow-lg);
}

.v2-subject-top {
  position: relative;

  display: flex;
  align-items: flex-start;
  gap: 11px;

  padding: 15px 16px 13px;
}

.v2-subject-top::before {
  content: "";

  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;

  background: linear-gradient(90deg,
      var(--v2-subject-color, var(--v2-accent)),
      transparent 70%);
}

.v2-subject-glyph {
  display: grid;
  place-items: center;

  flex: 0 0 auto;
  width: 38px;
  height: 38px;

  border-radius: var(--v2-r-sm);

  background: color-mix(in srgb, var(--v2-subject-color, var(--v2-accent)) 16%, transparent);
  color: var(--v2-subject-color, var(--v2-accent));

  font-size: 13px;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.v2-subject-id {
  flex: 1;
  min-width: 0;
}

.v2-subject-name {
  font-size: 13.5px;
  font-weight: 730;
  line-height: 1.35;
  letter-spacing: -0.01em;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.v2-subject-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;

  margin-top: 5px;
}

.v2-subject-body {
  padding: 0 16px 14px;
}

.v2-subject-progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;

  margin-bottom: 7px;
}

.v2-subject-progress-label {
  color: var(--v2-text-3);
  font-size: 11px;
  font-weight: 650;
}

.v2-subject-progress-value {
  font-size: 12.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.v2-subject-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;

  margin-top: 14px;

  border-top: 1px solid var(--v2-line);
  background: var(--v2-line);
}

.v2-subject-stat {
  padding: 10px 6px;

  background: var(--v2-surface);
  text-align: center;
}

.v2-subject-stat-value {
  font-size: 14px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.v2-subject-stat-label {
  margin-top: 1px;

  color: var(--v2-text-3);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.v2-subject-foot {
  display: flex;
  align-items: center;
  gap: 7px;

  padding: 10px 14px;

  border-top: 1px solid var(--v2-line);
  background: var(--v2-surface-2);
}

.v2-subject-exam {
  flex: 1;

  color: var(--v2-text-3);
  font-size: 11px;
  font-weight: 620;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------
   LESSON BOARD (inside subject detail)
------------------------------------------------------------ */

.v2-lesson-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.v2-lane {
  display: flex;
  flex-direction: column;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-md);

  background: var(--v2-surface-2);
  min-height: 130px;
}

.v2-lane-head {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 11px 13px;

  border-bottom: 1px solid var(--v2-line);
}

.v2-lane-title {
  flex: 1;

  font-size: 11.5px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.v2-lane-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.v2-lane-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  padding: 13px;
}

.v2-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  min-width: 34px;
  padding: 6px 10px;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-xs);

  background: var(--v2-surface);

  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;

  cursor: pointer;

  transition:
    background var(--v2-t-fast),
    border-color var(--v2-t-fast),
    transform var(--v2-t-fast);
}

.v2-chip:hover {
  transform: translateY(-1px);
  border-color: var(--v2-accent);
}

.v2-chip[data-state="studied"] {
  border-color: color-mix(in srgb, var(--v2-mint) 45%, transparent);
  background: color-mix(in srgb, var(--v2-mint) 15%, transparent);
  color: var(--v2-mint);
}

.v2-chip[data-state="target"] {
  border-color: color-mix(in srgb, var(--v2-accent) 45%, transparent);
  background: color-mix(in srgb, var(--v2-accent) 13%, transparent);
  color: var(--v2-accent-soft);
}

.v2-chip[data-state="pool"] {
  color: var(--v2-text-3);
}

.v2-chip-x {
  border: 0;
  background: transparent;
  color: inherit;

  font-size: 13px;
  line-height: 1;
  opacity: 0.55;

  cursor: pointer;
}

.v2-chip-x:hover {
  opacity: 1;
}

/* ============================================================
   CALENDAR
   ============================================================ */

.v2-cal-head {
  display: flex;
  align-items: center;
  gap: 10px;

  margin-bottom: 14px;
}

.v2-cal-month {
  flex: 1;

  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.v2-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);

  background: var(--v2-line);
  overflow: hidden;
}

.v2-cal-dow {
  padding: 9px 6px;

  background: var(--v2-surface-2);

  color: var(--v2-text-3);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: uppercase;
}

.v2-cal-cell {
  position: relative;

  display: flex;
  flex-direction: column;
  gap: 4px;

  min-height: 96px;
  padding: 7px 7px 6px;

  border: 0;

  background: var(--v2-surface);

  text-align: left;
  cursor: pointer;

  transition: background var(--v2-t-fast);
}

.v2-cal-cell:hover {
  background: var(--v2-surface-2);
}

.v2-cal-cell[data-outside="true"] {
  background: var(--v2-bg-2);
  opacity: 0.55;
}

.v2-cal-cell[data-today="true"] .v2-cal-daynum {
  background: var(--v2-accent);
  color: #fff;
}

.v2-cal-cell[data-selected="true"] {
  box-shadow: inset 0 0 0 2px var(--v2-accent);
}

.v2-cal-cell[data-vacation="true"] {
  background: color-mix(in srgb, var(--v2-amber) 9%, var(--v2-surface));
}

.v2-cal-daynum {
  display: grid;
  place-items: center;

  width: 23px;
  height: 23px;

  border-radius: var(--v2-r-full);

  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.v2-cal-events {
  display: flex;
  flex-direction: column;
  gap: 3px;

  overflow: hidden;
}

.v2-cal-event {
  display: flex;
  align-items: center;
  gap: 4px;

  padding: 2px 6px;

  border-radius: var(--v2-r-xs);

  background: var(--v2-surface-3);

  font-size: 10px;
  font-weight: 650;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-cal-event[data-kind="exam"] {
  background: color-mix(in srgb, var(--v2-rose) 20%, transparent);
  color: var(--v2-rose);
}

.v2-cal-event[data-kind="assignment"] {
  background: color-mix(in srgb, var(--v2-amber) 20%, transparent);
  color: var(--v2-amber);
}

.v2-cal-event[data-kind="task"] {
  background: color-mix(in srgb, var(--v2-cyan) 18%, transparent);
  color: var(--v2-cyan);
}

.v2-cal-event[data-kind="event"] {
  background: color-mix(in srgb, var(--v2-accent) 18%, transparent);
  color: var(--v2-accent-soft);
}

.v2-cal-hours {
  position: absolute;
  right: 6px;
  bottom: 5px;

  color: var(--v2-text-3);
  font-size: 9.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.v2-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;

  margin-top: 13px;
}

.v2-cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;

  color: var(--v2-text-3);
  font-size: 11px;
  font-weight: 620;
}

/* ============================================================
   ANALYTICS — inline SVG charts
   ============================================================ */

.v2-chart {
  width: 100%;
  overflow: visible;
}

.v2-chart-grid line {
  stroke: var(--v2-line);
  stroke-width: 1;
}

.v2-chart-axis {
  fill: var(--v2-text-3);
  font-size: 10px;
  font-weight: 650;
}

.v2-bar {
  transition: opacity var(--v2-t-fast);
  cursor: pointer;
}

.v2-bar:hover {
  opacity: 0.78;
}

.v2-area {
  fill: url(#v2AreaGradient);
}

.v2-line-path {
  fill: none;
  stroke: var(--v2-accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v2-point {
  fill: var(--v2-surface);
  stroke: var(--v2-accent);
  stroke-width: 2;
}

.v2-heat-cell {
  rx: 2.5;
  transition: opacity var(--v2-t-fast);
}

.v2-heat-cell:hover {
  opacity: 0.75;
}

.v2-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;

  margin-top: 12px;
}

.v2-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;

  color: var(--v2-text-2);
  font-size: 11.5px;
  font-weight: 620;
}

.v2-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Distribution bar */

.v2-distribution {
  display: flex;

  height: 10px;

  border-radius: var(--v2-r-full);
  overflow: hidden;

  background: var(--v2-surface-3);
}

.v2-distribution span {
  transition: width var(--v2-t-spring);
}

/* ============================================================
   TODOS
   ============================================================ */

.v2-todo {
  display: flex;
  align-items: flex-start;
  gap: 12px;

  padding: 13px 16px;

  border-bottom: 1px solid var(--v2-line);

  transition: background var(--v2-t-fast);
}

.v2-todo:last-child {
  border-bottom: 0;
}

.v2-todo:hover {
  background: var(--v2-surface-2);
}

.v2-todo[data-urgency="high"] {
  box-shadow: inset 3px 0 0 var(--v2-rose);
}

.v2-todo[data-urgency="mid"] {
  box-shadow: inset 3px 0 0 var(--v2-amber);
}

.v2-todo[data-urgency="low"] {
  box-shadow: inset 3px 0 0 var(--v2-mint);
}

.v2-todo-main {
  flex: 1;
  min-width: 0;
}

.v2-todo-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.v2-todo-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;

  margin-top: 5px;
}

.v2-todo-side {
  display: flex;
  align-items: center;
  gap: 7px;

  flex: 0 0 auto;
}

/* ============================================================
   COMMAND PALETTE
   ============================================================ */

.v2-cmd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;

  display: flex;
  justify-content: center;

  padding: 12vh 20px 20px;

  background: rgba(4, 6, 12, 0.62);
  backdrop-filter: blur(7px);

  animation: v2Fade 150ms ease;
}

@keyframes v2Fade {
  from {
    opacity: 0;
  }
}

.v2-cmd {
  width: 100%;
  max-width: 580px;
  height: fit-content;
  max-height: 64vh;

  display: flex;
  flex-direction: column;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-lg);

  overflow: hidden;

  animation: v2CmdIn 220ms cubic-bezier(0.22, 1.2, 0.36, 1);
}

@keyframes v2CmdIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
}

.v2-cmd-input-row {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 13px 16px;

  border-bottom: 1px solid var(--v2-line);
}

.v2-cmd-input {
  flex: 1;

  border: 0;
  outline: none;
  background: transparent;

  color: var(--v2-text);
  font-size: 14.5px;
}

.v2-cmd-input::placeholder {
  color: var(--v2-text-3);
}

.v2-cmd-list {
  overflow-y: auto;
  padding: 6px;
}

.v2-cmd-group {
  padding: 9px 11px 5px;

  color: var(--v2-text-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.v2-cmd-item {
  display: flex;
  align-items: center;
  gap: 11px;

  width: 100%;
  padding: 9px 11px;

  border: 0;
  border-radius: var(--v2-r-sm);

  background: transparent;

  color: var(--v2-text-2);
  font-size: 13px;
  text-align: left;

  cursor: pointer;
}

.v2-cmd-item.is-active {
  background: var(--v2-surface-2);
  color: var(--v2-text);
}

.v2-cmd-item-icon {
  display: grid;
  place-items: center;

  flex: 0 0 auto;
  width: 26px;
  height: 26px;

  border-radius: var(--v2-r-xs);

  background: var(--v2-surface-3);
  color: var(--v2-text-2);
}

.v2-cmd-item-main {
  flex: 1;
  min-width: 0;
}

.v2-cmd-item-title {
  font-weight: 620;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-cmd-item-sub {
  color: var(--v2-text-3);
  font-size: 11px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   MODAL
   ============================================================ */

.v2-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(4, 6, 12, 0.6);
  backdrop-filter: blur(5px);

  animation: v2Fade 150ms ease;
}

.v2-modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;

  display: flex;
  flex-direction: column;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-lg);

  overflow: hidden;

  animation: v2ModalIn 240ms cubic-bezier(0.22, 1.2, 0.36, 1);
}

.v2-modal-lg {
  max-width: 760px;
}

@keyframes v2ModalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

.v2-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;

  padding: 18px 20px 14px;

  border-bottom: 1px solid var(--v2-line);
}

.v2-modal-head-text {
  flex: 1;
  min-width: 0;
}

.v2-modal-eyebrow {
  color: var(--v2-accent-soft);
  font-size: 10.5px;
  font-weight: 780;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.v2-modal-head h2 {
  margin-top: 3px;

  font-size: 16.5px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.v2-modal-body {
  flex: 1;
  overflow-y: auto;

  padding: 18px 20px;
}

.v2-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;

  padding: 14px 20px;

  border-top: 1px solid var(--v2-line);
  background: var(--v2-surface-2);
}

.v2-modal-foot-spread {
  justify-content: space-between;
}

/* ============================================================
   TOAST
   ============================================================ */

.v2-toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;

  display: flex;
  flex-direction: column;
  gap: 8px;

  pointer-events: none;
}

.v2-toast {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 240px;
  max-width: 380px;
  padding: 11px 15px;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-md);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow);

  font-size: 12.5px;
  font-weight: 620;

  pointer-events: auto;

  animation: v2ToastIn 260ms cubic-bezier(0.22, 1.2, 0.36, 1);
}

.v2-toast[data-tone="success"] {
  border-color: color-mix(in srgb, var(--v2-mint) 45%, transparent);
}

.v2-toast[data-tone="error"] {
  border-color: color-mix(in srgb, var(--v2-rose) 45%, transparent);
}

.v2-toast-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;

  width: 20px;
  height: 20px;

  border-radius: 50%;
}

.v2-toast[data-tone="success"] .v2-toast-icon {
  background: color-mix(in srgb, var(--v2-mint) 20%, transparent);
  color: var(--v2-mint);
}

.v2-toast[data-tone="error"] .v2-toast-icon {
  background: color-mix(in srgb, var(--v2-rose) 20%, transparent);
  color: var(--v2-rose);
}

.v2-toast[data-tone="info"] .v2-toast-icon {
  background: color-mix(in srgb, var(--v2-accent) 20%, transparent);
  color: var(--v2-accent-soft);
}

.v2-toast.is-leaving {
  animation: v2ToastOut 200ms ease forwards;
}

@keyframes v2ToastIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@keyframes v2ToastOut {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

/* ============================================================
   RESOURCE POOL
   ------------------------------------------------------------
   Quick-capture bar, type/tag filtering, a uniform card grid
   where every card gets a real cover (photo, note excerpt, link
   monogram, or PDF document face), and the tag picker used
   inside the add/edit modal.
   ============================================================ */

.v2-res-quick {
  position: relative;

  display: flex;
  align-items: center;
  gap: 14px;

  padding: 13px 16px;
  margin-bottom: 16px;

  border: 1.5px dashed var(--v2-line-2);
  border-radius: var(--v2-r-lg);

  background: linear-gradient(120deg,
      color-mix(in srgb, var(--v2-accent) 6%, transparent),
      color-mix(in srgb, var(--v2-cyan) 4%, transparent));

  transition: border-color var(--v2-t), background var(--v2-t);
}

.v2-res-quick:hover,
.v2-res-quick.is-active {
  border-color: color-mix(in srgb, var(--v2-accent) 55%, transparent);
  border-style: solid;

  background: linear-gradient(120deg,
      color-mix(in srgb, var(--v2-accent) 14%, transparent),
      color-mix(in srgb, var(--v2-cyan) 8%, transparent));
}

.v2-res-quick-icon {
  display: grid;
  place-items: center;

  flex: 0 0 auto;
  width: 38px;
  height: 38px;

  border-radius: var(--v2-r-md);

  background: color-mix(in srgb, var(--v2-accent) 16%, transparent);
  color: var(--v2-accent-soft);
}

.v2-res-quick-copy {
  flex: 0 1 auto;
  min-width: 0;
}

.v2-res-quick-title {
  font-size: 13px;
  font-weight: 750;
}

.v2-res-quick-sub {
  margin-top: 2px;

  color: var(--v2-text-3);
  font-size: 11.5px;
  line-height: 1.45;
}

.v2-res-quick-input {
  flex: 1 1 220px;
  min-width: 170px;
}

/* --- toolbar --- */

.v2-res-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;

  margin-bottom: 12px;
}

.v2-res-type-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v2-res-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 7px 12px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-full);

  background: var(--v2-surface);

  color: var(--v2-text-2);
  font-size: 12px;
  font-weight: 650;

  cursor: pointer;

  transition: background var(--v2-t-fast), border-color var(--v2-t-fast), color var(--v2-t-fast);
}

.v2-res-filter-pill:hover {
  border-color: var(--v2-line-2);
  color: var(--v2-text);
}

.v2-res-filter-pill.is-on {
  border-color: color-mix(in srgb, var(--v2-accent) 45%, transparent);
  background: color-mix(in srgb, var(--v2-accent) 14%, transparent);
  color: var(--v2-accent-soft);
}

.v2-res-filter-count {
  min-width: 16px;
  padding: 1px 5px;

  border-radius: var(--v2-r-full);

  background: var(--v2-surface-3);

  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.v2-res-filter-pill.is-on .v2-res-filter-count {
  background: color-mix(in srgb, var(--v2-accent) 25%, transparent);
}

.v2-res-search {
  position: relative;

  display: flex;
  align-items: center;
  gap: 8px;

  flex: 1 1 200px;
  max-width: 320px;
  margin-left: auto;

  padding: 8px 12px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-sm);

  background: var(--v2-surface);
  color: var(--v2-text-3);
}

.v2-res-search:focus-within {
  border-color: color-mix(in srgb, var(--v2-accent) 45%, transparent);
}

.v2-res-search input {
  flex: 1;
  min-width: 0;

  border: 0;
  background: transparent;
  outline: none;

  color: var(--v2-text);
  font-size: 12.5px;
}

.v2-res-search button {
  flex: 0 0 auto;

  display: grid;
  place-items: center;

  border: 0;
  background: transparent;
  color: var(--v2-text-3);
  cursor: pointer;
}

.v2-res-search button:hover {
  color: var(--v2-text);
}

/* --- tag filter row --- */

.v2-res-tagrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;

  padding-bottom: 14px;
  margin-bottom: 16px;

  border-bottom: 1px solid var(--v2-line);
}

.v2-res-tagrow-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  margin-right: 4px;

  color: var(--v2-text-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- shared tag chip (filter row, card, dialog) --- */

.v2-res-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 3px 9px;

  border: 1px solid color-mix(in srgb, var(--v2-res-tag-color, var(--v2-accent)) 40%, transparent);
  border-radius: var(--v2-r-full);

  background: color-mix(in srgb, var(--v2-res-tag-color, var(--v2-accent)) 14%, transparent);

  color: var(--v2-text);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

button.v2-res-tag {
  cursor: pointer;

  transition: background var(--v2-t-fast), transform var(--v2-t-fast);
}

button.v2-res-tag:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--v2-res-tag-color, var(--v2-accent)) 26%, transparent);
}

.v2-res-tag.is-on {
  background: color-mix(in srgb, var(--v2-res-tag-color, var(--v2-accent)) 38%, transparent);
  border-color: color-mix(in srgb, var(--v2-res-tag-color, var(--v2-accent)) 70%, transparent);
}

.v2-res-tag-more {
  color: var(--v2-text-3);
  font-size: 10.5px;
  font-weight: 650;
}

.v2-res-tag-removable button {
  border: 0;
  background: transparent;

  color: inherit;
  font-size: 13px;
  line-height: 1;

  cursor: pointer;
  opacity: 0.7;
}

.v2-res-tag-removable button:hover {
  opacity: 1;
}

/* --- grid + card --- */

.v2-res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 16px;
}

.v2-res-card {
  display: flex;
  flex-direction: column;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-sm);

  overflow: hidden;
  cursor: pointer;

  transition: transform var(--v2-t), border-color var(--v2-t), box-shadow var(--v2-t);
}

.v2-res-card:hover,
.v2-res-card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--v2-accent) 35%, transparent);
  box-shadow: var(--v2-shadow);

  outline: none;
}

.v2-res-cover-wrap {
  position: relative;

  aspect-ratio: 16 / 10;

  background: var(--v2-surface-2);
  overflow: hidden;
}

.v2-res-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;

  backdrop-filter: blur(8px);
}

.v2-res-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;

  display: flex;
  gap: 5px;

  opacity: 0;
  transform: translateY(-3px);

  transition: opacity var(--v2-t-fast), transform var(--v2-t-fast);
}

.v2-res-card:hover .v2-res-actions,
.v2-res-card:focus-within .v2-res-actions {
  opacity: 1;
  transform: translateY(0);
}

.v2-res-action {
  width: 27px;
  height: 27px;

  background: color-mix(in srgb, var(--v2-bg) 75%, transparent);
  backdrop-filter: blur(8px);
}

.v2-res-body {
  display: flex;
  flex-direction: column;
  gap: 6px;

  flex: 1;
  padding: 12px 13px 11px;
}

.v2-res-title {
  font-size: 13.5px;
  font-weight: 730;
  line-height: 1.35;
  letter-spacing: -0.01em;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.v2-res-desc {
  color: var(--v2-text-3);
  font-size: 11.5px;
  line-height: 1.5;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.v2-res-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  margin-top: auto;
  padding-top: 7px;
}

.v2-res-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;

  min-width: 0;
}

.v2-res-foot .v2-res-tag {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-res-date {
  flex: 0 0 auto;

  color: var(--v2-text-3);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* --- covers --- */

.v2-res-cover,
.v2-res-cover-stack {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-res-cover-photo {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v2-res-cover-play {
  position: absolute;

  display: grid;
  place-items: center;

  width: 42px;
  height: 42px;

  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;

  background: rgba(4, 6, 12, 0.55);
  backdrop-filter: blur(6px);

  color: #fff;
}

.v2-res-cover-play-over {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* note: dull typographic excerpt, never the loudest thing */

.v2-res-cover-note {
  align-items: stretch;
  justify-content: flex-start;

  padding: 12px 13px 0;

  background:
    linear-gradient(180deg, color-mix(in srgb, var(--v2-amber) 8%, transparent), transparent 60%),
    var(--v2-surface-2);
}

.v2-res-cover-note-text {
  padding-left: 10px;

  border-left: 2px solid color-mix(in srgb, var(--v2-amber) 45%, transparent);

  color: var(--v2-text-3);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.v2-res-cover-fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 44px;

  background: linear-gradient(180deg, transparent, var(--v2-surface-2) 92%);
}

/* link + video: monogram / play on a hashed hue */

.v2-res-cover-link,
.v2-res-cover-video {
  flex-direction: column;
  gap: 8px;

  background:
    radial-gradient(120% 120% at 30% 15%, hsl(var(--v2-res-hue, 220) 55% 30% / 0.55), transparent 70%),
    var(--v2-surface-2);
}

.v2-res-cover-mono {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -56%);

  color: hsl(var(--v2-res-hue, 220) 70% 70% / 0.16);
  font-size: 84px;
  font-weight: 900;
  line-height: 1;
  user-select: none;
}

.v2-res-cover-favicon {
  position: relative;
  z-index: 1;

  width: 32px;
  height: 32px;
  padding: 5px;

  border-radius: var(--v2-r-sm);
  background: rgba(255, 255, 255, 0.95);

  object-fit: contain;
}

.v2-res-cover-host {
  position: relative;
  z-index: 1;
  max-width: 84%;

  color: var(--v2-text-2);
  font-size: 10.5px;
  font-weight: 700;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* pdf: document face when no rendered page is available */

.v2-res-cover-pdf {
  background: var(--v2-surface-2);
}

.v2-res-cover-page {
  position: relative;

  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;

  width: 70px;
  padding: 11px 9px;

  border: 1px solid var(--v2-line-2);
  border-radius: 4px 4px 2px 2px;

  background: color-mix(in srgb, var(--v2-text) 5%, transparent);
}

.v2-res-cover-page-badge {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);

  padding: 2px 7px;

  border-radius: 4px;
  background: var(--v2-rose);

  color: #2a0c0c;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.v2-res-cover-page-line {
  height: 3px;
  border-radius: 2px;
  background: var(--v2-line-2);
}

.v2-res-cover-page-line.short {
  width: 60%;
}

/* ------------------------------------------------------------
   ADD/EDIT DIALOG EXTRAS — type tabs, dropzone, tag suggestions
------------------------------------------------------------ */

.v2-res-type-tabs {
  width: 100%;
  margin-bottom: 16px;
}

.v2-res-type-tabs button {
  flex: 1;
}

.v2-res-dropzone {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;

  padding: 22px 16px;

  border: 1.5px dashed var(--v2-line-2);
  border-radius: var(--v2-r-md);

  background: var(--v2-surface-2);

  text-align: center;
  cursor: pointer;

  transition: border-color var(--v2-t), background var(--v2-t);
}

.v2-res-dropzone:hover,
.v2-res-dropzone.is-active {
  border-color: color-mix(in srgb, var(--v2-accent) 55%, transparent);
  background: color-mix(in srgb, var(--v2-accent) 6%, transparent);
}

.v2-res-dropzone-icon {
  display: grid;
  place-items: center;

  width: 34px;
  height: 34px;
  margin-bottom: 4px;

  border-radius: var(--v2-r-sm);

  background: color-mix(in srgb, var(--v2-accent) 15%, transparent);
  color: var(--v2-accent-soft);
}

.v2-res-dropzone-title {
  font-size: 12.5px;
  font-weight: 700;
}

.v2-res-dropzone-sub {
  color: var(--v2-text-3);
  font-size: 11px;
}

.v2-res-tag-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;

  max-height: 92px;
  overflow-y: auto;

  padding: 9px 10px;
  margin-top: 8px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-sm);

  background: var(--v2-surface-2);
}

.v2-res-tag-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 4px 9px;

  border: 1px solid color-mix(in srgb, var(--v2-res-tag-color, var(--v2-accent)) 30%, transparent);
  border-radius: var(--v2-r-full);

  background: transparent;

  color: var(--v2-text-2);
  font-size: 10.5px;
  font-weight: 650;

  cursor: pointer;

  transition: background var(--v2-t-fast), color var(--v2-t-fast), border-color var(--v2-t-fast);
}

.v2-res-tag-suggestion:hover {
  background: color-mix(in srgb, var(--v2-res-tag-color, var(--v2-accent)) 20%, transparent);
  color: var(--v2-text);
}

.v2-res-tag-suggestion-count {
  color: var(--v2-text-3);
  font-size: 9px;
  font-weight: 800;
}

.v2-res-tag-suggestion.is-create {
  border-color: color-mix(in srgb, var(--v2-accent) 45%, transparent);
  background: color-mix(in srgb, var(--v2-accent) 12%, transparent);
  color: var(--v2-accent-soft);
}

@media (max-width: 860px) {
  .v2-res-search {
    max-width: none;
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .v2-res-quick {
    flex-wrap: wrap;
  }

  .v2-res-quick-input {
    flex: 1 1 100%;
  }
}

@media (max-width: 600px) {
  .v2-res-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .v2-res-actions {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   TOOLS — hub cards, GPA calculator rows, final-target results
   ============================================================ */

.v2-tool-card {
  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-sm);

  padding: 20px;
  cursor: pointer;

  transition: transform var(--v2-t), border-color var(--v2-t), box-shadow var(--v2-t);
}

.v2-tool-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--v2-tool-color, var(--v2-accent)) 40%, transparent);
  box-shadow: var(--v2-shadow);
}

.v2-tool-card-icon {
  display: grid;
  place-items: center;

  width: 44px;
  height: 44px;
  margin-bottom: 13px;

  border-radius: var(--v2-r-md);

  background: color-mix(in srgb, var(--v2-tool-color, var(--v2-accent)) 16%, transparent);
  color: var(--v2-tool-color, var(--v2-accent));
}

.v2-tool-card-title {
  margin-bottom: 5px;

  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.v2-tool-card-sub {
  color: var(--v2-text-3);
  font-size: 12px;
  line-height: 1.55;
}

/* --- GPA calculator: course rows --- */

.v2-gpa-rows {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.v2-gpa-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 11px 13px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-md);

  background: var(--v2-surface-2);
}

.v2-gpa-row-id {
  flex: 1 1 220px;
  min-width: 0;
}

.v2-gpa-row-code {
  margin-right: 7px;

  color: var(--v2-text-2);
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.v2-gpa-row-title {
  font-size: 12.5px;
  font-weight: 650;
}

.v2-gpa-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;

  margin-top: 6px;
}

.v2-gpa-row-input {
  display: flex;
  align-items: center;
  gap: 10px;

  flex: 0 0 auto;
}

.v2-gpa-mode-switch button {
  padding: 4px 9px;
  font-size: 10.5px;
}

.v2-gpa-marks-inputs {
  display: flex;
  gap: 6px;
}

.v2-input-sm {
  width: 64px;
  padding: 6px 8px;
  font-size: 12px;
}

.v2-select-sm {
  width: 78px;
  padding: 6px 24px 6px 8px;
  font-size: 12px;
  background-position: right 6px center;
  background-size: 12px;
}

.v2-gpa-row-result {
  min-width: 54px;

  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.v2-gpa-row-result small {
  color: var(--v2-text-3);
  font-weight: 650;
}

.v2-gpa-ce {
  border-top: 1px solid var(--v2-line);
  padding-top: 6px;
}

.v2-gpa-ce-row {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 9px 0;

  border-bottom: 1px dashed var(--v2-line);
}

.v2-gpa-ce-row:last-child {
  border-bottom: 0;
}

.v2-gpa-ce-info {
  display: flex;
  flex-direction: column;
  gap: 2px;

  flex: 1;
  min-width: 0;
}

/* --- final exam target --- */

.v2-ft-result {
  padding: 14px 16px;
}

.v2-ft-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;

  margin-bottom: 4px;

  font-size: 13px;
  font-weight: 720;
}

.v2-ft-result-value {
  font-size: 16px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.v2-ft-result[data-tone="mint"] {
  border-color: color-mix(in srgb, var(--v2-mint) 45%, transparent);
}

.v2-ft-result[data-tone="rose"] {
  border-color: color-mix(in srgb, var(--v2-rose) 45%, transparent);
}

.v2-ft-result[data-tone="amber"] {
  border-color: color-mix(in srgb, var(--v2-amber) 45%, transparent);
}

.v2-ft-result[data-tone="accent"] {
  border-color: color-mix(in srgb, var(--v2-accent) 40%, transparent);
}

@media (max-width: 720px) {
  .v2-gpa-row {
    align-items: flex-start;
  }

  .v2-gpa-row-input {
    width: 100%;
    justify-content: space-between;
  }
}

/* ============================================================
   GMAIL INTEGRATION
   ------------------------------------------------------------
   Isolated module: overview email button + unread count, topbar
   notification bell + dropdown (existing-notification hook),
   settings connection card, and the split-pane email page with
   its draggable divider. Nothing here is referenced outside
   this section plus the four hook points noted in v2.js.
   ============================================================ */

/* --- overview email button (lives in .v2-hero-actions) --- */

.v2-email-count {
  display: inline-grid;
  place-items: center;

  min-width: 18px;
  height: 18px;
  margin-right: -4px;
  padding: 0 5px;

  border-radius: var(--v2-r-full);

  background: var(--v2-rose);
  color: #fff;

  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

@keyframes v2EmailPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--v2-rose) 55%, transparent);
  }

  50% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--v2-rose) 0%, transparent);
  }
}

/* --- topbar notification bell --- */

.v2-notif-wrap {
  position: relative;
}

.v2-notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;

  width: 8px;
  height: 8px;

  border: 2px solid var(--v2-bg-2);
  border-radius: 50%;

  background: var(--v2-rose);

  animation: v2EmailPulse 1.8s ease-in-out infinite;
}

.v2-notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;

  width: 320px;
  max-height: 420px;

  display: flex;
  flex-direction: column;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-lg);

  overflow: hidden;

  animation: v2ModalIn 180ms cubic-bezier(0.22, 1.2, 0.36, 1);
}

.v2-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 12px 14px;

  border-bottom: 1px solid var(--v2-line);

  font-size: 12.5px;
  font-weight: 750;
}

.v2-notif-head button {
  border: 0;
  background: transparent;

  color: var(--v2-accent-soft);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.v2-notif-list {
  overflow-y: auto;
}

.v2-notif-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.v2-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 4px;

  width: 100%;
  padding: 5px 8px 5px 14px;

  border-bottom: 1px solid var(--v2-line);

  transition: background var(--v2-t-fast);
}

.v2-notif-item:last-child {
  border-bottom: 0;
}

.v2-notif-item:hover {
  background: var(--v2-surface-2);
}

.v2-notif-item.is-unread {
  background: color-mix(in srgb, var(--v2-accent) 6%, transparent);
}

.v2-notif-item-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  flex: 1;
  min-width: 0;

  padding: 6px 0;

  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.v2-notif-item-delete {
  display: grid;
  flex: 0 0 auto;
  place-items: center;

  width: 22px;
  height: 22px;
  margin-top: 8px;
  padding: 0;

  border: 0;
  border-radius: var(--v2-r-xs);

  background: transparent;
  color: var(--v2-text-3);

  opacity: 0;
  cursor: pointer;
  transition: opacity var(--v2-t-fast), background var(--v2-t-fast), color var(--v2-t-fast);
}

.v2-notif-item:hover .v2-notif-item-delete,
.v2-notif-item-delete:focus-visible {
  opacity: 1;
}

.v2-notif-item-delete:hover {
  background: var(--v2-surface-3);
  color: var(--v2-rose);
}

.v2-notif-item-icon {
  display: grid;
  place-items: center;

  flex: 0 0 auto;
  width: 26px;
  height: 26px;

  border-radius: var(--v2-r-xs);

  background: var(--v2-surface-3);
  color: var(--v2-text-2);
}

.v2-notif-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;

  flex: 1;
  min-width: 0;
}

.v2-notif-item-title {
  color: var(--v2-text);
  font-size: 12.5px;
  font-weight: 680;
}

.v2-notif-item-text {
  color: var(--v2-text-3);
  font-size: 11.5px;
  line-height: 1.4;

  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.v2-notif-item-time {
  color: var(--v2-text-3);
  font-size: 10.5px;
  font-weight: 650;
}

.v2-notif-empty {
  padding: 28px 16px;

  color: var(--v2-text-3);
  font-size: 12px;
  text-align: center;
}

/* --- settings connection card --- */

.v2-gmail-status {
  display: flex;
  align-items: center;
  gap: 11px;
}

.v2-gmail-status-dot {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;

  border-radius: 50%;
  background: var(--v2-text-3);
}

.v2-gmail-status-dot.is-on {
  background: var(--v2-mint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--v2-mint) 20%, transparent);
}

.v2-gmail-status-title {
  font-size: 13px;
  font-weight: 720;
}

/* --- split-pane email page --- */

/* Fill mode: while the inbox is showing, .v2-main is pinned to the
   viewport height and .v2-view becomes a flex column, so the inbox
   takes exactly the space left under the top bar — no magic numbers,
   and the page itself never scrolls. */
.v2-main.is-fill {
  height: 100vh;
  height: 100dvh;
}

.v2-main.is-fill .v2-view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;

  min-height: 0;
}

.v2-main.is-fill .v2-email-shell {
  flex: 1 1 auto;
  height: auto;
}

.v2-email-shell {
  display: grid;
  grid-template-columns: var(--v2-email-split, 36%) 8px 1fr;

  /* One row that is exactly as tall as the shell. With the default
     auto row the row grew to fit the whole list and overflow:hidden
     clipped it, which is why the list could not scroll. */
  grid-template-rows: minmax(0, 1fr);

  height: calc(100dvh - 230px);
  /* fallback when not in fill mode */
  min-height: 0;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-sm);
  overflow: hidden;
}

.v2-email-list-pane {
  display: flex;
  flex-direction: column;

  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--v2-line);
}

.v2-email-list-head {
  flex: 0 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 12px 14px;

  border-bottom: 1px solid var(--v2-line);

  color: var(--v2-text-3);
  font-size: 11.5px;
  font-weight: 700;
}

.v2-email-list {
  flex: 1 1 0;
  min-height: 0;

  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.v2-email-list-item {
  position: relative;

  display: flex;
  align-items: flex-start;
  gap: 10px;

  width: 100%;
  padding: 12px 14px;

  border: 0;
  border-bottom: 1px solid var(--v2-line);

  background: transparent;
  text-align: left;
  cursor: pointer;

  transition: background var(--v2-t-fast);
}

.v2-email-list-item:hover {
  background: var(--v2-surface-2);
}

.v2-email-list-item.is-active {
  background: color-mix(in srgb, var(--v2-accent) 12%, transparent);
}

.v2-email-list-item.is-unread .v2-email-subject {
  color: var(--v2-text);
  font-weight: 760;
}

.v2-email-avatar {
  display: grid;
  place-items: center;

  flex: 0 0 auto;
  width: 32px;
  height: 32px;

  border-radius: var(--v2-r-full);

  background: linear-gradient(135deg, var(--v2-accent), var(--v2-cyan));
  color: #fff;

  font-size: 12px;
  font-weight: 800;
}

.v2-email-avatar-lg {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.v2-email-list-main {
  display: flex;
  flex-direction: column;
  gap: 2px;

  flex: 1;
  min-width: 0;
}

.v2-email-list-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.v2-email-from {
  min-width: 0;

  color: var(--v2-text-2);
  font-size: 11.5px;
  font-weight: 680;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-email-date {
  flex: 0 0 auto;

  color: var(--v2-text-3);
  font-size: 10.5px;
  font-weight: 650;
}

.v2-email-subject {
  color: var(--v2-text-2);
  font-size: 12.5px;
  font-weight: 620;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-email-snippet {
  color: var(--v2-text-3);
  font-size: 11px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-email-unread-dot {
  position: absolute;
  top: 16px;
  right: 12px;

  width: 7px;
  height: 7px;

  border-radius: 50%;
  background: var(--v2-accent);
}

/* draggable divider */

.v2-email-divider {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--v2-surface-2);
  cursor: col-resize;

  touch-action: none;
}

.v2-email-divider:hover,
.v2-email-divider:focus-visible {
  background: color-mix(in srgb, var(--v2-accent) 20%, var(--v2-surface-2));
  outline: none;
}

.v2-email-divider-grip {
  display: grid;
  place-items: center;

  width: 16px;
  height: 34px;

  border-radius: var(--v2-r-xs);

  background: var(--v2-surface-3);
  color: var(--v2-text-3);
}

.v2-email-detail-pane {
  display: flex;
  flex-direction: column;

  min-width: 0;
  min-height: 0;

  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.v2-email-detail-empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
}

.v2-email-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;

  padding: 20px 22px;
}

.v2-email-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.v2-email-detail-head h2 {
  flex: 1;

  font-size: 18px;
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.v2-email-detail-meta {
  display: flex;
  align-items: center;
  gap: 11px;

  padding-bottom: 14px;
  border-bottom: 1px solid var(--v2-line);
}

.v2-email-detail-from {
  font-size: 13px;
  font-weight: 700;
}

.v2-email-detail-body {
  overflow-wrap: anywhere;
  color: var(--v2-text-2);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 860px) {
  .v2-email-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 8px minmax(0, 1fr);

    height: calc(100dvh - 160px);
    /* fallback when not in fill mode */
    min-height: 0;
  }

  .v2-email-list-pane {
    border-right: 0;
    border-bottom: 1px solid var(--v2-line);
  }

  .v2-email-divider {
    cursor: row-resize;
  }

  .v2-email-divider-grip {
    width: 34px;
    height: 16px;
  }

  .v2-notif-dropdown {
    width: min(320px, calc(100vw - 28px));
  }
}

/* ============================================================
   MOTIVATION MODULE
   ------------------------------------------------------------
   Isolated block, same pattern as GMAIL INTEGRATION above.
   Two pieces: the gallery grid (used inside the Settings-page
   card and the "Manage library" modal) and the forced player,
   which renders into its own #v2MotivationRoot instead of the
   normal (dismissable) #v2ModalRoot.
   ============================================================ */

.v2-card-head h2 {
  display: flex;
  align-items: center;
  gap: 7px;
}

.v2-mot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.v2-mot-card {
  overflow: hidden;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-md);

  background: var(--v2-surface-2);

  transition: opacity var(--v2-t);
}

.v2-mot-card.is-inactive {
  opacity: 0.5;
}

.v2-mot-thumb {
  position: relative;

  aspect-ratio: 4 / 3;

  background: var(--v2-surface-3);
}

.v2-mot-thumb img,
.v2-mot-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v2-mot-badge {
  position: absolute;
  top: 6px;
  left: 6px;

  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 2px 7px;

  border-radius: var(--v2-r-full);

  background: rgba(4, 6, 12, 0.62);
  backdrop-filter: blur(4px);

  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.v2-mot-badge-last {
  top: auto;
  bottom: 6px;
  left: 6px;

  background: color-mix(in srgb, var(--v2-accent) 75%, rgba(4, 6, 12, 0.6));
}

.v2-mot-card-body {
  padding: 9px 10px 10px;
}

.v2-mot-card-title {
  overflow: hidden;

  margin-bottom: 7px;

  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.v2-mot-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- forced player ---------- */

.v2-mot-player-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;

  display: grid;
  place-items: center;

  padding: 20px;

  background: rgba(3, 4, 8, 0.92);
  backdrop-filter: blur(6px);
}

.v2-mot-player {
  display: flex;
  flex-direction: column;
  gap: 12px;

  width: 100%;
  max-width: 560px;

  padding: 16px;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-lg);
}

.v2-mot-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.v2-mot-player-title {
  overflow: hidden;

  color: var(--v2-text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.v2-mot-player-media {
  overflow: hidden;

  max-height: 62vh;

  border-radius: var(--v2-r-md);

  background: #000;
}

.v2-mot-player-media img,
.v2-mot-player-media video {
  display: block;

  width: 100%;
  max-height: 62vh;

  object-fit: contain;
}

.v2-mot-player-bar {
  height: 3px;

  border-radius: var(--v2-r-full);

  background: var(--v2-surface-3);

  overflow: hidden;
}

.v2-mot-player-bar-fill {
  height: 100%;
  width: 0%;

  background: var(--v2-accent);
}

.v2-mot-player-foot {
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-mot-player-foot .v2-hint {
  text-align: center;
}

.v2-mot-player-continue {
  width: 100%;
}

/* ============================================================
   NOTIFICATION STACK
   ------------------------------------------------------------
   The rich toast/sticky cards pushed by the NOTIFICATIONS
   MODULE (todo reminders, Gmail arrivals, etc). Deliberately
   separate from .v2-toasts (#v2ToastRoot), which is for brief
   plain-text action feedback ("Subject updated.") — same split
   v1 keeps between showToast() and its #notificationStack.
   ============================================================ */

.v2-notif-stack {
  position: fixed;
  z-index: 400;
  top: 16px;
  right: 16px;

  display: flex;
  flex-direction: column;
  gap: 10px;

  width: min(340px, calc(100vw - 32px));

  pointer-events: none;
}

.v2-notif-card {
  pointer-events: auto;

  position: relative;
  overflow: hidden;

  display: flex;
  align-items: flex-start;
  gap: 10px;

  padding: 12px 30px 12px 13px;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-md);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-lg);

  cursor: pointer;

  animation: v2NotifCardIn 220ms cubic-bezier(0.22, 1.2, 0.36, 1);
}

.v2-notif-card.is-leaving {
  animation: v2NotifCardOut 180ms ease forwards;
}

.v2-notif-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;

  width: 28px;
  height: 28px;

  border-radius: var(--v2-r-xs);

  background: color-mix(in srgb, var(--v2-accent) 14%, transparent);
  color: var(--v2-accent-soft);
}

.v2-notif-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;

  flex: 1;
  min-width: 0;
}

.v2-notif-card-title {
  color: var(--v2-text);
  font-size: 12.5px;
  font-weight: 700;
}

.v2-notif-card-text {
  color: var(--v2-text-3);
  font-size: 11.5px;
  line-height: 1.4;
}

.v2-notif-card-close {
  position: absolute;
  top: 9px;
  right: 8px;

  display: grid;
  place-items: center;

  width: 20px;
  height: 20px;
  padding: 0;

  border: 0;
  border-radius: var(--v2-r-xs);

  background: transparent;
  color: var(--v2-text-3);

  cursor: pointer;
}

.v2-notif-card-close:hover {
  background: var(--v2-surface-3);
  color: var(--v2-text);
}

@keyframes v2NotifCardIn {
  from {
    transform: translateX(28px);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes v2NotifCardOut {
  to {
    transform: translateX(28px);
    opacity: 0;
  }
}

/* ============================================================
   REWARD CELEBRATIONS
   ------------------------------------------------------------
   Milestone popups for study hours, dev hours, and "balanced
   both today" — see the "REWARD CELEBRATIONS MODULE" section in
   app.js. Deliberately NOT built like the Motivation player:
   this is a celebration, not an obligation, so it's dismissable
   at any time (click the backdrop, press Escape, or just wait —
   it auto-dismisses on its own). Nothing here ever blocks input.

   .v2-reward-lottie is an empty, hidden-by-default slot: if a
   real Lottie player is ever wired in (see the module comment
   for exactly how), its canvas/SVG mounts here and
   .v2-reward-confetti is hidden instead — the card layout
   doesn't change either way.
   ============================================================ */

.v2-reward-backdrop {
  position: fixed;
  inset: 0;
  z-index: 450;

  display: grid;
  place-items: center;

  padding: 20px;

  background: rgba(3, 4, 8, 0.55);
  backdrop-filter: blur(3px);

  animation: v2RewardBackdropIn 220ms ease;
}

.v2-reward-backdrop.is-leaving {
  animation: v2RewardBackdropOut 180ms ease forwards;
}

.v2-reward-card {
  position: relative;
  overflow: hidden;

  width: 100%;
  max-width: 380px;

  padding: 28px 24px 24px;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-lg);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-lg);
  text-align: center;

  animation: v2RewardCardIn 420ms cubic-bezier(0.22, 1.2, 0.36, 1);
}

/* A soft radial glow behind the medallion, tinted per category
   via the --v2-reward-color custom property set inline. */
.v2-reward-card::before {
  content: "";
  position: absolute;
  top: -60px;
  left: 50%;

  width: 220px;
  height: 220px;

  background: radial-gradient(circle, color-mix(in srgb, var(--v2-reward-color) 35%, transparent), transparent 70%);
  transform: translateX(-50%);
}

.v2-reward-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.v2-reward-confetti-piece {
  position: absolute;
  top: -12px;

  width: 7px;
  height: 12px;

  border-radius: 2px;

  opacity: 0.9;

  animation-name: v2RewardConfettiFall;
  animation-timing-function: cubic-bezier(0.4, 0.1, 0.6, 1);
  animation-fill-mode: forwards;
}

.v2-reward-lottie {
  position: relative;
  z-index: 1;

  width: 96px;
  height: 96px;
  margin: 0 auto 6px;
}

.v2-reward-medallion {
  position: relative;
  z-index: 1;

  display: grid;
  place-items: center;
  margin: 0 auto 14px;

  width: 64px;
  height: 64px;

  border-radius: 50%;

  background: color-mix(in srgb, var(--v2-reward-color) 18%, var(--v2-surface));
  color: var(--v2-reward-color);

  animation: v2RewardMedallionPop 560ms cubic-bezier(0.22, 1.4, 0.36, 1) 80ms both;
}

.v2-reward-eyebrow {
  position: relative;
  z-index: 1;

  margin-bottom: 4px;

  color: var(--v2-reward-color);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.v2-reward-title {
  position: relative;
  z-index: 1;

  margin-bottom: 8px;

  color: var(--v2-text);
  font-size: 16.5px;
  font-weight: 780;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.v2-reward-stat {
  position: relative;
  z-index: 1;

  margin-bottom: 18px;

  color: var(--v2-text-3);
  font-size: 12.5px;
  line-height: 1.5;
}

.v2-reward-dismiss {
  position: relative;
  z-index: 1;

  width: 100%;
  padding: 10px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-sm);

  background: transparent;
  color: var(--v2-text-2);
  font-size: 12.5px;
  font-weight: 650;

  cursor: pointer;
  transition: background var(--v2-t-fast), color var(--v2-t-fast);
}

.v2-reward-dismiss:hover {
  background: var(--v2-surface-2);
  color: var(--v2-text);
}

.v2-reward-close {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;

  display: grid;
  place-items: center;

  width: 26px;
  height: 26px;
  padding: 0;

  border: 0;
  border-radius: var(--v2-r-xs);

  background: transparent;
  color: var(--v2-text-3);

  cursor: pointer;
}

.v2-reward-close:hover {
  background: var(--v2-surface-3);
  color: var(--v2-text);
}

@keyframes v2RewardBackdropIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes v2RewardBackdropOut {
  to {
    opacity: 0;
  }
}

@keyframes v2RewardCardIn {
  from {
    transform: scale(0.88) translateY(8px);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes v2RewardMedallionPop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }

  70% {
    transform: scale(1.12);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

@keyframes v2RewardConfettiFall {
  from {
    transform: translateY(0) rotate(0deg);
    opacity: 0.95;
  }

  to {
    transform: translateY(340px) rotate(540deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v2-reward-backdrop,
  .v2-reward-card,
  .v2-reward-medallion,
  .v2-reward-confetti-piece {
    animation: none !important;
  }
}

/* ============================================================
   AUTH GATE
   ============================================================ */

.v2-gate {
  position: fixed;
  inset: 0;
  z-index: 400;

  display: grid;
  place-items: center;

  padding: 24px;

  background: var(--v2-bg);
  background-image: var(--v2-glow);
}

.v2-gate-card {
  width: 100%;
  max-width: 380px;

  padding: 28px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-xl);

  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-lg);
}

.v2-gate-mark {
  display: block;

  width: 44px;
  height: 44px;
  margin-bottom: 16px;

  border-radius: var(--v2-r-md);
}

.v2-gate-tagline {
  margin-top: 4px;

  color: var(--v2-text-3);
  font-size: 12.5px;
  font-weight: 600;
}

.v2-gate-title {
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.v2-gate-sub {
  margin-top: 5px;
  margin-bottom: 20px;

  color: var(--v2-text-3);
  font-size: 12.5px;
  line-height: 1.55;
}

.v2-gate-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.v2-gate-error {
  padding: 9px 12px;

  border: 1px solid color-mix(in srgb, var(--v2-rose) 40%, transparent);
  border-radius: var(--v2-r-sm);

  background: color-mix(in srgb, var(--v2-rose) 12%, transparent);

  color: var(--v2-rose);
  font-size: 11.5px;
  font-weight: 620;
}

.v2-gate-foot {
  margin-top: 16px;

  color: var(--v2-text-3);
  font-size: 11.5px;
  text-align: center;
}

.v2-gate-foot button {
  border: 0;
  background: transparent;

  color: var(--v2-accent-soft);
  font-size: 11.5px;
  font-weight: 700;

  cursor: pointer;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

.v2-rail-scrim {
  position: fixed;
  inset: 0;
  z-index: 49;

  background: rgba(4, 6, 12, 0.55);
  backdrop-filter: blur(3px);
}

@media (max-width: 1000px) {
  .v2-search-trigger {
    width: 44px;
    padding: 7px;
    justify-content: center;
  }

  .v2-search-trigger span,
  .v2-search-trigger .v2-kbd {
    display: none;
  }
}

@media (max-width: 860px) {

  .v2-shell,
  .v2-shell[data-collapsed="true"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .v2-rail {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;

    width: 268px;

    transform: translateX(-100%);
    transition: transform var(--v2-t);
  }

  .v2-shell[data-drawer="true"] .v2-rail {
    transform: translateX(0);
    box-shadow: var(--v2-shadow-lg);
  }

  /* The collapsed styles must not apply to the mobile drawer. */
  .v2-shell[data-collapsed="true"] .v2-brand-text,
  .v2-shell[data-collapsed="true"] .v2-nav-label,
  .v2-shell[data-collapsed="true"] .v2-nav-badge,
  .v2-shell[data-collapsed="true"] .v2-nav-group-label,
  .v2-shell[data-collapsed="true"] .v2-rail-user-meta {
    display: revert;
  }

  .v2-shell[data-collapsed="true"] .v2-nav-item,
  .v2-shell[data-collapsed="true"] .v2-brand,
  .v2-shell[data-collapsed="true"] .v2-rail-user {
    justify-content: flex-start;
  }

  .v2-view {
    padding: 18px 15px 60px;
  }

  .v2-topbar {
    padding: 11px 15px;
  }

  .v2-cal-cell {
    min-height: 68px;
  }

  .v2-cal-event {
    font-size: 9px;
    padding: 1px 4px;
  }

  .v2-hero {
    padding: 18px;
  }

  .v2-hero-greeting {
    font-size: 19px;
  }
}

@media (max-width: 560px) {
  .v2-cal-grid {
    font-size: 11px;
  }

  .v2-cal-events {
    display: none;
  }

  .v2-cal-cell {
    min-height: 46px;
    align-items: center;
  }

  .v2-modal-foot {
    flex-direction: column-reverse;
  }

  .v2-modal-foot .v2-btn {
    width: 100%;
  }

  .v2-notif-stack {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {

  .v2-root *,
  .v2-root *::before,
  .v2-root *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {

  .v2-rail,
  .v2-topbar,
  .v2-toasts {
    display: none !important;
  }
}

/* ============================================================
   VACATION PLANNER
   ------------------------------------------------------------
   Amber is the vacation colour everywhere in v2 (calendar tint,
   heatmap outline, legend swatch), so the planner reuses it
   rather than introducing another accent.
   ============================================================ */


.v2-vac-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  margin: 12px 0 14px;
}

.v2-vac-preview {
  padding: 12px 13px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-md);

  background: var(--v2-surface-2);
}

.v2-vac-preview-main {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;

  color: var(--v2-text);
  font-size: 13px;
  font-weight: 640;
}

.v2-vac-preview-main strong {
  font-size: 19px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.v2-vac-preview-main span {
  color: var(--v2-text-3);
  font-size: 11.5px;
  font-weight: 560;
}

.v2-vac-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;

  margin-top: 9px;
}

.v2-vac-preview-meta span {
  padding: 3px 8px;

  border-radius: var(--v2-r-full);

  background: var(--v2-surface-3);

  color: var(--v2-text-3);
  font-size: 10.5px;
  font-weight: 640;
}

.v2-vac-warn {
  margin: 10px 0 0;
  padding: 0;

  list-style: none;
}

.v2-vac-warn li {
  display: flex;
  gap: 7px;
  align-items: flex-start;

  padding: 4px 0;

  color: var(--v2-amber);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
}

.v2-vac-warn svg {
  flex: none;
  margin-top: 2px;
}

.v2-vac-clear {
  display: flex;
  gap: 7px;
  align-items: center;

  margin: 10px 0 0;

  color: var(--v2-mint);
  font-size: 11.5px;
  font-weight: 600;
}

.v2-vac-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin-top: 14px;
}

.v2-vac-block-name {
  font-size: 12.5px;
  font-weight: 670;
}

.v2-vac-block-range {
  margin-top: 2px;

  color: var(--v2-text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.v2-vac-notes {
  margin: 0;
  padding-left: 17px;

  color: var(--v2-text-2);
  font-size: 12px;
  line-height: 1.65;
}

.v2-vac-notes li {
  margin-bottom: 5px;
}

.v2-vac-notes code {
  padding: 1px 5px;

  border-radius: 5px;

  background: var(--v2-surface-3);

  font-size: 11px;
}

.v2-vac-banner {
  display: flex;
  gap: 9px;
  align-items: flex-start;

  margin-bottom: 12px;
  padding: 10px 11px;

  border: 1px solid color-mix(in srgb, var(--v2-amber) 38%, transparent);
  border-radius: var(--v2-r-md);

  background: color-mix(in srgb, var(--v2-amber) 11%, transparent);
}

.v2-vac-banner svg {
  flex: none;
  margin-top: 1px;

  color: var(--v2-amber);
}

.v2-vac-banner strong {
  display: block;

  font-size: 12.5px;
  font-weight: 700;
}

.v2-vac-banner span {
  display: block;
  margin-top: 2px;

  color: var(--v2-text-3);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1100px) {

  .v2-view .v2-grid[style*="0.72fr"] {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------
   Vacation summary card (Calendar view, under the day panel)
------------------------------------------------------------ */

.v2-vac-status {
  display: flex;
  gap: 10px;
  align-items: flex-start;

  padding: 10px 11px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-md);

  background: var(--v2-surface-2);
}

.v2-vac-status.is-active {
  border-color: color-mix(in srgb, var(--v2-amber) 38%, transparent);
  background: color-mix(in srgb, var(--v2-amber) 11%, transparent);
}

.v2-vac-status svg {
  flex: none;
  margin-top: 1px;

  color: var(--v2-amber);
}

.v2-vac-status strong {
  display: block;

  font-size: 12.5px;
  font-weight: 700;
}

.v2-vac-status span {
  display: block;
  margin-top: 2px;

  color: var(--v2-text-3);
  font-size: 11px;
  line-height: 1.45;
}

.v2-vac-mini-stats {
  display: flex;
  gap: 14px;

  margin-top: 10px;

  color: var(--v2-text-3);
  font-size: 11px;
  font-weight: 600;
}

.v2-vac-mini-stats strong {
  color: var(--v2-text);
  font-size: 12.5px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   Vacation manager modal
------------------------------------------------------------ */

.v2-vac-modal-divider {
  height: 1px;
  margin: 18px 0 14px;

  background: var(--v2-line);
}

/* ------------------------------------------------------------
   REALTIME SYNC status pill (topbar, next to Refresh)
------------------------------------------------------------ */

.v2-rt-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;

  padding: 6px 10px 6px 8px;

  border: 1px solid var(--v2-line);
  border-radius: var(--v2-r-full);

  background: var(--v2-surface-2);

  color: var(--v2-text-3);
  font-size: 11px;
  font-weight: 640;
  line-height: 1;
  white-space: nowrap;

  cursor: pointer;

  transition:
    background var(--v2-t-fast),
    border-color var(--v2-t-fast),
    color var(--v2-t-fast);
}

.v2-rt-status:hover {
  background: var(--v2-surface-3);
  color: var(--v2-text-2);
}

.v2-rt-dot {
  width: 7px;
  height: 7px;
  flex: none;

  border-radius: 50%;

  background: var(--v2-text-3);
}

.v2-rt-status.is-connecting .v2-rt-dot {
  background: var(--v2-text-3);
  animation: v2-rt-pulse 1.1s ease-in-out infinite;
}

.v2-rt-status.is-live {
  border-color: color-mix(in srgb, var(--v2-mint) 32%, var(--v2-line));
  color: var(--v2-mint);
}

.v2-rt-status.is-live .v2-rt-dot {
  background: var(--v2-mint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--v2-mint) 22%, transparent);
}

.v2-rt-status.is-reconnecting {
  border-color: color-mix(in srgb, var(--v2-amber) 34%, var(--v2-line));
  color: var(--v2-amber);
}

.v2-rt-status.is-reconnecting .v2-rt-dot {
  background: var(--v2-amber);
  animation: v2-rt-pulse 0.9s ease-in-out infinite;
}

.v2-rt-status.is-offline {
  border-color: color-mix(in srgb, var(--v2-rose) 30%, var(--v2-line));
  color: var(--v2-rose);
}

.v2-rt-status.is-offline .v2-rt-dot {
  background: var(--v2-rose);
}

.v2-rt-text {
  max-width: 108px;
  overflow: hidden;

  text-overflow: ellipsis;
}

@keyframes v2-rt-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.32;
  }
}

@media (max-width: 760px) {
  .v2-rt-text {
    display: none;
  }

  .v2-rt-status {
    padding: 7px;
  }
}

/* ------------------------------------------------------------
   Study Hours dialog — optional per-subject breakdown
------------------------------------------------------------ */

.v2-hr-session-builder {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin-bottom: 10px;
}

.v2-hr-session-builder .v2-segment {
  flex: none;
}

.v2-hr-duration-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  margin-bottom: 10px;
}

.v2-duration-chip {
  padding: 6px 11px;

  border: 1px solid var(--v2-line-2);
  border-radius: var(--v2-r-full);

  background: var(--v2-surface-2);

  color: var(--v2-text-2);
  font-size: 11.5px;
  font-weight: 660;
  font-variant-numeric: tabular-nums;

  cursor: pointer;

  transition:
    background var(--v2-t-fast),
    border-color var(--v2-t-fast),
    color var(--v2-t-fast);
}

.v2-duration-chip:hover {
  background: var(--v2-surface-3);
}

.v2-duration-chip.is-on {
  border-color: color-mix(in srgb, var(--v2-accent) 45%, var(--v2-line-2));
  background: color-mix(in srgb, var(--v2-accent) 16%, var(--v2-surface-2));
  color: var(--v2-text);
}

/* The dynamic "Rest" chip — fills in exactly what's left
   unallocated — gets its own colour so it reads as a distinct,
   smarter action rather than just another fixed duration. */
.v2-duration-chip.is-rest {
  border-color: color-mix(in srgb, var(--v2-mint) 42%, var(--v2-line-2));
  color: var(--v2-mint);
}

.v2-duration-chip.is-rest.is-on {
  background: color-mix(in srgb, var(--v2-mint) 18%, var(--v2-surface-2));
  border-color: color-mix(in srgb, var(--v2-mint) 55%, var(--v2-line-2));
}

.v2-hr-duration-custom {
  display: flex;
  gap: 8px;
  align-items: center;
}

.v2-hr-duration-custom .v2-input {
  width: 92px;
  flex: none;
}

.v2-hr-duration-readout {
  flex: 1;
  min-width: 0;

  color: var(--v2-text-3);
  font-size: 11.5px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.v2-hr-session-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  margin-top: 12px;
}

.v2-hr-session-list .v2-chip {
  cursor: default;
}

@media (max-width: 560px) {
  .v2-hr-session-builder {
    flex-direction: column;
    align-items: stretch;
  }

  .v2-hr-duration-custom {
    flex-wrap: wrap;
  }

  .v2-hr-duration-custom .v2-btn {
    flex: 1;
  }
}