/* =========================================================
   Steady: styles shared by every page
   ---------------------------------------------------------
   The look: a colourful study notebook. Grid-paper background,
   highlighter titles, handwritten notes and one colour per
   section of the site:
     Home = coral · Planner = blue · Subjects = violet
     Habits = green · Review = amber
   ========================================================= */

:root {
  /* Paper and ink */
  --paper: #fdf8ee;
  --grid-line: rgba(99, 132, 199, .11);
  --card: #ffffff;
  --ink: #1e2235;
  --muted: #61677a;
  --line: #ece6d8;
  --field: #faf7f0;

  /* The colour box: main / strong (for text and buttons) / soft (backgrounds) */
  --blue: #3b82f6;   --blue-strong: #1d4ed8;   --blue-soft: #dbeafe;
  --violet: #8b5cf6; --violet-strong: #6d28d9; --violet-soft: #ede9fe;
  --green: #10b981;  --green-strong: #047857;  --green-soft: #d1fae5;
  --amber: #f59e0b;  --amber-strong: #b45309;  --amber-soft: #fef3c7;
  --coral: #f43f5e;  --coral-strong: #be123c;  --coral-soft: #ffe4e6;
  --cyan: #06b6d4;   --cyan-soft: #cffafe;
  --yellow-soft: #fef9c3;
  --highlight: #fde047;

  /* Each page swaps these three (see below) */
  --accent: var(--coral);
  --accent-strong: var(--coral-strong);
  --accent-soft: var(--coral-soft);

  --radius: 18px;
  --shadow: 0 2px 0 rgba(30, 34, 53, .04), 0 14px 30px -18px rgba(30, 34, 53, .3);
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', cursive;
}

body[data-page="planner"]  { --accent: var(--blue);   --accent-strong: var(--blue-strong);   --accent-soft: var(--blue-soft); }
body[data-page="subjects"] { --accent: var(--violet); --accent-strong: var(--violet-strong); --accent-soft: var(--violet-soft); }
body[data-page="habits"]   { --accent: var(--green);  --accent-strong: var(--green-strong);  --accent-soft: var(--green-soft); }
body[data-page="review"]   { --accent: var(--amber);  --accent-strong: var(--amber-strong);  --accent-soft: var(--amber-soft); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0; }
a { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Highlighter-pen effect for titles */
.hl {
  background: linear-gradient(transparent 58%, color-mix(in srgb, var(--highlight) 80%, transparent) 58%, color-mix(in srgb, var(--highlight) 80%, transparent) 92%, transparent 92%);
  padding: 0 4px;
}

/* ---------- Header and navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px clamp(16px, 4vw, 40px) 14px;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(8px);
}

/* Rainbow stripe under the header: one colour per section */
.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--coral) 0 20%, var(--blue) 20% 40%, var(--violet) 40% 60%, var(--green) 60% 80%, var(--amber) 80%);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }

.logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, var(--highlight), var(--amber));
  transform: rotate(-6deg);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .08);
}

.brand strong { display: block; font-family: var(--font-head); font-size: 22px; font-weight: 600; line-height: 1; }
.brand small { color: var(--muted); font-size: 12.5px; }

.nav { display: flex; gap: 4px; align-items: center; overflow-x: auto; max-width: 100%; padding: 2px; }

.nav a {
  --nc: var(--coral); --nc-strong: var(--coral-strong);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .15s;
}

.nav a[data-page="planner"]  { --nc: var(--blue);   --nc-strong: var(--blue-strong); }
.nav a[data-page="subjects"] { --nc: var(--violet); --nc-strong: var(--violet-strong); }
.nav a[data-page="habits"]   { --nc: var(--green);  --nc-strong: var(--green-strong); }
.nav a[data-page="review"]   { --nc: var(--amber);  --nc-strong: var(--amber-strong); }

