:root { --red: #d81f26; --black: #0b0b0b; --ink: #17181a; --line: #e3e4e6; --mute: #6b6f76; --bg: #f5f5f6; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body { font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
#app { height: 100dvh; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* top bar */
.top { background: var(--black); color: #fff; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 10px) 14px 10px; }
.top .mark { font-weight: 800; letter-spacing: .5px; }
.top .mark b { color: var(--red); }
.top .who { margin-left: auto; font-size: 13px; opacity: .8; }
.top button { background: none; border: 1px solid #444; color: #fff; border-radius: 8px; padding: 5px 10px; font-size: 13px; }

/* tabs */
.tabs { display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; border: 0; background: none; padding: 12px 4px; font-weight: 600; color: var(--mute); border-top: 3px solid transparent; }
.tabs button.on { color: var(--red); border-top-color: var(--red); }

.view { flex: 1; min-height: 0; position: relative; }
.page { height: 100%; overflow-y: auto; padding: 16px; max-width: 640px; margin: 0 auto; }
#map { position: absolute; inset: 0; background: #dfe3e6; }

/* map chrome */
.fab { position: absolute; right: 12px; bottom: 18px; z-index: 500; width: 52px; height: 52px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.3); font-size: 22px; }
.hint { position: absolute; left: 50%; top: 104px; max-width: 92%; white-space: normal; text-align: center; transform: translateX(-50%); z-index: 500; background: rgba(11,11,11,.85); color: #fff; padding: 6px 12px; border-radius: 16px; font-size: 13px; pointer-events: none; }
.legend { position: absolute; left: 10px; bottom: 18px; z-index: 500; background: rgba(255,255,255,.95); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.legend div { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.legend .lb { display: block; margin: 4px 0 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); flex: none; }
.star { color: var(--red); font-size: 26px; line-height: 1; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 1px 3px rgba(0,0,0,.6); }
.me { width: 16px; height: 16px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(26,115,232,.35); }

/* bottom sheet */
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.35); z-index: 900; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 901; background: #fff; border-radius: 16px 16px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 88%; overflow-y: auto; box-shadow: 0 -4px 20px rgba(0,0,0,.25); }
.sheet h2 { margin: 0 0 2px; font-size: 18px; }
.sheet .sub { color: var(--mute); font-size: 13px; margin-bottom: 10px; }
.sheet .x { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 26px; color: var(--mute); padding: 4px 10px; }
.dispos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.dispos button { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 8px; font-weight: 700; display: flex; align-items: center; gap: 8px; justify-content: center; }
.dispos button.on { border-color: var(--ink); background: #f0f0f1; }
.hist { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; font-size: 13px; }
.hist div { padding: 4px 0; display: flex; gap: 8px; align-items: baseline; }
.hist .when { color: var(--mute); margin-left: auto; white-space: nowrap; }

/* forms */
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid #c9cbcf; border-radius: 10px; background: #fff; }
textarea { min-height: 64px; resize: vertical; }
.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px; font-weight: 800; background: var(--red); color: #fff; margin-top: 14px; }
.btn:disabled { opacity: .5; }
.btn.alt { background: var(--ink); }
.btn.sm { display: inline-block; width: auto; padding: 8px 12px; font-size: 13px; margin: 0; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #c9cbcf; }
.msg { margin-top: 10px; font-size: 14px; min-height: 1.2em; }
.msg.bad { color: var(--red); }
.msg.good { color: #177a36; }

/* cards / tables */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.chips { display: flex; gap: 8px; margin-bottom: 12px; }
.chips button { border: 1px solid #c9cbcf; background: #fff; border-radius: 18px; padding: 7px 14px; font-weight: 600; }
.chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
table { width: 100%; border-collapse: collapse; }
th { text-align: right; font-size: 12px; color: var(--mute); font-weight: 600; padding: 4px 6px; }
th:first-child, td:first-child { text-align: left; }
td { padding: 9px 6px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { font-weight: 800; }
.row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row small { color: var(--mute); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: #eee; }
.linkbox { font-size: 12px; word-break: break-all; background: #f3f3f4; border-radius: 8px; padding: 8px; margin-top: 8px; user-select: all; }

/* login */
.login { max-width: 380px; margin: 0 auto; padding: 40px 20px; }
.login .logo { background: var(--black); color: #fff; border-radius: 18px; padding: 22px; text-align: center; margin-bottom: 18px; }
.login .logo .big { font-size: 34px; font-weight: 900; letter-spacing: 1px; }
.login .logo .big b { color: var(--red); }
.login .logo small { opacity: .75; }
.ver { text-align: center; color: var(--mute); font-size: 12px; margin-top: 18px; }

/* yard signs */
.mode { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 500; display: flex; background: #fff; border-radius: 22px; padding: 3px; box-shadow: 0 1px 6px rgba(0,0,0,.3); }
.mode button { border: 0; background: none; border-radius: 19px; padding: 8px 16px; font-weight: 700; font-size: 14px; color: var(--mute); white-space: nowrap; }
.mode button.on { background: var(--ink); color: #fff; }
.place { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 500; border: 0; border-radius: 26px; padding: 15px 20px; font-weight: 800; background: var(--red); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); white-space: nowrap; }
.sg { width: 22px; height: 15px; background: var(--red); border: 2px solid #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.45); position: relative; }
.sg::after { content: ''; position: absolute; left: 50%; top: 100%; width: 2px; height: 8px; margin: 3px 0 0 -1px; background: #222; }
.sg.miss { background: #fff; border: 2px dashed var(--red); }
.sg.sm { display: inline-block; width: 14px; height: 10px; flex: none; }
.sg.sm::after { display: none; }
.sheet .btn.ghost { margin-top: 8px; }
.preview { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin-top: 8px; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; display: block; flex: none; }
.hist div { align-items: center; }
th, td { font-size: 14px; }

/* map filters and zoom */
.chipbar { position: absolute; left: 0; right: 0; top: 58px; z-index: 500; display: flex; gap: 6px; padding: 0 10px 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chipbar::-webkit-scrollbar { display: none; }
.chipbar button { flex: none; border: 1px solid #c9cbcf; background: #fff; border-radius: 16px; padding: 7px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.2); white-space: nowrap; }
.chipbar button.on { background: var(--red); border-color: var(--red); color: #fff; }
.chipbar button.clear { background: var(--ink); border-color: var(--ink); color: #fff; }
.zoom { position: absolute; right: 12px; bottom: 82px; z-index: 500; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.zoom button { width: 52px; height: 46px; border: 0; background: #fff; font-size: 26px; line-height: 1; }
.zoom button + button { border-top: 1px solid var(--line); }
.dot.ring { background: #fff; border-width: 3px; border-style: solid; box-shadow: none; }
