/* Leash League — varsity crest, Tag Team colors */
/* Fonts are self-hosted (SIL Open Font License): no calls to Google, works offline */
@font-face { font-family: "Graduate"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/graduate-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/figtree-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/figtree-latin-800-normal.woff2") format("woff2"); }
:root {
  --navy: #17233D;
  --navy-2: #22314F;
  --orange: #E8651F;
  --orange-ink: #B24A12;   /* orange that passes contrast on light backgrounds */
  --sky: #BFD7EA;
  --chalk: #F6F0E4;
  --paper: #FFFFFF;
  --line: #E2D9C7;
  --muted: #4A5468;
  --ok-bg: #D9ECDF; --ok-ink: #1E5236;
  --req-bg: #FBEBD0; --req-ink: #7A4210;
  --bad-bg: #F3DADA; --bad-ink: #8A2424;
  --radius: 14px;
  --display: "Graduate", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Semantic tokens (swapped in dark mode below) */
  --line-strong: var(--line-strong);
  --line-soft: var(--line-soft);
  --seg: var(--seg);
  --on-accent: #17233D;      /* text on orange: always dark navy */
  --danger-bg: #8A2424;
  --crest: #17233D;
  --shadow: rgba(23,35,61,.15);
  --scrim: rgba(23,35,61,.45);
  color-scheme: light dark;
}

/* Dark mode follows the phone's setting (built into every modern browser) */
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #EDE6D8; --navy-2: #D5CCBB;
    --chalk: #0F1626; --paper: #18223A;
    --line: #2A3654; --line-strong: #3A4768; --line-soft: #243049; --seg: #212C45;
    --muted: #A9B2C4;
    --orange-ink: #F2904F;
    --sky: #29476A;
    --ok-bg: #173A2A; --ok-ink: #A6DDBB;
    --req-bg: #3D2A10; --req-ink: #F5C78A;
    --bad-bg: #3F1C1C; --bad-ink: #F2A7A7;
    --danger-bg: #B23434;
    --crest: #EDE6D8;
    --shadow: rgba(0,0,0,.45);
    --scrim: rgba(0,0,0,.6);
  }
  a:hover { color: #F6B083; }
}
.crest-fill { fill: var(--crest); }

/* Smooth navigation between the app and its info pages (cross-document View Transitions) */
@view-transition { navigation: auto; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--body); font-size: 16px; line-height: 1.45;
  color: var(--navy); background: var(--chalk);
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
a { color: var(--orange-ink); }
@media (prefers-color-scheme: light) { a:hover { color: #8F3A0D; } }
h1, h2, h3 { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5; background: var(--chalk);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 0 auto; }
.brand-team { font-weight: 800; font-size: 17px; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--muted); }
.main {
  max-width: 720px; margin: 0 auto; padding: 18px 16px calc(96px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 18px; outline: none;
}
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
  display: flex; justify-content: center; gap: 4px;
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + var(--safe-bottom));
}
.bottom-nav a {
  flex: 1 1 0; max-width: 140px; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; border-radius: 10px;
}
.bottom-nav a[aria-current] { color: var(--navy); background: var(--chalk); }
.bottom-nav a[aria-current] svg { color: var(--orange); }

.install {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px;
  background: var(--navy); color: var(--chalk); font-size: 14px;
}
.install span { flex: 1; }
.install .icon-btn { color: var(--chalk); }
.demo-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 16px;
  background: var(--orange); color: var(--on-accent); font-size: 14px; font-weight: 700;
}
.demo-bar select { min-height: 36px !important; width: auto !important; padding: 4px 10px !important; font-weight: 700; color: var(--navy); background: var(--paper); }

/* ---------- Type ---------- */
.display { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.05; }
.title { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.section-title { font-size: 18px; font-weight: 800; }
.label { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 17px; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); margin: 0; }
.center { text-align: center; }
.owed { color: var(--orange-ink); }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-row > .btn { flex: 1 1 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.card.callout { border-color: var(--orange); }
.card.inactive { opacity: .7; }
.link-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--navy); }
.link-card .pill { align-self: flex-start; }
.note { margin: 0; padding: 10px 12px; background: var(--chalk); border-radius: 10px; font-size: 15px; }
.note.warn { background: var(--req-bg); color: var(--req-ink); }

/* ---------- Forms ---------- */
label { font-weight: 600; font-size: 15px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper);
}
textarea { min-height: 72px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px;
}
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14px; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex-shrink: 0; accent-color: var(--navy); }
.inline { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.inline select { width: auto; min-height: 44px; }
input.price { width: 110px !important; text-align: right; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--navy);
  font-weight: 700; text-decoration: none; text-align: center;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: var(--chalk); }
.btn-accent { background: var(--orange); border-color: var(--orange); color: var(--on-accent); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger-bg); border-color: var(--danger-bg); color: #FFFFFF; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 56px; font-size: 18px; }
.danger { color: var(--bad-ink); }
.icon-btn {
  width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--navy);
}
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; text-decoration: none; min-height: 44px; }