.nav a:hover { background: color-mix(in srgb, var(--nc) 15%, white); }
.nav a[aria-current="page"] { background: var(--nc-strong); color: #fff; }

.nav-sep { width: 2px; height: 22px; background: var(--line); margin: 0 4px; flex: none; border-radius: 2px; }

/* ---------- Layout ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 26px clamp(16px, 4vw, 40px) 48px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 18px;
  align-items: start;
}

.full { grid-column: 1 / -1; }
.contents { display: contents; }

/* ---------- Page hero ---------- */
.hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding: 26px 28px;
  margin-bottom: 22px;
  border-radius: 24px;
  background: linear-gradient(120deg, var(--accent-soft) 0%, #fff 78%);
  border: 2px solid color-mix(in srgb, var(--accent) 30%, white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero > * { position: relative; }

/* Big faded emoji in the corner, like a doodle */
.hero-doodle {
  position: absolute;
  right: 18px;
  top: -14px;
  font-size: 130px;
  line-height: 1;
  opacity: .13;
  transform: rotate(12deg);
  pointer-events: none;
  user-select: none;
}

.hero h1 { font-size: clamp(28px, 4.2vw, 42px); }

.eyebrow {
  margin: 0 0 2px;
  font-family: var(--font-hand);
  font-size: 25px;
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1.1;
}

.quote { margin: 8px 0 0; font-family: var(--font-hand); font-size: 23px; color: var(--muted); line-height: 1.2; }

.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

/* Small rounded stat pills */
.bubbles { display: flex; gap: 8px; flex-wrap: wrap; }

.bubble {
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--bc, var(--accent)) 35%, white);
  border-radius: 16px;
  padding: 8px 14px;
  text-align: center;
  min-width: 96px;
}

.bubble b { display: block; font-family: var(--font-head); font-size: 24px; font-weight: 600; color: var(--bc-strong, var(--accent-strong)); }
.bubble span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- Cards ---------- */
.card {
  --cc: var(--accent);
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

/* Coloured strip along the top of each card */
.card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--cc); }

.c-blue   { --cc: var(--blue); }
.c-violet { --cc: var(--violet); }
.c-green  { --cc: var(--green); }
.c-amber  { --cc: var(--amber); }
.c-coral  { --cc: var(--coral); }
.c-cyan   { --cc: var(--cyan); }

.card h2, .card h3 { font-size: 20px; margin-bottom: 12px; }
.show-more { margin-top: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-link { font-weight: 700; font-size: 14px; text-decoration: none; }
.card-link:hover { text-decoration: underline; }

.hint { margin: -4px 0 12px; font-family: var(--font-hand); font-size: 20px; color: var(--muted); line-height: 1.2; }

.notice {
  background: var(--yellow-soft);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
}

/* ---------- Forms ---------- */
.stack { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

label { display: grid; gap: 4px; font-size: 13.5px; font-weight: 700; color: var(--muted); }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 11px;
  width: 100%;
  min-width: 0;
}

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
input[type="color"] { padding: 3px; height: 42px; cursor: pointer; }
textarea { resize: vertical; }

input[type="checkbox"] {
  width: 21px;
  height: 21px;
  padding: 0;
  margin: 0;
  flex: none;
  accent-color: var(--cc, var(--accent));
  cursor: pointer;
}

.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-form input { flex: 1; }
.goal-input { width: 72px; padding: 5px 8px; text-align: right; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  font-weight: 800;
  border: 0;
  border-radius: 12px;
  padding: 9px 16px;
  background: var(--accent-strong);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .15);
  transition: transform .1s, filter .15s;
}

.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-warn { background: var(--coral-strong); }
.btn-soft { background: #fff; color: var(--accent-strong); border: 2px solid color-mix(in srgb, var(--accent) 40%, white); box-shadow: none; }
.btn-ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); font-weight: 700; box-shadow: none; }
.btn-ghost:hover, .btn-soft:hover { background: var(--accent-soft); filter: none; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.danger { color: var(--coral-strong); }

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  cursor: pointer;
  flex: none;
}

.icon-btn:hover { background: var(--accent-soft); color: var(--ink); }
.icon-btn.sm { width: 24px; height: 24px; font-size: 14px; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.list.spaced:not(:empty) { margin-top: 14px; }

.list > li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--field);
}

.list > li.empty, p.empty {
  display: block;
  background: transparent;
  padding: 2px 0;
  color: var(--muted);
  font-size: 14.5px;
  margin: 0;
}

.empty strong { color: var(--ink); }
.grow { flex: 1; min-width: 0; display: grid; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; display: inline-block; }

.subject-link { color: inherit; text-decoration: none; }
.subject-link:hover { text-decoration: underline; color: var(--accent-strong); }

/* Session row has a coloured edge in the subject's colour */
.list > li.session-row { border-left: 5px solid var(--c); background: color-mix(in srgb, var(--c) 8%, white); }

.is-done .grow strong,
.check-row.is-done label span { text-decoration: line-through; color: var(--muted); }

.check-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
}

.streak {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--amber-strong);
  background: var(--amber-soft);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Deadlines ---------- */
.badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 8px;
  flex: none;
}

.badge-exam, .chip-exam { background: var(--coral-soft); color: var(--coral-strong); }
.badge-assignment, .chip-assignment { background: var(--blue-soft); color: var(--blue-strong); }
.badge-other, .chip-other { background: var(--violet-soft); color: var(--violet-strong); }

.when { font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 700; }
.urgent .when { color: var(--coral-strong); }
.past { opacity: .5; }

