/* StepOff admin — phone-first. Builds on style.css tokens. */

.admin-masthead { align-items: center; }
.masthead .admin-tag { border-color: rgba(250, 249, 245, 0.85); color: var(--offwhite); }
.masthead .session { color: rgba(250, 249, 245, 0.8); }
.masthead .link-btn { color: var(--offwhite); }
.masthead .link-btn:focus-visible { outline-color: var(--yellow); }

.admin-tag {
  padding: 2px 8px;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.session {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 0;
}

.session__email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }

.admin {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px calc(40px + env(safe-area-inset-bottom));
}

.admin-loading { color: var(--muted); }
.admin-title { margin: 12px 0 6px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.015em; }
.admin-lede { margin: 0 0 18px; color: var(--muted); }
.admin-h2 { margin: 0 0 4px; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.admin-h3 { margin: 22px 0 8px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }

.notice {
  margin: 12px 0;
  padding: 16px;
  border: 1.5px solid var(--navy);
  border-radius: 10px;
  background: var(--surface);
}
.notice--warn { border-style: dashed; }
.notice__title { margin: 0 0 6px; font-size: 1.1rem; font-weight: 800; }
.notice p { margin: 6px 0 0; line-height: 1.45; }
code { font-size: 0.9em; background: var(--platform); padding: 1px 5px; border-radius: 4px; }

/* ---- Forms ------------------------------------------------------------------ */

.field-label {
  display: block;
  margin: 16px 0 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0;
}
.optional { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }

.text-input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem; /* 16px+ stops iOS zooming into the field */
  color: var(--navy);
  background: var(--surface);
  border: 1.5px solid var(--navy);
  border-radius: var(--radius);
}
textarea.text-input { min-height: 88px; resize: vertical; line-height: 1.4; }
.text-input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }
.date-input { max-width: 220px; }

