:root {
  color-scheme: dark;
  --bg: #08090a;
  --bg-deep: #050607;
  --surface: #101214;
  --surface-2: #15181a;
  --surface-3: #1b1f22;
  --surface-hover: #1e2225;
  --line: #252a2e;
  --line-strong: #343a3f;
  --text: #f4f6f7;
  --text-soft: #d9dee1;
  --muted: #939da4;
  --dim: #657078;
  --lime: #c9f56a;
  --cyan: #66d9ef;
  --blue: #82b8ff;
  --coral: #ff8c7a;
  --orange: #ffb86b;
  --gold: #f2ce73;
  --danger: #ff7a6b;
  --success: #9ce68a;
  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.36);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scrollbar-color: var(--line-strong) transparent;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 15% -10%, rgba(201, 245, 106, 0.055), transparent 33rem),
    radial-gradient(circle at 100% 10%, rgba(102, 217, 239, 0.035), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.2;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 100% 72px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

::selection {
  color: #0a0b0c;
  background: var(--lime);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

img,
svg {
  display: block;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.boot-screen {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  align-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.boot-mark {
  position: relative;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  animation: breathe 1.8s ease-in-out infinite;
}

.boot-mark::before,
.boot-mark span {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.boot-mark::before {
  inset: 9px;
  border: 1px solid var(--line);
}

.boot-mark span {
  width: 12px;
  height: 12px;
  top: 5px;
  right: 7px;
  background: var(--lime);
  box-shadow: 0 0 24px rgba(201, 245, 106, 0.46);
}

@keyframes breathe {
  50% { transform: scale(1.045); opacity: 0.74; }
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
}

/* Auth */
.auth-screen {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
}

.auth-story {
  position: relative;
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(34px, 5.5vw, 78px);
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 74% 42%, rgba(102, 217, 239, 0.12), transparent 19rem),
    radial-gradient(circle at 40% 30%, rgba(201, 245, 106, 0.1), transparent 22rem),
    linear-gradient(145deg, #0c0e10, #070809 72%);
}

.auth-story::after {
  position: absolute;
  right: -15%;
  bottom: -22%;
  width: 66vw;
  height: 66vw;
  max-width: 920px;
  max-height: 920px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 86px rgba(255, 255, 255, 0.012),
    0 0 0 172px rgba(255, 255, 255, 0.008);
}

.brand-large {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #31373b;
  border-radius: 50%;
  background: #101214;
}

.brand-mark::before {
  position: absolute;
  inset: 9px;
  border: 1px solid #3a4146;
  border-radius: 50%;
  content: "";
}

.brand-mark::after {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 18px rgba(201, 245, 106, 0.55);
  content: "";
}

.brand-mark > span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  transform: translate(-50%, -50%);
}

.brand-word strong {
  display: block;
  font-size: 16px;
  font-weight: 740;
  letter-spacing: -0.015em;
}

.brand-word span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-hero {
  position: relative;
  z-index: 1;
  max-width: 770px;
  margin: clamp(48px, 10vh, 130px) 0;
}

.auth-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-kicker::before {
  width: 26px;
  height: 1px;
  background: currentColor;
  content: "";
}

.auth-title {
  max-width: 760px;
  margin: 0;
  font-size: clamp(48px, 6.2vw, 94px);
  font-weight: 770;
  letter-spacing: -0.062em;
  line-height: 0.94;
}

.auth-title em {
  color: var(--lime);
  font-style: normal;
}

.auth-lead {
  max-width: 630px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.45vw, 19px);
  line-height: 1.75;
}

.auth-subjects {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 740px;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 0;
  margin: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}

.auth-subjects li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-subjects span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--subject-accent, var(--muted));
}

.auth-panel {
  display: flex;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 44px clamp(28px, 6vw, 92px);
  background: rgba(8, 9, 10, 0.82);
}

.login-card {
  width: min(100%, 430px);
}

.login-eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-card h2 {
  margin: 0;
  font-size: 38px;
  font-weight: 730;
  letter-spacing: -0.035em;
}

.login-copy {
  margin: 14px 0 34px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.field {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.field label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field textarea,
.field select,
.ocr-editor {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.field input,
.field select {
  height: 50px;
  padding: 0 15px;
}

.field textarea {
  min-height: 120px;
  padding: 14px 15px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.ocr-editor:focus {
  border-color: #4a555c;
  background: var(--surface-2);
  box-shadow: 0 0 0 4px rgba(102, 217, 239, 0.06);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 92px;
}

.password-toggle {
  position: absolute;
  right: 7px;
  top: 7px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.login-button {
  width: 100%;
  height: 52px;
}

.login-security {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.55;
}

.login-security .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.form-error {
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 122, 107, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 122, 107, 0.07);
  color: #ffc0b8;
  font-size: 12px;
  line-height: 1.5;
}

/* Shared controls */
.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn-primary {
  border-color: var(--lime);
  background: var(--lime);
  color: #0b0c0d;
}

.btn-primary:hover {
  border-color: #d8ff8a;
  background: #d8ff8a;
  color: #070808;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

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

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

.btn-icon {
  width: 42px;
  padding: 0;
}

.icon-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

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

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.text-link,
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.text-link:hover,
.link-btn:hover {
  color: var(--text);
}

.text-link .icon,
.link-btn .icon {
  width: 14px;
  height: 14px;
}

.pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill-accent {
  border-color: rgba(201, 245, 106, 0.22);
  background: rgba(201, 245, 106, 0.075);
  color: var(--lime);
}

.pill-cyan {
  border-color: rgba(102, 217, 239, 0.22);
  background: rgba(102, 217, 239, 0.07);
  color: var(--cyan);
}

.pill-warn {
  border-color: rgba(255, 184, 107, 0.22);
  background: rgba(255, 184, 107, 0.07);
  color: var(--orange);
}

.pill-danger {
  border-color: rgba(255, 122, 107, 0.25);
  background: rgba(255, 122, 107, 0.075);
  color: var(--coral);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.live {
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(201, 245, 106, 0.07);
}

/* Shell */
.app-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden auto;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(8, 9, 10, 0.9);
  backdrop-filter: blur(18px);
}

.sidebar-top {
  padding: 0 8px 24px;
}

.sidebar .brand-large {
  gap: 12px;
}

.sidebar .brand-mark {
  width: 36px;
  height: 36px;
}

.sidebar .brand-mark::before {
  inset: 8px;
}

.sidebar .brand-mark::after {
  top: 2px;
  right: 3px;
  width: 9px;
  height: 9px;
}

.sidebar .brand-word strong {
  font-size: 14px;
  white-space: nowrap;
}

.nav-label {
  padding: 0 11px;
  margin: 17px 0 7px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 3px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-item {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 580;
  transition: background 150ms ease, color 150ms ease;
}

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

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

.nav-item.active::before {
  position: absolute;
  left: 0;
  width: 2px;
  height: 18px;
  border-radius: 3px;
  background: var(--lime);
  content: "";
}

.nav-item .icon {
  width: 18px;
  height: 18px;
}

.nav-item .nav-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 19px;
  text-align: center;
}

.subject-nav {
  display: grid;
  gap: 1px;
}

.subject-mini {
  display: grid;
  min-height: 38px;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
}

.subject-mini:hover {
  background: var(--surface);
  color: var(--text);
}

.subject-mini-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, var(--muted));
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent, var(--muted)) 34%, transparent);
}

.subject-mini span:last-child {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 9px 2px;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #3b4247;
  border-radius: 50%;
  background: linear-gradient(145deg, #1d2225, #101214);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.user-compact {
  min-width: 0;
  flex: 1;
}

.user-compact strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-compact span {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(22px, 3vw, 42px);
  border-bottom: 1px solid rgba(37, 42, 46, 0.75);
  background: rgba(8, 9, 10, 0.78);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 11px;
}

.crumbs .current {
  color: var(--text-soft);
}

.crumbs .icon {
  width: 12px;
  height: 12px;
}

.search-trigger {
  display: flex;
  width: min(280px, 26vw);
  height: 36px;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(16, 18, 20, 0.65);
  color: var(--dim);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.search-trigger:hover {
  border-color: var(--line-strong);
  color: var(--muted);
}

.search-trigger .icon {
  width: 15px;
  height: 15px;
}

.search-trigger span {
  flex: 1;
}

.kbd {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
}

.sync-chip {
  display: flex;
  height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: 9px;
}

.content {
  width: 100%;
  max-width: 1640px;
  padding: clamp(24px, 3.6vw, 52px) clamp(22px, 3.5vw, 50px) 70px;
  margin: 0 auto;
}

.page {
  animation: page-in 360ms cubic-bezier(0.2, 0.75, 0.3, 1);
}

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

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.page-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.page-kicker .status-dot {
  background: var(--accent, var(--lime));
}

.page-title {
  margin: 0;
  font-size: clamp(36px, 4.1vw, 60px);
  font-weight: 730;
  letter-spacing: -0.052em;
  line-height: 0.98;
}

.page-subtitle {
  max-width: 690px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

/* Dashboard */
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 322px;
  gap: clamp(22px, 2.6vw, 38px);
}

.dashboard-main,
.dashboard-rail {
  min-width: 0;
}

.dashboard-main {
  display: grid;
  align-content: start;
  gap: 30px;
}

.dashboard-rail {
  display: grid;
  align-content: start;
  gap: 18px;
}

.focus-panel {
  position: relative;
  display: grid;
  min-height: 304px;
  grid-template-columns: minmax(0, 1.3fr) minmax(210px, 0.7fr);
  overflow: hidden;
  padding: clamp(26px, 3.1vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 83% 50%, rgba(102, 217, 239, 0.1), transparent 15rem),
    radial-gradient(circle at 22% 115%, rgba(201, 245, 106, 0.065), transparent 17rem),
    linear-gradient(145deg, #121517, #0c0e10);
  box-shadow: var(--shadow-soft);
}

.focus-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 100% 52px;
  content: "";
  mask-image: linear-gradient(to right, black, transparent 70%);
}

.focus-copy,
.focus-visual {
  position: relative;
  z-index: 1;
}

.focus-copy {
  display: flex;
  max-width: 690px;
  flex-direction: column;
  align-items: flex-start;
}

.focus-subject {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.focus-subject-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, var(--lime));
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent, var(--lime)) 46%, transparent);
}

.focus-title {
  max-width: 800px;
  margin: 18px 0 0;
  font-size: clamp(32px, 3.5vw, 51px);
  font-weight: 720;
  letter-spacing: -0.048em;
  line-height: 1.04;
}

.focus-summary {
  max-width: 700px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
}

.focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.focus-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: auto;
  padding-top: 28px;
}

