@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@400;600;700&family=Share+Tech+Mono&display=swap');

:root {
  --bg-0: #030608;
  --bg-1: #071620;
  --cyan: #4cf3ff;
  --cyan-soft: rgba(76, 243, 255, 0.35);
  --cyan-dim: #1a5a66;
  --amber: #ffb347;
  --text: #d7f6ff;
  --text-dim: #7fb8c9;
  --panel-bg: rgba(8, 22, 32, 0.62);
  --panel-border: rgba(76, 243, 255, 0.35);
  --danger: #ff5470;
  --good: #57ffb0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(ellipse at 50% 0%, var(--bg-1) 0%, var(--bg-0) 65%);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(76, 243, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 243, 255, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  z-index: 0;
}

/* sparser glowing circuit-node dots, a second depth layer over the fine grid */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(76, 243, 255, 0.14) 1px, transparent 1.6px);
  background-size: 84px 84px;
  background-position: 21px 21px;
  z-index: 0;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(76, 243, 255, 0.03) 0px,
    rgba(76, 243, 255, 0.03) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: screen;
  opacity: 0.6;
}

/* ---------- drifting background particles ---------- */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px 1px var(--cyan-soft);
  opacity: 0;
  animation: drift linear infinite;
}

@keyframes drift {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.55; }
  90% { opacity: 0.35; }
  100% { transform: translateY(-110vh) translateX(var(--drift-x, 30px)); opacity: 0; }
}

/* ---------- ambient HUD background (dashboard page only) ---------- */
.hud-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hud-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(78vmin, 760px);
  height: min(78vmin, 760px);
  transform: translate(-50%, -50%);
  overflow: visible;
}

.hud-ring {
  fill: none;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
}

/* three concentric arcs, staggered speed/direction for parallax depth */
.hud-ring-a {
  stroke: var(--cyan);
  stroke-width: 1.5;
  opacity: 0.22;
  stroke-dasharray: 697 466;
  animation: spin 130s linear infinite;
}

.hud-ring-b {
  stroke: var(--cyan);
  stroke-width: 1.5;
  opacity: 0.24;
  stroke-dasharray: 364 547;
  animation: spin-rev 95s linear infinite;
}

/* dashed "gauge" ring — a targeting-reticle texture, one repeating dash pattern */
.hud-ring-c {
  stroke: var(--amber);
  stroke-width: 2;
  opacity: 0.3;
  stroke-dasharray: 3 11;
  animation: spin 70s linear infinite;
}

/* finer, denser tick ring at a different radius — reads as gauge texture alongside ring-c */
.hud-ring-d {
  stroke: var(--cyan);
  stroke-width: 1.5;
  opacity: 0.2;
  stroke-dasharray: 2 8;
  animation: spin-rev 45s linear infinite;
}

/* short faint lines from center, stopping well before the innermost ring */
.hud-crosshair {
  stroke: var(--cyan);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.2;
}

.hud-core-stop { stop-color: var(--cyan); }

.hud-core-glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: hud-breathe 11s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes hud-breathe {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* one slow light sweep that crosses the screen, then goes quiet for a long stretch */
.hud-sweep {
  position: absolute;
  top: -20%;
  left: 0;
  width: 16%;
  height: 140%;
  background: linear-gradient(100deg, transparent 0%, rgba(76, 243, 255, 0.18) 50%, transparent 100%);
  transform: translateX(-150%);
  animation: hud-sweep-move 18s ease-in-out infinite;
  mix-blend-mode: screen;
}

@keyframes hud-sweep-move {
  0%, 12% { transform: translateX(-150%); }
  50%, 100% { transform: translateX(750%); }
}

/* shared keyframes — used by the radar sweep, reactor rings, focus badge, assistant dot */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-rev { to { transform: rotate(-360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 0.75; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.05); }
}

h1, h2, h3 { font-family: 'Orbitron', sans-serif; letter-spacing: 0.08em; margin: 0; }

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

/* ---------- top bar ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px;
  /* keeps content clear of the notch/Dynamic Island when installed as an iOS home-screen app */
  padding-top: max(22px, env(safe-area-inset-top, 22px));
  padding-left: max(32px, env(safe-area-inset-left, 32px));
  padding-right: max(32px, env(safe-area-inset-right, 32px));
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(to bottom, rgba(76, 243, 255, 0.06), transparent);
}

/* Shared tab bar (nav.js injects the markup on every page) — replaces the old pattern of
   separate pages linked as "Quick Launch" buttons, so moving between sections feels like
   switching tabs inside one app rather than leaving it. */
