/* SureShow web app. One stylesheet, no framework. Tokens match sureshow.app (navy, blue, Inter).
   Phone first at 390px. Works with JavaScript off. */
:root {
  color-scheme: light;
  --navy: #0a1b3d;
  --ink: #172033;
  --muted: #5d6b82;
  --blue: #0d6dff;
  --blue-top: #2b7fff;
  --blue-deep: #0a5be0;
  --blue-rgb: 23, 105, 255;
  --sky: #eaf3ff;
  --green: #12b981;
  --green-rgb: 18, 185, 129;
  --yellow: #f4b431;
  --yellow-rgb: 244, 180, 49;
  --red: #d64545;
  --red-rgb: 214, 69, 69;
  --bg: #f6f8fb;
  --card: rgba(255, 255, 255, 0.92);
  --line: #dbe4f0;
  --line-strong: rgba(20, 42, 82, 0.16);
  --shadow-soft: 0 8px 28px rgba(8, 24, 64, 0.08);
  --shadow: 0 18px 50px rgba(8, 24, 64, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --tabbar: 68px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}
/* Room for the tab bar only on signed-in pages (signed-out pages have no tab bar). */
body:has(.tabbar) { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }
main { max-width: 40rem; margin: 0 auto; padding: 1rem 1rem 2rem; }
h1 { font-size: 1.55rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0.25rem 0 1rem; color: var(--navy); }
h2 { font-size: 1.1rem; line-height: 1.3; margin: 1.4rem 0 0.5rem; color: var(--navy); }
h3 { font-size: 1rem; margin: 0 0 0.35rem; color: var(--navy); }
p, li { overflow-wrap: anywhere; }
p { margin: 0.5rem 0; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
strong { color: var(--navy); }

/* Forms */
label { display: block; font-weight: 600; font-size: 0.95rem; margin: 0.9rem 0 0.3rem; color: var(--navy); }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  font: 1rem/1.3 var(--font);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.18);
}
input[type="checkbox"], input[type="radio"] {
  width: 1.25rem; height: 1.25rem; min-height: 0; padding: 0; margin: 0 0.5rem 0 0; accent-color: var(--blue); vertical-align: -0.2rem;
}
textarea { min-height: 6rem; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.4rem; }