.focus-stat strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.focus-stat span {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.focus-visual {
  display: grid;
  align-items: center;
  justify-items: center;
}

.progress-orbit {
  --progress: 0;
  --orbit-accent: var(--lime);
  position: relative;
  display: grid;
  width: clamp(172px, 17vw, 220px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--orbit-accent) calc(var(--progress) * 1%), rgba(255, 255, 255, 0.07) 0);
  box-shadow: 0 0 70px color-mix(in srgb, var(--orbit-accent) 9%, transparent);
}

.progress-orbit::before {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #0d0f10;
  content: "";
}

.progress-orbit::after {
  position: absolute;
  inset: -16px;
  border: 1px dashed rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  content: "";
  animation: orbit-rotate 26s linear infinite;
}

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

.progress-core {
  position: relative;
  z-index: 1;
  text-align: center;
}

.progress-core strong {
  display: block;
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 730;
  letter-spacing: -0.06em;
  line-height: 1;
}

.progress-core span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.focus-visual-caption {
  margin: 28px 0 0;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
}

.policy-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.policy-item {
  padding: 16px 18px;
}

.policy-item + .policy-item {
  border-left: 1px solid var(--line);
}

.policy-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.policy-item p {
  margin: 9px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
}

.section-block {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 19px;
  font-weight: 660;
  letter-spacing: -0.025em;
}