/* ---------- Slips ---------- */
.list > li.slip { align-items: flex-start; background: color-mix(in srgb, var(--coral) 6%, white); }
.slip p { margin: 4px 0 0; font-size: 14px; }

.tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--coral-strong);
  margin-right: 5px;
}

.tag-good { color: var(--green-strong); }

/* ---------- Home: big doors to each section ---------- */
.doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.door {
  --dc: var(--blue); --ds: var(--blue-soft); --dcs: var(--blue-strong);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border-radius: 22px;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(155deg, var(--ds) 0%, #fff 88%);
  border: 2px solid color-mix(in srgb, var(--dc) 40%, white);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}

.door:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: 0 18px 30px -18px rgba(30, 34, 53, .45); }
.door-subjects { --dc: var(--violet); --ds: var(--violet-soft); --dcs: var(--violet-strong); }
.door-habits   { --dc: var(--green);  --ds: var(--green-soft);  --dcs: var(--green-strong); }
.door-review   { --dc: var(--amber);  --ds: var(--amber-soft);  --dcs: var(--amber-strong); }

.door-emoji { font-size: 40px; line-height: 1; }
.door h2 { font-size: 23px; }
.door p { margin: 0; color: var(--muted); font-size: 14.5px; }
.door-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.door-stats span { background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 13px; border: 1px solid var(--line); }
.door-go { margin-top: auto; padding-top: 6px; font-weight: 800; color: var(--dcs); }

.door-group-label {
  font-family: var(--font-hand);
  font-size: 24px;
  color: var(--muted);
  margin: 0 0 8px 4px;
}

/* ---------- Planner: week grid ---------- */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.day-col {
  --day: var(--blue-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  box-shadow: var(--shadow);
}

/* A different pastel for each day of the week */
.day-col:nth-child(1) { --day: var(--coral-soft); }
.day-col:nth-child(2) { --day: var(--amber-soft); }
.day-col:nth-child(3) { --day: var(--yellow-soft); }
.day-col:nth-child(4) { --day: var(--green-soft); }
.day-col:nth-child(5) { --day: var(--cyan-soft); }
.day-col:nth-child(6) { --day: var(--blue-soft); }
.day-col:nth-child(7) { --day: var(--violet-soft); }

.day-col.is-today { outline: 3px solid var(--accent); outline-offset: 2px; }

.day-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: -10px -10px 2px;
  padding: 10px;
  background: var(--day);
  border-radius: 15px 15px 0 0;
}

