/* School Nudge brand: Royal Blue #2F6FED, Soft Blue #6895FF, Warm Yellow #FFC64D, Deep Navy #111520, Cream #F7F8FC */
:root {
  --bg: #F7F8FC;
  --card: #ffffff;
  --ink: #111520;
  --muted: #626a80;
  --line: #e2e5ee;
  --brand: #2F6FED;
  --brand-ink: #ffffff;
  --brand-soft: #e7eefe;
  --sun: #FFC64D;
  --sun-soft: #fff4d9;
  --danger: #d6455d;
  --ok: #1f9d6b;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(17, 21, 32, .06), 0 4px 16px rgba(17, 21, 32, .05);
  --tabs-h: 64px;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111520; --card: #1b2131; --ink: #F7F8FC; --muted: #9ba3b8; --line: #2a3145;
    --brand: #6895FF; --brand-ink: #111520; --brand-soft: #1f2a46; --sun: #FFC64D; --sun-soft: #3a3120;
    --danger: #ff7a8e; --ok: #4fd6a0;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111520; --card: #1b2131; --ink: #F7F8FC; --muted: #9ba3b8; --line: #2a3145;
  --brand: #6895FF; --brand-ink: #111520; --brand-soft: #1f2a46; --sun: #FFC64D; --sun-soft: #3a3120;
  --danger: #ff7a8e; --ok: #4fd6a0; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px);
}
[hidden] { display: none !important; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }

.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(env(safe-area-inset-top) + 14px) 16px 10px; }
.top h1 { font-size: 28px; font-weight: 600; }
.view { max-width: 640px; margin: 0 auto; padding: 4px 16px 24px; }

.banner { max-width: 640px; margin: 0 auto 4px; padding: 10px 16px; background: var(--sun-soft); color: var(--ink); font-size: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; border-radius: 12px; width: calc(100% - 32px); }
.banner button { flex: none; }

/* cards and lists */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 12px; }
.day { margin: 18px 0 8px; }
.day h2 { font-family: "Nunito", system-ui, sans-serif; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.day.today h2 { color: var(--brand); }
.item { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 8px; width: 100%; text-align: left; border: 0; color: inherit; font: inherit; cursor: pointer; }
.item .bar { width: 5px; align-self: stretch; border-radius: 4px; background: var(--line); flex: none; }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 700; }
.item .meta { color: var(--muted); font-size: 14px; }
.todo { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 700; background: var(--sun-soft); padding: 2px 8px; border-radius: 8px; }
.item .time { font-weight: 800; font-size: 14px; color: var(--muted); flex: none; }
.item.recurring { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); }
.item.done .title { text-decoration: line-through; color: var(--muted); }
.tick { width: 24px; height: 24px; flex: none; accent-color: var(--brand); margin: 1px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.empty .big { font-size: 40px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }

/* buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0; background: var(--brand); color: var(--brand-ink); font: 700 16px "Nunito", system-ui, sans-serif; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.plain { background: transparent; color: var(--brand); padding: 0 8px; min-height: 40px; }
.btn.danger { background: transparent; color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 12px; }

label.field { display: block; }
label.field > span { display: block; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font: 16px "Nunito", system-ui, sans-serif;
}
textarea { min-height: 180px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.hint { font-size: 14px; color: var(--muted); }
.error { color: var(--danger); font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: 700 14px "Nunito", system-ui, sans-serif; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip[aria-pressed="true"] .dot { outline: 2px solid var(--brand-ink); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.switch input { width: 46px; height: 28px; appearance: none; background: var(--line); border-radius: 999px; position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }

.section-title { font-size: 19px; font-weight: 600; margin: 24px 0 10px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }

/* bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around; align-items: center;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; padding: 6px 0; }
.tabs a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--brand); }
.tabs .tab-add { flex: none; width: 56px; height: 56px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); justify-content: center; margin-top: -18px; box-shadow: 0 6px 18px rgba(47,111,237,.35);
  border-radius: 20px; }
.tabs .tab-add svg { width: 28px; height: 28px; stroke-width: 2.5; }
.tabs .tab-add[aria-current="page"] { color: var(--brand-ink); }

/* bottom sheet */
.sheet { border: 0; padding: 0; width: 100%; max-width: 640px; margin: auto auto 0; border-radius: 22px 22px 0 0; background: var(--bg); color: var(--ink); max-height: 92dvh; }
.sheet::backdrop { background: rgba(10, 15, 30, .45); }
.sheet[open] { animation: up .22s ease-out; }
.sheet .inner { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 14px); z-index: 20; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; max-width: calc(100% - 32px); }