.section-title .icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.section-meta {
  color: var(--dim);
  font-size: 10px;
}

.agenda-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 18, 20, 0.72);
}

.agenda-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agenda-row {
  display: grid;
  min-height: 62px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}

.agenda-row + .agenda-row {
  border-top: 1px solid var(--line);
}

.check-button {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

.check-button:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.check-button .icon {
  width: 12px;
  height: 12px;
}

.agenda-row.done .agenda-title {
  color: var(--dim);
  text-decoration: line-through;
}

.agenda-title {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 560;
}

.agenda-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  color: var(--dim);
  font-size: 9px;
}

.agenda-type {
  color: var(--cyan);
}

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

.subject-card {
  position: relative;
  display: flex;
  min-height: 146px;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.subject-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.subject-card::after {
  position: absolute;
  right: -22px;
  bottom: -38px;
  width: 100px;
  height: 100px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 50%;
  content: "";
}

.subject-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subject-abbr {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.subject-card .icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
  opacity: 0.72;
}

.subject-name {
  margin: 17px 0 0;
  font-size: 18px;
  font-weight: 670;
  letter-spacing: -0.025em;
}

.subject-en {
  margin: 2px 0 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subject-progress {
  height: 3px;
  overflow: hidden;
  margin-top: auto;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
}

.subject-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.subject-statline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: var(--dim);
  font-size: 9px;
}

.activity-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.activity-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}

.activity-row + .activity-row {
  border-top: 1px solid var(--line);
}

.activity-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}

.activity-icon .icon {
  width: 14px;
  height: 14px;
}

.activity-summary {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.activity-time {
  margin-top: 3px;
  color: var(--dim);
  font-size: 9px;
}

.rail-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 18, 20, 0.72);
}

.rail-panel-accent {
  border-color: rgba(201, 245, 106, 0.14);
  background:
    radial-gradient(circle at 100% 0, rgba(201, 245, 106, 0.06), transparent 11rem),
    var(--surface);
}

.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.rail-heading h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.rail-heading .icon {
  width: 15px;
  height: 15px;
  color: var(--dim);
}

.ai-peek-title {
  margin: 0;
  font-size: 20px;
  font-weight: 670;
  letter-spacing: -0.025em;
  line-height: 1.32;
}

