/* Task Garage 2.0 — small hand-written design system.
   Tokens first, then a handful of reusable patterns. No framework. */

:root {
  --bg: #f6f0e5;
  --surface: #fffdf9;
  --surface-2: #eee7dc;
  --surface-strong: #ded4c5;
  --line: #d8d0c3;
  --line-strong: #aaa092;
  --text: #1b1c1b;
  --muted: #65625d;
  --accent: #e89c30;
  --hero-dot: #edd3af;
  --accent-hover: #d98b20;
  --accent-ink: #241707;
  --dark: #111315;
  --dark-text: #f6f0e5;
  --good: #27734d;
  --warn: #8b5b00;
  --danger: #a53b33;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --gap: 16px;
  --pad: 16px;
  --shadow: 0 20px 52px rgb(41 31 18 / 18%);
  --shadow-raised: 0 8px 24px rgb(81 62 35 / 10%);
  --shadow-nav: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "Besley", "Rockwell", "Roboto Slab", Georgia, serif;
  --max: 1200px;
  --page: #f6f0e5;
}

@font-face {
  font-family: "Besley";
  src: url("fonts/besley-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 116px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
  letter-spacing: 0;
  font-family: var(--font-heading);
}
h1,
h3 {
  font-family: var(--font);
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.25rem;
}
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 30;
}

/* ---------- App bar ---------- */
/* Floating pill navigation bar — inset 20px from the top and page edges,
   white surface with a soft drop shadow (Harvest-style floating header). */
.appbar {
  position: sticky;
  top: max(20px, calc(env(safe-area-inset-top) + 12px));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100% - 40px, var(--max));
  margin: max(20px, calc(env(safe-area-inset-top) + 12px)) auto 0;
  min-height: 76px;
  padding: 12px 28px;
  background: var(--surface);
  color: var(--text);
  border-radius: 40px;
  box-shadow: var(--shadow-nav);
}
.brand {
  display: flex;
  align-items: center;
  min-width: 184px;
}
.brand img {
  display: block;
  width: clamp(184px, 16vw, 220px);
  height: auto;
}
.appbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}
.navlink {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.navlink:hover {
  color: var(--text);
}
.nav-cta {
  min-height: 44px;
  padding-inline: 20px;
}
.nav-menu {
  display: none;
  margin-left: auto;
  position: relative;
}
.nav-menu summary {
  list-style: none;
}
.nav-menu summary::-webkit-details-marker {
  display: none;
}
.nav-menu summary span,
.nav-menu summary span::before,
.nav-menu summary span::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: currentColor;
}
.nav-menu summary span {
  position: relative;
}
.nav-menu summary span::before,
.nav-menu summary span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-menu summary span::before {
  top: -6px;
}
.nav-menu summary span::after {
  top: 6px;
}
.nav-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(280px, calc(100vw - 32px));
  padding: 10px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-nav);
}
.nav-menu-panel > a:not(.btn) {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.nav-menu-panel > a:not(.btn):hover {
  background: var(--surface-2);
}

.iconbtn {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}
.iconbtn:hover {
  background: var(--surface-2);
}

/* ---------- Layout ---------- */
.main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--pad) 72px;
}
.is-landing .main {
  max-width: none;
  padding: 0;
}
.startup {
  min-height: min(520px, calc(100vh - 148px));
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}
.startup h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}
.startup-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: startup-spin 900ms linear infinite;
}
.startup[data-state="failed"] .startup-spinner {
  display: none;
}
.startup-actions {
  justify-content: center;
}
@keyframes startup-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .startup-spinner {
    animation: none;
    border-top-color: var(--line-strong);
  }
}
.stack {
  display: grid;
  gap: var(--gap);
}
/* Field rows fit columns to the space the row actually has (not the viewport),
   so fields inside a narrow sheet never squeeze below a usable width. The
   200px floor keeps date inputs, which have a wide intrinsic size, intact. */
.row {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.row > *,
.field,
.field > input,
.field > select,
.field > textarea {
  min-width: 0;
}
.pagehead {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pagehead h1 {
  margin-right: auto;
}
.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 860px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card.pad {
  padding: var(--pad);
}
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}
.hint {
  color: var(--muted);
  font-size: 0.8rem;
}
.textlink {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.vcard {
  display: block;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}
.vcard:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-raised);
}
.vcard-photo {
  aspect-ratio: 16 / 10;
  background: var(--surface-2) center/cover no-repeat;
  display: grid;
  place-items: center;
  color: var(--muted);
}
/* Placeholder camera icon shown until a vehicle photo is added. */
.vcard-photo .icon {
  width: 36px;
  height: 36px;
}
.vcard-body {
  padding: 14px;
  display: grid;
  gap: 6px;
  min-width: 0;
}
/* A long, unbroken name must wrap rather than push the phone layout sideways. */
.vcard-body h2,
.vcard-body [data-slot="sub"],
.vehicle-home h1,
.vehicle-home [data-slot="sub"] {
  overflow-wrap: anywhere;
  min-width: 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--dark) center/cover no-repeat;
  color: var(--dark-text);
  padding: 20px;
  display: grid;
  gap: 14px;
  min-height: 190px;
  align-content: end;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(17 19 21 / 15%), rgb(17 19 21 / 88%));
}
.hero-body,
.hero-actions {
  position: relative;
  z-index: 1;
}
.hero-body {
  display: grid;
  gap: 6px;
}
.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}
.btn:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-ghost {
  background: transparent;
}
.btn-link {
  background: none;
  border: none;
  text-decoration: underline;
}
.btn-danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 50%, var(--line));
  color: var(--danger);
}
.btn-large {
  min-height: 52px;
  padding-inline: 22px;
}
.btn-inverse {
  background: var(--surface);
  border-color: var(--surface);
  color: var(--text);
}
.btn-inverse:hover {
  background: var(--bg);
  border-color: var(--bg);
}
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.2rem;
}
.filelabel {
  position: relative;
}
.formactions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.formactions.left {
  justify-content: flex-start;
}
.formactions .btn-danger {
  margin-right: auto;
}

/* ---------- Fields ---------- */
.field {
  display: grid;
  gap: 6px;
}
.field > span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  width: 100%;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.iconbtn:focus-visible,
.tl-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input[type="file"] {
  padding: 9px;
}
/* Date inputs have an intrinsic minimum width in WebKit that can overflow or
   overlap a narrow grid column. Force them to respect their column instead. */
input[type="date"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-width: 0;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  flex: none;
  margin-left: auto;
}
textarea {
  resize: vertical;
}
.invalid {
  border-color: var(--danger);
}

