:root {
  --bg-sidebar: #07080b;
  --bg: #0a0b0e;
  --card: #12141a;
  --raised: #191c24;
  --line: rgba(243, 245, 248, 0.08);
  --line-strong: rgba(243, 245, 248, 0.16);
  --ink: #f3f5f8;
  --ink-2: #a8b0bf;
  --muted: #7b8496;
  --lime: #d4ff00;
  --lime-ink: #07080a;
  --action: #d4ff00;
  --accent: #d4ff00;
  --accent-soft: rgba(212, 255, 0, 0.11);
  --accent-border: rgba(212, 255, 0, 0.36);
  --action-soft: rgba(212, 255, 0, 0.10);
  --cta-bg: #d4ff00;
  --cta-ink: #07080a;
  --pos: #3ecf8e;
  --pos-soft: rgba(62, 207, 142, 0.12);
  --neg: #f2555a;
  --neg-soft: rgba(242, 85, 90, 0.12);
  --warn: #f5a623;
  --warn-soft: rgba(245, 166, 35, 0.12);
  --code-bg: #07080b;
  --glass-bg: rgba(16, 18, 24, 0.62);
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  --r-xl: 24px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-tag: 9999px;
  --r-pill: 9999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* taste-skill motion & micro-interaction tokens */
  --m-in: 180ms;
  --m-out: 220ms;
  --m-press: 90ms;
  --m-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --m-ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --m-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --m-t: 180ms;
}

body.light {
  --bg-sidebar: #eceff4;
  --bg: #f3f5f8;
  --card: #ffffff;
  --raised: #e8ecf2;
  --line: rgba(10, 11, 14, 0.08);
  --line-strong: rgba(10, 11, 14, 0.15);
  --ink: #0a0b0e;
  --ink-2: #4b5464;
  --muted: #687283;
  --lime: #d4ff00;
  --lime-ink: #07080a;
  --action: #4d7c0f;
  --accent: #65a30d;
  --accent-soft: rgba(101, 163, 13, 0.11);
  --accent-border: rgba(101, 163, 13, 0.34);
  --action-soft: rgba(101, 163, 13, 0.09);
  --cta-bg: #d4ff00;
  --cta-ink: #07080a;
  --pos: #15803d;
  --pos-soft: rgba(21, 128, 61, 0.10);
  --neg: #dc2626;
  --neg-soft: rgba(220, 38, 38, 0.10);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.10);
  --code-bg: #edf0f5;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.92), inset 0 -1px 0 rgba(10, 11, 14, 0.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: var(--action); text-decoration: none; }
