/* =========================================================
   components.css — timeline, cards, modals, lists, badges.
   Terminal skin: flat surfaces, hairline borders, mono labels,
   neon signal colours. Layout/structure unchanged.
========================================================= */

/* ── Auth screen — one full-bleed campus composition on every viewport ─ */
.auth-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(28px, env(safe-area-inset-top)) clamp(18px, 5vw, 64px) max(28px, env(safe-area-inset-bottom));
  overflow: hidden auto;
  background: #07111c;
  z-index: 50;
}
.auth-screen::before {
  content: '';
  position: absolute;
  inset: -18px;
  z-index: -2;
  background: url('/assets/campus-core-yang-chaoying.webp?v=1') center center / cover no-repeat;
  filter: blur(5px) saturate(0.76) brightness(0.52);
  transform: scale(1.04);
  animation: authCampusIn 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(3, 8, 16, 0.2), rgba(3, 8, 16, 0.58)),
    radial-gradient(circle at 50% 42%, transparent 0 22%, rgba(2, 6, 12, 0.24) 72%);
}
.auth-form-wrap {
  width: min(100%, 420px);
  min-width: 0;
  animation: authPanelIn 520ms 100ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-box {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(24px, 5vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: rgba(5, 12, 22, 0.62);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}
.auth-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.auth-mark {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
}
.auth-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
}
.auth-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.auth-wordmark b {
  color: #fff;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.18em;
}
.auth-wordmark span {
  margin-top: 6px;
  color: rgba(226, 232, 240, 0.7);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.auth-box h1 {
  margin: 2px 0 0;
  color: #fff;
  font-size: clamp(28px, 6vw, 36px);
  letter-spacing: -0.035em;
}
.auth-sub {
  margin: -4px 0 4px;
  color: rgba(226, 232, 240, 0.76);
  font-size: 13px;
  line-height: 1.65;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form .field span {
  color: rgba(241, 245, 249, 0.88);
}
.auth-form input {
  min-height: 50px;
  color: #fff;
  background: rgba(2, 6, 14, 0.62);
  border-color: rgba(255, 255, 255, 0.18);
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.auth-form input::placeholder {
  color: rgba(203, 213, 225, 0.48);
}
.auth-form input:focus {
  border-color: var(--accent);
  background: rgba(2, 6, 14, 0.78);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.auth-form .btn-primary {
  width: 100%;
  min-height: 50px;
  margin-top: 2px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
}
.auth-error {
  margin: 0;
  color: #fda4af;
  font-size: 12px;
}
.auth-error::before { content: '! '; }
.auth-privacy {
  margin: 0;
  color: rgba(203, 213, 225, 0.58);
  font-size: 10.5px;
  line-height: 1.55;
  text-align: center;
}
@keyframes authCampusIn {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1.04); }
}
@keyframes authPanelIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 760px) {
  .pulse-bare .bare-route { min-height: 100svh; }
  .auth-screen {
    place-items: center;
    padding-left: 16px;
    padding-right: 16px;
  }
  .auth-screen::before {
    background-position: 49% center;
  }
  .auth-box {
    padding: 24px 20px;
    border-radius: 22px;
  }
}
@media (max-height: 700px) {
  .auth-screen {
    place-items: start center;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  .auth-box { gap: 12px; padding-top: 20px; padding-bottom: 20px; }
  .auth-mark { width: 42px; height: 42px; flex-basis: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-screen::before,
  .auth-form-wrap { animation: none; }
}

/* ── Home page ───────────────────────────────────────── */
.home-page {
  display: flex; flex-direction: column;
  gap: var(--gap);
}
.greeting-card {
  position: relative;
  display: flex; flex-direction: column;
  gap: 4px;
  padding: 20px 24px;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--border);
  overflow: hidden;
}
.greeting-card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
}
.greeting-kicker,
.section-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-3);
  text-transform: uppercase;
}
.greeting-kicker::before,
.section-kicker::before { content: '// '; color: var(--accent); }
.greeting-card h1 { font-weight: 600; margin: 6px 0 4px; }