.ai-peek-copy {
  margin: 10px 0 17px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.weak-list,
.doc-mini-list {
  display: grid;
  gap: 1px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.weak-row {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
}

.weak-row + .weak-row {
  border-top: 1px solid var(--line);
}

.weak-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
}

.weak-title {
  overflow: hidden;
  margin: 0;
  font-size: 11px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weak-subject {
  margin-top: 3px;
  color: var(--dim);
  font-size: 8px;
}

.weak-score {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.metric-box {
  padding: 14px;
  background: var(--surface-2);
}

.metric-box strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.metric-box span {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-mini {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
}

.doc-mini + .doc-mini {
  border-top: 1px solid var(--line);
}

.doc-mini-icon {
  display: grid;
  width: 28px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
}

.doc-mini-icon .icon {
  width: 14px;
  height: 14px;
}

.doc-mini strong {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-mini span {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-size: 8px;
}

.empty-line {
  padding: 18px 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.6;
}

/* Curriculum */
.curriculum-layout {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr) minmax(280px, 340px);
  gap: 0;
  overflow: hidden;
  min-height: 650px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.subject-rail {
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: #0b0d0e;
}

.subject-rail-label {
  padding: 8px 10px 12px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.subject-rail-list {
  display: grid;
  gap: 4px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.subject-rail-item {
  display: grid;
  min-height: 48px;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.subject-rail-item:hover {
  background: var(--surface);
  color: var(--text);
}

.subject-rail-item.active {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.subject-rail-item span:last-child {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
}

.curriculum-board {
  min-width: 0;
  padding: 22px;
  overflow: hidden;
}

.curriculum-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
}

.curriculum-toolbar h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.curriculum-toolbar p {
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 9px;
}

.verification-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 184, 107, 0.17);
  border-radius: 10px;
  background: rgba(255, 184, 107, 0.045);
  color: #c9b59b;
  font-size: 10px;
  line-height: 1.55;
}

.verification-banner .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--orange);
}

.module-list {
  display: grid;
  gap: 8px;
}

.module-row {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c0e0f;
}

.module-row.open {
  border-color: var(--line-strong);
  background: #0f1113;
}

.module-header {
  display: grid;
  width: 100%;
  min-height: 76px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 15px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.module-index {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
}

.module-copy {
  min-width: 0;
}

.module-copy strong {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 620;
}

.module-copy p {
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-side {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
}

.module-side .icon {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease;
}

.module-row.open .module-side .icon {
  transform: rotate(180deg);
}

.module-progress-mini {
  width: 52px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
}

.module-progress-mini span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.module-body {
  border-top: 1px solid var(--line);
  padding: 6px 8px 10px 46px;
}

.kp-row {
  display: grid;
  width: 100%;
  min-height: 48px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.kp-row:hover,
.kp-row.active {
  background: var(--surface-2);
}

.kp-row-main {
  min-width: 0;
}

.kp-row strong {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kp-row span {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-size: 8px;
}

.kp-state {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.kp-state.learning { border-color: rgba(102, 217, 239, 0.2); color: var(--cyan); }
.kp-state.assessment { border-color: rgba(255, 184, 107, 0.2); color: var(--orange); }
.kp-state.mastered { border-color: rgba(201, 245, 106, 0.2); color: var(--lime); }
.kp-state.remediation { border-color: rgba(255, 122, 107, 0.2); color: var(--coral); }

.curriculum-detail {
  min-width: 0;
  padding: 24px 21px;
  border-left: 1px solid var(--line);
  background: #0a0c0d;
}

.detail-inner {
  position: sticky;
  top: 90px;
}

.detail-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}

.detail-title {
  margin: 0;
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.detail-summary {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.72;
}

.detail-section {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-section h4 {
  margin: 0 0 10px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.list-clean {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.list-clean li {
  position: relative;
  padding-left: 13px;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.55;
}

.list-clean li::before {
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  content: "";
}

.concept-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.concept-pills span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 9px;
}

.formula-list {
  display: grid;
  gap: 7px;
}

.formula-list code {
  overflow-x: auto;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f1214;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 8px;
}

.source-chip .icon {
  width: 11px;
  height: 11px;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.detail-actions .btn:first-child {
  grid-column: 1 / -1;
}

/* Tutor */
.tutor-page .page-head {
  margin-bottom: 20px;
}

.tutor-layout {
  display: grid;
  height: clamp(560px, calc(100dvh - 370px), 860px);
  min-height: 0;
  grid-template-columns: 226px minmax(0, 1fr) 286px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #0b0d0e;
  box-shadow: var(--shadow-soft);
}

.tutor-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #090b0c;
}

.tutor-side-label {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tutor-class-title {
  margin: 11px 0 0;
  font-size: 17px;
  font-weight: 670;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.tutor-class-subject {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}

.tutor-class-subject span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, var(--cyan));
}

.tutor-tiny-progress {
  height: 3px;
  overflow: hidden;
  margin: 18px 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
}

.tutor-tiny-progress span {
  display: block;
  height: 100%;
  background: var(--accent, var(--cyan));
}

.tutor-outline {
  display: grid;
  gap: 4px;
  max-height: 44vh;
  overflow-y: auto;
}

.tutor-outline-group {
  padding: 10px 0 0;
}

.tutor-outline-group > span {
  color: var(--dim);
  font-size: 8px;
  text-transform: uppercase;
}

.tutor-outline-item {
  display: grid;
  grid-template-columns: 5px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 7px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.tutor-outline-item.active,
.tutor-outline-item:hover {
  background: var(--surface);
  color: var(--text-soft);
}

.tutor-outline-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--dim);
}

.tutor-outline-item.active .tutor-outline-dot {
  background: var(--accent, var(--cyan));
}

.tutor-side-foot {
  padding-top: 14px;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.state-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.state-pill .status-dot {
  background: var(--cyan);
}

.tutor-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #0d0f10;
}

.tutor-stage-head {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}

.tutor-stage-title {
  min-width: 0;
}

.tutor-stage-title strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tutor-stage-title span {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 9px;
}

.mode-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #090b0c;
}

.mode-btn {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  font-size: 9px;
  cursor: pointer;
}

.mode-btn:hover {
  color: var(--text-soft);
}

.mode-btn.active {
  background: var(--surface-3);
  color: var(--text);
}

.chat-scroll {
  overflow-y: auto;
  padding: 28px clamp(22px, 4vw, 56px) 40px;
  scroll-behavior: smooth;
}

.chat-thread {
  width: min(100%, 780px);
  margin: 0 auto;
}

.chat-empty {
  display: flex;
  min-height: 370px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.chat-empty-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--lime);
  background: var(--surface);
}

.chat-empty-mark .icon {
  width: 22px;
  height: 22px;
}

.chat-empty h3 {
  max-width: 590px;
  margin: 20px 0 0;
  font-size: clamp(25px, 3vw, 37px);
  font-weight: 690;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.chat-empty p {
  max-width: 610px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.prompt-suggestions {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 24px;
}

.prompt-chip {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.prompt-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text-soft);
}

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  animation: message-in 300ms ease;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-user {
  justify-content: flex-end;
  padding-left: 18%;
}

.message-assistant {
  align-items: flex-start;
  padding-right: 7%;
}

.message-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--lime);
}

.message-avatar .icon {
  width: 14px;
  height: 14px;
}

.message-main {
  min-width: 0;
  max-width: 100%;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.ai-label {
  padding: 2px 5px;
  border: 1px solid rgba(201, 245, 106, 0.17);
  border-radius: 4px;
  color: var(--lime);
  font-size: 7px;
}

.message-bubble {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.76;
}

.message-user .message-bubble {
  border-color: #30363a;
  border-radius: 16px 4px 16px 16px;
  background: #1b1f22;
  color: var(--text);
}

.message-bubble > :first-child { margin-top: 0; }
.message-bubble > :last-child { margin-bottom: 0; }
.message-bubble p { margin: 0 0 12px; }
.message-bubble h2,
.message-bubble h3,
.message-bubble h4 {
  margin: 23px 0 9px;
  color: var(--text);
  letter-spacing: -0.025em;
}
.message-bubble h2 { font-size: 20px; }
.message-bubble h3 { font-size: 16px; }
.message-bubble h4 { font-size: 13px; }
.message-bubble ul,
.message-bubble ol { padding-left: 20px; margin: 9px 0 14px; }
.message-bubble li { margin: 5px 0; }
.message-bubble strong { color: var(--text); font-weight: 660; }
.message-bubble blockquote {
  padding: 10px 13px;
  margin: 13px 0;
  border-left: 2px solid var(--cyan);
  background: rgba(102, 217, 239, 0.035);
  color: var(--muted);
}
.message-bubble code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #090b0c;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.9em;
}
.message-bubble pre {
  overflow-x: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #090b0c;
}
.message-bubble pre code { padding: 0; border: 0; background: transparent; }
.message-actions {
  display: flex;
  gap: 2px;
  margin-top: 8px;
}

.math {
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  padding: 0.06em 0.3em;
  border-radius: 4px;
  background: rgba(102, 217, 239, 0.055);
  color: #dffaff;
  font-family: "Times New Roman", "STIX Two Math", serif;
  font-size: 1.08em;
  white-space: nowrap;
}

.math-display {
  display: flex;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.45em 0.65em;
  margin: 10px 0;
}

.math-frac {
  display: inline-grid;
  grid-template-rows: auto auto;
  place-items: center;
  line-height: 1.05;
  vertical-align: middle;
}

.math-frac > span:first-child {
  padding: 0 0.18em 0.09em;
  border-bottom: 1px solid currentColor;
}

.math-frac > span:last-child {
  padding-top: 0.09em;
}

.math-root > span {
  padding-top: 0.12em;
  border-top: 1px solid currentColor;
}

.thinking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px 42px;
  color: var(--dim);
  font-size: 9px;
}

.thinking-dots {
  display: flex;
  gap: 3px;
}

.thinking-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  animation: thinking 1.15s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 140ms; }
.thinking-dots span:nth-child(3) { animation-delay: 280ms; }

@keyframes thinking {
  0%, 100% { opacity: 0.22; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.composer {
  padding: 12px 18px 18px;
  border-top: 1px solid var(--line);
  background: #0b0d0e;
}

.composer-inner {
  width: min(100%, 830px);
  padding: 10px 10px 8px 15px;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.composer-inner:focus-within {
  border-color: #465056;
  box-shadow: 0 0 0 4px rgba(102, 217, 239, 0.04);
}

.attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 8px;
}

.attachment-chip button {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}

.attachment-chip .icon {
  width: 10px;
  height: 10px;
}

.composer-textarea {
  width: 100%;
  min-height: 46px;
  max-height: 180px;
  padding: 3px 3px 8px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.composer-textarea::placeholder {
  color: var(--dim);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composer-left,
.composer-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.composer-hint {
  color: var(--dim);
  font-size: 8px;
}

.send-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--lime);
  color: #080909;
  cursor: pointer;
}

.send-button:disabled {
  background: #23282b;
  color: var(--dim);
  cursor: default;
}

.send-button .icon {
  width: 15px;
  height: 15px;
}

.tutor-rail {
  min-width: 0;
  overflow-y: auto;
  padding: 20px 18px;
  border-left: 1px solid var(--line);
  background: #090b0c;
}

.context-section {
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.context-section h4 {
  margin: 0 0 10px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.context-section p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.verification-list {
  display: grid;
  gap: 7px;
}

.verification-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.verification-item .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
}

.state-control {
  display: grid;
  gap: 6px;
}

.state-control button {
  justify-content: flex-start;
  width: 100%;
}

/* Library */
.library-layout {
  display: grid;
  min-height: 670px;
  grid-template-columns: 330px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.documents-pane {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #0a0c0d;
}

.documents-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px;
  border-bottom: 1px solid var(--line);
}

.documents-toolbar strong {
  font-size: 13px;
  font-weight: 650;
}

.documents-toolbar span {
  color: var(--dim);
  font-size: 9px;
}

.doc-list {
  display: grid;
  max-height: 610px;
  overflow-y: auto;
}

.doc-row {
  display: grid;
  width: 100%;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid rgba(37, 42, 46, 0.65);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.doc-row:hover {
  background: var(--surface);
}

.doc-row.active {
  background: var(--surface-2);
}

.doc-icon {
  display: grid;
  width: 36px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
}

.doc-icon.image {
  color: var(--cyan);
}

.doc-icon.pdf {
  color: var(--coral);
}

.doc-icon .icon {
  width: 17px;
  height: 17px;
}

.doc-copy {
  min-width: 0;
}

.doc-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-copy span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--dim);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-state {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dim);
}

.doc-state.ready { background: var(--lime); }
.doc-state.ocr { background: var(--cyan); }
.doc-state.failed { background: var(--coral); }

.doc-detail {
  display: grid;
  min-width: 0;
  min-height: 670px;
  grid-template-rows: auto minmax(0, 1fr);
  background: #0d0f10;
}

.doc-detail-head {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.doc-detail-title {
  min-width: 0;
}

.doc-detail-title h2 {
  overflow: hidden;
  margin: 0;
  font-size: 11px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-detail-title p {
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 8px;
}

.doc-detail-actions {
  display: flex;
  gap: 6px;
}

.doc-split {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(280px, 1.05fr) minmax(300px, 0.95fr);
}

.doc-preview {
  display: grid;
  min-width: 0;
  min-height: 560px;
  place-items: center;
  overflow: auto;
  padding: 22px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%) 0 0 / 20px 20px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%) 0 0 / 20px 20px,
    #090b0c;
}

.doc-preview img {
  max-width: 100%;
  max-height: 640px;
  border-radius: 8px;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.4);
}

.doc-preview iframe {
  width: 100%;
  height: 640px;
  border: 0;
  border-radius: 8px;
  background: white;
}

.doc-placeholder {
  max-width: 300px;
  color: var(--muted);
  text-align: center;
}

.doc-placeholder-mark {
  display: grid;
  width: 64px;
  height: 80px;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

.doc-placeholder-mark .icon {
  width: 25px;
  height: 25px;
}

.doc-placeholder p {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.6;
}

.doc-text-pane {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 18px;
}

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

.text-pane-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 620;
}

.ocr-editor {
  min-height: 460px;
  padding: 16px;
  resize: none;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.72;
}

.text-pane-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}

.text-pane-note {
  color: var(--dim);
  font-size: 8px;
  line-height: 1.5;
}

.document-empty {
  display: grid;
  min-height: 600px;
  place-items: center;
  padding: 28px;
  background: #0d0f10;
}

.empty-state {
  display: flex;
  width: min(100%, 470px);
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.empty-state-mark {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}

.empty-state-mark .icon {
  width: 28px;
  height: 28px;
}

.empty-state h2 {
  margin: 22px 0 0;
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.empty-state p {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

/* Practice */
.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
}

.question-workspace {
  min-width: 0;
}

.question-card {
  min-height: 500px;
  padding: clamp(26px, 4vw, 54px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 95% 0, rgba(102, 217, 239, 0.045), transparent 17rem),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 24px;
}

.question-index {
  margin-left: auto;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
}

.question-prompt {
  max-width: 840px;
  margin: 0;
  font-size: clamp(21px, 2.4vw, 31px);
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1.48;
}

.option-list {
  display: grid;
  gap: 8px;
  max-width: 820px;
  margin-top: 28px;
}

.option-row {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 13px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0c0e0f;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.option-row:hover,
.option-row.selected {
  border-color: #424b50;
  background: var(--surface-2);
}

.option-key {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.option-row.selected .option-key {
  border-color: var(--lime);
  background: var(--lime);
  color: #0a0b0c;
}

.answer-box {
  width: 100%;
  min-height: 130px;
  padding: 14px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  resize: vertical;
  background: #0b0d0e;
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.question-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
}

.result-panel {
  padding: 18px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a0c0d;
}

.result-panel.correct {
  border-color: rgba(201, 245, 106, 0.22);
  background: rgba(201, 245, 106, 0.035);
}

.result-panel.incorrect {
  border-color: rgba(255, 122, 107, 0.2);
  background: rgba(255, 122, 107, 0.035);
}

.result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.result-title .icon {
  width: 17px;
  height: 17px;
}

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

.result-grid h4 {
  margin: 0 0 6px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-grid p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.practice-rail {
  display: grid;
  align-content: start;
  gap: 14px;
}

.practice-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.question-dot {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  cursor: pointer;
}

.question-dot.active {
  border-color: var(--lime);
  background: rgba(201, 245, 106, 0.08);
  color: var(--lime);
}

/* Analytics */
.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 22px;
}

.analytics-main,
.analytics-rail {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.analytics-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 86% 50%, rgba(201, 245, 106, 0.07), transparent 16rem),
    var(--surface);
}

.analytics-hero h2 {
  max-width: 600px;
  margin: 0;
  font-size: clamp(28px, 3.3vw, 45px);
  font-weight: 690;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.analytics-hero p {
  max-width: 610px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.analytics-numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.stat-large {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: center;
  padding: 17px;
  background: #0c0e0f;
}

.stat-large strong {
  font-size: 34px;
  font-weight: 710;
  letter-spacing: -0.05em;
  line-height: 1;
}

.stat-large span {
  margin-top: 7px;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chart-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.chart-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.chart-head p {
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 9px;
}

.bar-chart {
  display: grid;
  gap: 15px;
}

.bar-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
}

.bar-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.055);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent, var(--cyan));
}

.bar-value {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  text-align: right;
}

.state-bar {
  display: flex;
  height: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-2);
}

.state-segment {
  min-width: 2px;
  height: 100%;
}

.state-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 18px;
  margin-top: 18px;
}

.state-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.state-legend-item span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.state-legend-item i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
}

.state-legend-item strong {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 9px;
}

.insight-list {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
}

.insight-item {
  padding: 13px 0;
}

.insight-item + .insight-item {
  border-top: 1px solid var(--line);
}

.insight-item strong {
  display: block;
  font-size: 11px;
  font-weight: 570;
  line-height: 1.45;
}

.insight-item span {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 8px;
  line-height: 1.5;
}

.trend-svg {
  width: 100%;
  height: 150px;
  overflow: visible;
}

/* Modal / palette / toast */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 4, 5, 0.72);
  backdrop-filter: blur(10px);
  animation: overlay-in 160ms ease;
}

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(100%, 560px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #111315;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
  animation: modal-in 220ms cubic-bezier(0.2, 0.75, 0.3, 1);
}

.modal-wide {
  width: min(100%, 780px);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.986); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 660;
  letter-spacing: -0.025em;
}

.modal-body {
  padding: 20px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 20px;
}

.drop-zone {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #0c0e0f;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--cyan);
  background: rgba(102, 217, 239, 0.03);
  color: var(--text-soft);
}

.drop-zone .icon {
  width: 27px;
  height: 27px;
  margin: 0 auto 12px;
}

.drop-zone strong {
  display: block;
  font-size: 12px;
  font-weight: 620;
}

.drop-zone span {
  display: block;
  max-width: 330px;
  margin-top: 7px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.55;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.selected-file .doc-icon {
  width: 32px;
  height: 38px;
}

.selected-file-copy {
  min-width: 0;
  flex: 1;
}

.selected-file-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-copy span {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 8px;
}

.upload-progress {
  height: 4px;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 99px;
  background: var(--surface-2);
}

.upload-progress span {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--cyan);
  animation: upload-slide 1.15s ease-in-out infinite;
}

@keyframes upload-slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(330%); }
}