a.u-link {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size var(--m-t) var(--m-ease);
}
a.u-link:hover { background-size: 100% 1px; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

/* Staggered Hero Entrance with buttery ease */
html.m-enter [data-enter] { animation: m-up 540ms var(--m-ease-enter) both; }
[data-enter="1"] { animation-delay: 0ms; }
[data-enter="2"] { animation-delay: 70ms; }
[data-enter="3"] { animation-delay: 140ms; }
[data-enter="4"] { animation-delay: 210ms; }
[data-enter="5"] { animation-delay: 280ms; }
@keyframes m-up {
  from { opacity: 0; transform: translateY(16px) scale(0.99); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes viewEnter {
  from { opacity: 0; transform: translateY(8px); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}
.view-enter { animation: viewEnter 280ms var(--m-ease-enter) both; }

/* Micro-reveal cascade for cards */
@keyframes cardPop {
  from { opacity: 0; transform: translateY(10px) scale(0.995); }
  to { opacity: 1; transform: none; }
}
.q-card {
  animation: cardPop 320ms var(--m-ease-enter) both;
}

/* App Shell */
.shell { display: flex; min-height: 100vh; }

aside.sidebar {
  width: 274px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  padding: 14px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: width 180ms var(--ease), padding 180ms var(--ease);
}

body.sidebar-collapsed aside.sidebar {
  width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
}

body:not(.sidebar-collapsed) .sidebar-expand-btn { display: none; }
body.sidebar-collapsed .sidebar-expand-btn { display: inline-flex; }

.btn.sidebar-expand-fab {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 45;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  box-shadow: var(--glass-specular), 0 10px 24px -10px rgba(0, 0, 0, 0.55);
}
body.sidebar-collapsed .shell:not(.is-home) .btn.sidebar-expand-fab { display: inline-flex; }
@media (max-width: 900px) {
  body.sidebar-collapsed .shell:not(.is-home) .btn.sidebar-expand-fab { display: none !important; }
}
@media (max-width: 900px) {
  body.sidebar-collapsed .sidebar-expand-btn { display: none; }
}

.brand {
  padding: 4px 8px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}
.brand-mark:hover { background: var(--raised); }

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.brand-sub { font-size: 12px; color: var(--muted); }

.stream-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  margin: 0 0 8px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 12px;
}

.stream-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 9999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.nav-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 16px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color var(--m-out) var(--m-ease), color var(--m-out) var(--m-ease), border-color var(--m-out) var(--m-ease);
}

.nav-item:hover { background: var(--raised); color: var(--ink); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--ink);
  border-color: var(--accent-border);
  box-shadow: inset 2px 0 0 var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-title {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-count {
  font-size: 11.5px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.save-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 2px 2px 0;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  flex-shrink: 0;
}
.sync-dot.connected { background: var(--pos); }
.sync-dot.syncing { background: var(--action); animation: m-pulse 1.2s ease-in-out infinite; }
.sync-dot.error { background: var(--neg); }
@keyframes m-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Buttons & Tactile Micro-interactions */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: 9999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: background-color var(--m-out) var(--m-ease), border-color var(--m-out) var(--m-ease), transform var(--m-out) var(--m-ease-bounce), box-shadow var(--m-out) var(--m-ease), opacity var(--m-out) var(--m-ease);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) {
    background: var(--raised);
    border-color: var(--muted);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.4);
  }
  .btn.primary:hover:not(:disabled) {
    background: var(--cta-bg);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -8px rgba(212, 255, 0, 0.45);
    opacity: 0.96;
  }
  .btn.accent:hover:not(:disabled) {
    background: var(--lime);
    transform: translateY(-1.5px);
    box-shadow: 0 8px 20px -6px rgba(212, 255, 0, 0.38);
    opacity: 0.96;
  }
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.965);
  transition-duration: var(--m-press);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary {
  background: var(--cta-bg);
  color: var(--cta-ink);
  border-color: var(--cta-bg);
  font-weight: 600;
  box-shadow: 0 4px 14px -4px rgba(212, 255, 0, 0.32);
}
.btn.accent {
  background: var(--lime);
  color: var(--lime-ink);
  border-color: var(--lime);
  font-weight: 600;
}
.btn.active-filter {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--lime-ink);
  font-weight: 600;
  box-shadow: 0 4px 12px -4px rgba(212, 255, 0, 0.35);
}
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 9999px; }

.btn .m-arrow { display: inline-flex; transition: transform var(--m-t) var(--m-ease); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover .m-arrow, .subj-card:hover .m-arrow { transform: translateX(3px); }
}

.icon-svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.theme-seg {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
}