.tab-bar {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px max(20px, env(safe-area-inset-left, 20px)) 10px max(32px, env(safe-area-inset-left, 32px));
  border-bottom: 1px solid var(--panel-border);
  background: rgba(5, 12, 18, 0.55);
  backdrop-filter: blur(6px);
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-link {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 3px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tab-link:hover { color: var(--text); border-color: var(--panel-border); background: rgba(76, 243, 255, 0.06); }
.tab-link.active {
  color: var(--cyan);
  border-color: var(--cyan-soft);
  background: rgba(76, 243, 255, 0.12);
  box-shadow: 0 0 14px rgba(76, 243, 255, 0.25) inset;
}
.tab-link .tab-dot {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.5; flex-shrink: 0;
}
.tab-link.active .tab-dot { opacity: 1; box-shadow: 0 0 6px currentColor; }
.tab-link.tab-live { color: #ff8a97; }
.tab-link.tab-live.active { color: #ff5470; border-color: rgba(255, 84, 112, 0.5); background: rgba(255, 84, 112, 0.12); box-shadow: 0 0 14px rgba(255, 84, 112, 0.3) inset; }

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

.reactor {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  --reactor-accent: var(--cyan);
}

.reactor-svg { width: 100%; height: 100%; overflow: visible; display: block; }

/* thin radial ticks that chase around the ring like a live scan readout */
.reactor-tick {
  stroke: var(--reactor-accent);
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.15;
  animation: tick-chase 2.4s ease-in-out infinite;
}

@keyframes tick-chase {
  0%, 75%, 100% { opacity: 0.15; }
  8% { opacity: 0.9; }
}

/* precise SVG arcs — no miter artifacts, clean rounded ends */
.reactor-ring {
  fill: none;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
}

.reactor-ring-outer {
  stroke: var(--reactor-accent);
  stroke-width: 1.6;
  opacity: 0.85;
  filter: drop-shadow(0 0 3px var(--cyan-soft));
  animation: spin 6s linear infinite;
}

.reactor-ring-inner {
  stroke: var(--reactor-accent);
  stroke-width: 1.2;
  opacity: 0.45;
  animation: spin-rev 4s linear infinite;
}

/* the single bright "live data" point traveling around the loop */
.reactor-sweep {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 4px var(--reactor-accent));
  animation: spin 3.2s linear infinite;
}

.reactor-core-stop {
  stop-color: var(--reactor-accent);
  transition: stop-color 0.4s ease;
}

.reactor-core-glow,
.reactor-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: reactor-breathe 3.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.reactor-core { animation-delay: -1.8s; }

@keyframes reactor-breathe {
  0%, 100% { transform: scale(0.9); opacity: 0.75; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* ---------- reactor reacts to live assistant state ---------- */
.reactor.state-listening { --reactor-accent: var(--amber); }
.reactor.state-listening .reactor-ring-outer,
.reactor.state-listening .reactor-ring-inner,
.reactor.state-listening .reactor-sweep,
.reactor.state-listening .reactor-tick {
  animation-duration: 1.3s;
}
.reactor.state-listening .reactor-core-glow,
.reactor.state-listening .reactor-core {
  animation-duration: 1s;
}

.reactor.state-thinking .reactor-ring-outer,
.reactor.state-thinking .reactor-ring-inner,
.reactor.state-thinking .reactor-sweep,
.reactor.state-thinking .reactor-tick {
  animation-duration: 0.7s;
}
.reactor.state-thinking .reactor-core-glow,
.reactor.state-thinking .reactor-core {
  animation-duration: 0.6s;
}

.reactor.state-speaking .reactor-ring-outer,
.reactor.state-speaking .reactor-ring-inner,
.reactor.state-speaking .reactor-sweep,
.reactor.state-speaking .reactor-tick {
  animation-duration: 0.9s;
}
.reactor.state-speaking .reactor-core-glow,
.reactor.state-speaking .reactor-core {
  animation-duration: 0.45s;
}
.reactor.state-speaking .reactor-sweep {
  filter: drop-shadow(0 0 7px var(--cyan));
}

/* Dormant: the opposite of the speed-ups above — everything slows way down
   and dims, instead of just resetting to the idle look, so "asleep" reads
   as a distinct state rather than "nothing happening right now". */
.reactor.state-sleeping { --reactor-accent: var(--cyan-dim); opacity: 0.55; }
.reactor.state-sleeping .reactor-ring-outer,
.reactor.state-sleeping .reactor-ring-inner,
.reactor.state-sleeping .reactor-sweep,
.reactor.state-sleeping .reactor-tick {
  animation-duration: 9s;
}
.reactor.state-sleeping .reactor-core-glow,
.reactor.state-sleeping .reactor-core {
  animation-duration: 6s;
}

/* ---------- hero centerpiece: the same reactor, blown up into the dashboard's
   focal point so it reads as "he's actually there" rather than a status icon ---------- */
.hero-reactor {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 36px 20px 28px;
  text-align: center;
}
.hero-reactor::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 243, 255, 0.14), transparent 70%);
  pointer-events: none;
  animation: reactor-breathe 4.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.brain-wrap {
  position: relative;
  width: min(340px, 62vw);
  height: min(340px, 62vw);
}
#brainCanvas {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-status {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan-soft);
}
.hero-hint {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.brand-text h1 {
  font-size: 1.6rem;
  color: var(--cyan);
  text-shadow: 0 0 14px var(--cyan-soft);
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--text-dim);
}

.header-right { display: flex; align-items: center; gap: 22px; }

.focus-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--panel-border);
  background: rgba(76, 243, 255, 0.05);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  clip-path: polygon(0 6px, 6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
}

.focus-badge .focus-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.focus-badge.active { color: var(--good); border-color: rgba(87, 255, 176, 0.4); }
.focus-badge.active .focus-dot { background: var(--good); box-shadow: 0 0 8px var(--good); }
.focus-badge.active.work { color: var(--amber); border-color: rgba(255, 179, 71, 0.4); }
.focus-badge.active.work .focus-dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1.4s ease-in-out infinite; }

