/* imhere.to — the screens from the "You Are There screens" mocks
   (https://claude.ai/artifact/E6MtQzZaVCK3QLX7357J7K), lifted out of inline styles. */

:root {
    --ink: #0f172a;
    --muted: #475569;
    --muted-2: #64748b;
    --ground: #ECEFE8;          /* map background */
    --screen: #f1f5f4;          /* behind the cards */
    --line: #e2e8f0;
    --field: #f8fafc;
    --handle: #cbd5e1;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --accent-soft: #e6f2f0;
    --accent-ring: rgba(15, 118, 110, 0.14);
    --me: #e11d48;
    --me-glow: rgba(225, 29, 72, 0.16);
    --amber: #b45309;
    --amber-soft: #fef3c7;
    --amber-line: #fcd34d;
    --amber-text: #92400e;
    --shadow-pin: 0 1px 6px rgba(15, 23, 42, 0.22);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --sheet-h: 0px;             /* set from JS so the toast sits above the sheet */
}

*, *::before, *::after { box-sizing: border-box; }

@keyframes wSweep { 0% { transform: translateY(0) } 100% { transform: translateY(58px) } }

html, body { height: 100%; }
body {
    margin: 0; background: var(--screen); color: var(--ink); overflow: hidden;
    font-family: Figtree, system-ui, sans-serif; font-size: 15px; line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
input::placeholder { color: #94a3b8; }
[hidden] { display: none !important; }

/* phone-width column; full-bleed on a phone */
.app {
    position: relative;
    width: 100%;
    max-width: 412px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    overflow: hidden;
    background: var(--ground);
}

/* ── map ── */
.map { position: absolute; inset: 0; background: var(--ground); }
.maplibregl-ctrl-attrib { font-family: inherit; font-size: 10px; border-radius: 999px; }
.maplibregl-ctrl-top-left { top: calc(60px + var(--safe-top)); }
.map.is-picking { cursor: crosshair; }

/* pins: a white name chip over a dot; the dot sits on the location.
   Pins that share a spot keep their dots there and stack their chips in a column
   (map.js sets the chip's transform and .is-stacked). */
.pin { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pin-label {
    background: #ffffff; border-radius: 8px; padding: 3px 9px;
    font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-pin);
    transition: transform 180ms ease;
}
.map.is-zooming .pin-label { transition: none; }
.pin-dot {
    width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
    border: 3px solid #ffffff; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
}
.pin-me .pin-label { font-weight: 700; outline: 2px solid var(--me); }
.pin-me .pin-dot {
    width: 24px; height: 24px; background: var(--me);
    box-shadow: 0 0 0 8px var(--me-glow), 0 1px 4px rgba(15, 23, 42, 0.35);
}
.pin-meet { gap: 0; }
.pin-meet .pin-label { background: var(--amber); color: #ffffff; font-weight: 700; box-shadow: 0 1px 6px rgba(15, 23, 42, 0.3); }
.pin-tail {
    width: 0; height: 0;
    border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 12px solid var(--amber);
    transition: opacity 120ms ease;
}
.pin-meet.is-stacked .pin-tail { opacity: 0; }

/* ── chips over the map ── */
.chips {
    position: absolute; left: 16px; right: 16px; top: calc(16px + var(--safe-top)); z-index: 60;
    display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none;
}
.chip {
    display: flex; align-items: center; gap: 8px; background: #ffffff; border-radius: 999px;
    padding: 9px 16px; font-weight: 600; font-size: 15px; box-shadow: 0 2px 12px rgba(15, 23, 42, 0.16);
}
.chip-time { font-variant-numeric: tabular-nums; }

/* ── buttons ── */
.btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 0; padding: 10px 8px; min-height: 44px; border-radius: 12px; border: 1px solid transparent;
    font-size: 14px; font-weight: 600; transition: background 140ms ease, transform 140ms ease;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-primary {
    width: 100%; gap: 10px; padding: 15px; min-height: 52px; border: 0; border-radius: 14px;
    font-size: 17px; background: var(--accent); color: #ffffff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-plain { background: var(--field); border-color: var(--line); color: var(--ink); }
.btn-plain:hover { background: #f1f5f9; }
.btn-plain[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-icon { padding: 0; }
.btn-amber { background: var(--amber-soft); color: var(--amber-text); border: 0; }
.btn-amber:hover { background: #fde68a; }
.btn-amber-outline { border: 1px solid var(--amber-line); }
.btn-meet {
    justify-content: flex-start; text-align: left; padding: 11px 14px; font-size: 15px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}

/* ── bottom sheet ── */
.sheet {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 70;
    background: #ffffff; border-radius: 24px 24px 0 0;
    padding: 10px 20px calc(28px + var(--safe-bottom));
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.14);
    display: flex; flex-direction: column; gap: 14px;
}
.grabber { align-self: center; width: 40px; height: 5px; border-radius: 999px; background: var(--handle); }
.field { display: flex; align-items: center; gap: 12px; }
.field-label { flex: none; width: 78px; font-size: 14px; color: var(--muted); }
.field-value { flex: none; width: 56px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.input {
    flex: 1; min-width: 0; font-size: 16px; padding: 12px 14px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--field); color: var(--ink); outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.input:focus { border: 2px solid var(--accent); padding: 11px 13px; background: #ffffff; box-shadow: 0 0 0 4px var(--accent-ring); }
input[type="range"] { flex: 1; min-width: 0; height: 28px; margin: 0; accent-color: var(--accent); }
.meet-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 44px; gap: 8px; }
.meet-row .btn { padding-left: 6px; padding-right: 6px; white-space: nowrap; }
.sheet-note { font-size: 13px; color: var(--muted-2); text-align: center; }

/* ── full-screen cards ── */
.card-screen {
    position: absolute; inset: 0; z-index: 90; background: var(--screen);
    display: flex; align-items: center; justify-content: center;
    padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
    overflow-y: auto;
}
.card {
    width: 100%; background: #ffffff; border-radius: 24px; padding: 32px 24px 24px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.10);
    display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.card h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.card p { font-size: 16px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.card ol {
    margin: 0; padding-left: 22px; align-self: stretch; text-align: left;
    display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; color: var(--ink);
}
.card .btn-primary { margin-top: 8px; }
.badge {
    width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent);
}
.badge-amber { background: var(--amber-soft); color: var(--amber); }

/* settings, folded away under the first screen's button */
.settings { align-self: stretch; margin-top: 4px; text-align: left; }
.settings summary {
    list-style: none; cursor: pointer; text-align: center;
    font-size: 14px; font-weight: 600; color: var(--muted-2); padding: 6px;
}
.settings summary::-webkit-details-marker { display: none; }
.settings[open] summary { color: var(--accent); }
.setting {
    display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
    margin-top: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--field);
}
.setting input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.setting-text { display: flex; flex-direction: column; gap: 2px; }
.setting-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.setting-note { font-size: 13px; line-height: 1.4; color: var(--muted-2); }

/* ── in-between states ── */
.scrim { position: absolute; inset: 0; z-index: 95; background: rgba(15, 23, 42, 0.32); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

.locating {
    position: absolute; inset: 0; z-index: 95;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
    background: rgba(241, 245, 244, 0.94);
}
.sweep { position: relative; width: 108px; height: 58px; overflow: hidden; }
.sweep-line { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); animation: wSweep 1.7s ease-in-out infinite alternate; }
.locating-label { font-size: 15px; font-weight: 600; color: var(--muted); }

.toast {
    position: absolute; left: 50%; bottom: calc(var(--sheet-h) + 16px + var(--safe-bottom)); z-index: 99;
    transform: translateX(-50%); max-width: calc(100% - 32px);
    display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
    background: var(--ink); color: #ffffff; font-size: 14px; font-weight: 500; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.3);
}
.toast-check { flex: none; }
.toast:not(.toast-ok) .toast-check { display: none; }