.command-overlay {
  align-items: start;
  padding-top: min(13vh, 120px);
}

.command-palette {
  width: min(100%, 650px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #111315;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.64);
  animation: modal-in 180ms ease;
}

.command-input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.command-results {
  max-height: 56vh;
  overflow-y: auto;
  padding: 8px;
}

.command-group-label {
  padding: 9px 10px 6px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.command-result {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.command-result:hover,
.command-result.active {
  background: var(--surface-2);
  color: var(--text);
}

.command-result .icon {
  width: 15px;
  height: 15px;
}

.command-result-copy {
  min-width: 0;
  flex: 1;
}

.command-result-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-result-copy span {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-size: 8px;
}

.command-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 8px;
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  max-width: min(380px, calc(100vw - 44px));
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #171a1c;
  color: var(--text-soft);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.45);
  font-size: 11px;
  line-height: 1.5;
  animation: toast-in 220ms ease;
}

.toast.error {
  border-color: rgba(255, 122, 107, 0.28);
  color: #ffd0ca;
}

.toast.success {
  border-color: rgba(201, 245, 106, 0.25);
}

.toast .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.spin {
  animation: spin 0.9s linear infinite;
}

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

.skeleton {
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
}

.skeleton::after {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  content: "";
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.mobile-nav {
  display: none;
}

/* Responsive */
@media (max-width: 1320px) {
  .dashboard-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .curriculum-layout { grid-template-columns: 166px minmax(0, 1fr) 300px; }
  .tutor-layout { grid-template-columns: 205px minmax(0, 1fr) 260px; }
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 214px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .curriculum-layout { grid-template-columns: 160px minmax(0, 1fr); }
  .curriculum-detail { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0; }
  .detail-inner { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .detail-inner > .detail-actions { align-self: start; }
  .tutor-layout { grid-template-columns: 190px minmax(0, 1fr); }
  .tutor-rail { display: none; }
  .library-layout { grid-template-columns: 290px minmax(0, 1fr); }
  .doc-split { grid-template-columns: 1fr; }
  .doc-preview { min-height: 390px; border-right: 0; border-bottom: 1px solid var(--line); }
  .practice-layout { grid-template-columns: 1fr; }
  .practice-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  body { padding-bottom: 70px; }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: 250px;
    transform: translateX(-102%);
    transition: transform 200ms ease;
    box-shadow: 20px 0 70px rgba(0, 0, 0, 0.55);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { height: 60px; padding-inline: 18px; }
  .menu-btn { display: inline-grid; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; }
  .search-trigger span,
  .search-trigger .kbd,
  .sync-chip { display: none; }
  .content { padding: 24px 18px 44px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .head-actions { justify-content: flex-start; }
  .focus-panel { grid-template-columns: 1fr; gap: 26px; }
  .focus-visual { justify-items: start; }
  .focus-visual-caption { text-align: left; }
  .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-rail { grid-template-columns: 1fr; }
  .curriculum-layout { display: block; min-height: 0; }
  .subject-rail { border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .subject-rail-list { display: flex; min-width: max-content; }
  .subject-rail-item { min-width: 120px; }
  .curriculum-board { padding: 16px; }
  .curriculum-detail { border-top: 1px solid var(--line); }
  .detail-inner { display: block; }
  .tutor-layout { display: block; height: auto; min-height: 0; }
  .tutor-sidebar { display: none; }
  .tutor-stage { min-height: calc(100dvh - 190px); }
  .chat-scroll { padding-inline: 16px; }
  .prompt-suggestions { grid-template-columns: 1fr; }
  .library-layout { display: block; min-height: 0; }
  .documents-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .doc-list { max-height: 260px; }
  .doc-detail { min-height: 0; }
  .doc-split { display: block; }
  .doc-preview { min-height: 320px; }
  .ocr-editor { min-height: 360px; }
  .practice-rail,
  .analytics-rail { grid-template-columns: 1fr; }
  .analytics-hero { grid-template-columns: 1fr; }
  .mobile-nav {
    position: fixed;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 60;
    display: flex;
    height: 56px;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(17, 19, 21, 0.91);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(18px);
  }
  .mobile-nav a,
  .mobile-nav button {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--dim);
  }
  .mobile-nav a.active,
  .mobile-nav button.active {
    background: var(--surface-3);
    color: var(--lime);
  }
  .mobile-nav .icon { width: 19px; height: 19px; }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 70;
    border: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
  }
  .menu-btn { display: inline-grid; }
}

@media (min-width: 861px) {
  .menu-btn { display: none; }
  .sidebar-scrim { display: none; }
}

@media (max-width: 620px) {
  .auth-screen { display: block; }
  .auth-story { min-height: 54dvh; padding: 28px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-hero { margin: 46px 0 28px; }
  .auth-title { font-size: clamp(45px, 14vw, 68px); }
  .auth-lead { font-size: 14px; }
  .auth-panel { min-height: auto; padding: 42px 24px 60px; }
  .login-card h2 { font-size: 31px; }
  .page-title { font-size: 38px; }
  .policy-strip { grid-template-columns: 1fr; }
  .policy-item + .policy-item { border-top: 1px solid var(--line); border-left: 0; }
  .subject-grid { grid-template-columns: 1fr 1fr; }
  .subject-card { min-height: 132px; padding: 14px; }
  .focus-panel { padding: 24px 20px; }
  .focus-title { font-size: 34px; }
  .focus-stats { gap: 14px; }
  .progress-orbit { width: 150px; }
  .modal { max-height: calc(100dvh - 20px); }
  .overlay { padding: 10px; }
  .command-overlay { padding-top: 8vh; }
  .tutor-stage-head { align-items: flex-start; flex-direction: column; gap: 10px; padding: 14px 16px; }
  .mode-switch { width: 100%; }
  .mode-btn { flex: 1; }
  .composer { padding-inline: 10px; }
  .composer-hint { display: none; }
  .message-user { padding-left: 8%; }
  .message-assistant { padding-right: 0; }
  .doc-detail-head { align-items: flex-start; flex-direction: column; }
  .question-card { padding: 22px 18px; }
  .option-row { align-items: flex-start; }
  .result-grid { grid-template-columns: 1fr; }
  .analytics-numbers { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 70px minmax(0, 1fr) 26px; }
}