.clock { text-align: right; }

#time {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.7rem;
  color: var(--text);
  text-shadow: 0 0 10px var(--cyan-soft);
}

#date {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  margin-top: 2px;
}

/* ---------- briefing strip ---------- */
.briefing-strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 32px;
  background: rgba(76, 243, 255, 0.04);
  border-bottom: 1px solid var(--panel-border);
  overflow: hidden;
  flex-wrap: wrap;
}

.briefing-scan {
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(76, 243, 255, 0.15), transparent);
  animation: briefing-sweep 5s linear infinite;
  pointer-events: none;
}

@keyframes briefing-sweep {
  0% { left: -30%; }
  100% { left: 130%; }
}

.briefing-chip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 18px;
  border-right: 1px solid var(--panel-border);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.briefing-chip:last-of-type { border-right: none; }

.briefing-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: var(--cyan);
  flex-shrink: 0;
}

.briefing-value {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mic-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  color: var(--cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.mic-toggle:hover { background: rgba(76, 243, 255, 0.1); }

.mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 6px 1px var(--good);
}

.mic-toggle.muted {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(255, 84, 112, 0.08);
}

.mic-toggle.muted .mic-dot {
  background: var(--danger);
  box-shadow: 0 0 6px 1px var(--danger);
}

@media (max-width: 640px) {
  .briefing-strip { padding: 8px 16px; }
  .mic-toggle { margin: 4px 0 0; }
  .briefing-chip { max-width: 100%; border-right: none; padding: 4px 0; width: 100%; }
}

/* ---------- layout ---------- */
main.grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  padding: 28px 32px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

.panel {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  padding: 20px 22px 22px;
  backdrop-filter: blur(6px);
  clip-path: polygon(0 10px, 10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2) inset, 0 0 24px rgba(76, 243, 255, 0.06);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.panel:hover {
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2) inset, 0 0 34px rgba(76, 243, 255, 0.14);
  transform: translateY(-1px);
}

/* HUD-style corner brackets, complementing the diagonal-cut corners from clip-path */
.panel::before,
.panel::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--cyan);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.25s ease, box-shadow 0.25s ease;
}

.panel::before {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
}

.panel::after {
  bottom: -1px;
  left: -1px;
  border-right: none;
  border-top: none;
}

.panel:hover::before,
.panel:hover::after {
  opacity: 1;
  box-shadow: 0 0 8px var(--cyan-soft);
}

.panel h2 {
  font-size: 0.95rem;
  color: var(--cyan);
  margin-bottom: 14px;
  text-shadow: 0 0 8px var(--cyan-soft);
}

.panel-links { grid-column: span 1; }

/* ---------- balance ---------- */
.balance-display {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.2rem;
  color: var(--good);
  text-shadow: 0 0 14px rgba(87, 255, 176, 0.4);
  margin-bottom: 10px;
}

.hidden { display: none !important; }

.auth-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 84, 112, 0.15);
  border-bottom: 1px solid var(--danger);
  color: var(--text);
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
}

.auth-banner input {
  flex: 1;
  min-width: 160px;
  max-width: 320px;
}

.auth-banner button {
  color: var(--danger);
  border-color: var(--danger);
  white-space: nowrap;
}

.auth-banner button:hover { background: rgba(255, 84, 112, 0.2); }

.balance-chart {
  position: relative;
  height: 90px;
  margin-bottom: 12px;
}

.balance-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  cursor: crosshair;
}

.balance-chart-tooltip {
  position: absolute;
  top: -26px;
  padding: 4px 8px;
  background: rgba(3, 6, 8, 0.9);
  border: 1px solid var(--panel-border);
  color: var(--text);
  font-size: 0.72rem;
  font-family: 'Orbitron', sans-serif;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

.balance-edit { display: flex; gap: 8px; margin-bottom: 10px; }

input[type="number"], input[type="text"], input[type="datetime-local"], input[type="time"] {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--panel-border);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  padding: 8px 10px;
  border-radius: 2px;
  width: 100%;
  color-scheme: dark;
}

input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 8px var(--cyan-soft); }

button, .ghost-btn, .launch-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--cyan);
  background: rgba(76, 243, 255, 0.08);
  border: 1px solid var(--panel-border);
  padding: 9px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-block;
}