/* Home learning overview */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 2px 0 0; }
.learning-panel,
.domain-panel,
.seiue-panel,
.activity-panel {
  display: flex; flex-direction: column;
  gap: var(--gap);
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--border);
}
.learning-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.home-metric {
  position: relative;
  display: flex; flex-direction: column;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.home-metric-label,
.home-metric-sub {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.home-metric-label { letter-spacing: 0.04em; }
.home-metric-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 26px;
  font-feature-settings: 'tnum' on;
  color: var(--text-1);
  line-height: 1.15;
}
.seiue-digest {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
  color: var(--text-2);
  background: var(--accent-soft);
  font-size: 13px;
}
.learning-site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.home-site-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.home-site-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.home-site-group-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.home-site-group-title::before { content: '> '; color: var(--accent); }
.learning-site-card {
  display: flex; flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.learning-site-card:hover { border-color: var(--border-accent); transform: translateY(-1px); }
.learning-site-title { font-weight: 600; }
.learning-site-host,
.learning-site-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-activity-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.home-activity-row {
  display: grid;
  grid-template-columns: 58px 1fr 84px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.home-activity-row:last-child { border-bottom: none; }
.home-activity-main {
  display: flex; flex-direction: column;
  min-width: 0;
}
.home-activity-main b,
.home-activity-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-activity-main b { font-size: 14px; font-weight: 600; }
.home-activity-main em {
  font-style: normal;
  font-size: 12px;
  color: var(--text-3);
}
.home-activity-time {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
@media (max-width: 600px) {
  .home-activity-row { grid-template-columns: 48px 1fr; }
  .home-activity-time { grid-column: 2; justify-self: start; }
}

/* =========================================================
   v22 observatory auth + home control room.
========================================================= */

.control-room {
  gap: 16px;
}
.ops-hero,
.ops-panel,
.ops-module,
.ops-kpi,
html[data-design="observatory"] .learning-panel,
html[data-design="observatory"] .domain-panel,
html[data-design="observatory"] .seiue-panel,
html[data-design="observatory"] .activity-panel {
  border: 1px solid var(--border);
  background:
    linear-gradient(hsl(var(--hue), var(--sat), 69%, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--hue), var(--sat), 69%, 0.035) 1px, transparent 1px),
    rgba(8, 16, 30, 0.68);
  background-size: 26px 26px, 26px 26px, auto;
  box-shadow: inset 0 1px 0 rgba(226, 232, 240, 0.06);
}
.ops-hero {
  min-height: 236px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  padding: 24px;
  border-radius: var(--r-xl);
}
.ops-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 20px;
  align-items: center;
}
.ops-title h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
  margin: 6px 0 6px;
}
.ops-title p {
  margin: 0;
  color: var(--text-2);
}
.command-cursor {
  color: var(--giverny-leaf);
  font-family: var(--font-mono);
  text-shadow: 0 0 18px rgba(52, 211, 153, 0.6);
}
.ops-session-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: rgba(3, 7, 18, 0.42);
}
.ops-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-accent);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 22px;
  overflow: hidden;
}
.ops-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ops-session-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ops-session-copy b { font-size: 18px; }
.ops-session-copy small,
.ops-level {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}
.ops-health {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 18px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}
.health-ring {
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #07111f 0 55%, transparent 56%),
    conic-gradient(var(--giverny-leaf) 0 var(--score), rgba(148, 163, 184, 0.16) var(--score) 100%);
  box-shadow: 0 0 30px rgba(52, 211, 153, 0.14);
}
.health-ring b {
  font-size: 30px;
  line-height: 1;
}
.health-ring span {
  display: block;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}
.health-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.health-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}
.health-lines li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  background: var(--giverny-leaf);
  box-shadow: 0 0 14px var(--giverny-leaf);
}
.health-lines li.warn::before {
  background: var(--giverny-sun);
  box-shadow: 0 0 14px var(--giverny-sun);
}
.health-lines b { color: var(--text-1); }

