:root {
  --navy: #12324f;
  --blue: #1f6feb;
  --orange: #e8710a;
  --red: #c62828;
  --bg: #ffffff;
  --muted: #5b6876;
  --line: #dde3ea;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #18212b; }
#map { position: absolute; inset: 0; background: #e9eef2; }
button svg { width: 24px; height: 24px; fill: currentColor; stroke: currentColor; }
button { font: inherit; color: inherit; }

.card { background: var(--bg); border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.18); }

#info {
  position: absolute; z-index: 1000; left: 10px; right: 10px; top: calc(10px + var(--safe-t));
  padding: 10px 14px; pointer-events: none;
}
#info-main { font-size: 22px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
#info-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.35; }
#info .side-L { color: #1b7f3b; } #info .side-R { color: #9c3b00; }

#side-buttons { position: absolute; z-index: 1000; right: 10px; bottom: calc(92px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.round { width: 50px; height: 50px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25); display: grid; place-items: center; color: var(--navy); }
.round.on { background: var(--blue); color: #fff; }

#bar {
  position: absolute; z-index: 1000; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: flex-end;
  background: #fff; box-shadow: 0 -2px 10px rgba(0,0,0,.15); padding: 6px 4px calc(6px + var(--safe-b));
}
#bar button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--navy); padding: 4px 0; }
#bar button.primary span { font-weight: 700; color: var(--orange); }
#bar button.primary svg { width: 52px; height: 52px; padding: 13px; margin-top: -26px; border-radius: 50%; background: var(--orange); color: #fff; stroke: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.3); }

#crosshair { position: absolute; z-index: 900; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: var(--red); }
#crosshair::before { left: 21px; top: 0; width: 2px; height: 44px; }
#crosshair::after { top: 21px; left: 0; height: 2px; width: 44px; }

#backdrop { position: fixed; inset: 0; z-index: 1500; background: rgba(0,0,0,.3); }
.sheet {
  position: fixed; z-index: 1600; left: 0; right: 0; bottom: 0; max-height: 78vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.25); padding-bottom: var(--safe-b);
}
.sheet.tall { max-height: 92vh; }
.sheet.peek { max-height: 48vh; }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 6px; border-bottom: 1px solid var(--line); }
.sheet h2 { margin: 0; font-size: 18px; color: var(--navy); }
.sheet .close { border: 0; background: none; font-size: 30px; line-height: 1; padding: 0 6px; color: var(--muted); }
.sheet .body { overflow-y: auto; padding: 12px 16px 18px; -webkit-overflow-scrolling: touch; }

.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--line); background: #f5f7fa; border-radius: 12px; padding: 12px 14px; font-size: 15.5px; font-weight: 600; color: var(--navy); cursor: pointer; text-align: center; }
.btn small { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary small { color: #c9d6e3; }
.btn.danger { color: var(--red); border-color: #f0c9c9; background: #fff6f6; }
.btn.block { display: flex; width: 100%; margin: 8px 0; }
.row { display: flex; gap: 10px; margin-top: 14px; }
.row .btn { flex: 1; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.45; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.field { display: block; font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }
.field small { font-size: 12px; }
.field input, .field textarea { display: block; width: 100%; margin-top: 5px; font: inherit; font-size: 16px; color: #18212b; padding: 10px 12px; border: 1px solid #c8d1db; border-radius: 10px; background: #fff; }
.field textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; font-size: 15px; }
.check input { width: 20px; height: 20px; }

.seg { display: flex; background: #eef2f6; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 8px 6px; font-size: 14px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--navy); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.12); }

.posbox { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #f3f7fb; font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.posbox b { color: var(--navy); font-size: 17px; }
.posbox .warn { color: var(--red); }

.photo-btns { display: flex; gap: 10px; margin-top: 14px; }
.photo-btns .btn { flex: 1; font-size: 14.5px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs .t { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; background: #ddd; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .t button { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 1; }

.list { list-style: none; margin: 10px 0 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.list li .num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.list li .txt { flex: 1; min-width: 0; }
.list li .t1 { font-weight: 600; color: var(--navy); }
.list li .t2 { font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.list li .t3 { font-size: 13.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li .act { flex: none; border: 0; background: none; color: var(--red); font-size: 13.5px; padding: 4px; }
.list.radio li { align-items: center; cursor: pointer; }
.list.radio li .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #9aa7b4; flex: none; }
.list.radio li.on .dot { border: 6px solid var(--blue); }
.list.radio li.disabled { opacity: .45; }
.empty { color: var(--muted); font-size: 14px; padding: 16px 0; text-align: center; }

#dialog { position: fixed; z-index: 2100; left: 20px; right: 20px; top: 32%; padding: 18px; }
#dialog p { margin: 0; font-size: 16px; line-height: 1.45; }
#toast { position: fixed; z-index: 2200; left: 50%; transform: translateX(-50%); bottom: calc(100px + var(--safe-b)); background: rgba(20,30,40,.92); color: #fff; padding: 10px 16px; border-radius: 22px; font-size: 14px; max-width: 90vw; text-align: center; }

/* Χάρτης */
.pt-icon { background: var(--orange); color: #fff; border: 2px solid #fff; border-radius: 50%; font-weight: 700; font-size: 12px; display: grid; place-items: center; box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.ch-label { background: rgba(255,255,255,.88); border: 1px solid #12324f; border-radius: 4px; padding: 0 4px; font-size: 11px; font-weight: 700; color: #12324f; white-space: nowrap; }
.leaflet-popup-content { margin: 10px 12px; font-size: 14px; line-height: 1.4; }
.pop h3 { margin: 0 0 4px; font-size: 15px; color: var(--navy); }
.pop .m { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pop .n { margin-top: 6px; white-space: pre-wrap; }
.pop .ph { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.pop .ph img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.pop .b { display: flex; gap: 8px; margin-top: 8px; }
.pop .b button { flex: 1; border: 1px solid var(--line); background: #f5f7fa; border-radius: 8px; padding: 7px; font-size: 13.5px; font-weight: 600; color: var(--navy); }
.pop .b button.del { color: var(--red); }
#viewer { position: fixed; inset: 0; z-index: 2300; background: #000; display: grid; place-items: center; }
#viewer img { max-width: 100%; max-height: 100%; }
#viewer button { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 26px; }