.theme-seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 34px;
  height: 28px;
  padding: 0 9px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--m-out) var(--m-ease), color var(--m-out) var(--m-ease), transform var(--m-out) var(--m-ease-bounce), box-shadow var(--m-out) var(--m-ease);
}
.theme-seg button:active {
  transform: scale(0.92);
}
.theme-seg button.active {
  background: #f3f5f8;
  color: #0a0b0e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
body.light .theme-seg button.active {
  background: #0a0b0e;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

/* Segmented Tabs with sliding hairline/pill indicator */
.seg-tabs {
  position: relative;
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
}
.seg-tab {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 9999px;
  cursor: pointer;
  transition: color var(--m-in) var(--m-ease);
}
.seg-tab[aria-selected="true"] { color: var(--ink); }
.seg-ind {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: 9999px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  transition: transform 220ms var(--m-ease), width 220ms var(--m-ease);
  pointer-events: none;
}

/* Workspace container */
.workspace {
  flex: 1;
  min-width: 0;
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 36px 96px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.page-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
}

.page-meta {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* Home Landing Page (Architectural Optical Grid + Multi-Lens Liquid Glass) */
.shell.is-home aside.sidebar { display: none; }
.shell.is-home {
  position: relative;
  background: var(--bg);
}
.shell.is-home main.workspace {
  max-width: 1340px;
  margin: 0 auto;
  padding: 16px 32px 96px;
}

.home-header {
  position: sticky;
  top: 12px;
  z-index: 40;
  margin-bottom: 14px;
  border-radius: 9999px;
  border: 1px solid var(--line-strong);
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(175%);
  -webkit-backdrop-filter: blur(22px) saturate(175%);
  box-shadow: var(--glass-specular), 0 18px 42px -18px rgba(0, 0, 0, 0.62);
}
body.light .home-header {
  box-shadow: var(--glass-specular), 0 14px 32px -16px rgba(10, 11, 14, 0.14);
}
.liquid-gl-pane,
.hero-demo-glass,
.home-dock-glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
  pointer-events: none;
}
.home-header-inner {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 18px;
}

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

.home-brand-title {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.home-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-stage {
  position: relative;
}

/* First Screen Hero — Galuzo Bento + Multi-Lens Liquid Glass */
.hero-screen {
  position: relative;
  min-height: calc(100dvh - 156px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 0 26px;
}

/* Architectural Optical Backdrop behind Liquid Glass lenses */
.hero-optical-bg {
  position: absolute;
  inset: -12px -24px 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 28px;
}
.hero-optical-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 78% 76% at 68% 48%, rgba(0, 0, 0, 0.92), transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 78% 76% at 68% 48%, rgba(0, 0, 0, 0.92), transparent 100%);
}
.hero-optical-beam {
  position: absolute;
  right: 0;
  top: 8%;
  width: 56%;
  height: 82%;
  opacity: 0.78;
}
body.light .hero-optical-beam { opacity: 0.56; }

.hero-split {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 24px;
  align-items: center;
}
.hero-right-stage {
  display: grid;
  grid-template-columns: minmax(200px, 0.36fr) minmax(0, 0.64fr);
  gap: 16px;
  align-items: center;
}
.hero-airi-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 480px;
  pointer-events: none;
}
.hero-airi-glow {
  position: absolute;
  inset: 14% 8% 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 255, 0, 0.22) 0%, rgba(212, 255, 0, 0.04) 55%, transparent 75%);
  filter: blur(22px);
  z-index: 0;
}
.hero-airi-img {
  position: relative;
  z-index: 1;
  width: auto;
  height: clamp(460px, 60vh, 560px);
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.48));
  user-select: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 18px;
}
.hero-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  border: 1px solid rgba(7, 8, 10, 0.25);
}