/* ---------- Chips / tags ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--muted);
}
.tag {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--text);
}

.filterbar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filterbar::-webkit-scrollbar {
  display: none;
}
.filterbar .chip {
  cursor: pointer;
  white-space: nowrap;
}
.filterbar .chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

/* ---------- Timeline ---------- */
.timeline {
  display: grid;
  gap: 10px;
}
/* History folded by year: one-line summary per year, newest open. */
.tl-year { border-top: 1px solid var(--line); padding: 6px 0; }
.tl-year > summary { cursor: pointer; font-weight: 600; padding: 6px 0; list-style-position: inside; }
.tl-month {
  font-size: 0.78rem;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 0;
}
.tl-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 52px;
  position: relative;
  display: grid;
  gap: 12px;
}
.tl-list::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}
.tl-item {
  position: relative;
}
.tl-badge {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent-ink);
  border: 2px solid var(--bg);
}
.tl-item > .tl-badge {
  position: absolute;
  left: -52px;
  top: 10px;
}
.tl-card {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 6px;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  font: inherit;
  color: inherit;
}
.tl-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.tl-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-top time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
}
.body {
  white-space: pre-wrap;
  color: var(--text);
  font-size: 0.92rem;
}

.thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.thumbwrap {
  position: relative;
}
.thumbwrap button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: var(--surface);
  cursor: pointer;
  line-height: 1;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty-icon {
  font-size: 2rem;
}
.empty-icon .icon {
  width: 34px;
  height: 34px;
}
.empty-icon .icon svg {
  stroke: currentColor;
}
/* Discreet import alternative under the empty-garage call to action. */
.empty-alt {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Decorative "Empty bay" placeholder matching a vehicle card's footprint.
   Presentational only: no hover, no pointer cursor, never a link. */
.empty-bay {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  min-height: 240px;
  padding: 20px;
}
.empty-bay svg {
  width: 88px;
  fill: currentColor;
  opacity: 0.16;
}
.empty-bay-label {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* The bays exist to balance a multi-column grid, so phones never show them. */
@media (max-width: 559px) {
  .empty-bay {
    display: none;
  }
}

/* ---------- Sheet / lightbox ---------- */
.sheet {
  border: none;
  padding: 0;
  background: transparent;
  width: min(560px, 100%);
  max-width: 100%;
}
.sheet::backdrop,
.lightbox::backdrop {
  background: rgb(0 0 0 / 60%);
  backdrop-filter: blur(2px);
}
.sheet-inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--pad);
  box-shadow: var(--shadow);
  max-height: 88vh;
  overflow: auto;
}
.sheet {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0 auto;
}
@media (min-width: 620px) {
  .sheet {
    inset: 0;
    margin: auto;
  }
}
.lightbox {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 96vw;
  max-height: 92vh;
}
.lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 10px;
  display: block;
}