.ops-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.ops-kpi {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: var(--r-lg);
}
.ops-kpi-label,
.ops-kpi small {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}
.ops-kpi b {
  margin: 8px 0 4px;
  color: var(--text-1);
  font-size: 34px;
  line-height: 1;
}
.ops-kpi.assignments { border-color: rgba(251, 191, 36, 0.28); }
.ops-kpi.records { border-color: hsl(var(--hue), var(--sat), 69%, 0.28); }
.ops-kpi.data { border-color: rgba(52, 211, 153, 0.28); }
.ops-kpi.activity { border-color: rgba(167, 139, 250, 0.28); }

.ops-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.ops-module,
.ops-panel {
  padding: 16px;
  border-radius: var(--r-lg);
}
.module-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.module-head h2 {
  font-size: 18px;
}
.module-head span {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
}
.task-health-bar,
.stack-meter,
.site-progress-line {
  height: 8px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}
.task-health-bar span,
.site-progress-line span,
.stack-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--giverny-leaf));
}
.stack-meter {
  display: flex;
}
.stack-meter .ok { background: linear-gradient(90deg, var(--giverny-leaf), var(--accent)); }
.stack-meter .idle { background: rgba(148, 163, 184, 0.22); }
.module-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.mini-stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mini-stat b {
  font-size: 20px;
  color: var(--text-1);
}
.mini-stat small {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
}
.ops-digest {
  margin: 0 0 12px;
  color: var(--text-2);
  font-size: 12px;
}
.module-action {
  display: block;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}
.module-action:hover {
  border-color: var(--border-accent);
  background: var(--accent-soft);
}
.spark-bars {
  height: 62px;
  display: flex;
  align-items: end;
  gap: 3px;
}
.spark-bars span {
  flex: 1;
  min-width: 3px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent), hsl(var(--hue), var(--sat), 69%, 0.14));
}
.source-matrix {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.source-matrix li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
}
.source-matrix li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--giverny-leaf);
  box-shadow: 0 0 14px var(--giverny-leaf);
}
.source-matrix .source-idle::before {
  background: var(--text-muted);
  box-shadow: none;
}
.source-matrix b { color: var(--text-1); }

.ops-wide {
  padding: 18px;
  border-radius: var(--r-lg);
}
.command-head {
  align-items: center;
}
.command-head .muted {
  margin: 4px 0 0;
  font-size: 12px;
}
.command-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mission-search {
  width: min(360px, 58vw);
}
html[data-design="observatory"] .home-site-groups {
  gap: 16px;
}
html[data-design="observatory"] .home-site-group-title {
  color: var(--accent);
}
html[data-design="observatory"] .learning-site-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
html[data-design="observatory"] .learning-site-card {
  gap: 8px;
  padding: 13px;
  border-radius: var(--r);
  background: rgba(3, 7, 18, 0.36);
}
.learning-site-card.is-connected {
  border-color: rgba(52, 211, 153, 0.28);
}
.site-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.site-mark {
  flex: 0 0 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  background: hsl(var(--hue), var(--sat), 69%, 0.1);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.site-progress-line {
  height: 5px;
}

.ops-bottom-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
  gap: 12px;
}
.ops-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ops-timeline li {
  display: grid;
  grid-template-columns: 14px 62px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--text-2);
}
.timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  box-shadow: 0 0 14px hsl(var(--hue), var(--sat), 69%, 0.42);
}
.ops-timeline time,
.ops-timeline em {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
}
.ops-timeline b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topology-legend {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}
.site-topology {
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  padding: 12px 4px 4px;
}
.topology-node {
  position: relative;
  flex: 0 0 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-2);
  background: rgba(3, 7, 18, 0.52);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.topology-node::after {
  content: "";
  position: absolute;
  right: -15px;
  width: 15px;
  height: 1px;
  background: var(--border);
}
.topology-node:last-child::after { display: none; }
.topology-node.active {
  border-color: var(--giverny-leaf);
  color: var(--giverny-leaf);
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.16);
}
.topology-node.core {
  border-color: var(--accent);
  color: var(--accent);
}
.topology-node.idle {
  opacity: 0.62;
}