.home-hero h1 {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(38px, 4.5vw, 58px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.03;
  margin: 0 0 18px;
}

.home-hero p {
  margin: 0 0 24px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.58;
  max-width: 46ch;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.hero-cta-row .btn {
  height: 44px;
  padding: 0 20px;
  font-size: 14px;
}

.hero-proof {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hero-proof-val {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero-proof-lbl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Right-side Galuzo Bento Cluster */
.hero-bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Bento Tile 1: Interactive Liquid Glass Hero Exam Card */
.hero-demo {
  grid-column: 1 / -1;
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(175%);
  -webkit-backdrop-filter: blur(22px) saturate(175%);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 18px 20px;
  box-shadow: var(--glass-specular), 0 28px 60px -24px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}
body.light .hero-demo {
  box-shadow: var(--glass-specular), 0 22px 46px -22px rgba(10, 11, 14, 0.16);
}
.hero-demo-inner {
  position: relative;
  z-index: 3;
}
.hero-demo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 11px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.demo-q {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
  color: var(--ink);
  font-weight: 500;
}
.demo-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.demo-opt {
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--m-out) var(--m-ease), background-color var(--m-out) var(--m-ease), transform var(--m-out) var(--m-ease-bounce), box-shadow var(--m-out) var(--m-ease);
}
body.light .demo-opt { background: rgba(255, 255, 255, 0.74); }
.demo-opt:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.demo-opt:active {
  transform: scale(0.965);
  transition-duration: var(--m-press);
}
.demo-opt.correct {
  background: var(--pos-soft);
  border-color: var(--pos);
  color: var(--pos);
  animation: optSuccess 360ms var(--m-ease-bounce);
}
.demo-opt.wrong {
  background: var(--neg-soft);
  border-color: var(--neg);
  color: var(--neg);
  animation: optShake 340ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes optSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes optShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}
.demo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* Bento Tile 2: Acid-Lime Focal Repeat Density Card */
.bento-tile {
  border-radius: 24px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 172px;
}
.bento-lime {
  background: var(--lime);
  color: var(--lime-ink);
  border: 1px solid rgba(7, 8, 10, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 16px 36px -22px rgba(212, 255, 0, 0.42);
}
.bento-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bento-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}
.bento-pill-dark {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(7, 8, 10, 0.11);
  color: var(--lime-ink);
}
.bento-big {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.bento-sub {
  font-size: 12px;
  opacity: 0.78;
  margin-top: 2px;
}
.bento-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: end;
  height: 54px;
  padding-top: 4px;
}
.bento-bar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--lime-ink);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
}
.bento-bar-track {
  width: 16px;
  height: 40px;
  margin: 0 auto;
  border-radius: 9999px;
  background: rgba(7, 8, 10, 0.14);
  display: flex;
  align-items: flex-end;
  padding: 2px;
  overflow: hidden;
}
.bento-bar-fill {
  width: 100%;
  border-radius: 9999px;
  background: var(--lime-ink);
  transition: transform var(--m-out) var(--m-ease);
}
.bento-bar-btn:hover .bento-bar-fill {
  transform: scaleY(1.06);
}

/* Bento Tile 3: Mastery Gauge Card */
.bento-gauge {
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.bento-gauge-body {
  display: flex;
  align-items: center;
  gap: 14px;
}
.gauge-ring {
  position: relative;
  width: 66px;
  height: 66px;
  flex-shrink: 0;
}
.gauge-ring svg {
  width: 66px;
  height: 66px;
  transform: rotate(-90deg);
}
.gauge-ring-bg {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 6;
}
.gauge-ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 450ms var(--m-ease);
}
.gauge-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.gauge-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--ink-2);
}
.gauge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.gauge-row strong {
  color: var(--ink);
  font-weight: 600;
}

/* Floating Bottom Stream Capsule Dock (Liquid Glass Lens #3) */
.home-dock {
  position: sticky;
  bottom: 14px;
  z-index: 38;
  width: fit-content;
  max-width: calc(100vw - 32px);
  margin: 4px auto 0;
  border-radius: 9999px;
  border: 1px solid var(--line-strong);
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--glass-specular), 0 18px 42px -14px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}
body.light .home-dock {
  box-shadow: var(--glass-specular), 0 16px 34px -14px rgba(10, 11, 14, 0.16);
}
.home-dock-inner {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.home-dock-inner::-webkit-scrollbar { display: none; }
.dock-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 8px 0 6px;
  white-space: nowrap;
}
.dock-pill {
  height: 30px;
  padding: 0 12px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--m-out) var(--m-ease), border-color var(--m-out) var(--m-ease), color var(--m-out) var(--m-ease);
}
.dock-pill:hover {
  background: var(--raised);
  border-color: var(--line-strong);
}
.dock-pill.lime {
  background: var(--lime);
  color: var(--lime-ink);
  border-color: var(--lime);
}

/* Second Screen: Subjects Directory */
.subjects-section {
  padding-top: 38px;
}

.resume-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-radius: 9999px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--accent-border);
  box-shadow: var(--glass-specular);
  margin-bottom: 24px;
  font-size: 13.5px;
}

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.group-head h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.group-head span {
  font-size: 12.5px;
  color: var(--muted);
}

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

