/* Colours come from Iris's van (sage paint, white roof, black bumper, yellow plate, orange
   indicators) and her red knitted sweater, which is kept for the things you act on. */
:root {
  --sage: #8b9c7b; --sage-deep: #4b5944; --sage-pale: #d3dac9; --roof: #eef0e8; --bumper: #23282a;
  --plate: #f3ad1c; --amber: #c9571f; --sweater: #8c1233; --sweater-deep: #6d0b26;
  --muted: #56604f; --line: #c3ccb8;
  --display: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--roof); color: var(--bumper); font: 400 1.0625rem/1.45 Barlow, system-ui, sans-serif; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: 2rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0; }
.muted { color: var(--muted); } .err { color: var(--sweater); }
button, input, select { font: inherit; color: inherit; }
button { min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--sage-deep); background: transparent; border-radius: 8px; font-weight: 500; cursor: pointer; touch-action: manipulation; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--sweater); border-color: var(--sweater); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--sweater-deep); }
button.big { min-height: 56px; font-size: 1.15rem; }
button.plain { border: 0; padding: 8px 6px; color: var(--sweater); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--sweater); outline-offset: 2px; }
input, select { width: 100%; min-height: 44px; padding: 8px 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 6px; }
input[type=checkbox] { width: 22px; min-height: 22px; accent-color: var(--sweater); }
label { display: grid; gap: 4px; font-weight: 500; font-size: .95rem; }