@media (max-width: 1180px) {
  .ops-hero,
  .ops-hero-main,
  .ops-bottom-grid {
    grid-template-columns: 1fr;
  }
  .ops-health {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 18px;
  }
  .ops-kpi-grid,
  .ops-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .ops-hero,
  .ops-module,
  .ops-panel,
  .ops-wide {
    padding: 14px;
  }
  .ops-kpi-grid,
  .ops-module-grid,
  .module-split,
  .ops-health {
    grid-template-columns: 1fr;
  }
  .ops-session-card {
    grid-template-columns: 52px 1fr;
  }
  .ops-level {
    grid-column: 2;
  }
  .health-ring {
    width: 108px;
    height: 108px;
  }
  .mission-search {
    width: 100%;
  }
  .command-tools {
    width: 100%;
  }
  .ops-timeline li {
    grid-template-columns: 12px 1fr;
  }
  .ops-timeline time,
  .ops-timeline em {
    grid-column: 2;
  }
}

/* ── Timeline ────────────────────────────────────────── */
.g-timeline {
  position: relative;
  display: flex; flex-direction: column;
  gap: 16px;
  padding: 22px clamp(18px, 3vw, 28px) 24px;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.g-timeline::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--sig-now), var(--sig-next) 50%, var(--sig-past));
  opacity: 0.8;
}

.g-timeline-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.g-timeline-title h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--text-1);
}
.g-timeline-kicker {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.6em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 0.25em;
}
.g-timeline-sub {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 12px;
  font-family: var(--font-mono);
}
.g-timeline-actions { display: flex; gap: 8px; }
.g-timeline-empty {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

/* Focus */
.g-focus {
  position: relative;
  padding: 18px 20px 18px 22px;
  border-radius: var(--r);
  background: var(--bg-2);
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--dur), box-shadow var(--dur), border-color var(--dur);
}
.g-focus::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
  border-radius: var(--r) 0 0 var(--r);
}
.g-focus:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.g-focus-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.g-focus-kicker::before { content: '// '; color: var(--accent); }
.g-focus-title {
  margin: 4px 0 6px;
  font-size: clamp(19px, 2vw, 24px);
}
.g-focus-summary { margin: 0 0 10px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.g-focus-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.g-focus-badge {
  padding: 2px 9px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-fg);
  font-family: var(--font-mono);
  font-weight: 600;
}
.g-focus-action {
  margin-left: auto;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
}
.g-focus-action::after { content: ' →'; }

/* Buckets */
.g-buckets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 880px) {
  .g-buckets { grid-template-columns: 1fr; gap: 10px; }
}
.g-bucket {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  border-radius: var(--r);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--text-muted);
  min-height: 140px;
}
.g-bucket-now  { border-top-color: var(--sig-now); }
.g-bucket-next { border-top-color: var(--sig-next); }
.g-bucket-past { border-top-color: var(--sig-past); }
.g-bucket-head {
  display: flex; align-items: baseline; justify-content: space-between;
}
.g-bucket-head h3 { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.g-bucket-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  padding: 1px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
}
.g-bucket-body { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.g-bucket-empty {
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  font-family: var(--font-mono);
}
.g-bucket-empty::before { content: '// '; color: var(--text-muted); }

/* Cards */
.g-card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left: 2px solid var(--text-muted);
  cursor: pointer;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast);
}
.g-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow);
}
.g-card-now  { border-left-color: var(--sig-now); }
.g-card-next { border-left-color: var(--sig-next); }
.g-card-past { border-left-color: var(--sig-past); opacity: 0.82; }