.subj-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color var(--m-out) var(--m-ease), transform var(--m-out) var(--m-ease-bounce), box-shadow var(--m-out) var(--m-ease);
}

@media (hover: hover) and (pointer: fine) {
  .subj-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-4px) scale(1.008);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 20px 42px -20px rgba(212, 255, 0, 0.28), 0 8px 18px -6px rgba(0, 0, 0, 0.4);
  }
}
.subj-card:active {
  transform: translateY(1px) scale(0.985);
  transition-duration: var(--m-press);
}

.subj-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.subj-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 10px 0 4px;
}

.subj-desc {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0;
}

.subj-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.subj-metric-val {
  font-size: 15.5px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

.subj-metric-lbl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.subj-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

/* Toolbar & Inputs */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
}

.toolbar input, .toolbar select {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
}
.toolbar input { flex: 1; min-width: 210px; }
.toolbar input:focus, .toolbar select:focus {
  outline: none;
  border-color: var(--action);
}

/* Stats & Overview */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}

.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-val {
  font-size: 27px;
  font-weight: 600;
  line-height: 1.15;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th, table.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
table.data-table th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr[data-nav]:hover { background: var(--raised); }

.bar-track {
  width: 100%;
  height: 6px;
  background: var(--raised);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--action), var(--accent));
  border-radius: 4px;
  transition: width 320ms var(--ease);
}

/* Sections & Question Cards */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
  margin: 28px 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  font-weight: 500;
}

.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 14px;
  transition: border-color var(--m-out) var(--m-ease);
}
.q-card.focused { border-color: var(--action); }
.q-card.state-mastered { border-left: 3px solid var(--pos); }
.q-card.state-review { border-left: 3px solid var(--neg); }

.q-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--r-tag);
  font-size: 12px;
  font-weight: 500;
  background: var(--raised);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag.repeat {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.25);
}
.tag.marks { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

.q-prompt {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  max-width: 74ch;
  overflow-x: auto;
}
.q-prompt p:first-child { margin-top: 0; }
.q-prompt p:last-child { margin-bottom: 0; }

.q-prompt pre, .sol-box pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.q-prompt code, .sol-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Electronics Boolean Overlines */
.bar, .overline {
  text-decoration: overline;
  text-decoration-thickness: 1.5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.q-prompt table, .sol-box table {
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  width: auto;
  max-width: 100%;
  display: block;
  overflow-x: auto;
}
.q-prompt th, .q-prompt td, .sol-box th, .sol-box td {
  border: 1px solid var(--line-strong);
  padding: 6px 10px;
}
.q-prompt th, .sol-box th {
  background: var(--raised);
  color: var(--ink);
  font-weight: 600;
}

.q-prompt img, .sol-box img {
  background: #ffffff;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px 0;
}

/* MathJax containment */
mjx-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
}
mjx-container[display="true"] {
  display: block !important;
  margin: 10px 0 !important;
  padding: 6px 2px;
}

/* MCQ Grid & Image Options */
.mcq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.mcq-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--raised);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--m-out) var(--m-ease), background-color var(--m-out) var(--m-ease), transform var(--m-out) var(--m-ease-bounce), box-shadow var(--m-out) var(--m-ease);
}

