:root {
  --bg: #eef3f6;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #5d6878;
  --line: #d8e0e8;
  --brand: #0f3d5f;
  --brand-soft: #e5f1f8;
  --green: #13734f;
  --green-soft: #e7f5ee;
  --gold: #8a5a00;
  --gold-soft: #fff3d5;
  --red: #a9352a;
  --red-soft: #fdebea;
  --nav-height: 76px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow: 0 12px 32px rgba(17, 24, 39, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100%;
  margin: 0;
}

body.has-open-modal {
  overflow: hidden;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
.sr-only {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 0;
  font-size: 1.24rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.28rem;
  line-height: 1.12;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.22;
}

.app-shell {
  min-height: 100dvh;
  background: var(--bg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.header-logo {
  display: block;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--brand);
  font-size: 1.45rem;
  font-weight: 900;
}

.app-main {
  padding: 12px 12px calc(var(--nav-height) + var(--safe-bottom) + 18px);
}

.app-view {
  display: none;
}

.app-view.is-active {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.screen-stack,
.card-list,
.question-list {
  display: grid;
  gap: 12px;
}

.hero-card,
.live-clock-card,
.panel,
.map-top,
.map-frame {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.live-clock-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 14px;
}

.live-clock-date,
.live-clock-time {
  display: block;
}

.live-clock-date {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
}

.live-clock-time {
  color: var(--ink);
  font-size: clamp(2rem, 11vw, 3.2rem);
  font-weight: 950;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.hero-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero-card h2 {
  font-size: 1.65rem;
}

.hero-card.is-checked {
  border-color: var(--green);
}

.hero-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.42;
}

.hero-tags,
.tag-row,
.hero-actions,
.tool-grid,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 850;
}

.primary-button,
.secondary-button,
.complete-toggle,
.text-button,
.text-chip,
.day-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
  text-align: center;
}

.primary-button,
.secondary-button,
.complete-toggle {
  flex: 1 1 132px;
  padding: 0 14px;
}

.primary-button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--brand);
}

.complete-toggle {
  gap: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--brand);
  cursor: pointer;
}

.complete-toggle.is-checked {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.complete-toggle input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--green);
}

.text-button,
.text-chip {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--brand);
  background: #ffffff;
  color: var(--brand);
  font-size: 0.82rem;
}

.text-chip {
  border-color: var(--line);
  color: var(--muted);
}

.panel,
.attached {
  padding: 14px;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.row-between {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.counter {
  margin-bottom: 0;
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 900;
  white-space: nowrap;
}

.day-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.day-tab {
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.day-tab.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.schedule-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.schedule-card.is-current {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.schedule-card.is-next {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.schedule-card.is-checked {
  border-color: var(--green);
  border-left-color: var(--green);
}

.schedule-card.is-checked h3,
.schedule-card.is-checked .schedule-copy > p {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.schedule-check {
  display: grid;
  align-content: start;
}

.schedule-check input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.schedule-time {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.schedule-time strong {
  color: var(--ink);
  font-size: 1rem;
}

.schedule-copy {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.schedule-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.38;
}

.schedule-meta {
  display: grid;
  gap: 8px;
}

.schedule-meta-group {
  display: grid;
  gap: 5px;
}

.schedule-meta-group p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.people-row span {
  background: var(--brand);
  color: #ffffff;
}

.deliverable-row span {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
}

.map-screen {
  display: grid;
  gap: 10px;
}

.map-top {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.map-top p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.map-frame {
  overflow: hidden;
  height: min(54dvh, 520px);
  min-height: 360px;
  background: var(--brand-soft);
}

.map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  text-align: center;
}

.location-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: thin;
}

.location-pill {
  display: grid;
  gap: 4px;
  min-width: 112px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.location-pill.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.location-pill span {
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 900;
}

.check-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.check-card.is-checked {
  border-color: var(--green);
  background: var(--green-soft);
}

.check-card label {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.check-card input {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  accent-color: var(--green);
}

.check-card label span {
  display: grid;
  gap: 4px;
}

.check-card small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.34;
}

.check-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.42;
}

.item-photo-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.item-photo {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.image-modal[hidden] {
  display: none;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.78);
}

.image-modal-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: center;
  width: min(100%, 720px);
  max-height: 92dvh;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.image-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.image-modal-head h2 {
  font-size: 1rem;
}

.image-modal-panel img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(92dvh - 68px);
  object-fit: contain;
  background: #ffffff;
}

.question-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--red-soft);
}

.question-card p,
.empty-note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.42;
}

.question-card p {
  color: var(--red);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: calc(var(--nav-height) + var(--safe-bottom));
  padding: 8px 8px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.nav-button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
}

.nav-button svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.nav-button.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}

@media (min-width: 760px) {
  .app-shell {
    width: min(720px, 100%);
    margin: 0 auto;
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }

  .bottom-nav {
    right: auto;
    left: 50%;
    width: min(720px, 100%);
    transform: translateX(-50%);
  }

  .app-main {
    padding-right: 18px;
    padding-left: 18px;
  }

  .hero-card h2 {
    font-size: 2rem;
  }

  .live-clock-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .live-clock-time {
    text-align: right;
  }

  .schedule-card {
    grid-template-columns: 28px 72px minmax(0, 1fr);
  }

  .schedule-time {
    display: grid;
    align-content: start;
    gap: 4px;
  }

  .schedule-copy {
    grid-column: auto;
  }
}

@media print {
  .app-header,
  .bottom-nav,
  .map-frame,
  .hero-actions,
  .card-actions,
  .tool-grid {
    display: none;
  }

  .app-main {
    padding: 0;
  }

  .app-view {
    display: block;
  }

  .hero-card,
  .live-clock-card,
  .panel,
  .check-card,
  .schedule-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