/* sign-in and onboarding */
.welcome { min-height: 80dvh; display: flex; flex-direction: column; justify-content: center; }
.logo { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 18px; }
.welcome h1 { font-size: 30px; font-weight: 600; margin-bottom: 8px; }
.welcome p.lead { color: var(--muted); margin: 0 0 24px; }
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.steps i { height: 5px; flex: 1; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--brand); }
.colours { display: flex; gap: 8px; flex-wrap: wrap; }
.colours button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.colours button[aria-pressed="true"] { border-color: var(--ink); }

.plan { border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; background: var(--card); width: 100%; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.plan strong { font-size: 18px; }
.plan .save { font-size: 12px; font-weight: 800; background: var(--sun-soft); padding: 2px 8px; border-radius: 8px; margin-left: 6px; }

.loading { display: grid; place-items: center; min-height: 50dvh; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.demo-pill { display: inline-block; margin-bottom: 6px; font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: var(--sun-soft); color: var(--ink); padding: 3px 10px; border-radius: 999px; }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 76px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--card); border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(20,25,40,.75); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }

/* wordmark: icon + "school nudge" */
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 700 22px/1 var(--display); letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.wordmark img { width: 34px; height: 34px; border-radius: 9px; }
.wordmark.big { font-size: 34px; gap: 14px; margin-bottom: 8px; }
.wordmark.big img { width: 56px; height: 56px; border-radius: 15px; }
.tagline { margin: 0 0 36px; font-size: 18px; color: var(--muted); }
.todo.warn { background: #fde4e8; color: #8a1c2e; margin-right: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .todo.warn { background: #4a1f28; color: #ffc9d2; } }
:root[data-theme="dark"] .todo.warn { background: #4a1f28; color: #ffc9d2; }

/* small brand mark beside the screen title (phones) */
.top h1 { display: flex; align-items: center; gap: 10px; }
.top-logo { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.tabs .side-logo, .tabs .side-foot, .tabs .tab-add .label { display: none; }

/* Computers: the tab bar becomes a sidebar with the logo top left */
@media (min-width: 900px) {
  body.has-nav { padding-left: 264px; padding-bottom: 32px; }
  .top { max-width: 720px; margin-left: auto; margin-right: auto; }
  .banner { max-width: 688px; margin-left: auto; margin-right: auto; }
  .top { padding: 36px 16px 12px; }
  .top-logo { display: none; }
  .view { max-width: 720px; }
  .tabs {
    top: 0; bottom: 0; right: auto; width: 264px; height: auto; padding: 28px 18px 24px;
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .tabs .side-logo { display: flex; flex: none; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; order: -2; margin: 0 8px 28px; padding: 0; font-size: 24px; color: var(--ink); }
  .tabs .side-logo img { width: 38px; height: 38px; border-radius: 10px; }
  .tabs a:not(.side-logo) { flex: none; flex-direction: row; gap: 12px; font-size: 16px; padding: 11px 14px; border-radius: 12px; }
  .tabs a:not(.side-logo):not(.tab-add):hover { background: var(--bg); color: var(--ink); }
  .tabs a[aria-current="page"]:not(.tab-add) { background: var(--brand-soft); color: var(--brand); }
  .tabs .tab-add { order: -1; width: auto; height: 48px; margin: 0 0 18px; justify-content: center; box-shadow: none; border-radius: 14px; }
  .tabs .tab-add svg { width: 22px; height: 22px; }
  .tabs .tab-add .label { display: inline; font-size: 16px; }
  .tabs .side-foot { display: block; margin: auto 8px 0; font: 500 14px/1.4 var(--display); color: var(--muted); }
  .toast { bottom: 28px; left: calc(50% + 132px); }
  .sheet { margin: auto; border-radius: 22px; }
}

/* Getting started: home screen steps on the Week screen */
.getting-started { background: var(--sun-soft); box-shadow: none; border: 1px solid color-mix(in srgb, var(--sun) 55%, transparent); }
.getting-started ol { margin: 0 0 12px; padding-left: 22px; }
.getting-started li { margin: 4px 0; }
.getting-started li::marker { font-weight: 800; color: var(--brand); }
.getting-started #hs-install { margin-bottom: 8px; }
.getting-started .row-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.getting-started .row-links a { color: var(--brand); font-weight: 700; }
