/* GO!Stroll web app (specs/007-veb-iphone): the APK's look, ui/Theme.kt and site/assets/style.css. */
:root {
  --neva: #0F1C2E;
  --gold: #B8892B;
  --gold-bright: #D8AB48;
  --gold-ink: #8A6413;
  --on-gold: #23180A;
  --granite: #3D4B5C;
  --bg: #F7F5F1;
  --surface: #FFFFFF;
  --surface-alt: #EFECE6;
  --border: #E0DBD2;
  --text: #16202E;
  --muted: #5D6875;
  --ok: #2C7A4B;
  --warn: #9A6B12;
  --focus: #1967D2;
  --picked: rgba(216, 171, 72, .25);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161F;
    --surface: #18212E;
    --surface-alt: #1F2937;
    --border: #2B3644;
    --text: #E7ECF3;
    --muted: #9AA7B6;
    --gold-ink: #E8C273;
    --ok: #6FC79A;
    --warn: #E8C273;
    --focus: #8AB4F8;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Dialog headings take the focus on open (no keyboard popping up over the list); no ring on them. */
h2[tabindex]:focus { outline: none; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; line-height: 1.2; margin: 0 0 .3em; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
p { margin: 0 0 .4em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }
.small, .note { font-size: 14px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.pair { display: flex; gap: 8px; margin: 6px 0; }
.pair > * { flex: 1 1 0; min-width: 0; }

/* Screens fill the phone between the notch and the home bar. */
.screen {
  min-height: 100%;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.brand { padding-top: 8px; }
.slogan { color: var(--gold-ink); margin-bottom: 12px; }
.bottom { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 max(4px, env(safe-area-inset-bottom)); }

/* Buttons: 44 px and more to touch (ux-checklist). */
button {
  font: inherit; color: inherit; min-height: 48px; border-radius: 12px; cursor: pointer;
  padding: 8px 14px; border: 1px solid transparent; background: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button:disabled { opacity: .55; cursor: default; }
.primary { width: 100%; background: var(--gold); color: var(--on-gold); font-weight: 600; }
.outlined { border-color: var(--border); background: var(--surface); color: var(--gold-ink); }
.tonal { background: rgba(255, 255, 255, .92); color: #16202E; border-color: #E0DBD2; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.text { color: var(--gold-ink); padding: 8px 10px; }
.wide { width: 100%; }
.chip { border-color: var(--border); background: var(--surface); }
.chip[aria-checked="true"] { background: var(--picked); border: 2px solid var(--gold); font-weight: 600; }

input[type="search"], input[type="time"] {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; min-height: 48px; padding: 8px 12px; width: 100%;
  font-size: 17px; /* not smaller: iOS zooms into inputs under 16 px */
}
.field { display: block; margin: 8px 0; }

/* City cards and scenario cards. */
.cards { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 10px; }
.card {
  display: block; width: 100%; text-align: left; white-space: normal; min-height: 64px;
  border: 1px solid var(--gold); border-radius: 14px; background: var(--surface); padding: 12px;
}
.card[aria-pressed="true"] { border-width: 3px; padding: 10px; background: var(--picked); }
.card b { display: block; font-family: Georgia, serif; font-size: 18px; }
.card span { display: block; font-size: 14px; color: var(--muted); }
.card .note-gold { color: var(--gold-ink); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.grid .card { min-height: 96px; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li > button, .rows li > label {
  display: block; width: 100%; text-align: left; white-space: normal; border-radius: 0;
  border-bottom: 1px solid var(--border); padding: 8px 4px; min-height: 48px;
}
.rows span { display: block; font-size: 14px; color: var(--muted); }
.rows label { display: flex !important; gap: 10px; align-items: center; cursor: pointer; }
.rows input[type="checkbox"], .check input { width: 22px; height: 22px; flex: none; accent-color: var(--gold); }
.check { display: flex; align-items: center; gap: 10px; min-height: 48px; }

/* Main screen: map over the panel, 45 / 55 as in the APK. */
#main { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0; }
#map-box { position: relative; flex: 45 1 0; min-height: 0; padding-top: env(safe-area-inset-top); background: #f4f1ea; }
#main.map-full #map-box { flex: 1 1 0; }
#main.map-full #panel { display: none; }
#map { position: absolute; inset: env(safe-area-inset-top) 0 0 0; }
.attribution {
  position: absolute; left: 0; bottom: 0; margin: 0; padding: 2px 6px; font-size: 12px;
  background: rgba(255, 255, 255, .85); color: #16202E;
}
#map-full { position: absolute; right: 8px; bottom: 24px; }
#to-route { position: absolute; left: 8px; top: calc(env(safe-area-inset-top) + 8px); }
#panel {
  flex: 55 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 8px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.loading { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--gold);
  animation: spin 1s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.time { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); position: relative; }
.time input { margin-top: 2px; color: var(--text); }
.clear { position: absolute; right: 0; bottom: 0; min-width: 48px; font-size: 22px; color: var(--muted); }

.status { font-family: Georgia, serif; font-size: 19px; font-weight: 700; color: var(--warn); }
.status.ok { color: var(--ok); }
.ride { font-weight: 600; margin-top: 6px; }
.stops { list-style: none; margin: 8px 0 0; padding: 0; }
.stops li { padding: 6px 0; }
.leg { font-size: 14px; color: var(--muted); }
.exit { display: flex; align-items: center; gap: 8px; color: var(--gold-ink); font-weight: 600; }
.stop { display: flex; align-items: center; gap: 10px; }
.stop img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--gold-bright); object-fit: cover; flex: none; }
.stop b { display: block; }
.stop .small { display: block; }
.finish { padding-bottom: 16px; }
.finish .bold { font-weight: 600; }

/* Map markers (RouteMap.kt): gold stops, navy ends, granite metro. */
.mk {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; display: flex;
  align-items: center; justify-content: center; font: 700 14px/1 system-ui, sans-serif; color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.mk-stop { background: #D8AB48; color: #23180A; }
.mk-end { background: #0F1C2E; }
.mk-metro { background: #3D4B5C; width: 22px; height: 22px; font-size: 12px; }
.mk-photo { position: relative; width: 46px; height: 46px; border: 2.5px solid #D8AB48; padding: 0; background: #D8AB48; }
.mk-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.mk-photo i {
  position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; border-radius: 9px;
  background: #D8AB48; color: #23180A; font: 700 11px/18px system-ui, sans-serif; font-style: normal; text-align: center;
}

/* Dialogs: a sheet from the bottom on the phone. */
dialog {
  border: 0; padding: 0; width: 100%; max-width: 560px; max-height: 92%;
  margin: auto auto 0; border-radius: 22px 22px 0 0; background: var(--bg); color: var(--text);
}
dialog::backdrop { background: rgba(15, 28, 46, .45); }
.dialog { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px max(12px, env(safe-area-inset-bottom)); max-height: 92vh; }
.scroll { overflow-y: auto; min-height: 0; flex: 1 1 auto; max-height: 50vh; -webkit-overflow-scrolling: touch; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (min-width: 600px) { dialog { margin: auto; border-radius: 22px; } }
