:root {
  --bg: #070b17;
  --panel: #10182c;
  --text: #f4f7ff;
  --muted: #a9b6d4;
  --line: #32466a;
  --good: #1f7f67;
  --later: #26344f;
  --accent: #4bffb2;
  --danger: #ef476f;
  --focus: #ffd166;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at 15% 0%, #1a2f5e, #070b17 58%);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
#particles { position: fixed; inset: 0; z-index: -1; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: .75rem; top: .75rem; background: #fff; color: #000; padding: .45rem .7rem; border-radius: 8px; }
.hero { max-width: 980px; margin: 1.1rem auto 0; padding: 0 1rem; }
.hero h1 { margin: 0; font-size: clamp(2rem, 8vw, 3.5rem); letter-spacing: .02em; }
.lead { margin: .35rem 0; font-size: clamp(1rem, 3.6vw, 1.2rem); }
.sub { color: var(--accent); font-weight: 700; margin-top: .2rem; }
.wrap { max-width: 980px; margin: .9rem auto 2rem; padding: 0 1rem max(1rem, env(safe-area-inset-bottom)); display: grid; gap: .85rem; }
.card {
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .95rem;
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 30px rgba(0,0,0,.22);
}
.card h2 { margin: 0 0 .5rem; font-size: clamp(1.06rem, 3.8vw, 1.25rem); }
.tabCard { padding: .6rem; }
.tabRow { display: flex; gap: .45rem; flex-wrap: wrap; }
.tabBtn {
  background: #1c2842;
  color: #dbe7ff;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 34px;
  padding: .4rem .8rem;
  font-size: .84rem;
}
.tabBtn.active {
  background: var(--accent);
  color: #042515;
  border-color: transparent;
}
.flowSteps {
  display: grid;
  grid-template-columns: 1fr;
  gap: .45rem;
}
.flowStep {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .45rem .55rem;
  background: #0c1425;
  display: grid;
}
.flowStep span { font-size: .82rem; color: var(--muted); }
.muted { color: var(--muted); margin: .2rem 0 0; }
.tiny { font-size: .88rem; }
.help ol { margin: .3rem 0 .5rem 1.2rem; padding: 0; }
.help li { margin: .25rem 0; }
.top { display: grid; grid-template-columns: 1fr auto; gap: .6rem .8rem; align-items: center; }
#flareHint { grid-column: 1 / -1; }
.switchRow { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; }
.energyHeader { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.meter { margin-top: .65rem; width: 100%; height: 16px; border-radius: 999px; border: 1px solid var(--line); overflow: hidden; background: #0a1222; }
#energyFill { height: 100%; width: 100%; background: linear-gradient(90deg,#4bffb2,#2fb6ff); transition: width .22s ease; }
.energyText { margin: .55rem 0 0; }
.energyCard { position: relative; overflow: hidden; }
#energyFill.spend { animation: pulseSpend .55s ease; }
@keyframes pulseSpend {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.35); }
  100% { filter: brightness(1); }
}
.energyDelta {
  position: absolute;
  right: .7rem;
  top: .7rem;
  background: rgba(14, 22, 37, 0.95);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .2rem .52rem;
  color: #ffd166;
  font-size: .76rem;
  pointer-events: none;
  animation: riseOut 1.25s ease forwards;
}
@keyframes riseOut {
  0% { opacity: 0; transform: translateY(6px); }
  14% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}
form { display: grid; gap: .55rem; }
.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
input[type="text"], input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1425;
  color: var(--text);
  padding: .72rem;
  font: inherit;
}
input[type="text"] { width: 100%; }
input[type="number"] { width: 100px; }
.check { display: flex; align-items: center; gap: .5rem; }
button {
  border: 0;
  border-radius: 999px;
  padding: .5rem .78rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #042515;
  min-height: 34px;
  font-size: .86rem;
}
.toggleGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .45rem;
}
.toggleItem {
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .46rem .55rem;
  background: #0c1425;
  font-size: .9rem;
}
.toggleItem input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #4bffb2;
}
button, input { touch-action: manipulation; }
button:focus, input:focus, a:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.board { display: grid; grid-template-columns: 1fr; gap: .85rem; }
.column h2 { margin-top: 0; }
ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.task { border: 1px solid var(--line); border-radius: 12px; padding: .68rem; display: grid; gap: .45rem; }
.task.today { background: color-mix(in srgb, var(--good) 28%, transparent); }
.task.later { background: color-mix(in srgb, var(--later) 82%, transparent); }
.taskTop { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.taskTop strong { display: block; line-height: 1.35; }
.pill { font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; padding: .14rem .45rem; color: var(--muted); white-space: nowrap; }
.taskBtns { display: flex; flex-wrap: wrap; gap: .35rem; }
.taskBtns button { padding: .4rem .62rem; font-size: .82rem; min-height: 36px; }
.taskBtns .ghost { background: #2b3c5b; color: #f0f4ff; }
.taskBtns .done { background: #52ffa7; color: #09331f; }
.taskBtns .danger { background: var(--danger); color: #fff; }
.taskBtns.primary { gap: .4rem; }
.taskBtns.secondary { margin-top: .45rem; }
.taskMore {
  border-top: 1px dashed var(--line);
  margin-top: .45rem;
  padding-top: .4rem;
}
.taskMore summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .84rem;
}
.scheduleRow { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.scheduleRow input { min-height: 38px; }
.quickTimes { display: flex; flex-wrap: wrap; gap: .35rem; }
.quickTimes button { min-height: 32px; font-size: .78rem; padding: .34rem .56rem; }
.scheduleRow select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c1425;
  color: var(--text);
  padding: .45rem .55rem;
  font: inherit;
  font-size: .85rem;
}
.countdown { color: #d5e6ff; font-size: .86rem; }
.reminderOn { box-shadow: 0 0 0 2px rgba(75,255,178,.3) inset; }
.row { display: flex; gap: .45rem; flex-wrap: wrap; }
.msg textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1425;
  color: var(--text);
  padding: .72rem;
  font: inherit;
  line-height: 1.4;
  resize: vertical;
}
.noteMeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .65rem;
  margin-top: .45rem;
}
.historyHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
}
.historyList {
  display: grid;
  gap: .5rem;
  margin-top: .6rem;
}
.insightGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .45rem;
  margin-top: .5rem;
}
.insightCard {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .5rem;
  background: #0c1425;
}
.insightCard h3 { margin: 0; font-size: .8rem; color: var(--muted); font-weight: 600; }
.insightCard p { margin: .18rem 0 0; font-size: 1rem; font-weight: 700; }
.recommendation { margin-top: .5rem; }
.recommendation p { font-size: .92rem; font-weight: 600; line-height: 1.45; }
.historyItem {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1425;
  padding: .65rem;
}
.historyItem h3 {
  margin: 0;
  font-size: .9rem;
}
.historyMeta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .38rem;
}
.tag {
  font-size: .74rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .1rem .4rem;
  color: var(--muted);
}
.historyNote {
  margin: .42rem 0 0;
  font-size: .85rem;
  color: #dbe7ff;
}
.performedList {
  margin-top: .45rem;
  padding-left: 1rem;
  display: grid;
  gap: .2rem;
}
.performedList li { font-size: .82rem; color: #dbe7ff; }
.small { min-height: 30px; font-size: .78rem; padding: .32rem .58rem; }
.ghost { background: #2b3c5b; color: #f0f4ff; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.high-contrast {
  --panel: #000;
  --text: #fff;
  --muted: #f1f1f1;
  --line: #fff;
  --accent: #ffe600;
  --good: #005f46;
  --danger: #ff2f2f;
}
.large-text { font-size: 1.13rem; }
.dyslexia-font {
  font-family: "OpenDyslexic", "Atkinson Hyperlegible", "Arial", "Verdana", sans-serif;
  letter-spacing: .03em;
  word-spacing: .07em;
}
.reduce-motion * { animation: none !important; transition: none !important; }
.sensory-mode {
  --panel: #131b2a;
  --line: #41567c;
  --accent: #9bf4d0;
}
.sensory-mode #particles { opacity: .2; }
.sensory-mode .card { box-shadow: none; }
.sensory-mode .task { padding: .82rem; gap: .6rem; }
.asl-spell {
  display: inline-block;
  margin-left: .35rem;
  color: var(--muted);
  font-size: .84em;
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 0 .35rem;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .taskTop { flex-direction: column; gap: .35rem; }
  .pill { align-self: flex-start; }
  .asl-spell { display: block; margin: .2rem 0 0; width: fit-content; }
}
@media (min-width: 740px) { .board { grid-template-columns: 1fr 1fr; } }
@media (min-width: 740px) {
  .flowSteps { grid-template-columns: 1fr 1fr; }
  .toggleGrid { grid-template-columns: 1fr 1fr; }
  .insightGrid { grid-template-columns: 1fr 1fr 1fr; }
}