.g-card-risk-med  { border-color: color-mix(in srgb, var(--sig-now) 55%, var(--border)); }
.g-card-risk-high { border-color: color-mix(in srgb, var(--giverny-rose) 62%, var(--border)); }

.g-card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-3);
}
.g-badge {
  padding: 2px 7px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--text-3) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-3) 32%, transparent);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* Domain colour coding — tinted border + text, dark-aware via tokens. */
.g-badge-task    { color: var(--giverny-sun);   border-color: color-mix(in srgb, var(--giverny-sun) 50%, transparent);   background: color-mix(in srgb, var(--giverny-sun) 12%, transparent); }
.g-badge-score   { color: var(--giverny-sun);   border-color: color-mix(in srgb, var(--giverny-sun) 50%, transparent);   background: color-mix(in srgb, var(--giverny-sun) 12%, transparent); }
.g-badge-lesson  { color: var(--giverny-leaf);  border-color: color-mix(in srgb, var(--giverny-leaf) 50%, transparent);  background: color-mix(in srgb, var(--giverny-leaf) 12%, transparent); }
.g-badge-leave   { color: var(--giverny-leaf);  border-color: color-mix(in srgb, var(--giverny-leaf) 50%, transparent);  background: color-mix(in srgb, var(--giverny-leaf) 12%, transparent); }
.g-badge-message { color: var(--giverny-wisteria); border-color: color-mix(in srgb, var(--giverny-wisteria) 50%, transparent); background: color-mix(in srgb, var(--giverny-wisteria) 12%, transparent); }
.g-badge-chat    { color: var(--giverny-wisteria); border-color: color-mix(in srgb, var(--giverny-wisteria) 50%, transparent); background: color-mix(in srgb, var(--giverny-wisteria) 12%, transparent); }
.g-badge-event   { color: var(--giverny-pond);  border-color: color-mix(in srgb, var(--giverny-pond) 50%, transparent);  background: color-mix(in srgb, var(--giverny-pond) 12%, transparent); }
.g-badge-exam    { color: var(--giverny-pond);  border-color: color-mix(in srgb, var(--giverny-pond) 50%, transparent);  background: color-mix(in srgb, var(--giverny-pond) 12%, transparent); }
.g-badge-learning{ color: var(--giverny-pond);  border-color: color-mix(in srgb, var(--giverny-pond) 50%, transparent);  background: color-mix(in srgb, var(--giverny-pond) 12%, transparent); }
.g-badge-form    { color: var(--giverny-rose);  border-color: color-mix(in srgb, var(--giverny-rose) 50%, transparent);  background: color-mix(in srgb, var(--giverny-rose) 12%, transparent); }

.g-card-title {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-1);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.g-card-summary {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.g-card-chip {
  align-self: flex-start;
  margin-top: 4px;
  padding: 1px 7px;
  font-size: 11px;
  font-family: var(--font-mono);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-3);
}
.g-empty { color: var(--text-3); font-family: var(--font-mono); }