@media (hover: hover) and (pointer: fine) {
  .mcq-opt:hover {
    border-color: var(--muted);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  }
}
.mcq-opt:active {
  transform: translateY(1px) scale(0.975);
  transition-duration: var(--m-press);
}
.mcq-opt.selected {
  border-color: var(--action);
  background: var(--action-soft);
  box-shadow: 0 0 0 2px var(--action-soft);
}
.mcq-opt.correct {
  background: var(--pos-soft);
  border-color: var(--pos);
  color: var(--pos);
  animation: optSuccess 360ms var(--m-ease-bounce);
}
.mcq-opt.wrong {
  background: var(--neg-soft);
  border-color: var(--neg);
  color: var(--neg);
  animation: optShake 340ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
.mcq-opt .opt-body { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; padding: 3px 0; }
.mcq-opt .opt-body mjx-container[display="true"] {
  display: inline-block !important;
  text-align: left !important;
  margin: 0 !important;
  padding: 2px 0;
}
.mcq-opt .opt-body img {
  background: #ffffff;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  max-height: 92px;
  width: auto;
  display: inline-block;
  margin: 0;
}

.mcq-feedback { margin-top: 8px; font-size: 13px; font-weight: 500; }
.mcq-feedback.ok { color: var(--pos); }
.mcq-feedback.bad { color: var(--neg); }

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.q-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sol-box {
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--code-bg);
  border: 1px solid var(--line-strong);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 74ch;
  overflow-x: auto;
  animation: solReveal 240ms var(--m-ease-enter) both;
}
.sol-box.hidden { display: none; }
@keyframes solReveal {
  from { opacity: 0; transform: translateY(-6px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.sol-label { font-size: 12.5px; font-weight: 600; color: var(--pos); margin-bottom: 6px; }
.conf-group { display: flex; gap: 6px; }
.conf-btn.active-pos { background: var(--pos-soft); border-color: var(--pos); color: var(--pos); }
.conf-btn.active-neg { background: var(--neg-soft); border-color: var(--neg); color: var(--neg); }

.note-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--action-soft);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-size: 14px;
  max-width: 74ch;
}

.note-editor {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--raised);
  border: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-editor textarea {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line-strong);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.banner-warn {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  color: var(--warn);
  font-size: 13px;
  margin-bottom: 16px;
}

/* Ambient Boot Stage & Subtle Stream Skeleton */
.boot-stage {
  min-height: calc(100dvh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.boot-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  animation: m-pulse 1.4s ease-in-out infinite;
}
@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-block {
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: skelShimmer 1.6s ease-in-out infinite;
}
body.light .skel-block {
  background: linear-gradient(90deg, rgba(10, 11, 14, 0.04) 25%, rgba(10, 11, 14, 0.08) 50%, rgba(10, 11, 14, 0.04) 75%);
  background-size: 200% 100%;
}
.skel-pill { border-radius: 9999px; }
.skel-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px 22px;
}

/* Mobile App Bottom Navigation (Workspaces <= 900px) */
.app-bottom-nav { display: none; }
.shell.is-home .app-bottom-nav { display: none !important; }

/* Modals (Cloud Sync & Command Search) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }

.modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--glass-specular), 0 28px 70px rgba(0, 0, 0, 0.55);
  animation: modalIn 260ms var(--m-ease-bounce) both;
  max-height: 90vh;
  overflow-y: auto;
}
.oauth-btn {
  width: 100%;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 9999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--m-out) var(--m-ease), border-color var(--m-out) var(--m-ease), transform var(--m-press) var(--m-ease);
}
.oauth-btn:hover { background: var(--raised); border-color: var(--muted); transform: translateY(-1px); }
.oauth-btn:active { transform: translateY(1px) scale(0.99); }
.oauth-btn.is-disabled { opacity: 0.64; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  font-size: 12px;
  color: var(--muted);
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -0.015em; }
.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field-group label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field-group input {
  height: 36px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--raised);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
}
.field-group input:focus { outline: none; border-color: var(--action); }

/* Toast notification */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 95;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--raised);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms var(--m-ease-enter), opacity 180ms var(--m-ease-enter);
}
.toast.show { transform: none; opacity: 1; }
.toast.ok { border-color: var(--pos); }
.toast.err { border-color: var(--neg); }

/* Command Palette Search Results */
.cmd-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; margin-top: 8px; }
.cmd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.cmd-row:hover { background: var(--raised); border-color: var(--line); }

.mobile-bar { display: none; }
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 55;
}