button:hover, .ghost-btn:hover, .launch-btn:hover {
  background: rgba(76, 243, 255, 0.2);
  box-shadow: 0 0 12px var(--cyan-soft);
}

.ghost-btn, .launch-btn { text-align: center; width: 100%; margin-top: 6px; }

.meta { margin-top: 10px; font-size: 0.75rem; color: var(--text-dim); }

.live-badge {
  display: inline-block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  background: #e0142c;
  padding: 2px 8px;
  border-radius: 2px;
  vertical-align: middle;
}

.panel-live { border-color: rgba(224, 20, 44, 0.7); box-shadow: 0 0 18px rgba(224, 20, 44, 0.18); }

.trading-mode-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--amber);
  border: 1px solid var(--amber);
  padding: 2px 8px;
  border-radius: 2px;
  vertical-align: middle;
}

/* ---------- quick launch ---------- */
.panel-links .launch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 14px;
}

.panel-links .launch-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  flex-shrink: 0;
}

/* ---------- timer ---------- */
.timer-tabs { display: flex; gap: 8px; margin-bottom: 14px; }

.tab {
  flex: 1;
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}

.tab.active { color: var(--cyan); background: rgba(76, 243, 255, 0.12); }

.timer-phase {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--good);
  margin-top: 8px;
}

.timer-phase.phase-break { color: var(--amber); }

.study-btn { margin-top: 10px; color: var(--amber); border-color: rgba(255, 179, 71, 0.4); }
.study-btn:hover { background: rgba(255, 179, 71, 0.15); box-shadow: 0 0 12px rgba(255, 179, 71, 0.35); }

.shutdown-btn {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--danger);
  border-color: var(--danger);
}
.shutdown-btn:hover { background: rgba(255, 84, 112, 0.15); box-shadow: 0 0 14px rgba(255, 84, 112, 0.4); }

.timer-display {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.4rem;
  text-align: center;
  color: var(--text);
  text-shadow: 0 0 12px var(--cyan-soft);
  margin: 8px 0 14px;
}

.countdown-input { display: flex; gap: 8px; margin-bottom: 12px; }

.timer-controls { display: flex; gap: 8px; }
.timer-controls button { flex: 1; }

/* ---------- todo preview ---------- */
.todo-summary { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 10px; }

.todo-preview { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.todo-preview li {
  font-size: 0.9rem;
  padding: 8px 10px;
  border-left: 2px solid var(--cyan-dim);
  background: rgba(76, 243, 255, 0.04);
}

.todo-preview .empty { color: var(--text-dim); border-left-color: transparent; font-style: italic; }

/* ---------- things to remember ---------- */
.badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--amber);
  color: #000;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  text-align: center;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(255, 179, 71, 0.5);
}

.thing-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }

.thing-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 8px 10px;
  border-left: 2px solid var(--amber);
  background: rgba(255, 179, 71, 0.06);
}

.thing-item.is-read { border-left-color: var(--cyan-dim); background: rgba(76, 243, 255, 0.04); }

.thing-item .thing-text { flex: 1; }

.thing-item .thing-actions { display: flex; gap: 4px; flex-shrink: 0; }

.thing-item .thing-actions button {
  padding: 4px 8px;
  font-size: 0.62rem;
}

.thing-list .empty { color: var(--text-dim); border-left-color: transparent; font-style: italic; }

.thing-add { display: flex; gap: 6px; }
.thing-add input { flex: 1; }
.thing-add button { flex-shrink: 0; }

/* ---------- status ---------- */
.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.status-row span { width: 90px; flex-shrink: 0; color: var(--text-dim); }
.status-row span.status-value { width: 52px; text-align: right; color: var(--text); font-family: 'Orbitron', sans-serif; font-size: 0.72rem; }

.bar { flex: 1; height: 8px; background: rgba(255,255,255,0.06); position: relative; overflow: hidden; }

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
  box-shadow: 0 0 8px var(--cyan-soft);
  transition: width 0.8s ease;
}

.status-note { margin-top: 14px; color: var(--good); font-size: 0.8rem; letter-spacing: 0.1em; }

/* ---------- assistant panel ---------- */
.assistant-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.assistant-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.assistant-dot.idle { background: var(--text-dim); }
.assistant-dot.listening { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: pulse 0.9s ease-in-out infinite; }
.assistant-dot.thinking { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: pulse 0.5s ease-in-out infinite; }
.assistant-dot.speaking { background: var(--good); box-shadow: 0 0 10px var(--good); animation: pulse 0.4s ease-in-out infinite; }
.assistant-dot.sleeping { background: var(--cyan-dim); animation: pulse 3.4s ease-in-out infinite; }

.assistant-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--text);
}

.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  margin-left: auto;
  opacity: 0.25;
  transition: opacity 0.3s ease;
}

.equalizer.active { opacity: 1; }

