:root {
  --bg: #f5f6f2;
  --surface: #ffffff;
  --text: #1c2321;
  --muted: #5d6764;
  --line: #dfe3dd;
  --accent: #0d7a5f;
  --accent-ink: #ffffff;
  --accent-soft: #e2f2ec;
  --warn: #b4532a;
  --warn-soft: #fbeee6;
  --danger: #b42318;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615;
    --surface: #1b211f;
    --text: #e8ece9;
    --muted: #9aa5a1;
    --line: #2d3532;
    --accent: #3fbf96;
    --accent-ink: #0b1411;
    --accent-soft: #173229;
    --warn: #f0a37c;
    --warn-soft: #3a2519;
    --danger: #ff8a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

a { color: var(--accent); }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { font-weight: 800; font-size: 18px; text-decoration: none; color: var(--text); }
.brand span { font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 8px; }
.top nav { display: flex; gap: 16px; }
.top nav a { text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand { white-space: nowrap; }
@media (max-width: 420px) {
  .brand span { display: none; }
  .top nav { gap: 12px; flex-wrap: wrap; justify-content: flex-end; font-size: 15px; }
}

main { max-width: 720px; margin: 0 auto; padding: 16px; }
footer { max-width: 720px; margin: 24px auto 0; padding: 16px; color: var(--muted); font-size: 13px; }

h1 { font-size: 24px; line-height: 1.3; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.card h2 { margin-top: 0; }

.hero { padding: 16px 0 8px; }
.hero h1 { font-size: 28px; }
.hero p { color: var(--muted); margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }

.field { display: block; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
label, legend { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }

.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin: 12px 0; }
.check input { width: auto; margin-top: 4px; }
.weekdays { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.weekdays label { display: flex; align-items: center; gap: 4px; font-weight: 500; margin: 0;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
.weekdays input { width: auto; }
.rating { display: flex; gap: 16px; }
.rating label { display: flex; gap: 6px; align-items: center; font-weight: 500; }
.rating input { width: auto; }

button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
form > button[type=submit]:last-child, .search button { width: 100%; }
button.secondary { background: var(--accent-soft); color: var(--accent); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.link { background: none; color: var(--accent); padding: 8px 0; font-weight: 500; width: auto; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline .field { flex: 1; margin: 0; min-width: 160px; }
.inline button { width: auto; }

.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.empty { color: var(--muted); }

.flash { padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; }
.flash.ok { background: var(--accent-soft); color: var(--accent); }
.flash.err { background: var(--warn-soft); color: var(--warn); }
.flash.dev { background: var(--warn-soft); color: var(--warn); }

.place-picker { position: relative; }
.suggestions {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 10;
  list-style: none; margin: 4px 0 0; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
  max-height: 280px; overflow-y: auto;
}
.suggestions li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.suggestions li.active, .suggestions li:hover { background: var(--accent-soft); }
.suggestions b { display: block; font-weight: 600; }
.suggestions small { color: var(--muted); }

.list { display: grid; gap: 0; }
a.card.trip { display: block; color: inherit; text-decoration: none; }
a.card.trip:hover { border-color: var(--accent); }
.trip.dim { opacity: 0.6; }
.when { font-weight: 700; color: var(--accent); }
.when.big { font-size: 18px; }
.route { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 17px; font-weight: 600; margin: 4px 0; }
.route.big { font-size: 21px; }
.arrow { color: var(--muted); }
.walk { color: var(--muted); font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 14px; margin-top: 6px; }
.price { color: var(--text); font-weight: 800; font-size: 17px; }
.price small { font-weight: 500; color: var(--muted); }
.badge { background: var(--warn-soft); color: var(--warn); padding: 0 8px; border-radius: 999px; font-weight: 600; }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.muted { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.singpass-box { background: var(--bg); border-radius: 10px; padding: 12px; margin-top: 12px; }
.singpass-box p { margin-top: 0; }
.singpass-button { display: inline-block; line-height: 0; border-radius: 6px; }
.singpass-button img { display: block; height: 48px; width: auto; }
.check.vehicle { padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; }
.check.vehicle.dim { opacity: 0.55; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.exact { background: var(--accent-soft); border-radius: 10px; padding: 4px 12px; }

.requests { list-style: none; padding: 0; margin: 0; }
.requests > li { padding: 12px 0; border-top: 1px solid var(--line); }
.requests > li.card { border: 1px solid var(--line); padding: 16px; }
.requests > li:first-child { border-top: 0; }
.msg { color: var(--muted); margin: 4px 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.actions form button { width: auto; }

.ad {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 14px;
}
.ad a { font-weight: 600; }
.ad-label { font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-right: 8px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { margin: 0; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.warn { border-color: var(--warn); }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
table.users th, table.users td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.users input { width: 120px; padding: 6px 8px; }

.prose ul { padding-left: 20px; }
details.rules { background: var(--bg); border-radius: 10px; padding: 8px 12px; margin: 12px 0; }
details.rules summary { font-weight: 700; cursor: pointer; }
details.rules ul { padding-left: 20px; margin: 8px 0; }