/* Buttons. One primary per screen. */
button, .tap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  margin-top: 0.75rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  font: 600 1rem/1.2 var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, filter 0.15s;
}
button {
  width: 100%;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, var(--blue-top), var(--blue) 55%, var(--blue-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 0 rgba(8, 24, 64, 0.18), 0 8px 20px rgba(var(--blue-rgb), 0.28);
}
button:hover { filter: brightness(1.04); }
button:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 rgba(8, 24, 64, 0.18), 0 3px 10px rgba(var(--blue-rgb), 0.22); }
button:focus-visible, .tap:focus-visible, a:focus-visible { outline: 3px solid rgba(var(--blue-rgb), 0.45); outline-offset: 2px; }
button:disabled { background: #cfd8e6; color: #5d6b82; box-shadow: none; cursor: default; }
.tap, button.secondary, button.suggestion, #address-suggestions button {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
}
.tap:active { transform: translateY(1px); }
button.danger, button[data-danger] { background: #fff; color: var(--red); border: 1px solid rgba(var(--red-rgb), 0.5); box-shadow: none; }
button.suggestion { color: var(--ink); text-align: left; justify-content: flex-start; margin-top: 0.35rem; min-height: 44px; }
form[aria-busy="true"] button:disabled, form[aria-busy="true"] input:disabled { opacity: 0.72; }
/* Cancel visit link (PR #64): looks like the outlined danger button. */
a.danger { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-top: 0.75rem; padding: 0.75rem 1rem; border: 1px solid rgba(var(--red-rgb), 0.5); border-radius: var(--radius-sm); background: #fff; color: var(--red); font: 600 1rem/1.2 var(--font); text-align: center; text-decoration: none; }
details summary { min-height: 44px; display: flex; align-items: center; }
form[aria-busy="true"] button:disabled::after {
  content: ""; width: 0.85em; height: 0.85em; margin-left: 0.55em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; flex: 0 0 auto;
  animation: sureshow-spin 0.7s linear infinite;
}
@keyframes sureshow-spin { to { transform: rotate(360deg); } }

/* Banner */
.banner, .note, .card, .hint { border-radius: var(--radius-sm); }
.banner {
  margin: 0; padding: 0.6rem 1rem; text-align: center; font-size: 0.92rem; font-weight: 600;
  background: var(--sky); color: var(--navy); border-bottom: 1px solid var(--line); border-radius: 0;
}
.banner[data-banner="live-test"] { background: rgba(var(--green-rgb), 0.12); color: #0b6b4c; }
main .banner { margin-bottom: 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.note { background: #fff; border: 1px solid var(--line); padding: 0.75rem 1rem; margin: 0.5rem 0; color: var(--ink); }
.note.warn { background: rgba(var(--red-rgb), 0.07); border-color: rgba(var(--red-rgb), 0.35); color: #8a2a24; }
.hint { color: var(--muted); font-size: 0.92rem; margin: 0.2rem 0 0.35rem; }

/* Cards */
.card, li.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.05rem;
  margin: 0.75rem 0;
  list-style: none;
}
.card > p:first-child { margin-top: 0; }
li.card[data-light] { padding-left: 1.2rem; }
li.card[data-light]::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--line-strong); }
li.card[data-light="green"]::before { background: var(--green); }
li.card[data-light="yellow"]::before { background: var(--yellow); }
li.card[data-light="red"]::before { background: var(--red); }
.locked { color: #8a94a6; }
.locked-card { background: #f0f3f8; box-shadow: none; }
ul, ol { padding: 0; margin: 0; }
ol { padding-left: 1.2rem; }
section + section { margin-top: 0.5rem; }
.day { margin-top: 0.5rem; }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border-radius: 999px; padding: 0.2rem 0.65rem;
  font: 600 0.8rem/1.2 var(--font); letter-spacing: 0.01em; vertical-align: middle;
}
.pill::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; opacity: 0.9; }
.green { background: rgba(var(--green-rgb), 0.14); color: #0b6b4c; }
.yellow { background: rgba(var(--yellow-rgb), 0.2); color: #7a5300; }
.red { background: rgba(var(--red-rgb), 0.12); color: #9b2b24; }
.none { background: #edf1f7; color: var(--muted); }

/* Details ("More") */
details { margin-top: 0.6rem; }
summary { cursor: pointer; color: var(--blue); font-weight: 600; list-style: none; padding: 0.4rem 0; }
summary::-webkit-details-marker { display: none; }
summary::after { content: " ▾"; font-size: 0.8em; }
details[open] summary::after { content: " ▴"; }

/* Lists used by setup and registration */
.status-list, .steps { list-style: none; padding: 0; margin: 0 0 1rem; }
.steps { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; }
.steps .current, .status-list .current { font-weight: 700; color: var(--navy); }
.status-list li { margin: 0.2rem 0; }
.status-list .later { color: #8a94a6; }
[data-slot="registration-wizard"] { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed var(--line-strong); }
dl { margin: 0.5rem 0 1rem; }
dt { font-weight: 600; margin-top: 0.7rem; color: var(--navy); }
dd { margin: 0.15rem 0 0; }

/* Quick picks and the one-screen visit form */
.picks { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.35rem 0 0.2rem; }
.picks input[type="radio"] { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.picks label { display: inline-flex; align-items: center; margin: 0; min-height: 44px; padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--navy); cursor: pointer; }
.picks input:checked + label { background: var(--sky); color: var(--blue); border-color: var(--blue); box-shadow: 0 4px 14px rgba(var(--blue-rgb), 0.18); }
.picks input:focus-visible + label { outline: 3px solid rgba(var(--blue-rgb), 0.45); outline-offset: 2px; }
.what-other { display: none; }
form:has(#what-other:checked) .what-other { display: block; }
.person .ask { display: none; }
.person:not(:has(.check input:checked)) .ask { display: block; }
label.check { display: flex; align-items: center; font-weight: 600; }
fieldset.card, section.card { min-inline-size: 0; }

/* Address suggestions */
#address-suggestions { list-style: none; margin: 0.35rem 0 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-soft); }
#address-suggestions[hidden] { display: none; }
#address-suggestions button { margin: 0; width: 100%; border: 0; border-radius: 0; box-shadow: none; color: var(--ink); justify-content: flex-start; text-align: left; }
#address-suggestions li + li button { border-top: 1px solid var(--line); }

/* Top bar (brand) */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  max-width: 40rem; margin: 0 auto; padding: 0.8rem 1rem 0;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; color: var(--navy); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 22px; height: 22px; }
.topbar form { margin: 0; }
.topbar button {
  width: auto; min-height: 36px; margin: 0; padding: 0 0.6rem;
  background: none; color: var(--muted); box-shadow: none; font-size: 0.85rem; font-weight: 600;
}
.topbar button:hover { color: var(--navy); }

/* Bottom tab bar on phones, left rail on wide screens */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
  padding: 0 0.25rem env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(8, 24, 64, 0.06);
}
.tabbar a {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
  min-height: 0; margin: 0; padding: 0.4rem 0.25rem; border-radius: 10px;
  font: 600 0.72rem/1.1 var(--font); color: var(--muted); text-decoration: none; background: none; box-shadow: none; border: 0;
}
.tabbar a svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--blue); }
.tabbar a[aria-current="page"] svg { filter: drop-shadow(0 2px 6px rgba(var(--blue-rgb), 0.35)); }
.tabbar a.tab-add svg { width: 30px; height: 30px; color: #fff; stroke: #fff; padding: 4px; border-radius: 50%; background: linear-gradient(180deg, var(--blue-top), var(--blue-deep)); box-shadow: 0 6px 16px rgba(var(--blue-rgb), 0.35); }

@media (min-width: 900px) {
  body:has(.tabbar) { padding-bottom: 2rem; padding-left: 220px; }
  .topbar { padding-top: 1.2rem; justify-content: flex-end; }
  .tabbar {
    top: 0; bottom: 0; right: auto; width: 220px; height: auto;
    flex-direction: column; justify-content: flex-start; gap: 0.25rem;
    padding: 5.5rem 0.75rem 1rem; border-top: 0; border-right: 1px solid var(--line); box-shadow: none;
  }
  .tabbar a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 0.75rem; padding: 0.7rem 0.8rem; font-size: 0.95rem; }
  .tabbar a[aria-current="page"] { background: var(--sky); }
  .tabbar a.tab-add svg { width: 26px; height: 26px; }
  .brand { position: fixed; top: 1.25rem; left: 1.4rem; z-index: 21; font-size: 1.1rem; }
  .topbar .brand { position: fixed; }
  main { padding-top: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition: none !important; }
}
a.sign-in-google {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 48px; margin-top: 0.75rem; padding: 0.75rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); box-shadow: var(--shadow-soft);
  font: 600 1.05rem/1.2 var(--font); text-align: center; text-decoration: none;
}

/* Board people, status legend and empty state */
.dots, .legend { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.dot { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; font-size: 0.7rem; font-weight: 700; }
.legend { color: var(--muted); font-size: 0.8rem; }
.legend .dot { width: 0.7rem; height: 0.7rem; }
.empty-state { text-align: center; padding: 2rem 0; }
.empty-state .tap { display: inline-block; background: var(--blue); color: white; border-radius: var(--radius-sm); padding: 0.8rem 1rem; }
