*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg:       #111827;
  --surface:  #1F2937;
  --border:   #374151;
  --text:     #F9FAFB;
  --muted:    #9CA3AF;
  --green:    #10B981;
  --red:      #EF4444;
  --amber:    #F59E0B;
  --blue:     #60A5FA;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior: none;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
}
header .icon { font-size: 28px; }
header h1   { font-size: 22px; font-weight: 700; flex: 1; }
#clock       { font-size: 18px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

/* ── Screens ── */
.screen { display: flex; flex-direction: column; gap: 14px; }
.hidden { display: none !important; }

/* ── Buttons ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: opacity .15s, transform .1s;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active         { opacity: .82; transform: scale(.97); }
.btn:disabled       { opacity: .4; cursor: not-allowed; }
.btn-primary        { background: var(--green); color: #fff; }
.btn-danger         { background: var(--red);   color: #fff; }
.btn-large          { padding: 22px 20px; font-size: 20px; border-radius: 18px; }
.btn-link           { background: none; border: none; color: var(--blue); font-size: 14px; cursor: pointer; padding: 4px 8px; }

/* ── Setup screen ── */
.setup-card h2  { font-size: 20px; margin-bottom: 8px; }
.setup-card p   { color: var(--muted); margin-bottom: 20px; font-size: 15px; }

/* ── Home card ── */
.home-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.home-info .label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.home-info .value { font-size: 16px; font-weight: 600; }

/* ── Metro hours card ── */
.metro-card h3    { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.schedule-grid    { display: grid; grid-template-columns: 1fr auto; gap: 5px 20px; font-size: 14px; }
.schedule-grid .val { color: var(--green); font-weight: 600; text-align: right; }
.night-buses      { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.night-buses strong { color: var(--text); }

/* ── Status card ── */
.status-card      { text-align: center; padding: 28px 20px; transition: background .3s, border-color .3s; }
.status-card.alert-mode { border-color: var(--amber); background: rgba(245,158,11,.08); }
.status-icon      { font-size: 44px; margin-bottom: 12px; }
.status-text      { font-size: 18px; font-weight: 600; }
.status-sub       { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ── Stops list ── */
.stops-list { display: flex; flex-direction: column; gap: 10px; }
/* ── Metro watch card ── */
.metro-watch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
}
.last-train-badge {
  font-size: 13px;
  background: rgba(16,185,129,.15);
  color: var(--green);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.station-row {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.station-row.nearest  { }
.station-row.urgent   { }
.station-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.station-name { font-weight: 600; font-size: 15px; }
.station-line { font-size: 12px; color: var(--muted); }
.station-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.station-walk  { font-size: 13px; color: var(--muted); }
.station-leave { font-size: 13px; color: var(--text); }
.leave-urgent  { color: var(--amber); font-weight: 700; }

/* ── Night buses card ── */
.night-buses-card     { padding: 14px 18px; }
.night-buses-title    { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.night-buses-list     { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.night-buses-note     { font-size: 12px; color: var(--muted); }

/* ── Alert overlay ── */
.alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.alert-box {
  background: var(--surface);
  border: 2px solid var(--amber);
  border-radius: 22px;
  padding: 32px 24px;
  text-align: center;
  max-width: 340px;
  width: 100%;
}
.alert-emoji { font-size: 60px; margin-bottom: 14px; display: block; }
.alert-box h2 { font-size: 24px; margin-bottom: 10px; }
.alert-box p  { color: var(--muted); margin-bottom: 26px; line-height: 1.65; font-size: 15px; }