@media (max-width: 900px) {
  .mascot-dock { display: none !important; }
  .shell { flex-direction: column; width: 100%; max-width: 100%; overflow-x: clip; }
  .shell.is-home main.workspace { width: 100%; max-width: 100%; padding: 10px 14px 92px; }
  .workspace { width: 100%; max-width: 100%; min-width: 0; padding: 16px 14px 84px; }
  .home-stage, .hero-screen, .hero-split, .home-hero, .hero-bento, .hero-demo, .bento-tile, .panel, .stat-card, .q-card { min-width: 0; max-width: 100%; }
  .panel { padding: 16px; border-radius: 20px; }
  .table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .home-header { top: 8px; margin-bottom: 12px; border-radius: 9999px; }
  .home-header-inner { padding: 7px 10px 7px 14px; gap: 8px; flex-wrap: nowrap; }
  .hero-screen { min-height: auto; padding: 8px 0 18px; }
  .hero-optical-bg { inset: 0; }
  .hero-split { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hero-right-stage { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .hero-airi-wrap { min-height: 0; justify-content: center; }
  .hero-airi-img { height: 280px; }
  .hero-eyebrow { font-size: 11.5px; padding: 4px 10px; margin-bottom: 12px; }
  .home-hero h1 { font-size: clamp(31px, 8.5vw, 42px); line-height: 1.04; margin-bottom: 12px; }
  .home-hero p { font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
  .hero-cta-row { gap: 8px; margin-bottom: 18px; }
  .hero-cta-row .btn { height: 42px; padding: 0 16px; font-size: 13.5px; }
  .hero-proof {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--line);
  }
  .hero-proof-val { font-size: 16px; }
  .hero-proof-lbl { font-size: 10.5px; }
  .hero-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hero-demo { padding: 14px 15px; border-radius: 22px; }
  .hero-demo-top { flex-wrap: wrap; gap: 6px; padding-bottom: 10px; margin-bottom: 10px; }
  .seg-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .bento-tile { padding: 14px; border-radius: 20px; min-height: 152px; gap: 8px; }
  .bento-kicker { font-size: 10px; }
  .bento-pill-dark { font-size: 10px; padding: 2px 7px; }
  .bento-big { font-size: 24px; }
  .bento-sub { font-size: 11px; }
  .bento-bars { gap: 4px; height: 46px; }
  .bento-bar-track { width: 12px; height: 32px; }
  .bento-bar-btn { font-size: 9px; }
  .bento-gauge-body { flex-direction: column; align-items: flex-start; gap: 8px; }
  .gauge-ring { width: 50px; height: 50px; }
  .gauge-ring svg { width: 50px; height: 50px; }
  .gauge-val { font-size: 11.5px; }
  .gauge-meta { width: 100%; font-size: 11px; gap: 2px; }
  .home-dock {
    position: fixed;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
    margin: 0 auto;
    z-index: 48;
    border-radius: 9999px;
  }
  .dock-label { display: none; }
  .home-dock-inner { justify-content: space-between; padding: 5px 6px; gap: 4px; }
  .dock-pill { height: 32px; padding: 0 11px; font-size: 12px; }
  .group-head { flex-direction: column; align-items: flex-start; gap: 3px; margin: 22px 0 12px; }
  .subject-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .subj-card { padding: 16px 18px; border-radius: 20px; gap: 14px; }
  .demo-opts { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .mobile-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
  }
  #mobileTitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shell.is-home .mobile-bar { display: none !important; }
  aside.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    width: 286px;
    transform: translateX(-100%);
    transition: transform 200ms var(--ease);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
  aside.sidebar.open { transform: translateX(0); }
  .drawer-backdrop.open { display: block !important; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 14px 16px; border-radius: 18px; }
  .stat-val { font-size: 22px; }
  .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .toolbar input { grid-column: 1 / -1; min-width: 0; width: 100%; height: 40px; border-radius: 12px; }
  .toolbar select, .toolbar .btn { width: 100%; min-width: 0; height: 38px; border-radius: 12px; }
  .mcq-grid { grid-template-columns: minmax(0, 1fr); }
  .q-card { padding: 16px; border-radius: 20px; }
  .btn { min-height: 38px; }
  .theme-seg button { min-width: 36px; height: 30px; padding: 0 9px; }
  .app-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    position: fixed;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    padding: 5px;
    z-index: 48;
    border-radius: 9999px;
    border: 1px solid var(--line-strong);
    background: var(--glass-bg);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    box-shadow: var(--glass-specular), 0 16px 36px -14px rgba(0, 0, 0, 0.55);
  }
  .app-nav-item {
    flex: 1;
    height: 34px;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--ink-2);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color var(--m-out) var(--m-ease), color var(--m-out) var(--m-ease), transform var(--m-out) var(--m-ease-bounce), box-shadow var(--m-out) var(--m-ease);
  }
  .app-nav-item:active {
    transform: scale(0.92);
  }
  .app-nav-item.active {
    background: var(--lime);
    color: var(--lime-ink);
    box-shadow: 0 2px 10px -2px rgba(212, 255, 0, 0.4);
  }
}