.equalizer span {
  width: 4px;
  background: var(--good);
  border-radius: 1px;
  height: 20%;
  animation: eq 0.9s ease-in-out infinite;
  animation-play-state: paused;
}

.equalizer.active span { animation-play-state: running; }
.equalizer span:nth-child(1) { animation-delay: 0s; }
.equalizer span:nth-child(2) { animation-delay: 0.15s; }
.equalizer span:nth-child(3) { animation-delay: 0.3s; }
.equalizer span:nth-child(4) { animation-delay: 0.1s; }
.equalizer span:nth-child(5) { animation-delay: 0.25s; }

@keyframes eq {
  0%, 100% { height: 20%; }
  50% { height: 100%; }
}

.assistant-transcript {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
  border-left: 2px solid var(--cyan-dim);
  padding-left: 10px;
  margin-top: 4px;
}

.assistant-transcript strong { color: var(--text); font-weight: 600; }

.ask-form { display: flex; gap: 8px; margin-top: 14px; }
.ask-form input { flex: 1; }

#askMic {
  flex-shrink: 0;
  width: 44px;
}

#askMic.active {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(255, 84, 112, 0.15);
  animation: pulse 1s ease-in-out infinite;
}

#pasteForm { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

#pasteInput {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--panel-border);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 2px;
  width: 100%;
  resize: vertical;
  color-scheme: dark;
}

#pasteInput:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 8px var(--cyan-soft); }

/* ---------- activity feed ---------- */
.activity-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
}

.activity-log li {
  font-size: 0.82rem;
  color: var(--text-dim);
  border-left: 2px solid var(--cyan-dim);
  padding: 6px 10px;
  animation: fade-in 0.4s ease;
  background: rgba(76, 243, 255, 0.03);
}

.activity-log li .activity-time {
  color: var(--cyan);
  margin-right: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.68rem;
}

.activity-log .empty { font-style: italic; border-left-color: transparent; }

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

/* ---------- laptop control buttons ---------- */
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

/* ---------- boot animation ---------- */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: radial-gradient(ellipse at 50% 0%, var(--bg-1) 0%, var(--bg-0) 65%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  animation: boot-fade-out 0.6s ease forwards;
  animation-delay: 2.1s;
}

.boot-reactor {
  position: relative;
  width: 120px;
  height: 120px;
  opacity: 0;
  --reactor-accent: var(--cyan);
  animation: boot-pop-in 0.6s ease forwards 0.1s;
}

/* faster than the header's resting speed, to feel energetic during boot */
.boot-reactor .reactor-ring-outer,
.boot-reactor .reactor-sweep {
  animation-duration: 1.6s;
}
.boot-reactor .reactor-ring-inner { animation-duration: 1.1s; }
.boot-reactor .reactor-tick { animation-duration: 1.2s; }
.boot-reactor .reactor-core-glow,
.boot-reactor .reactor-core {
  animation-duration: 1.4s;
}

.boot-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.4rem;
  letter-spacing: 0.3em;
  color: var(--cyan);
  text-shadow: 0 0 18px var(--cyan-soft);
  opacity: 0;
  animation: boot-pop-in 0.5s ease forwards 0.35s;
}

.boot-log { text-align: center; font-size: 0.8rem; letter-spacing: 0.15em; color: var(--text-dim); }
.boot-line { opacity: 0; transform: translateY(4px); animation: boot-line-in 0.4s ease forwards; }
.boot-line:nth-child(1) { animation-delay: 0.7s; }
.boot-line:nth-child(2) { animation-delay: 1.05s; }
.boot-line:nth-child(3) { animation-delay: 1.4s; }
.boot-line.boot-online { color: var(--good); animation-delay: 1.75s; }

@keyframes boot-pop-in { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }
@keyframes boot-line-in { to { opacity: 1; transform: translateY(0); } }
@keyframes boot-fade-out { to { opacity: 0; visibility: hidden; } }

/* ---------- todo page ---------- */
.todo-page main.grid { grid-template-columns: 1fr; max-width: 720px; }

.back-link { color: var(--text-dim); font-size: 0.85rem; }
.back-link:hover { color: var(--cyan); }

.todo-add { display: flex; gap: 8px; margin-bottom: 18px; }
.todo-add input { flex: 1; }

.reminder-add input[type="text"] { flex: 2; }
.reminder-add input[type="datetime-local"] { flex: 1.4; min-width: 0; }

.reminder-due {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.68rem;
  color: var(--amber);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- wake-up schedule ---------- */
.wakeup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.wakeup-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-family: 'Orbitron', sans-serif;
}

.wakeup-enabled {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.wakeup-enabled input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}

.todo-filters { display: flex; gap: 8px; margin-bottom: 16px; }
.todo-filters .tab { flex: initial; padding: 8px 16px; }

.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  background: rgba(76, 243, 255, 0.03);
}

.todo-item.done { opacity: 0.5; }
.todo-item.done .todo-text { text-decoration: line-through; }