/* ── Metric row (used in seiue/today) ────────────────── */
.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.metric-card {
  display: flex; flex-direction: column;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.metric-label {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.metric-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 27px;
  font-feature-settings: 'tnum' on;
  margin: 2px 0;
}
.metric-sub {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ───── Modal overlay (notify / lesson / task / form / leave) ───── */
.modal-host {
  display: none;
  position: fixed; inset: 0;
  z-index: 200;
  align-items: center; justify-content: center;
  background: rgba(8, 11, 17, 0.62);
  backdrop-filter: blur(6px);
  padding: 18px;
}
.modal-host.open { display: flex; animation: modalIn var(--dur) var(--ease-out); }
@keyframes modalIn { from { opacity: 0 } to { opacity: 1 } }
.modal-shell {
  width: min(600px, 100%);
  max-height: 85vh;
  display: flex; flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: modalShellIn var(--dur) var(--ease-spring);
  overflow: hidden;
}
.modal-shell::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
}
@keyframes modalShellIn {
  from { transform: translateY(12px) scale(0.98); opacity: 0 }
  to   { transform: translateY(0) scale(1); opacity: 1 }
}
.modal-sm { width: min(420px, 100%); }
.modal-md { width: min(600px, 100%); }
.modal-lg { width: min(760px, 100%); max-height: 88vh; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 17px;
}
.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 14px;
}
.modal-close:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--border-accent); }
.modal-body {
  flex: 1; overflow-y: auto;
  padding: 18px 20px;
}
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0 0;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}
.modal-foot .btn-primary, .modal-foot .btn-soft { margin-left: 0; }
.modal-foot .btn-primary:last-child, .modal-foot .btn-soft:last-child {
  margin-left: 4px;
}
.modal-status {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.modal-status[data-tone="ok"]      { color: var(--giverny-leaf); }
.modal-status[data-tone="danger"]  { color: var(--giverny-rose); }
.modal-status[data-tone="muted"]   { color: var(--text-3); }
.modal-error { color: var(--giverny-rose); font-family: var(--font-mono); }

/* form-runner field rendering */
.form-fields { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.form-label .req { color: var(--giverny-rose); margin-left: 4px; }
.form-options, .form-scale {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
}
.form-radio, .form-scale-opt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  font-family: var(--font-mono);
  padding: 4px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.form-radio:hover, .form-scale-opt:hover { border-color: var(--border-accent); }
.form-runner textarea, .form-runner input[type=text] {
  font: inherit;
}

/* notify compose */
.compose-form { display: flex; flex-direction: column; gap: 14px; }
.compose-form .field { display: flex; flex-direction: column; gap: 6px; }
.compose-form .field span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.recvs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px;
  max-height: 160px; overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-2);
}
.recv-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-size: 13px;
  font-family: var(--font-mono);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.recv-chip:hover { border-color: var(--border-accent); }
.compose-form details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  padding: 6px 0;
  font-family: var(--font-mono);
}
.mono { font-family: var(--font-mono); font-size: 12px; }
.small { font-size: 11px; }

/* lesson detail */
.lesson-detail { display: flex; flex-direction: column; gap: 18px; }
.lesson-head { display: flex; flex-direction: column; gap: 4px; }
.lesson-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.lesson-kicker::before { content: '// '; color: var(--accent); }
.lesson-sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); margin: 0; }
.lesson-sec { display: flex; flex-direction: column; gap: 6px; }
.lesson-sec h4 { font-size: 15px; }
.simple-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.simple-list li {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-2);
}
.simple-list li.clickable { cursor: pointer; transition: border-color var(--dur-fast); }
.simple-list li.clickable:hover { border-color: var(--border-accent); }

/* task detail */
.task-detail { display: flex; flex-direction: column; gap: 14px; }
.task-content {
  padding: 12px;
  background: var(--bg-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.55;
  max-height: 200px; overflow-y: auto;
}
.task-content p { margin: 0 0 8px; }
.task-submit-form { display: flex; flex-direction: column; gap: 12px; }
.task-submit-form .field { display: flex; flex-direction: column; gap: 6px; }
.task-submit-form .field span { font-size: 13px; color: var(--text-2); }
.task-submit-form input[type="file"],
.form-field input[type="file"] {
  width: 100%;
  padding: 9px 10px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--text-1);
}
.upload-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.upload-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  font-size: 12px;
  font-family: var(--font-mono);
}
.upload-list li span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-list li[data-tone="ok"] span:last-child { color: var(--giverny-leaf); }
.upload-list li[data-tone="danger"] span:last-child { color: var(--giverny-rose); }
.attachment-list a {
  overflow: hidden;
  color: var(--text-1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* leave form */
.leave-form { display: flex; flex-direction: column; gap: 14px; }
.leave-form .field { display: flex; flex-direction: column; gap: 6px; }
.leave-form .field span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.task-submissions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.task-submissions h4 {
  margin: 0 0 8px;
  font-size: 13px;
}