.day-name { font-size: 12.5px; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.day-head strong { font-family: var(--font-head); font-size: 22px; font-weight: 600; }
.day-total { font-size: 12px; color: var(--muted); font-weight: 700; }
.day-head .icon-btn { margin-left: auto; align-self: center; background: #fff; }
.day-empty { margin: auto 0; text-align: center; color: var(--muted); font-family: var(--font-hand); font-size: 19px; opacity: .6; }

.block {
  border-left: 5px solid var(--c);
  background: color-mix(in srgb, var(--c) 14%, white);
  border-radius: 10px;
  padding: 6px 8px;
  display: grid;
  gap: 1px;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.block.is-done { opacity: .55; }
.block.is-done strong { text-decoration: line-through; }
.block-top { display: flex; justify-content: space-between; align-items: center; }
.block-time { font-size: 12px; font-weight: 800; color: var(--muted); }

.chip { font-size: 12.5px; font-weight: 800; padding: 4px 8px; border-radius: 8px; overflow-wrap: anywhere; }

/* ---------- Progress bars ---------- */
.hbar { margin-bottom: 12px; }
.hbar:last-child { margin-bottom: 0; }

.hbar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 5px;
}

.hbar-top > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar-top .muted { font-size: 13px; text-align: right; font-weight: 600; }

.track { height: 10px; border-radius: 999px; background: #f1ede3; overflow: hidden; }
.fill { height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s ease; }

.goal-block + .goal-block { margin-top: 18px; }

.card .mini-title, .mini-title {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 10px;
}

/* ---------- Subjects page ---------- */
.subject-card { --cc: var(--c); padding: 0; }
.subject-card::before { display: none; }
.subject-card:target { outline: 4px solid var(--c); outline-offset: 3px; }

.subject-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px 18px;
  background: color-mix(in srgb, var(--c) 22%, white);
  border-bottom: 4px solid var(--c);
}

.subject-head h2 { margin: 0; flex: 1; font-size: 22px; min-width: 0; overflow-wrap: anywhere; }
.subject-head input[type="color"] { width: 38px; height: 34px; padding: 2px; flex: none; background: #fff; }
.subject-body { padding: 16px 18px 18px; display: grid; gap: 16px; }

.goal-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.goal-row span { flex: 1; }

.plan-list > li { background: var(--yellow-soft); }
.plan-form { margin: 8px 0 0; }

.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.mini-list li { display: flex; gap: 8px; align-items: center; }
.mini-list .day { font-weight: 800; width: 40px; color: var(--muted); font-size: 12.5px; text-transform: uppercase; }
.mini-list .done-mark { margin-left: auto; color: var(--green-strong); font-weight: 800; }

.subject-foot { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Habit dots (last 14 days) ---------- */
.list > li.habit-item { align-items: flex-start; }
.dots { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }

.dot-btn {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 0;
  padding: 0;
  background: #e9e4d7;
  cursor: pointer;
}

.dot-btn.on { background: var(--green); }
.dot-btn.is-today { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green-strong); }
.dot-btn:disabled { opacity: .3; cursor: default; }

/* ---------- Review page ---------- */
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }

.segmented { display: flex; background: #fff; padding: 4px; border-radius: 14px; gap: 2px; border: 2px solid var(--line); }

.segmented button {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.segmented button.active { background: var(--accent-strong); color: #fff; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.tile { border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border: 2px solid #fff; }
.tile:nth-child(1) { background: var(--green-soft); }
.tile:nth-child(2) { background: var(--blue-soft); }
.tile:nth-child(3) { background: var(--coral-soft); }
.tile:nth-child(4) { background: var(--violet-soft); }
.tile-label { font-size: 13px; color: var(--muted); font-weight: 800; }
.tile-value { font-family: var(--font-head); font-size: 34px; font-weight: 600; margin: 2px 0; }
.tile-note { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile-note.up { color: var(--green-strong); }
.tile-note.down { color: var(--coral-strong); }

/* "What the data says" looks like a sticky note */
.insights {
  background: var(--yellow-soft);
  border: 0;
  margin-bottom: 18px;
  transform: rotate(-.3deg);
}

.insights::before { background: var(--highlight); }
.insights ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 28px;
}

.chart h4 { font-family: var(--font-body); font-size: 14px; color: var(--muted); font-weight: 800; margin-bottom: 10px; }
.bars { display: flex; gap: 6px; height: 170px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }

.bar-track {
  flex: 1;
  width: 100%;
  max-width: 38px;
  position: relative;
  background: #f1ede3;
  border-radius: 8px;
  overflow: hidden;
}

.bar { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 8px 8px 0 0; background: var(--green); }
.chart-blue .bar { background: var(--blue); }
.chart-coral .bar { background: var(--coral); }
.bar-value { font-size: 11px; color: var(--muted); height: 14px; white-space: nowrap; font-weight: 700; }
.bar-label { font-size: 11.5px; color: var(--muted); font-weight: 700; }

.heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; max-width: 440px; }
.heatmap .wd { font-size: 11.5px; text-align: center; color: var(--muted); font-weight: 800; }

.cell {
  aspect-ratio: 1;
  border-radius: 9px;
  background: #ece7da;
  position: relative;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.cell.l1 { background: #a7f3d0; color: var(--ink); }
.cell.l2 { background: #6ee7b7; color: var(--ink); }
.cell.l3 { background: #34d399; color: var(--ink); }
.cell.l4 { background: var(--green-strong); color: #fff; }
.cell.blank { background: transparent; }
.cell.future { background: transparent; border: 2px dashed var(--line); }

.slip-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px #fff;
}

.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; align-items: center; font-weight: 600; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; vertical-align: -2px; margin-right: 4px; }

.plans { margin: 8px 0 0; padding-left: 20px; font-size: 14.5px; display: grid; gap: 4px; }
.card .sub-title, .sub-title { font-family: var(--font-body); font-size: 13.5px; color: var(--muted); font-weight: 800; margin: 16px 0 10px; }

/* ---------- Welcome card ---------- */
.welcome { margin-bottom: 20px; background: var(--yellow-soft); border: 0; }
.welcome::before { background: var(--highlight); }
.welcome p { margin: 0 0 12px; max-width: 62ch; }

/* ---------- Footer and toast ---------- */
.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 40px) 40px;
  border-top: 2px dashed var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13.5px;
}

.footer p { margin: 0; }
.footer .btn { font-size: 13px; padding: 7px 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 20;
  max-width: calc(100% - 32px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Smaller screens ---------- */
@media (max-width: 960px) {
  .week-grid { grid-template-columns: 1fr; }
  .day-col { min-height: 0; }
  .hero-side { align-items: flex-start; }
  .controls { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .site-header { position: static; }
  .hero { padding: 22px 18px; }
  .hero-doodle { font-size: 96px; }
  .tile-value { font-size: 28px; }
  .nav a { padding: 7px 11px; font-size: 14px; }
}