.todo-item .todo-text { flex: 1; font-size: 1rem; }

.todo-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.todo-item .delete-btn {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 6px 10px;
  font-size: 0.65rem;
}

.todo-item .delete-btn:hover { background: rgba(255, 84, 112, 0.15); box-shadow: 0 0 10px rgba(255,84,112,0.3); }

.todo-empty { text-align: center; color: var(--text-dim); padding: 30px 0; font-style: italic; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 14px; }
  .header-right { flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; }
  .clock { text-align: left; }
  main.grid { padding: 20px 16px 40px; }
}

/* ---------- task queue: groups sidebar, views, calendar, autoplan ---------- */
.todo-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  padding: 28px 32px 48px;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}

.todo-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.todo-sidebar { position: sticky; top: 16px; }
.group-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.group-row { display: flex; align-items: stretch; gap: 4px; }
.group-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  padding: 8px 10px;
}
.group-row.active .group-btn { color: var(--text); border-color: var(--panel-border); background: rgba(76, 243, 255, 0.1); }
.group-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--g, var(--cyan)); box-shadow: 0 0 6px var(--g, var(--cyan)); flex-shrink: 0; }
.group-dot.neutral { background: transparent; border: 1px solid var(--text-dim); box-shadow: none; }
.group-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-count { font-family: 'Orbitron', sans-serif; font-size: 0.62rem; color: var(--text-dim); }
.group-del {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 0 8px;
  font-size: 0.9rem;
  opacity: 0;
}
.group-row:hover .group-del, .group-del:focus { opacity: 1; }
.group-del:hover { color: var(--danger); border-color: var(--danger); background: rgba(255, 84, 112, 0.1); box-shadow: none; }
.group-add { display: flex; gap: 6px; }
.group-add button { padding: 6px 12px; font-size: 0.9rem; }

.todo-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.todo-toolbar .todo-filters { margin-bottom: 0; }
.show-done { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 0.9rem; cursor: pointer; }
.show-done input { accent-color: var(--cyan); width: 16px; height: 16px; }
.autoplan-btn { margin-left: auto; color: var(--amber); border-color: rgba(255, 179, 71, 0.5); background: rgba(255, 179, 71, 0.08); }
.autoplan-btn:hover { background: rgba(255, 179, 71, 0.18); box-shadow: 0 0 12px rgba(255, 179, 71, 0.35); }

.todo-add { margin-bottom: 0; }
.details-toggle { background: transparent; color: var(--text-dim); }
.form-error { color: var(--danger); min-height: 0; }
.form-error:empty { display: none; }

select, textarea, input[type="date"] {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--panel-border);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  padding: 8px 10px;
  border-radius: 2px;
  color-scheme: dark;
}
textarea { width: 100%; resize: vertical; }
select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 8px var(--cyan-soft); }

.task-fields { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.field-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; align-items: start; }
.field-label { font-family: 'Orbitron', sans-serif; font-size: 0.6rem; letter-spacing: 0.15em; color: var(--cyan); padding-top: 11px; }
.field-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.field-controls input[type="date"] { width: auto; }
.field-controls input[type="time"] { width: auto; }
.mini-chip { padding: 5px 9px; font-size: 0.6rem; background: transparent; color: var(--text-dim); }
.subtask-edit { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; }
.subtask-edit li { display: flex; gap: 6px; }

