/* Otweta web app styles. One narrow column that works at phone width. */
:root {
  --bg: #EDF0EE;
  --surface: #FFFFFF;
  --ink: #142220;
  --muted: #5B6A67;
  --line: #D5DCD9;
  --accent: #F2B705;
  --accent-ink: #1A1500;
  --good: #1E8F4E;
  --warn: #A35F00;
  --danger: #B3261E;
  --land: #E3E9E5;
  --pin: #142220;
  --p1: #2F6FEB;
  --p2: #C2417C;
  --p3: #7A5AD8;
  --p4: #12877F;
  --p5: #D4552A;
  --p6: #6F7F12;
  --on-p: #FFFFFF;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1413;
    --surface: #17211F;
    --ink: #EAF1EE;
    --muted: #93A5A0;
    --line: #2A3835;
    --good: #4CC57F;
    --warn: #E8A33D;
    --danger: #FF8A80;
    --land: #182321;
    --pin: #EAF1EE;
    --p1: #6B9BFF;
    --p2: #E27AAA;
    --p3: #A58CF0;
    --p4: #3FBDB3;
    --p5: #F2845C;
    --p6: #B5C94A;
    --on-p: #0D1413;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.app {
  max-width: 480px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100dvh;
}
#view { display: flex; flex-direction: column; gap: 14px; flex: 1; min-width: 0; }

.top { display: flex; align-items: center; justify-content: space-between; min-height: 34px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: blink 1.8s infinite; }
.live.off i { background: var(--muted); animation: none; }
@keyframes blink { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 7px transparent; } }

.meet h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance; overflow-wrap: anywhere; }
.meet p { margin: 6px 0 0; color: var(--muted); }

/* ---------- map ---------- */
.mapwrap { position: relative; border-radius: 18px; overflow: hidden; height: clamp(300px, 50dvh, 440px); background: var(--land); border: 1px solid var(--line); isolation: isolate; }
.mapwrap.small { height: clamp(220px, 34dvh, 300px); }
#map { position: absolute; inset: 0; background: var(--land); }
.leaflet-container { font-family: var(--font-body); background: var(--land); }
.leaflet-control-attribution { font-size: 10px; }
.nomap { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); z-index: 500; }
.chips { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 500; pointer-events: none; }
.chip { background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / 0.18); font-variant-numeric: tabular-nums; }
.mapbtn { position: absolute; z-index: 500; right: 10px; top: 10px; background: var(--surface); border: 0; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / 0.18); }
.maptag { position: absolute; z-index: 500; left: 10px; bottom: 8px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--surface) 86%, transparent); border-radius: 8px; padding: 2px 8px; pointer-events: none; }
.ended { position: absolute; inset: 0; z-index: 600; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); padding: 16px; }
.ended div { background: var(--surface); border-radius: 16px; padding: 16px 20px; text-align: center; box-shadow: 0 6px 24px rgb(0 0 0 / 0.2); max-width: 300px; }
.ended strong { display: block; font-family: var(--font-display); font-size: 22px; }
.ended span { color: var(--muted); }

/* map markers */
.otw-icon { background: none; border: 0; }
.dot { position: relative; width: 36px; height: 36px; transform: translate(var(--ox, 0px), var(--oy, 0px)); transition: transform 0.7s ease; cursor: pointer; }
.dot .halo { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--c); opacity: 0.35; animation: pulse 2.4s ease-out infinite; }
.dot.arrived .halo, .dot.stale .halo { animation: none; opacity: 0; }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.4; } 100% { transform: scale(2.4); opacity: 0; } }
.dot .ring { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 2.5px solid transparent; }
.dot.arrived .ring { border-color: var(--good); }
.dot.stale .ring { border-color: var(--warn); border-style: dashed; }
.dot.sel .ring { border-color: var(--ink); border-style: solid; }
.dot .body { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--surface); display: grid; place-items: center; font: 700 11px var(--font-body); color: var(--on-p); }
.dot.you .body { color: var(--accent-ink); }
.dot.stale .body { opacity: 0.6; }
.dot .chk { position: absolute; right: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 1.5px var(--surface); display: none; place-items: center; }
.dot.arrived .chk { display: grid; }
.dot .nm { position: absolute; left: 50%; top: 100%; margin-top: -4px; transform: translateX(-50%); white-space: nowrap; font: 600 11px var(--font-body); color: var(--ink); text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface), 0 0 3px var(--surface); }
.dot.arrived:not(.sel) .nm { display: none; }
.pin { position: absolute; left: -14px; top: -40px; width: 28px; height: 40px; pointer-events: none; }
.pin svg { display: block; }
.pinlab { position: absolute; left: 32px; top: 2px; white-space: nowrap; font: 700 12px var(--font-body); color: var(--ink); text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface), 0 0 3px var(--surface); }