@media (max-width: 640px) {
  .home-brand .tag { display: none; }
  .home-brand-title { font-size: 15.5px; }
  .home-header-actions { gap: 6px; flex-wrap: nowrap; }
  .home-header-actions .kbd,
  .home-header-actions .hide-xs { display: none; }
  .home-header-actions .btn.sm { min-height: 32px; height: 32px; padding: 0 10px; font-size: 12px; }
  .home-dock-inner .dock-pill:last-child { display: none; }
  .dock-pill { padding: 0 10px; font-size: 11.5px; }
  .resume-strip { border-radius: 18px; padding: 12px 14px; }
}

@media print {
  aside.sidebar, .mobile-bar, .toolbar, .q-actions, .toast, .modal-backdrop { display: none !important; }
  .sol-box.hidden { display: block !important; }
}

@media (prefers-reduced-motion: reduce) {
  #mascotImg { animation: none !important; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* Airi Study Companion Dock */
.mascot-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 36;
  pointer-events: none;
}
.shell.is-home ~ .mascot-dock { display: none; }
.mascot-dock > * { pointer-events: auto; }
.mascot-restore {
  display: none;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1px solid var(--line-strong);
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--glass-specular), 0 12px 28px -12px rgba(0, 0, 0, 0.55);
  transition: transform var(--m-out) var(--m-ease-bounce), border-color var(--m-out) var(--m-ease);
}
.mascot-restore:hover { transform: translateY(-2px); border-color: var(--accent-border); }
.mascot-dock.is-minimized .mascot-card { display: none; }
.mascot-dock.is-minimized .mascot-restore { display: inline-flex; }

.mascot-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.mascot-bubble {
  width: 184px;
  padding: 8px 11px 9px;
  border-radius: 14px 14px 4px 14px;
  border: 1px solid var(--line-strong);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(175%);
  -webkit-backdrop-filter: blur(20px) saturate(175%);
  box-shadow: var(--glass-specular), 0 16px 34px -16px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform var(--m-out) var(--m-ease-bounce), border-color var(--m-out) var(--m-ease);
}
.mascot-bubble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mascot-name {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}
.mascot-line {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
}
.mascot-avatar-btn {
  position: relative;
  width: 76px;
  height: 76px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  background: radial-gradient(circle at 50% 28%, #1d212d 0%, #090b10 100%);
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: transform var(--m-out) var(--m-ease-bounce), border-color var(--m-out) var(--m-ease), box-shadow var(--m-out) var(--m-ease);
}
.mascot-avatar-btn:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: var(--accent-border);
  box-shadow: 0 16px 34px -10px rgba(212, 255, 0, 0.35), 0 0 0 3px var(--accent-soft);
}
.mascot-avatar-btn:active { transform: scale(0.95); }
.mascot-avatar-btn.is-reacting {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 14px 30px -8px rgba(212, 255, 0, 0.38);
  animation: mascotPop 340ms var(--m-ease-bounce) both;
}
@keyframes mascotPop {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
#mascotImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.mascot-min {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--m-out) var(--m-ease), background-color var(--m-out) var(--m-ease), border-color var(--m-out) var(--m-ease);
}
.mascot-min:hover { color: var(--ink); background: var(--raised); border-color: var(--line-strong); }