/* Page: the van's face on top (phone) or parked on the left (wide screens) */
.page { min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.van-side { background: var(--sage-pale); text-align: center; padding: calc(18px + env(safe-area-inset-top)) 16px 14px; border-bottom: 10px solid var(--bumper); }
.van { width: min(250px, 66vw); height: auto; display: block; margin: 0 auto -14px; }
.van-line { font-family: var(--display); font-weight: 600; font-size: 1.15rem; padding-top: 22px; }
.content { max-width: 680px; margin: 0 auto; padding: 24px 18px 40px; }
.tabs { position: fixed; inset: auto 0 0 0; z-index: 5; display: flex; background: var(--bumper); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
.tabs button { flex: 1; min-width: 0; min-height: 52px; border: 0; padding: 4px; color: #d9dfd2; font-family: var(--display); font-size: 1.05rem; }
.tabs button[aria-current] { background: var(--sage); color: var(--bumper); font-weight: 600; }
.tabs :focus-visible { outline-color: var(--plate); }
@media (min-width: 900px) {
  .page { display: grid; grid-template-columns: minmax(340px, 40%) 1fr; grid-template-rows: auto 1fr; padding: 0; }
  .van-side { grid-row: 1 / 3; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; justify-content: center; border-bottom-width: 64px; }
  .van { width: min(440px, 88%); }
  .content { width: 100%; margin: 0; padding: 32px 48px 60px; grid-column: 2; grid-row: 2; }
  .tabs { position: sticky; inset: 0 0 auto 0; grid-column: 2; grid-row: 1; padding: 8px 40px; }
  .tabs button { flex: none; padding: 4px 20px; }
}

/* The van */
.paint { fill: var(--sage); } .roof { fill: var(--roof); } .lip { fill: #6f8062; } .black, .wheels { fill: var(--bumper); }
.glass { fill: #313a3a; } .seam { stroke: var(--sage-deep); stroke-width: 2; } .slats { stroke: #4c5557; stroke-width: 3; }
.wiper { stroke: #121516; stroke-width: 3; stroke-linecap: round; }
.thread { fill: none; stroke: #dfe5d8; stroke-width: 2; } .feather { stroke: #eef0e8; stroke-width: 4; stroke-linecap: round; }
.steer { fill: none; stroke: #121516; stroke-width: 6; }
.amber { fill: var(--amber); } .plate { fill: var(--plate); } .plate-eu { fill: #2a4fa3; }
.plate-text { font: 700 19px var(--display); fill: var(--bumper); letter-spacing: .5px; }
.light rect { fill: #c5ccc6; transition: fill .4s; } .light path { stroke: #98a19b; stroke-width: 2; }
.light.on rect { fill: #fff3c2; filter: drop-shadow(0 0 12px #ffd75e); }

/* Today */
.tab > * + section, .tab > section + section { margin-top: 34px; }
.tab h2 { margin-bottom: 8px; }
.watching { background: var(--sage-pale); border-radius: 8px; padding: 10px 14px; margin-bottom: 20px; }
.watching select { width: auto; margin-left: 6px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 0; border-top: 1.5px solid var(--line); }
.rows > li:last-child { border-bottom: 1.5px solid var(--line); }
.rows .what { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.rows .what b { display: block; font: 600 1.2rem/1.2 var(--display); }
.rows .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.km { margin-left: 6px; font-family: var(--display); font-weight: 600; white-space: nowrap; }
.donemark { font-weight: 600; color: var(--sage-deep); }
.tank { flex: 1 1 100%; height: 18px; border-radius: 9px; background: #fff; border: 1.5px solid var(--sage-deep); overflow: hidden; }
.tank i { display: block; height: 100%; background: var(--sage); transition: width .35s ease-out; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.empty { padding: 14px 0; color: var(--muted); }

.streaks { width: 100%; border-collapse: collapse; table-layout: fixed; }
.streaks th { font-weight: 500; text-align: center; font-size: .9rem; color: var(--muted); padding: 4px 0; }
.streaks tbody th { text-align: left; color: inherit; overflow-wrap: anywhere; padding-right: 6px; line-height: 1.2; }
.streaks thead th:first-child { width: 31%; }
.streaks td { text-align: center; padding: 3px 0; }
.dot { display: inline-grid; place-items: center; width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: .9rem; line-height: 1; }
.dot.on { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }
.dot.today { border-color: var(--sweater); border-width: 2.5px; }

/* Training */
.week { list-style: none; margin: 0; padding: 0; }
.week li { display: grid; grid-template-columns: 6.6em 1fr; gap: 8px; padding: 8px 0; border-top: 1.5px solid var(--line); align-items: center; }
.week li.today > span:first-child { font-weight: 600; color: var(--sweater); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-flex; align-items: center; background: var(--sage-pale); border-radius: 6px; padding-left: 10px; min-height: 40px; }
.tag.done { background: var(--sage-deep); color: #fff; }
.tag button { border: 0; min-height: 40px; min-width: 40px; padding: 0; }
.tags select { width: auto; min-height: 40px; padding: 4px 8px; background: transparent; width: 4.8em; border-color: transparent; color: var(--muted); }
details summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.exlist { margin: 4px 0 0; padding-left: 1.3em; } .exlist li { padding: 2px 0; }
.timer-form { display: grid; gap: 14px; max-width: 360px; margin-top: 18px; }
.timer-form input { font: 600 1.5rem var(--display); min-height: 56px; }

/* Road: asphalt on the left, rewards as stops along it */
.road { list-style: none; margin: 18px 0 0; padding: 0; position: relative; }
.road::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 64px; border-radius: 8px;
  background: repeating-linear-gradient(var(--plate) 0 18px, transparent 18px 40px) center / 4px 100% no-repeat var(--bumper); }
.road li { position: relative; padding: 18px 0 18px 84px; min-height: 84px; }
.road .sign { position: absolute; left: 6px; top: 20px; width: 52px; text-align: center; background: var(--roof); border-radius: 5px; font: 600 1rem/1 var(--display); padding: 7px 2px; }
.road .reached .sign { background: var(--plate); }
.road .here { padding-top: 22px; }
.road .here svg { position: absolute; left: 8px; top: 8px; width: 48px; }
.road .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Forms */
.login { display: grid; gap: 14px; max-width: 360px; margin: 0 auto; }
.sheet { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 12px; padding: 22px; background: var(--roof); color: inherit; }
.sheet::backdrop { background: rgb(35 40 42 / .65); }
.sheet form { display: grid; gap: 14px; }
.sheet .inline, .inline { display: flex; align-items: center; gap: 10px; }
.sheet .foot { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; bottom: -22px; background: var(--roof); padding: 12px 0; }
.sheet .foot .plain { margin-left: auto; }
.ex { border: 0; border-top: 1.5px solid var(--line); margin: 0; padding: 14px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; min-width: 0; }
.ex .wide { grid-column: 1 / -1; } .ex .acts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 480px) { .ex { grid-template-columns: 1fr 1fr; } }
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--plate); color: var(--bumper); font-weight: 600; padding: 11px 18px; border-radius: 8px; z-index: 20; }

/* Training timer: the whole screen changes colour, so you can tell work from rest across the room */
.player { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; padding: calc(16px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); background: var(--bumper); color: #fff; }
.player[open] { display: flex; flex-direction: column; text-align: center; }
.player.work { background: var(--sweater); } .player.rest { background: var(--sage); color: var(--bumper); }
.player button { border-color: currentColor; }
.player :focus-visible { outline-color: var(--plate); }
.pl-top { display: flex; justify-content: space-between; align-items: center; }
.pl-main { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
#pl-phase { font: 600 1.4rem var(--display); }
#pl-name { font-size: clamp(2rem, 8vw, 3.6rem); }
.pl-clock { font: 700 clamp(6rem, 32vw, 15rem)/1 var(--display); font-variant-numeric: tabular-nums; }
#pl-cue { font-size: 1.2rem; min-height: 1.5em; } #pl-next { min-height: 1.5em; margin-bottom: 14px; }
.pl-bar { height: 10px; border-radius: 5px; background: rgb(255 255 255 / .3); overflow: hidden; margin-bottom: 18px; }
.pl-bar i { display: block; height: 100%; width: 0; background: var(--plate); }
.player.rest .pl-bar i { background: var(--bumper); }
.pl-acts { display: flex; gap: 10px; justify-content: center; }
.pl-acts button { min-height: 64px; flex: 1; max-width: 220px; font-size: 1.15rem; }
.pl-acts .pl-go { flex: 2; max-width: 340px; background: var(--plate); border-color: var(--plate); color: var(--bumper); font-weight: 600; }
@media (max-height: 520px) { .pl-clock { font-size: 5.5rem; } #pl-cue, #pl-next { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* On phones the van steps back on every page except Today */
@media (max-width: 899px) {
  body:not([data-tab="today"]) .van { width: 104px; margin: 0 0 -4px; }
  body:not([data-tab="today"]) .van-side { display: flex; align-items: center; gap: 18px; text-align: left; padding-block: calc(8px + env(safe-area-inset-top)) 6px; }
  body:not([data-tab="today"]) .van-line { padding: 0; }
}
.week, .watching + .tab .week { margin-top: 12px; }
.week + p { margin-top: 10px; }
@media (max-width: 480px) { .week li { grid-template-columns: 5.4em 1fr; } .week .tag button { min-width: 34px; } .tags select { width: 4.3em; padding-inline: 2px; } }

/* Before logging in there is only the form */
.page.entry { display: grid; grid-template: 1fr / 1fr; place-items: center; padding: 0; }
.page.entry .content { grid-area: 1 / 1; width: 100%; padding: 24px 18px; }