.form-error { min-height: 1.2em; margin: 12px 0 0; color: #9A3412; font-weight: 600; }
.form-error:empty { min-height: 0; margin: 0; }

.btn-primary, .btn-secondary, .btn-start, .btn-stop {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 16px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  background: var(--yellow);
  border: 2px solid var(--navy);
}
.btn-primary:disabled { opacity: 0.55; cursor: progress; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  font-weight: 700;
  color: var(--navy);
  background: var(--surface);
  border: 1.5px solid var(--hairline-strong);
}
.btn-secondary:hover { border-color: var(--navy); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-small { min-height: 44px; padding: 0 12px; font-size: 0.9rem; }
.btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-start:focus-visible, .btn-stop:focus-visible, .link-btn:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

.link-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn--danger { color: #9A3412; }

/* ---- Sync bar ---------------------------------------------------------------- */

.syncbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 12px;
  margin: 4px 0 8px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 600;
}
.syncbar__dot { width: 9px; height: 9px; border-radius: 50%; background: #2E8B57; flex: none; }
.syncbar.is-pending .syncbar__dot { background: #D97706; }
.syncbar.is-offline .syncbar__dot { background: #9A3412; }
.syncbar__text { flex: 1; }

.sync-errors { list-style: none; margin: 0 0 8px; padding: 0; }
.sync-error {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; margin-bottom: 6px;
  border: 1.5px dashed #9A3412; border-radius: 8px; font-size: 0.86rem;
}

.run-banner {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0 0 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: left;
  color: var(--navy);
  background: var(--yellow);
  border: 2px solid var(--navy);
  border-radius: 8px;
  cursor: pointer;
}

/* ---- Unfinished pairs ------------------------------------------------------------ */

.unfinished { padding: 12px 0 14px; border-bottom: 1px solid var(--hairline); }
.unfinished__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.unfinished__item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--hairline-strong); border-radius: 8px;
}
.unfinished__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 0.86rem; }
.unfinished__state { color: var(--muted); }

/* ---- Destinations ------------------------------------------------------------------ */

.admin-planner .step { padding: 16px 0; }
.dest-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.dest-list:empty { display: none; }
.dest-card {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
}
.dest-card__head { display: flex; gap: 12px; align-items: flex-start; }
.dest-card__door {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px;
  background: var(--yellow); border: 2px solid var(--navy); border-radius: var(--radius);
  font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.dest-card__text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.dest-card__name { font-size: 1.02rem; }
.dest-card__shared, .dest-card__saved { font-size: 0.82rem; color: var(--muted); }
.dest-card__saved { color: #1E6B3A; font-weight: 700; }
.dest-card__actions { display: flex; gap: 8px; margin-top: 10px; }
.dest-card__actions .btn-secondary { flex: 1; }
.btn-add { width: 100%; margin-top: 12px; border-style: dashed; border-color: var(--navy); }

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid var(--navy);
}
.chip--demo { border-style: dashed; }
.chip--verified { background: var(--navy); color: var(--offwhite); }
.chip--pending { border-color: #D97706; color: #92400E; }
.chip--error, .chip--slower { border-color: #9A3412; color: #9A3412; }
.chip--good { border-color: #1E6B3A; color: #1E6B3A; }
.chip--muted { border-color: var(--hairline-strong); color: var(--muted); text-transform: none; letter-spacing: 0; border-radius: 6px; font-weight: 600; }

/* ---- Panels: editor + timer --------------------------------------------------------- */

.panel {
  margin: 16px 0;
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--navy);
  border-radius: 12px;
  scroll-margin-top: 12px;
}
.panel__route { margin: 0 0 8px; font-size: 0.86rem; color: var(--muted); }
.note {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  background: var(--offwhite);
  border-left: 3px solid var(--navy);
  border-radius: 4px;
}
.note:empty { display: none; }

.doors-field { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.doors-field legend.field-label { margin-top: 0; }
.doors-front { margin: -2px 0 6px; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.door-buttons { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.door-btn { min-height: 60px; font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; padding: 0; }
.door-buttons--small .door-btn { min-height: 48px; font-size: 1.1rem; }

.editor-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; align-items: end; }
.editor-actions .btn-primary { margin-top: 16px; }
.save-status { min-height: 1.3em; margin: 12px 0 0; font-weight: 700; }
.save-status:empty { min-height: 0; margin: 0; }

.timer-summary { margin: 4px 0 0; font-weight: 800; color: #1E6B3A; }
.timer-summary.is-slower, .dest-card__saved.is-slower { color: #9A3412; }
.timer-summary.is-empty { color: var(--muted); font-weight: 600; }
.timer-howto { margin: 10px 0 0; line-height: 1.45; }

.run-cards { display: grid; gap: 10px; margin-top: 14px; }
@media (min-width: 560px) { .run-cards { grid-template-columns: 1fr 1fr; } }
.run-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  background: var(--offwhite);
}
.run-card--stepoff { border-color: var(--navy); }
.run-card__title { margin: 0; font-size: 1rem; font-weight: 800; }
.run-card__hint { margin: 0; font-size: 0.86rem; color: var(--muted); }
.run-card--stepoff .run-card__hint { color: var(--navy); font-weight: 700; }
.run-card__warn { margin: 0; font-size: 0.82rem; color: #92400E; }

.btn-start, .btn-stop {
  width: 100%;
  min-height: 64px;
  font-size: 1.25rem;
  font-weight: 800;
  border: 2px solid var(--navy);
}
.btn-start { background: var(--navy); color: var(--offwhite); margin-top: auto; }
.btn-start:disabled { background: var(--platform); color: var(--muted); border-color: var(--hairline-strong); cursor: not-allowed; }
.btn-stop { background: var(--yellow); color: var(--navy); min-height: 88px; font-size: 1.6rem; }

.run-live, .run-done { margin-top: 14px; text-align: center; }
.run-live__label { margin: 0; font-weight: 700; }
.run-live__time {
  margin: 6px 0 12px;
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.run-done .editor-actions { text-align: left; }

.pair-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.pair-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
}
.pair-item__body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 0.86rem; min-width: 0; }
.pair-item__date { font-weight: 700; }
.pair-item__runs { font-variant-numeric: tabular-nums; }
.pair-empty { color: var(--muted); font-size: 0.86rem; }

#timer-close { width: 100%; }

/* ---- "Also applies to" ----------------------------------------------------- */
.also-field { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.also-field legend.field-label { margin-top: 0; }
.also-hint { margin: -2px 0 8px; font-size: 0.82rem; color: var(--muted); }
.also-buttons { display: grid; gap: 8px; }
.also-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  min-height: 60px;
  text-align: left;
}
.also-btn__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.also-btn__title { font-weight: 700; }
.also-btn__sub { font-size: 0.82rem; color: var(--muted); }
.also-btn[aria-pressed="true"] .also-btn__sub { color: var(--navy); }
.also-btn__state {
  flex: none;
  padding: 2px 9px;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.also-btn[aria-pressed="true"] .also-btn__state { background: var(--navy); color: var(--yellow); }
.line-badge--small { width: 30px; height: 30px; font-size: 0.82rem; flex: none; }
