/* Bunji Ride design system — warm, inclusive, accessible (WCAG 2.2 AA targets:
   ≥4.5:1 text contrast, ≥44px touch targets, visible focus). */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');
:root {
  --ink: #221a33; --muted: #5d5470; --line: #e7e2f0;
  --bg: #f8f6fc; --card: #ffffff;
  --brand: #6d28d9;        /* purple — Bunji base colour */
  --brand-ink: #ffffff;
  --accent: #c2410c;       /* warm clay — energy, country (AA on white) */
  --good: #1c7a4d; --bad: #b3261e; --warn: #8a5a00;
  --radius: 14px; --shadow: 0 2px 12px rgba(60,30,110,.10);
  --font: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--bg); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
a { color: var(--brand); }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
header.app { background: var(--brand); color: var(--brand-ink); padding: 14px 16px; display: flex;
  align-items: center; gap: 12px; }
header.app .logo { font-weight: 800; font-size: 20px; letter-spacing: .5px; }
header.app .tag { font-size: 12px; opacity: .85; }
header.app .spacer { flex: 1; }
header.app .who { font-size: 13px; opacity: .95; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin: 14px 0; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; min-height: 44px; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 3px solid #1a7fb8; outline-offset: 1px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: 12px 16px; min-height: 44px;
  font-weight: 700; background: var(--brand); color: #fff; }
button.alt { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
button.accent { background: var(--accent); }
button.ghost { background: transparent; color: var(--muted); font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.req { background: #fef0e6; color: var(--warn); }
.pill.live { background: #e6f4ee; color: var(--good); }
.pill.done { background: #eef1f4; color: var(--muted); }
.pill.bad { background: #fdeceb; color: var(--bad); }
.big { font-size: 30px; font-weight: 800; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border: 0; }
.banner { padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-weight: 600; }
.banner.err { background: #fdeceb; color: var(--bad); }
.banner.ok { background: #e6f4ee; color: var(--good); }
.hide { display: none !important; }
.list > div { border-bottom: 1px solid var(--line); padding: 12px 0; }
.list > div:last-child { border: 0; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 9; }
.note { font-size: 12px; color: var(--muted); margin-top: 6px; }
/* maps (Leaflet) */
.map { height: 320px; width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin: 8px 0; z-index: 0; }
.map.tall { height: 380px; }
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; }
.pin span { transform: rotate(45deg); color: #fff; font-size: 13px; font-weight: 800; line-height: 1; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.seg { display: flex; gap: 0; border: 1.5px solid var(--brand); border-radius: 10px; overflow: hidden; margin: 8px 0; }
.seg button { flex: 1; border-radius: 0; background: #fff; color: var(--brand); border: 0; }
.seg button.on { background: var(--brand); color: #fff; }
.results { border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; max-height: 160px; overflow: auto; }
.results button { display: block; width: 100%; text-align: left; background: #fff; color: var(--ink); border: 0;
  border-bottom: 1px solid var(--line); border-radius: 0; font-weight: 500; padding: 12px 12px; min-height: 44px; }
.results button:hover { background: var(--bg); }
.chip { display:inline-block; margin: 4px 6px 0 0; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background:#fff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; min-height: 0; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
/* accessibility controls (WCAG 2.2 AA — text size, contrast, language) */
#a11y { position: fixed; right: 8px; bottom: 8px; z-index: 1000; display: flex; gap: 6px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px; box-shadow: var(--shadow); }
#a11y button, #a11y select { min-height: 38px; padding: 6px 10px; border-radius: 999px; font-weight: 700; }
#a11y button { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
#a11y button[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
#a11y select { border: 1px solid var(--line); background: #fff; width: auto; }
/* large-text mode */
body.bigtext { font-size: 19px; }
body.bigtext h1 { font-size: 30px; } body.bigtext h2 { font-size: 25px; } body.bigtext h3 { font-size: 21px; }
body.bigtext input, body.bigtext select, body.bigtext textarea, body.bigtext button { font-size: 18px; min-height: 50px; }
body.bigtext .small, body.bigtext .note, body.bigtext .muted.small { font-size: 16px; }
body.bigtext label { font-size: 17px; }
/* high-contrast mode — stronger text/border contrast, heavier focus ring */
body.contrast { --ink: #000; --muted: #1c1c1c; --line: #555; --bg: #fff; --card: #fff;
  --brand: #4c1d95; --accent: #7c2d12; --good: #0a5a30; --bad: #8a0c08; --warn: #5a3a00; }
body.contrast .card { border-width: 2px; }
body.contrast button { outline: 1px solid rgba(0,0,0,.4); }
body.contrast *:focus-visible { outline: 4px solid #08406b; outline-offset: 2px; }
body.contrast .muted { color: #1c1c1c; }