/* ---------- summary and list ---------- */
.summary { margin: 0; font-size: 14px; color: var(--muted); min-height: 1.4em; }
.summary b { color: var(--ink); font-weight: 600; }
.summary .w { color: var(--warn); font-weight: 600; }
.people { list-style: none; margin: 0; padding: 0; }
.people li + li { border-top: 1px solid var(--line); }
.row { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 6px; margin: 0; background: transparent; border: 0; border-radius: 12px; text-align: left; }
.row.sel { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--font-body); color: var(--on-p); background: var(--c); }
.av.you { color: var(--accent-ink); }
.who { min-width: 0; display: flex; flex-direction: column; }
.who .n { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.tag { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.who .s { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.who .s.w { color: var(--warn); }
.eta { font-family: var(--font-mono); font-weight: 500; font-size: 22px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eta small { font-size: 12px; color: var(--muted); margin-left: 3px; font-family: var(--font-body); }
.eta.here { color: var(--good); font-family: var(--font-body); font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; gap: 5px; }
.eta.old, .eta.none { color: var(--muted); }

/* ---------- forms and buttons ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .lab { font-weight: 600; font-size: 14px; }
.opt { font-weight: 400; color: var(--muted); margin-left: 4px; }
.field input[type="text"], .joinform input[type="text"] { height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding-inline: 14px; font-size: 16px; width: 100%; }
.search { position: relative; }
.sugg { list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; left: 0; right: 0; z-index: 1000; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); max-height: 260px; overflow-y: auto; }
.sugg button { width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; display: flex; flex-direction: column; }
.sugg button:hover, .sugg button:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.sugg small { color: var(--muted); font-size: 13px; }
.destchip { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; font-weight: 600; }
.destchip span { min-width: 0; overflow-wrap: anywhere; }
.destchip button { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ink) 9%, transparent); font-size: 18px; line-height: 1; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.err { margin: 0; color: var(--danger); font-size: 14px; font-weight: 500; }
.fine { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 14px; font-weight: 600; font-size: 14px; min-height: 40px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.primary { width: 100%; background: var(--accent); color: var(--accent-ink); border-color: transparent; min-height: 52px; border-radius: 14px; font-size: 16px; }
.btn.big { min-height: 78px; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 -3px 0 rgb(0 0 0 / 0.12); }
.btn.big strong { font-family: var(--font-display); font-weight: 800; font-size: 25px; letter-spacing: -0.025em; }
.btn.big span { font-size: 13px; font-weight: 500; opacity: 0.78; }
.btn.danger { color: var(--danger); }
.link { background: none; border: 0; padding: 0; text-decoration: underline; font-weight: 600; font-size: inherit; color: var(--muted); }

.foot { text-align: center; color: var(--muted); font-size: 13px; margin: 0; padding-bottom: 4px; }

.bar { position: sticky; bottom: 0; margin-inline: -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--bg) 78%, transparent); display: flex; flex-direction: column; gap: 8px; z-index: 700; }
.bar .note { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.sharing { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 14px; flex-wrap: wrap; }
.sharing > div { min-width: 0; }
.sharing b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.sharing span { font-size: 13px; color: var(--muted); }
.sharing span.w { color: var(--warn); }
.sharing .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.row2 { display: flex; gap: 8px; }
.row2 .btn { flex: 1; }
.joinform { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.joinform label { font-weight: 600; font-size: 14px; }
.joinform .fine { text-align: left; }
.joinform .acts { display: flex; gap: 8px; }
.joinform .acts .primary { flex: 1; width: auto; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100vw - 32px); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 2000; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .dot .halo, .live i { animation: none; }
  .dot { transition: none; }
}

.extend { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.extend span { font-size: 13px; color: var(--muted); margin-right: auto; }
.extend .btn { padding: 8px 14px; min-height: 0; }

.fine.allow { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }

.meetactions { font-size: 14px; }
.meetactions:empty { display: none; }
.meet .meetactions a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.meet h1 a.destlink { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.changebox { display: grid; gap: 8px; margin-top: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.changebox .fine { margin: 0; }
.changebox input { width: 100%; }
.changebox .destchip { background: var(--bg); }
.changebox input[type="text"] { height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding-inline: 14px; font-size: 16px; width: 100%; }

#mTitle { font-size: 21px; line-height: 1.15; letter-spacing: -0.015em; }
.meet #mSub { margin-top: 2px; font-size: 14px; }