.task-section h2 { display: flex; align-items: center; gap: 10px; }
.task-section h2 .count { font-size: 0.65rem; color: var(--text-dim); text-shadow: none; }
.task-section.overdue { border-color: rgba(255, 84, 112, 0.55); }
.task-section.overdue h2 { color: var(--danger); text-shadow: none; }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.task-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--g, var(--cyan));
  background: rgba(76, 243, 255, 0.03);
}
.task-card > input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--g, var(--cyan)); cursor: pointer; flex-shrink: 0; }
.task-card.done { opacity: 0.5; }
.task-card.done .task-title { text-decoration: line-through; }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.task-title { font-size: 1.05rem; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border: 1px solid var(--panel-border);
  padding: 3px 7px;
  border-radius: 2px;
  white-space: nowrap;
}
.group-chip { color: var(--g); border-color: var(--g); }
.due-chip { color: var(--amber); border-color: rgba(255, 179, 71, 0.5); }
.due-chip.overdue { color: var(--danger); border-color: var(--danger); }
.do-chip { color: var(--cyan); }
.task-notes { color: var(--text-dim); font-size: 0.92rem; white-space: pre-wrap; overflow-wrap: anywhere; border-left: 1px solid var(--panel-border); padding-left: 10px; }
.subtask-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.subtask-list label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.95rem; }
.subtask-list input { accent-color: var(--g, var(--cyan)); width: 16px; height: 16px; }
.subtask-list li.done span { text-decoration: line-through; color: var(--text-dim); }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; }
.task-actions button { padding: 6px 10px; font-size: 0.6rem; }
.task-actions .delete-btn { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.task-actions .delete-btn:hover { background: rgba(255, 84, 112, 0.15); box-shadow: 0 0 10px rgba(255,84,112,0.3); }
.task-card.compact { padding: 8px 10px; gap: 8px; }
.task-card.compact .task-title { font-size: 0.95rem; }
.task-card.compact .task-actions button { padding: 4px 7px; font-size: 0.55rem; }

.view-nav { display: flex; align-items: center; gap: 10px; }
.view-nav #navLabel { font-family: 'Orbitron', sans-serif; font-size: 0.75rem; letter-spacing: 0.12em; color: var(--text); min-width: 160px; text-align: center; }
.view-nav button { padding: 6px 12px; }
.view-nav #navPrev, .view-nav #navNext { font-size: 1rem; line-height: 1; }

.day-grid { display: grid; gap: 12px; }
.day-grid.days-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day-grid.days-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.day-grid.days-1 { grid-template-columns: 1fr; }
.day-col { padding: 14px 12px; min-width: 0; }
.day-col.is-today { border-color: var(--cyan); box-shadow: 0 0 24px rgba(76, 243, 255, 0.18); }
.day-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.day-name { font-family: 'Orbitron', sans-serif; font-size: 0.75rem; letter-spacing: 0.15em; color: var(--cyan); }
.day-date { color: var(--text-dim); font-size: 0.85rem; }
.day-empty { color: var(--text-dim); font-style: italic; font-size: 0.85rem; }
.col-label { font-family: 'Orbitron', sans-serif; font-size: 0.55rem; letter-spacing: 0.15em; color: var(--text-dim); margin: 12px 0 6px; }
.days-7 .task-card { flex-wrap: wrap; }
.days-7 .task-actions { flex-direction: row; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.tl-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 9px;
  border-left: 3px solid var(--g, var(--text-dim));
  background: rgba(255, 255, 255, 0.03);
}
.days-1 .tl-item, .plan-preview .tl-item, .today-timeline .tl-item { flex-direction: row; align-items: baseline; gap: 12px; }
.tl-time { font-family: 'Orbitron', sans-serif; font-size: 0.56rem; letter-spacing: 0.08em; color: var(--text-dim); white-space: nowrap; }
.days-1 .tl-time, .plan-preview .tl-time, .today-timeline .tl-time { min-width: 150px; }
.tl-title { font-size: 0.93rem; overflow-wrap: anywhere; }
.tl-class { background: color-mix(in srgb, var(--g, var(--cyan)) 12%, transparent); }
.tl-class .tl-title { color: var(--g, var(--cyan)); font-weight: 600; }
.tl-commitment { --g: var(--amber); }
.tl-event { --g: #ff8ad8; }
.tl-break { --g: transparent; opacity: 0.6; font-style: italic; }
.tl-task { --g: var(--cyan); }
.tl-item.now { box-shadow: 0 0 0 1px var(--cyan) inset, 0 0 14px var(--cyan-soft); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
  background: rgba(3, 6, 8, 0.78);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.modal-card { width: 100%; max-width: 640px; }
.modal-card:hover { transform: none; }
.modal-card > input[type="text"] { font-size: 1.1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-actions .ghost { background: transparent; color: var(--text-dim); }

.autoplan-card { max-width: 720px; }
.autoplan-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.autoplan-head h2 { margin-bottom: 0; color: var(--amber); text-shadow: 0 0 8px rgba(255, 179, 71, 0.4); }
.autoplan-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-step { font-family: 'Orbitron', sans-serif; font-size: 0.52rem; letter-spacing: 0.12em; color: var(--text-dim); border-bottom: 2px solid transparent; padding-bottom: 3px; }
.ap-step.current { color: var(--amber); border-color: var(--amber); }
.ap-step.done { color: var(--text); }
.ap-question { font-size: 1.1rem; margin: 18px 0 10px; }
.ap-hint { color: var(--text-dim); font-size: 0.9rem; margin-top: 8px; }
.ap-warning { color: var(--amber); border: 1px solid rgba(255, 179, 71, 0.5); padding: 10px 12px; margin-top: 12px; font-size: 0.95rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 9px 14px;
  background: transparent;
  color: var(--text);
  border-radius: 999px;
}
.choice.selected { background: rgba(255, 179, 71, 0.18); border-color: var(--amber); color: var(--amber); box-shadow: 0 0 10px rgba(255, 179, 71, 0.3); }
.commit-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.commit-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.commit-list input[type="text"] { flex: 1; min-width: 140px; width: auto; }
.ap-to { color: var(--text-dim); }
.ap-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.ap-tasks li { border: 1px solid var(--panel-border); border-left: 3px solid var(--g, var(--cyan)); padding: 8px 10px; }
.ap-tasks li.picked { background: rgba(255, 179, 71, 0.06); border-color: rgba(255, 179, 71, 0.5); border-left-color: var(--g, var(--cyan)); }
.ap-task-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: none;
  padding: 2px 0;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.ap-task-toggle:hover { background: transparent; box-shadow: none; }
.ap-check { width: 20px; height: 20px; border: 1px solid var(--panel-border); display: inline-flex; align-items: center; justify-content: center; color: var(--amber); flex-shrink: 0; }
.ap-task-name { flex: 1; overflow-wrap: anywhere; }
.ap-task-due { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }
.chip-row.durations { margin: 8px 0 2px 30px; gap: 6px; }
.chip-row.durations .choice { font-size: 0.9rem; padding: 5px 11px; }

/* ---------- dashboard Today panel ---------- */
.panel-today { grid-column: 1 / -1; }
.today-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.today-head h2 { margin-bottom: 0; }
.today-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.today-sub { font-family: 'Orbitron', sans-serif; font-size: 0.56rem; letter-spacing: 0.15em; color: var(--text-dim); margin-bottom: 8px; }
.today-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.today-tasks li { border-left: 3px solid var(--g, var(--cyan)); padding: 6px 10px; background: rgba(76, 243, 255, 0.03); display: flex; justify-content: space-between; gap: 10px; }
.today-tasks .when { font-family: 'Orbitron', sans-serif; font-size: 0.55rem; letter-spacing: 0.08em; color: var(--amber); white-space: nowrap; }
.today-tasks li.overdue .when { color: var(--danger); }
.today-empty { color: var(--text-dim); font-style: italic; font-size: 0.9rem; }

@media (max-width: 1000px) {
  .day-grid.days-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .todo-layout { grid-template-columns: 1fr; padding: 20px 16px 40px; }
  .todo-sidebar { position: static; }
  .group-del { opacity: 1; }
  .day-grid.days-7, .day-grid.days-3 { grid-template-columns: 1fr; }
  .today-cols { grid-template-columns: 1fr; }
  .autoplan-btn { margin-left: 0; width: 100%; }
  .field-row { grid-template-columns: 1fr; gap: 4px; }
  .field-label { padding-top: 0; }
  .days-1 .tl-item, .plan-preview .tl-item, .today-timeline .tl-item { flex-direction: column; gap: 1px; }
  .days-1 .tl-time, .plan-preview .tl-time, .today-timeline .tl-time { min-width: 0; }
  .task-card { flex-wrap: wrap; }
  .task-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
}

/* narrow calendar columns: keep compact cards to title + when */
.day-col .tl-time { white-space: normal; }
.tl-title, .task-title { overflow-wrap: break-word; }
.task-card.compact { flex-wrap: wrap; }
.task-card.compact .task-body { flex: 1 1 0; min-width: 0; }
.task-card.compact .task-meta .chip:not(.due-chip):not(.do-chip) { display: none; }
.task-card.compact .chip { white-space: normal; }
.task-card.compact .task-actions { width: 100%; justify-content: flex-end; }
.days-7 .day-col { padding: 12px 9px; }
.days-7 .tl-title { font-size: 0.84rem; hyphens: auto; }
.days-7 .task-card.compact .task-title { font-size: 0.88rem; }
.today-head .today-open { width: auto; margin-top: 0; padding: 7px 14px; }

@media (max-width: 760px) {
  .todo-sidebar { padding: 14px 16px; }
  .todo-sidebar h2 { margin-bottom: 8px; }
  .group-list { flex-direction: row; overflow-x: auto; gap: 6px; margin-bottom: 10px; scrollbar-width: none; }
  .group-list::-webkit-scrollbar { display: none; }
  .group-row { flex: 0 0 auto; }
  .group-btn { padding: 6px 10px; border-color: var(--panel-border); }
  .group-name { overflow: visible; }
  .view-tabs { width: 100%; }
  .view-tabs .tab { flex: 1; padding: 8px 4px; font-size: 0.6rem; letter-spacing: 0.06em; }
}
@media (max-width: 760px) {
  .todo-layout { grid-template-columns: minmax(0, 1fr); }
  .todo-layout > * { min-width: 0; }
}
@media (max-width: 760px) {
  .todo-add { flex-wrap: wrap; }
  .todo-add input { flex-basis: 100%; }
  .todo-add button { flex: 1; }
}

/* iOS has no install prompt of its own, so nav.js shows this once in Safari — otherwise
   "Add to Home Screen" is very hard to discover. Fixed clear of the home indicator. */
.install-hint {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 12px));
  right: max(12px, env(safe-area-inset-right, 12px));
  bottom: max(12px, env(safe-area-inset-bottom, 12px));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.35;
  color: #cfe6f5;
  background: rgba(5, 12, 18, 0.94);
  border: 1px solid rgba(76, 243, 255, 0.28);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.install-hint strong { color: #05d9ff; font-weight: 600; }
.install-hint button {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 8px;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  color: #9fb3c8;
  background: transparent;
  border: 1px solid rgba(159, 179, 200, 0.25);
  border-radius: 8px;
  cursor: pointer;
}