/* ---------- Pills ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.pill-requested { background: var(--req-bg); color: var(--req-ink); }
.pill-confirmed, .pill-completed { background: var(--ok-bg); color: var(--ok-ink); }
.pill-declined, .pill-cancelled { background: var(--bad-bg); color: var(--bad-ink); }
.pill-owed { background: var(--req-bg); color: var(--req-ink); }

/* ---------- Booking ---------- */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--seg); border-radius: 14px; border: 0; margin: 0; }
.seg > button, .seg > label {
  flex: 1 1 0; min-height: 48px; border: 0; border-radius: 10px; background: transparent;
  font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.seg > button small { font-weight: 600; color: var(--muted); }
.seg > button[aria-checked=true] { background: var(--paper); box-shadow: 0 1px 3px var(--shadow); }
.seg > label { flex-direction: row; gap: 8px; }
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.day {
  flex: 0 0 58px; height: 66px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
}
.day span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.day strong { font-size: 19px; }
.day[aria-pressed=true] { background: var(--navy); border-color: var(--navy); color: var(--chalk); }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper);
  font-weight: 700; cursor: pointer;
}
.slot[aria-pressed=true] { border: 2px solid var(--navy); background: var(--sky); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); font-weight: 700; cursor: pointer;
}
.chip input:checked + span { background: var(--navy); color: var(--chalk); border-color: var(--navy); }
.chip input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.sticky-cta {
  position: sticky; bottom: calc(72px + var(--safe-bottom)); z-index: 4;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 6px 18px var(--shadow);
}
.cta-summary { font-weight: 700; font-size: 15px; }

/* ---------- Walk lists ---------- */
.walk-card {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--navy);
}
.walk-card.mine { border-left: 0; box-shadow: inset 4px 0 0 var(--orange); }
.walk-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: var(--navy); }
.walk-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.walk-info .pill { align-self: flex-start; }
.date-badge, .time-col {
  flex: 0 0 56px; min-height: 60px; border-radius: 12px; background: var(--chalk);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px;
}
.date-badge strong { font-size: 20px; }
.time-col { flex-basis: 72px; }
.time-col strong { font-size: 15px; }

/* ---------- Report card, stats, ledger ---------- */
.report-photo { width: 100%; max-height: 360px; object-fit: cover; border-radius: 12px; }
.report-note { margin: 0; font-size: 17px; line-height: 1.5; }
.photo-pick {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px;
  border: 2px dashed var(--line-strong); border-radius: 12px; cursor: pointer; background: var(--chalk);
}
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 26px; }
.stat small { color: var(--muted); }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.ledger li:last-child { border-bottom: 0; }
.hours { list-style: none; margin: 0; padding: 0; }
.hours li { display: flex; justify-content: space-between; align-items: center; font-size: 15px; border-bottom: 1px solid var(--line-soft); }
details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.pet-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pet-card div { display: flex; flex-direction: column; }

/* ---------- Hero, empty ---------- */
.hero { text-align: center; padding: 18px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 0; }
input[type=search] { background: var(--paper); }

/* ---------- Sheet ---------- */
.sheet { display: none; }
.sheet.open { display: block; position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 90dvh; overflow: auto;
  background: var(--chalk); border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + var(--safe-bottom));
  max-width: 720px; margin: 0 auto;
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--chalk); padding: 8px 0; }
.sheet-head h2 { font-size: 20px; font-weight: 800; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translate(-50%, 20px);
  background: var(--navy); color: var(--chalk); padding: 12px 18px; border-radius: 12px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 30; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-err { background: var(--danger-bg); color: #FFFFFF; }

@media (min-width: 720px) {
  .slot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* ---------- Page entry and sheet motion (CSS @starting-style: no JavaScript) ---------- */
.page-enter { transition: opacity .18s ease, translate .18s ease; }
@starting-style { .page-enter { opacity: 0; translate: 0 6px; } }
.sheet.open .sheet-panel { transition: translate .22s cubic-bezier(.2,.8,.2,1); }
@starting-style { .sheet.open .sheet-panel { translate: 0 40px; } }
.sheet.open .sheet-backdrop { transition: opacity .2s ease; }
@starting-style { .sheet.open .sheet-backdrop { opacity: 0; } }

/* ---------- Live updates, sharing ---------- */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2FA35B; margin-right: 6px; vertical-align: middle; }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: pulse 1.6s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .35; } }
.info-page { padding-bottom: 40px; }
.link-box { font-size: 14px; word-break: break-all; background: var(--chalk); padding: 10px 12px; border-radius: 10px; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .toast, .page-enter, .sheet.open .sheet-panel, .sheet.open .sheet-backdrop { transition: none; }
  @view-transition { navigation: none; }
}
.page { display: flex; flex-direction: column; gap: 18px; }

/* ---------- FAQ, two-step sign-in ---------- */
.faq summary { font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--navy-2); }
.steps { padding-left: 34px; }
.steps li { margin: 4px 0; }
.qr { display: block; width: 200px; height: 200px; margin: 10px 0; background: #FFFFFF; padding: 8px; border-radius: 12px; }
.key { font-size: 14px; letter-spacing: .04em; overflow-wrap: anywhere; }
.demo-bar { flex-wrap: wrap; }
.demo-bar .btn { min-height: 32px; padding: 0 12px; font-size: 13px; color: var(--on-accent); border: 1.5px solid var(--on-accent); background: transparent; }
.slot-empty, .slot-grid > .muted { grid-column: 1 / -1; margin: 0; }