.meter {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.meter > div {
  height: 100%;
  background: var(--accent);
  width: 0;
}

/* ---------- Privacy & ownership ---------- */
.about {
  max-width: 760px;
}
.about-intro {
  padding-bottom: var(--gap);
  border-bottom: 1px solid var(--line);
}
.about-intro > p:first-child {
  font-size: 1.08rem;
  font-weight: 650;
}
.principles {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}
.principle {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.principle > div {
  display: grid;
  gap: 5px;
}
.principle-mark {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}
.principle code {
  color: var(--text);
  font: inherit;
}
.notice {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-left: 3px solid var(--warn);
  background: var(--surface);
}
.notice p {
  color: var(--muted);
  font-size: 0.9rem;
}
@media (min-width: 700px) {
  .principles {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
  }
}

/* ---------- Toast / offline ---------- */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 20;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 14px;
}
.toast-action {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.offline-note {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  background: var(--warn);
  color: var(--surface);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 19;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---------- Update notice ---------- */
.updatebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: var(--pad) auto 0;
  max-width: calc(var(--max) - 2 * var(--pad));
  width: calc(100% - 2 * var(--pad));
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.updatebar p {
  font-size: 0.92rem;
  flex: 1 1 220px;
}
.updatebar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ---------- System check ---------- */
.diag {
  max-width: 760px;
}
.diaglist {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  margin: 0;
}
.diaglist dt {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.diaglist dd {
  margin: 0;
  padding: 7px 0;
  text-align: right;
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.diaglist dd.good {
  color: var(--good);
}
.diaglist dd.warn {
  color: var(--warn);
}
.diaglist dd.bad {
  color: var(--danger);
}
.diaglist dt:last-of-type,
.diaglist dd:last-of-type {
  border-bottom: none;
}
.report {
  white-space: pre-wrap;
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  overflow: auto;
}

/* ---------- Landing page ---------- */
.landing {
  overflow: clip;
  background: var(--bg);
}
.landing-hero,
.story-section,
.principle-section,
.landing-cta {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

.landing-hero {
  position: relative;
  padding: 70px 0 0;
  text-align: center;
}
.landing-hero::before {
  /* Mask only the dotted layer so the welcome copy never fades with it. */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: min(560px, 100%);
  pointer-events: none;
  background-image: radial-gradient(var(--hero-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse, black 30%, transparent 70%);
  mask-image: radial-gradient(ellipse, black 30%, transparent 70%);
}
.landing-copy {
  position: relative;
  max-width: 900px;
  margin-inline: auto;
}
.landing-kicker,
.section-number {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.landing-title {
  display: grid;
  justify-items: center;
  color: var(--text);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.08;
  font-family: var(--font-heading);
}
.landing-title-rotator {
  position: relative;
  display: block;
  width: 100%;
  height: 1.2em;
  color: var(--accent);
  perspective: 900px;
  overflow: hidden;
}
.roller-face {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  white-space: nowrap;
  backface-visibility: hidden;
  visibility: hidden;
  opacity: 0;
}
.roller-face-current {
  visibility: visible;
  opacity: 1;
  transform: none;
}
.roller-face-standby {
  visibility: hidden;
}
.landing-title-rotator.is-rolling .roller-face-incoming {
  visibility: visible;
  transform: translateY(50%) rotateX(-90deg);
  transform-origin: center top;
  animation: roller-face-in 700ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
}
.landing-title-rotator.is-rolling .roller-face-outgoing {
  visibility: visible;
  transform-origin: center bottom;
  animation: roller-face-out 700ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
}
@keyframes roller-face-in {
  from {
    opacity: 0;
    transform: translateY(50%) rotateX(-90deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}
@keyframes roller-face-out {
  from {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
  to {
    opacity: 0;
    transform: translateY(-50%) rotateX(90deg);
  }
}
.landing-lead {
  max-width: 720px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.65;
}
.landing-actions {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.text-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line-strong);
  font-weight: 600;
}
.text-action:hover {
  border-color: var(--accent);
}

.garage-showcase {
  position: relative;
  width: 100vw;
  margin: 58px 0 0 calc(50% - 50vw);
  padding: clamp(52px, 7vw, 92px) 16px;
  background: var(--dark) url("assets/taskgarage-bg.jpg") center 57% / cover no-repeat;
  isolation: isolate;
}
.garage-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(17 19 21 / 64%);
}
.media-stage {
  position: relative;
  max-width: 760px;
  min-height: 410px;
  margin: 0 auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--surface) 35%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 70px rgb(0 0 0 / 32%);
  overflow: hidden;
  text-align: left;
}
.media-stage-bar {
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  background: var(--surface-2);
}
.media-stage-dots {
  display: flex;
  gap: 6px;
}
.media-stage-dots span {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}
.media-stage-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.media-stage-status {
  justify-self: end;
  color: var(--muted);
  font-size: 0.72rem;
}
.media-stage-status span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--good);
}
.media-stage.has-demo-video .demo-video-wrapper {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--dark);
}
.media-stage.has-demo-video .media-stage-body,
.media-stage.has-demo-video .media-stage-note {
  display: none;
}
.demo-video {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.media-stage-body {
  min-height: 358px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}
.preview-sidebar {
  padding: 38px 30px;
  border-right: 1px solid var(--line);
  background: var(--dark);
  color: var(--dark-text);
}
.preview-monogram {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 30px;
  border: 1px solid color-mix(in srgb, var(--dark-text) 25%, transparent);
  border-radius: 12px;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
}
.preview-eyebrow {
  margin-bottom: 7px;
  color: var(--accent-hover);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.preview-sidebar h2 {
  color: var(--dark-text);
  font-size: 2.1rem;
}
.preview-sidebar dl {
  margin: 34px 0 0;
  display: grid;
}
.preview-sidebar dl div {
  padding: 12px 0;
  border-top: 1px solid color-mix(in srgb, var(--dark-text) 16%, transparent);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.preview-sidebar dt {
  color: color-mix(in srgb, var(--dark-text) 62%, transparent);
  font-size: 0.72rem;
}
.preview-sidebar dd {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
}
.preview-history {
  padding: 38px clamp(24px, 5vw, 56px);
}
.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.preview-heading h3 {
  font-size: 1.65rem;
}
.preview-add {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.preview-timeline {
  list-style: none;
  position: relative;
  margin: 28px 0 0;
  padding: 0 0 0 27px;
  display: grid;
  gap: 25px;
}
.preview-timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}
.preview-timeline li {
  position: relative;
}
.preview-marker {
  position: absolute;
  left: -27px;
  top: 5px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  outline: 1px solid var(--accent);
}
.preview-timeline div {
  display: grid;
  gap: 3px;
}
.preview-timeline time,
.preview-timeline small {
  color: var(--muted);
  font-size: 0.73rem;
}
.preview-timeline strong {
  font-family: var(--font-heading);
  font-size: 1rem;
}
.media-stage-note {
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: var(--muted);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.trustline {
  list-style: none;
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 16px 66px;
  display: grid;
  /* 4 across on wide screens, 2x2 on tablet, 1-2 on phones — never 3+1. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}
.trustline li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.trustline-icon {
  width: 24px;
  height: 24px;
  color: var(--good);
}

.story-section,
.principle-section {
  padding: 88px 0;
  border-top: 1px solid var(--line);
  text-align: left;
}
.section-heading h2 {
  font-size: 3rem;
  line-height: 1.12;
}
.story-section .section-heading {
  max-width: 750px;
  margin: 0 auto;
  text-align: center;
}
.story-section .section-heading p:last-child {
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

/* Closing first-visit call to action, just above the support/coffee area. */
.closing-cta {
  margin: 0 0 88px;
  padding: 56px 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
}
.closing-cta h2 {
  font-size: 2.2rem;
  line-height: 1.15;
}
.closing-cta p {
  max-width: 560px;
  margin: 16px auto 28px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}
.workflow {
  margin-top: 48px;
}
/* Wrapper lets us overlay a "more tabs" cue on the scrollable tablist. */
.workflow-tabs-wrap {
  position: relative;
}
.workflow-tabs-more {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: -14px 0 18px 6px var(--surface);
  z-index: 1;
}
.workflow-tabs-more svg {
  width: 18px;
  height: 18px;
}
.workflow-tabs-more[hidden] {
  display: none;
}
.workflow-tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
}
.workflow-tab {
  flex: 1 0 auto;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.workflow-tab-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}
.workflow-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}
.workflow-tab[aria-selected="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.workflow-panel {
  min-height: 318px;
  padding: 64px 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  align-items: start;
  gap: clamp(48px, 9vw, 144px);
}
.workflow-step {
  color: var(--accent-hover);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.workflow-panel h3 {
  margin-top: 16px;
  font-size: 2.3rem;
}
.workflow-detail > p:last-child {
  max-width: 560px;
  margin-top: 20px;
  color: var(--muted);
  line-height: 1.65;
}
.workflow-example {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.workflow-example-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.workflow-example ul {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.workflow-example li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
}
.workflow-example li::before {
  content: "—";
  margin-right: 16px;
  color: var(--accent-hover);
}
.principle-section .about-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  align-items: start;
  gap: 18px clamp(40px, 8vw, 120px);
}
.principle-section .about-intro .section-number {
  grid-column: 1 / -1;
}
.principle-section .about-intro h2 {
  max-width: 13ch;
}
/* Origin-story illustration: sits beside the heading on wide screens and
   stacks centrally between heading and story on phones. */
.about-illustration {
  margin: 0;
  justify-self: center;
  width: 100%;
  max-width: 560px;
}
.about-illustration img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg, 16px);
}
@media (min-width: 680px) {
  .principle-section .about-intro .about-illustration { grid-column: 2; }
  .principle-section .about-intro .about-story { grid-column: 2; }
}
.about-story {
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.about-ownership {
  margin: 64px 0 0;
}
.ownership-heading {
  max-width: 700px;
  margin-bottom: 28px;
}
.ownership-heading h2 {
  max-width: 18ch;
  font-size: 2.25rem;
}
.ownership-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.ownership-fact {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}
.ownership-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent-ink);
}
.ownership-card-icon {
  width: 30px;
  height: 30px;
}
.ownership-fact h3 {
  font-size: 1.1rem;
}
.ownership-fact p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}
.about > .ownership-facts {
  margin: 10px 0 14px;
}
.about {
  max-width: 980px;
}
.landing-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.landing-principle {
  padding-top: 20px;
  border-top: 2px solid var(--accent);
}
.landing-principle > span {
  display: block;
  margin-bottom: 30px;
  color: var(--accent-hover);
  font-size: 0.72rem;
  font-weight: 700;
}
.landing-principle h3 {
  font-size: 1.2rem;
}
.landing-principle p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.install-intro > p:last-child {
  max-width: 650px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.landing-cta {
  margin-top: 18px;
  margin-bottom: 72px;
  padding: clamp(32px, 5vw, 56px);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.landing-cta .landing-kicker {
  color: var(--accent-ink);
  opacity: 0.7;
}
.landing-cta h2 {
  max-width: 18ch;
  font-size: 2.35rem;
}
.landing-cta .btn {
  background: var(--dark);
  border-color: var(--dark);
  color: var(--dark-text);
}
.landing-cta .btn:hover {
  background: var(--text);
  border-color: var(--text);
}
.site-footer {
  min-height: 150px;
  padding: 38px max(var(--pad), calc((100vw - var(--max)) / 2));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px 32px;
  background: var(--dark);
  color: color-mix(in srgb, var(--dark-text) 70%, transparent);
  font-size: 0.78rem;
}
.footer-brand img {
  display: block;
  width: 190px;
  height: auto;
}
.site-footer nav {
  justify-self: center;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer a:not(.footer-brand) {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer small {
  white-space: nowrap;
  font-size: 0.78rem;
}
.footer-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

/* Tablets and below: the three footer blocks stack rather than crowd one row. */
@media (max-width: 899px) {
  .site-footer {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 20px;
    padding-inline: var(--pad);
  }
  .site-footer nav {
    justify-self: start;
    gap: 14px 22px;
  }
  .footer-meta {
    justify-items: start;
  }
}

/* ---------- Public information pages ---------- */
.info-page {
  width: min(100%, 1040px);
  margin: 0 auto;
}
.info-page-head {
  max-width: 780px;
  padding: 20px 0 28px;
}
.info-page-head h1 {
  margin-top: 8px;
  font-size: clamp(2.3rem, 5vw, 4rem);
}
.info-page-head > p:last-child {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.info-grid section {
  padding: 26px 28px 28px 0;
  border-bottom: 1px solid var(--line);
}
.info-grid section:nth-child(odd) {
  padding-right: 36px;
  border-right: 1px solid var(--line);
}
.info-grid section:nth-child(even) {
  padding-left: 36px;
}
.info-grid span,
.roadmap-label {
  color: var(--accent-hover);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.info-grid h2 {
  margin-top: 12px;
  font-size: 1.25rem;
}
.info-grid p {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.65;
}
.info-page code {
  color: var(--text);
  font: inherit;
}
.roadmap-horizons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.roadmap-horizon {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.roadmap-horizon.is-now {
  border-top-color: var(--good);
}
.roadmap-horizon.is-next {
  border-top-color: var(--accent);
}
.roadmap-horizon h2 {
  margin-top: 10px;
  font-size: 1.35rem;
}
.roadmap-horizon ul {
  margin: 20px 0 0;
  padding-left: 19px;
  color: var(--muted);
}
.roadmap-horizon li {
  margin: 10px 0;
  line-height: 1.5;
}
/* Compact roadmap: one section visible, with native expandable release rows. */
.roadmap-tabs { border-radius: var(--radius-pill); }
.roadmap-tabs .workflow-tab { min-height: 44px; padding-inline: 12px; font-size: 0.85rem; }
.roadmap-panels > [hidden] { display: none !important; }
.roadmap-panels .tl-year { margin-top: 16px; }
.roadmap-panels .tl-list { margin-top: 12px; }
.roadmap-horizon .tl-list > .tl-item { margin: 0; }
.roadmap-horizon ol.tl-list { padding-left: 52px; }
.roadmap-release > summary { cursor: pointer; }
.roadmap-release > summary span:last-child { display: block; margin-top: 6px; font-weight: 600; }
.roadmap-release ul { margin-top: 10px; }
.history-entry { cursor: default; position: relative; }
.history-entry .tl-top { padding-right: 38px; flex-wrap: wrap; }
.history-options { position: absolute; top: 8px; right: 8px; }
.history-entry .context-menu { top: 48px; right: 8px; min-width: min(220px, 100%); }
.history-entry .facts { margin: 4px 0; }
.history-entry .entry-links { display: flex; flex-wrap: wrap; gap: 8px; }
/* Reserved supporter space above the footer: centered, quiet, no tracking.
   The Buy Me a Coffee cup pattern tiles behind the button, centered. */
.ad-reserve {
  min-height: 256px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3, 12px);
  background-image: url("assets/buycoffee-bg.png");
  background-position: center center;
  background-repeat: repeat;
}
.bmc-link {
  display: inline-block;
  line-height: 0;
  border-radius: 12px;
}
.bmc-link img {
  width: 160px;
  height: auto;
  display: block;
}
.bmc-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.backup-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 14px 18px;
  border-left: 3px solid var(--good);
  background: var(--surface);
}
.backup-status.is-missing {
  border-left-color: var(--warn);
}
.backup-status strong {
  font-size: 0.95rem;
}
.backup-status p {
  font-size: 0.82rem;
  margin-top: 3px;
}

.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 12;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-nav);
  font: 700 1.2rem/1 var(--font);
  cursor: pointer;
}
.back-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.install-note {
  position: fixed;
  left: 50%;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
  z-index: 18;
  width: min(calc(100% - 24px), 460px);
  transform: translateX(-50%);
  padding: 10px 10px 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.install-note[hidden] {
  display: none;
}
.install-note-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text);
}
.install-note-icon .icon,
.install-note-icon svg {
  width: 20px;
  height: 20px;
}
.install-note-text {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.install-note-text strong {
  display: block;
  font-size: 0.9rem;
}
.install-note p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.install-note .btn {
  flex: none;
}
.install-dismiss {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: 1.2rem/1 var(--font);
  cursor: pointer;
}
.install-dismiss:hover {
  background: var(--line);
  color: var(--text);
}

.reveal {
  animation: landing-reveal 0.5s cubic-bezier(0.2, 0, 0, 1) both;
}
@keyframes landing-reveal {
  from {
    opacity: 0.88;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 899px) {
  .appbar-actions {
    gap: 10px;
  }
  .brand {
    min-width: 150px;
  }
  .brand img {
    width: 150px;
  }
  .navlink {
    font-size: 0.8rem;
  }
  .nav-cta {
    padding-inline: 14px;
  }
  .landing-title {
    font-size: 3rem;
  }
  .media-stage-body {
    grid-template-columns: 230px minmax(0, 1fr);
  }
  .preview-sidebar {
    padding-inline: 24px;
  }
  .story-section,
  .principle-section,
  .workflow-panel {
    gap: 48px;
  }
  .about-intro {
    gap: 22px 40px;
  }
  .landing-principles {
    gap: 18px;
  }
}

@media (max-width: 679px) {
  .appbar {
    top: max(12px, calc(env(safe-area-inset-top) + 6px));
    margin-top: max(12px, calc(env(safe-area-inset-top) + 6px));
    width: min(100% - 24px, var(--max));
    min-height: 68px;
    padding: 8px 18px;
  }
  .brand {
    min-width: 0;
  }
  .brand img {
    width: 164px;
  }
  .appbar-actions {
    display: none;
  }
  .nav-menu {
    display: block;
  }
  .main {
    padding-top: 24px;
  }
  .landing-hero,
  .story-section,
  .principle-section,
  .landing-cta {
    width: min(100% - 32px, var(--max));
  }
  .landing-hero {
    padding-top: 48px;
  }
  .landing-title {
    font-size: 2.35rem;
  }
  .landing-lead {
    font-size: 1rem;
  }
  .landing-actions {
    align-items: stretch;
    gap: 16px;
  }
  .landing-actions .btn {
    width: 100%;
  }
  .text-action {
    margin-inline: auto;
  }
  .garage-showcase {
    margin-top: 42px;
    padding: 30px 12px;
  }
  .media-stage {
    min-height: 0;
  }
  .media-stage-bar {
    grid-template-columns: auto 1fr;
  }
  .media-stage-label {
    display: none;
  }
  .media-stage-body {
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .preview-sidebar {
    padding: 24px;
    border-right: 0;
  }
  .preview-monogram,
  .preview-sidebar dl {
    display: none;
  }
  .preview-history {
    padding: 24px 20px 44px;
  }
  .preview-heading {
    align-items: flex-start;
  }
  .preview-add {
    display: none;
  }
  .media-stage-note {
    display: none;
  }
  .trustline {
    grid-template-columns: repeat(2, 1fr);
    padding: 24px 0 48px;
  }
  .trustline li {
    justify-content: flex-start;
  }
  .story-section,
  .principle-section {
    padding-block: 52px;
  }
  .section-heading h2 {
    font-size: 1.85rem;
  }
  .story-section .section-heading p:last-child {
    margin-top: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .about-intro,
  .workflow-panel {
    grid-template-columns: 1fr;
  }
  .about-intro .section-number {
    grid-column: auto;
  }
  .workflow-tabs {
    border-radius: var(--radius-lg);
    gap: 4px;
    padding: 5px;
  }
  .workflow-tab {
    flex: 0 0 auto;
    min-height: 44px;
    padding-inline: 12px;
    gap: 6px;
    font-size: 0.82rem;
  }
  .workflow-tab-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }
  .workflow {
    margin-top: 26px;
  }
  .workflow-panel {
    min-height: 0;
    padding: 24px 0 12px;
    gap: 18px;
  }
  .workflow-panel h3 {
    margin-top: 8px;
    font-size: 1.45rem;
  }
  .workflow-detail > p:last-child {
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .workflow-example {
    padding: 14px 0;
  }
  .workflow-example ul {
    margin-top: 8px;
  }
  .workflow-example li {
    padding: 9px 0;
    font-size: 0.9rem;
  }
  .principle-section .about-intro {
    grid-template-columns: 1fr;
  }
  .about-ownership {
    margin-top: 38px;
  }
  .ownership-heading {
    margin-bottom: 18px;
  }
  .ownership-heading h2 {
    font-size: 1.85rem;
  }
  .ownership-facts {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ownership-fact {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    column-gap: 14px;
    padding: 16px;
  }
  .ownership-icon {
    grid-row: 1 / 3;
    width: 42px;
    height: 42px;
    margin: 0;
  }
  .ownership-card-icon {
    width: 22px;
    height: 22px;
  }
  .ownership-fact h3 {
    font-size: 0.98rem;
  }
  .ownership-fact p {
    grid-column: 2;
    margin-top: 4px;
    font-size: 0.86rem;
    line-height: 1.45;
  }
  .landing-principles {
    grid-template-columns: 1fr;
  }
  .landing-principle > span {
    margin-bottom: 16px;
  }
  .landing-cta {
    margin-top: 8px;
    margin-bottom: 0;
    border-radius: 0;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .landing-cta h2 {
    font-size: 2rem;
  }
  .site-footer {
    min-height: 0;
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 34px 16px;
  }
  .site-footer nav {
    justify-self: start;
  }
  .footer-meta {
    justify-items: start;
  }
  .info-grid,
  .roadmap-horizons {
    grid-template-columns: 1fr;
  }
  .info-grid section,
  .info-grid section:nth-child(odd),
  .info-grid section:nth-child(even) {
    padding: 22px 0;
    border-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Icons (local Heroicons) ---------- */
.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: none;
}
.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Vehicle profile ---------- */
.profile {
  position: relative;
  display: grid;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-raised);
}
/* Top-right options button: round, sits over the card (photo on phones). */
.profile-options {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-raised);
}
.profile-options:focus-visible {
  outline: 2px solid var(--accent, currentColor);
  outline-offset: 2px;
}
.profile-options .icon {
  width: 22px;
  height: 22px;
}
/* Fast actions sit at the bottom-right of the profile details. */
.profile .hero-actions {
  justify-content: flex-end;
}
.options-list {
  display: grid;
  gap: 8px;
}
.options-item {
  justify-content: flex-start;
  width: 100%;
}
.options-item .icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}
/* Attached contextual menu: anchored under the ⋮ trigger (top-right of card). */
.context-menu {
  position: absolute;
  top: 56px;
  right: 8px;
  z-index: 20;
  display: grid;
  gap: 0;
  min-width: 220px;
  padding: 6px 0;
  background: var(--surface, #fff);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 12px 28px rgba(0, 0, 0, 0.14);
}
/* Flat, borderless native-style rows inside the contextual menu. */
.context-menu .options-item {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 44px;
  padding: 10px 16px;
  font-weight: 500;
  color: var(--ink, inherit);
}
.context-menu .options-item:hover,
.context-menu .options-item:focus-visible,
.context-menu .options-item:active {
  background: rgba(0, 0, 0, 0.06);
  outline: none;
}
.context-menu .options-item + .options-item {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-photo {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: var(--surface-2) center / cover no-repeat;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.profile-photo .icon {
  width: 40px;
  height: 40px;
}
.profile-body {
  display: grid;
  gap: 10px;
  align-content: start;
}
.profile-body h1,
.profile-body .eyebrow {
  margin: 0;
}
.profile-notes {
  white-space: pre-wrap;
  margin: 0;
}
.vehicle-summary {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}
.vehicle-home {
  gap: 22px;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.section-head > div {
  display: grid;
  gap: 3px;
}
.history-section {
  display: grid;
  gap: 14px;
}
@media (min-width: 760px) {
  .profile {
    grid-template-columns: minmax(260px, 40%) 1fr;
    padding: 16px;
  }
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 0.92rem;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (min-width: 520px) {
  .facts-inline {
    grid-template-columns: max-content 1fr max-content 1fr;
  }
}

/* ---------- Vehicle form ---------- */
.group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin: 0;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.group legend {
  font-weight: 700;
  padding: 0 6px;
}
.photo-edit {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: start;
}
.photo-preview {
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.btn-small {
  min-height: 44px;
  justify-self: start;
}

/* Place input (about 3/4 width), "or", then a round location button. */
.placefield { display: flex; gap: 10px; align-items: center; }
.placefield input { flex: 0 1 75%; min-width: 0; }
.placeor { font-size: 0.85rem; }
.locatebtn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
}
.locatebtn .icon, .locatebtn svg { width: 22px; height: 22px; }
.locatebtn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
/* ---------- Event type picker ----------
 * Equal-width grid cells so selecting a type never shifts the layout:
 * constant border width and font weight in both states. */
.typepicker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 560px) {
  .typepicker { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* Rounded-square tiles: icon above a centred label. */
.typechip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 8px 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.typechip .icon, .typechip svg { width: 28px; height: 28px; }
.typechip[aria-checked="true"], .typechosen {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.typechip:focus-visible, .typechange:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}
/* Step 2 keeps the chosen tile; Change is a separate, familiar edit action. */
.typesummary { display: flex; align-items: center; gap: 12px; }
.typechosen { width: 92px; flex: 0 0 92px; cursor: default; }
.typesummary[hidden] { display: none !important; }
.typechange {
  width: 92px;
  flex: 0 0 92px;
}
.typechange[hidden], .typestep-hint[hidden], .typestep-description[hidden], [data-action="next-type"][hidden] { display: none !important; }
.typestep-description { min-height: 3em; margin: 0; }
[data-action="next-type"]:disabled { opacity: 0.45; cursor: not-allowed; }
/* Step 1 keeps only the type choice, caption and Cancel/Next actions visible. */
.form.is-picking > :not(h2):not(.typestep-hint):not(.typestep-description):not(.typepicker):not(.taskpicker):not(.formactions) { display: none !important; }
.form.is-picking .formactions > :not([data-action="cancel"]):not([data-action="next-type"]) { display: none !important; }
.form:not(.is-picking) .typepicker, .form:not(.is-picking) .taskpicker { display: none; }
/* Task templates: journey sections of tiles, scrolled inside the sheet. */
.taskpicker { display: grid; gap: 10px; }
.taskpicker [data-slot="templates"] { display: grid; gap: 8px; }
.taskpicker-title { margin: 6px 0 0; font-size: 0.85rem; font-weight: 600; }

[data-field][hidden],
.row[hidden] {
  display: none !important;
}

/* ---------- Event detail ---------- */
.ed-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.ed-head h2,
.ed-head .eyebrow {
  margin: 0;
}
.thumbs-lg img {
  width: 120px;
  height: 120px;
}

/* ---- Tasks v1 ----------------------------------------------------------- */
.task-summary {
  display: grid;
  gap: var(--space-3, 12px);
  padding-block: 4px 22px;
  border-bottom: 1px solid var(--line);
}
.task-summary-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.task-summary-head h2 {
  margin: 0;
}
.task-summary-head p {
  margin: 2px 0 0;
}
.task-summary-actions,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.task-summary-empty {
  padding: 18px 0;
  color: var(--muted);
}
.has-overdue {
  color: var(--danger);
  font-weight: 600;
}
.task-list {
  display: grid;
  gap: 8px;
}
.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
.task-row:hover,
.task-row:focus-visible {
  border-color: var(--line-strong);
}
.task-row[data-status="done"] .task-title {
  text-decoration: line-through;
  opacity: 0.7;
}
.task-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--surface-2);
}
.task-row[data-status="done"] .task-badge {
  color: var(--accent);
}
.task-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.task-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.task-meta {
  font-size: 0.875rem;
}
.pill {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--line);
}
.pill-high {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  border-color: var(--accent);
}
.pill-low {
  color: var(--line-strong);
}
.pill-overdue {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
}
.task-group {
  font-size: 1rem;
  margin: 12px 0 0;
}
.task-group-overdue {
  color: var(--danger);
}
.task-actions .btn {
  min-height: 44px;
}
.task-actions .btn .icon,
.task-summary-actions .btn .icon {
  width: 18px;
  height: 18px;
  margin-right: 6px;
}
.task-history-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  color: inherit;
}
.task-history-link .icon {
  width: 20px;
  height: 20px;
}
.breadcrumb {
  width: fit-content;
  max-width: 100%;
  min-height: 38px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}
.breadcrumb a {
  color: var(--text);
}
.breadcrumb a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.breadcrumb a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.breadcrumb .breadcrumb-separator {
  width: 14px;
  height: 14px;
  flex: none;
  transform: rotate(-90deg);
  opacity: 0.55;
}
@media (max-width: 560px) {
  .task-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-actions > * {
    justify-content: center;
  }
  .section-head {
    align-items: start;
  }
}

/* Tasks v2: subtasks, progress, compact meta */
.task-progress {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 4px;
}
.task-progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.subtasks {
  display: grid;
  gap: 8px;
}
.subtasks-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.subtasks-head h3 {
  margin: 0;
  font-size: 1rem;
}
.subtask-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.subtask {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.subtask input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex: none;
}
.subtask-title {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.subtask[data-done="true"] .subtask-title {
  text-decoration: line-through;
  opacity: 0.65;
}
.subtask-input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
}
.subtask-tools {
  display: flex;
  flex: none;
  gap: 6px;
}
/* Give the rename/delete controls a visible surface so they always read as
   buttons, even if an inline icon fails to paint in a given browser. */
.subtask-tools .icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.subtask-tools .icon-btn[aria-label="Delete subtask"] {
  color: var(--text);
}
.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
}
.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.icon-btn .icon,
.icon-btn .icon svg {
  display: block;
  width: 20px;
  height: 20px;
  min-width: 20px;
  stroke: currentColor;
}
/* Task links: tappable row with label + domain; add row stacks on phones. */
.task-links {
  display: grid;
  gap: 8px;
}
.task-link-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.task-link-main > .icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.task-link-text {
  display: grid;
  min-width: 0;
}
.task-link-label,
.task-link-domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-link-domain {
  font-size: 0.8125rem;
}
.link-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}
.link-add input {
  min-width: 0;
  min-height: 44px;
}
.link-add input[type="url"] {
  grid-column: 1 / -1;
}
@media (min-width: 640px) {
  .link-add {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 40px;
  }
  .link-add input[type="url"] {
    grid-column: auto;
  }
}
.subtask-add {
  display: flex;
  gap: 8px;
  align-items: center;
}
.subtask-add input {
  flex: 1;
  min-height: 44px;
}
@media (max-width: 560px) {
  .subtask {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
  }
  .subtask-tools {
    grid-column: 2;
    justify-self: end;
  }
  .subtask.task-link {
    display: flex;
  }
}

/* Beta 0.9.2 — restrained task state colours (bar, badge, small pill only). */
.task-row[data-state="done"] .task-badge {
  color: var(--good);
}
.task-row[data-state="done"] .task-progress > span {
  background: var(--good);
}
.task-row[data-state="progress"] .task-badge {
  color: var(--accent);
}
.task-row[data-state="overdue"] .task-badge {
  color: var(--danger);
}
.task-row[data-state="overdue"] .task-progress > span {
  background: var(--danger);
}
.task-row[data-state="open"] .task-progress > span {
  background: var(--line-strong);
}
.pill-progress {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--warn);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.task-counts .has-overdue {
  display: inline;
}
.link-quiet {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.chip.chip-overdue {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
}

/* Short explanatory line under a section or page title. */
.section-hint {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

/* Speech-bubble note above the Buy Me a Coffee link: a rounded card with a
   small tail pointing down at the coffee button. */
.ad-reserve {
  flex-direction: column;
  gap: 14px;
}
.support-note {
  position: relative;
  max-width: 56ch;
  margin: 0;
  padding: 12px 28px;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  /* Pill ends, matching the control shape used across Task Garage. */
  border-radius: var(--radius-pill);
}

/* Bubble tail: a rotated square showing two of its four borders so it reads
   as a solid pointer into the card below. */
.support-note::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-bottom-right-radius: 3px;
}

/* First-vehicle starter plan: asked once, only when the garage is empty. */
.starter-plan > p {
  margin: 0 0 8px;
}
.starter-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
}
.starter-option + .starter-option {
  margin-top: 8px;
}
.starter-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface);
}
.starter-option input {
  flex: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
.starter-option > span {
  flex: 1;
}
.starter-option strong {
  display: block;
  font-size: 0.92rem;
}
.starter-option small {
  color: var(--muted);
}

/* Tags (Beta 0.9.18): compact read-only #tag chips on cards, plus a tag filter row. */
.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.hashtag {
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border-radius: var(--radius-pill);
}
.tagbar {
  margin-top: -0.25rem;
}
.tagbar .chip {
  font-size: 0.8125rem;
}

/* Shared 404 screen (in-app twin of public/404.html). */
.notfound {
  max-width: 520px;
  margin: 24px auto;
  padding: 0 20px;
  text-align: center;
}
.notfound-logo {
  width: 190px;
  height: auto;
}
.notfound-art {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  margin: 24px auto 8px;
}
.notfound h2 {
  font-family: var(--font-heading, Besley, Georgia, serif);
  font-size: 2rem;
  margin: 4px 0 8px;
}
.notfound-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Photo descriptions (alt text) under thumbnails and in the lightbox. */
.thumbcaption {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line, currentColor);
}
.lightbox-caption {
  margin: 8px auto 0;
  max-width: 96vw;
  text-align: center;
  color: var(--surface);
  font-size: 0.9rem;
}

/* Keep-awake toggle: highlighted while the screen is held on. */
.wake-toggle[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
}

/* Instant search field for History and Tasks (pill-shaped like all controls). */
.search-box { display: block; }
.search-box input {
  width: 100%;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  background: var(--surface);
}

/* Printable workshop task sheet: only #print-sheet prints while body.printing. */
.print-sheet { display: none; }
@media print {
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing { background: #fff; color: #000; }
  body.printing .print-sheet { display: block; font: 11pt/1.4 Inter, sans-serif; }
  .print-sheet h1 { font-size: 18pt; margin: 0; }
  .ps-specs, .ps-meta { margin: 2pt 0; font-size: 9pt; color: #333; }
  .ps-head { border-bottom: 1.5pt solid #000; padding-bottom: 6pt; margin-bottom: 10pt; }
  .ps-task { break-inside: avoid; border-bottom: 0.5pt solid #999; padding: 6pt 0 10pt; }
  .ps-task h2 { font-size: 13pt; margin: 0 0 2pt; }
  .ps-notes { white-space: pre-wrap; margin: 4pt 0; }
  .ps-checks, .ps-links { list-style: none; padding: 0; margin: 4pt 0; }
  .ps-links { font-size: 8.5pt; word-break: break-all; }
  /* 0.9.44: force ink-on-white so notes never print as a dark block. */
  .print-sheet, .print-sheet * { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .ps-lines { margin-top: 6pt; height: 36pt; font-size: 9pt; border-bottom: 0.5pt solid #bbb; }
  /* 0.9.51: branded masthead + footer. */
  .ps-mast { display: flex; align-items: center; justify-content: space-between; gap: 12pt; padding-bottom: 6pt; margin-bottom: 8pt; border-bottom: 0.5pt solid #999; }
  .ps-logo { height: 22pt; width: auto; }
  .ps-mast-text { display: flex; flex-direction: column; align-items: flex-end; font-size: 9pt; }
  .ps-mast-text strong { font: 600 12pt Besley, Georgia, serif; }
  .ps-head h1 { font-family: Besley, Georgia, serif; }
  .ps-foot { display: flex; justify-content: space-between; gap: 12pt; margin-top: 14pt; padding-top: 6pt; border-top: 1pt solid #000; font-size: 8.5pt; break-inside: avoid; }
  .ps-lines::after { content: ''; display: block; height: 17pt; border-bottom: 0.5pt solid #bbb; }
}

/* YouTube bookmark lightbox (js/youtube.js). Mobile-first 16:9 player. */
.video-lightbox {
  border: none;
  padding: 0;
  background: transparent;
  width: min(960px, 96vw);
  max-width: 96vw;
}
.video-lightbox::backdrop { background: rgb(0 0 0 / 75%); }
.video-frame {
  aspect-ratio: 16 / 9;
  background: var(--ink, #111);
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--surface);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-bar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* Beta 0.9.43 — pinned vehicle manual, full-screen reader and docked tray. */
.manual-card { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface, #fff); box-shadow: 0 1px 3px rgb(0 0 0 / 8%); }
.manual-open { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-align: left; background: none; border: 0; padding: 4px; cursor: pointer; color: inherit; font: inherit; }
.manual-open .icon { grid-row: span 2; width: 24px; height: 24px; color: var(--brand, #e89c30); }
.manual-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manual-meta { font-size: .8rem; }
.manual-page { width: 72px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line, #ddd); border-radius: 999px; font: inherit; }
.manual-reader { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: var(--surface, #fff); }
.manual-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 8px calc(4px) 12px; padding-top: max(4px, env(safe-area-inset-top)); box-shadow: 0 1px 0 var(--line, #e5e5e5); }
.manual-head > .icon { width: 22px; height: 22px; color: var(--brand, #e89c30); flex: none; }
.manual-title { flex: 1; min-width: 0; text-align: left; background: none; border: 0; font: inherit; font-weight: 600; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; }
.manual-actions { display: flex; align-items: center; gap: 2px; }
.manual-actions .btn-icon .icon { width: 22px; height: 22px; }
.manual-pages { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px; background: var(--surface-2, #f1efea); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.manual-sheet { width: 100%; max-width: 900px; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 12%); flex: none; }
.manual-sheet canvas { display: block; width: 100%; height: auto; }
.manual-count { font-size: 0.85rem; opacity: 0.7; margin-right: 4px; white-space: nowrap; }
.manual-reader:not(.is-tray) [aria-label="Expand manual"] { display: none; }
.manual-reader.is-tray { inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px; height: 52px; border-radius: 14px; box-shadow: 0 6px 24px rgb(0 0 0 / 18%); overflow: hidden; }
.manual-reader.is-tray .manual-pages, .manual-reader.is-tray .manual-count, .manual-reader.is-tray .manual-page, .manual-reader.is-tray [aria-label="Minimise to tray"], .manual-reader.is-tray [aria-label="Open in browser viewer"] { display: none; }
.manual-reader.is-tray .manual-head { box-shadow: none; min-height: 52px; padding-top: 4px; }
body.has-manual-tray { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.manual-toggle { display: flex; align-items: center; gap: 6px; font-size: .9rem; margin-top: 8px; }
/* Global inputs are width:100%; keep the checkbox its natural size so the label stays readable. */
.manual-toggle input[type="checkbox"] { width: auto; margin: 0; flex-shrink: 0; }
.task-link.is-editing { background: var(--surface-2, rgba(0,0,0,.04)); border-radius: 8px; }
/* 0.9.44: full-width docked layer and circular icon buttons. */
.manual-reader.is-tray { inset: auto 0 0 0; height: calc(56px + env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; box-shadow: 0 -4px 20px rgb(0 0 0 / 14%); padding-bottom: env(safe-area-inset-bottom); }
.manual-reader.is-tray .manual-head { min-height: 56px; }
body.has-manual-tray { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.manual-actions { gap: 6px; }
.manual-actions .btn-icon { width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2, #f1efea); color: inherit; cursor: pointer; }
.manual-actions .btn-icon:hover, .manual-actions .btn-icon:focus-visible { background: var(--line, #e5e2db); }
.manual-actions .btn-icon .icon { width: 20px; height: 20px; }
@media print { .manual-reader { display: none !important; } }

/* 0.9.50: task manual reference — matches the pinned manual card. */
.task-manual-jump { margin: 12px 0; }
.task-manual-ref { display: inline-flex; align-items: center; gap: 4px; }
.task-manual-ref .icon { width: 14px; height: 14px; color: var(--brand, #e89c30); }

/* 0.9.52: Manuals Library shelf. */
.manual-shelf-item { display: flex; flex-direction: column; gap: 6px; }
.manual-shelf-vehicle { font-weight: 600; color: inherit; text-decoration: none; }
.pagehead .btn + .btn { margin-left: 8px; }
/* 0.9.52: stop a trailing blank printed page. */
@media print {
  html:has(body.printing), body.printing { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  body.printing .print-sheet > :last-child, body.printing .ps-foot { margin-bottom: 0 !important; }
}

/* 0.9.53: Manuals Library intro, add form and tips. */
.manual-intro { margin: 0; }
.manual-add { display: flex; flex-direction: column; gap: 10px; }
.manual-add h2, .manual-tips h2 { margin: 0; font-size: 1.1rem; }
.manual-add .field { display: flex; flex-direction: column; gap: 4px; }
.manual-add input, .manual-add select { width: 100%; }
.manual-add-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.manual-tips ul { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }



/* History section head: entry count plus the "Add entry" action, inline. */
.history-head-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
/* Task templates are many: shorter tiles keep the list scannable on phones. */
.taskpicker .typechip { aspect-ratio: auto; min-height: 76px; }

/* Logbook card: compact km/trips per year under the vehicle profile. */
.logbook-card { margin: 12px 0; padding: 12px 16px; background: #fff; border: 1px solid var(--line, #e5ded3); border-radius: 16px; }
.logbook-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1rem; }
.logbook-title svg { width: 20px; height: 20px; color: var(--accent, #e89c30); }
.logbook-years { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; margin: 0; font-size: .9rem; }
.logbook-years dt { font-weight: 600; }
.logbook-years dd { margin: 0; }

/* Quick Specs (0.9.76): dense label/value strip under the vehicle card. */
.specs-card { margin: 12px 0; padding: 12px 16px; background: #fff; border: 1px solid var(--line, #e5ded3); border-radius: 16px; }
.specs-card.is-empty { padding: 4px 8px; background: transparent; border-style: dashed; }
.specs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.specs-head h2 { margin: 0; font-size: 1rem; }
.specs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 0; }
.specs-grid > div { min-width: 0; }
.specs-grid dt { font-size: .75rem; color: var(--muted, #6b6359); }
.specs-grid dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.specs-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.specs-custom { display: grid; gap: 8px; }
.specs-custom-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.specs-form input { width: 100%; min-height: 44px; }
/* Quick Specs form (0.9.81): interface type, not display serif. */
.specs-form h2 { font-family: var(--font); font-size: 1.25rem; font-weight: 600; margin: 0 0 4px; }
.specs-form > .muted { margin-top: 0; }
.specs-own-label { margin: 16px 0 0; font-family: var(--font); font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #6b6359); }
.specs-custom-row .icon-btn { width: 44px; height: 44px; }
.specs-add-row .icon-btn { background: var(--surface-2, #f3eee6); }
.task-pill { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; max-width: 100%; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-pill svg { width: 14px; height: 14px; flex: none; }
@media (min-width: 720px) { .specs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Vehicle Home footer (0.9.78): logbook and manual docked inside the profile card. */
.profile-footer { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line, #e5ded3); }
.profile-footer .logbook-card.is-docked { margin: 0; padding: 0; border: 0; background: transparent; }
.profile-footer .logbook-card.is-docked .logbook-title { font-size: .9rem; margin-bottom: 2px; }
.profile-footer .manual-card { box-shadow: none; border: 1px solid var(--line, #e5ded3); }

/* Vehicle Home (0.9.79): logbook line with print button; collapsible Quick Specs. */
.logbook-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logbook-print { width: 32px; height: 32px; min-height: 32px; }
.specs-toggle > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.specs-toggle > summary::-webkit-details-marker { display: none; }
.specs-toggle > summary > :first-child { width: 18px; height: 18px; flex: none; transform: rotate(-90deg); transition: transform .15s; }
.specs-toggle[open] > summary > :first-child { transform: none; }
.specs-toggle > summary h2 { flex: 1; }
.specs-toggle[open] > .specs-grid { margin-top: 8px; }
.specs-card { padding: 8px 16px; }
.profile-footer .manual-card { width: 100%; }

/* Vehicle Home (0.9.80): manual spans the full card, specs use the interface
   font, logbook print button stays inline in the summary line. */
.profile-footer { grid-column: 1 / -1; margin-top: 0; }
.specs-toggle > summary h2 { font-family: var(--font); font-size: 1rem; font-weight: 600; }
.vehicle-summary .logbook-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; margin-top: 4px; }
.vehicle-summary .logbook-print { width: 32px; height: 32px; min-height: 32px; flex: none; }
