:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1b2232;
  --muted: #6a7487;
  --line: #e3e8f0;
  --accent: #1d63f0;
  --hot: #ef3b4f;
  --hot2: #ff7a3d;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(20, 32, 64, .13), 0 1px 3px rgba(20, 32, 64, .08);
  --head: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- header ---------- */
header#top {
  position: fixed; inset: 0 0 auto 0; height: var(--head); z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub a { font-weight: 600; }

.search-wrap { position: relative; flex: 1 1 220px; max-width: 480px; min-width: 140px; margin: 0 auto; }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
#search {
  width: 100%; height: 40px; padding: 0 14px 0 36px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font: inherit; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 99, 240, .15); }
.search-list { position: absolute; top: 46px; left: 0; right: 0; background: #fff; border-radius: 12px; box-shadow: var(--shadow); display: none; overflow: hidden; z-index: 30; }
.search-list.open { display: block; }
.search-item { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; }
.search-item:hover { background: #f1f5fd; }
.search-item span { color: var(--muted); font-size: 12px; }

.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.seg { display: flex; background: #eef2f8; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 600; line-height: 1.2; color: var(--muted); }
.seg button.active { background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(29, 99, 240, .35); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none !important; }
.btn svg { width: 17px; height: 17px; flex: none; display: block; }
.btn .lbl, .btn .count { display: block; line-height: 1; margin: 0; font-weight: 600; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: #c8d1df; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #1554d4; }
.btn.hot { background: linear-gradient(135deg, var(--hot2), var(--hot)); color: #fff; box-shadow: 0 4px 14px rgba(239, 59, 79, .35); }
.btn.hot:hover { filter: brightness(1.05); }
.btn.small { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn.lang { font-size: 12px; letter-spacing: .04em; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 600; }

.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; top: 46px; width: 420px; max-width: 90vw; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 14px; display: none; z-index: 30; }
.pop.open { display: block; }
.filters-foot { margin-top: 10px; text-align: right; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: #eef2f8; border: 1px solid transparent; font-size: 12.5px; }
.chip.toggle.on { background: #e5edff; border-color: var(--accent); color: #123fa3; }

/* ---------- map ---------- */
#map { position: fixed; top: var(--head); left: 0; right: 0; bottom: 0; background: radial-gradient(ellipse at 50% 45%, #13275a 0%, #0a1634 45%, #050b1d 100%); }
body.picking #map .maplibregl-canvas { cursor: crosshair; }
.maplibregl-ctrl-attrib { font-size: 10.5px; }

/* ---------- cards ---------- */
.card { position: fixed; z-index: 10; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.card-title { font-weight: 700; font-size: 14.5px; }
.card-title .unit { font-weight: 500; color: var(--muted); font-size: 12px; }

.legend { left: 14px; bottom: 26px; width: 300px; }
.grad { height: 12px; border-radius: 6px; margin: 10px 0 4px; }
.grad-nums, .grad-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.grad-labels { color: var(--ink); margin-top: 2px; }
.grad-labels span:nth-child(2) { margin-left: 8px; }
.legend-note { font-size: 11px; color: var(--muted); margin-top: 8px; }
.foot-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; }
.foot-links a { color: var(--muted); }

.timecard { left: 50%; transform: translateX(-50%); bottom: 26px; width: 480px; max-width: calc(100vw - 680px); min-width: 330px; }
.diff-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.time-body { display: flex; flex-direction: column; gap: 6px; }
.diff-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 15px; flex: none; box-shadow: 0 4px 12px rgba(29, 99, 240, .35); }
.play.small { width: 36px; height: 36px; font-size: 13px; }
.diff-track { flex: 1; min-width: 0; }
.diff-track input[type=range] { width: 100%; accent-color: var(--accent); }
.diff-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 1px; }
.period-label { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.dual { position: relative; height: 28px; }
.dual-track, .dual-fill { position: absolute; top: 12px; height: 5px; border-radius: 3px; }
.dual-track { left: 0; right: 0; background: #e3e8f0; }
.dual-fill { background: var(--accent); }
.dual input[type=range] { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 28px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.dual input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.2); cursor: grab; }
.dual input[type=range]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: grab; }
.dual input[type=range]::-moz-range-track { background: none; }
.dual.single input[type=range] { opacity: .5; }
.dual-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.dual-ticks.one { justify-content: center; }
.sim { border-top: 1px dashed #d5dbe6; margin-top: 4px; padding-top: 8px; }
.sim-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.admin-badge { background: #eef2ff; color: #2a3fa8; border-radius: 999px; padding: 2px 8px; font-weight: 700; font-size: 11.5px; }
.sim-label { font-weight: 700; font-variant-numeric: tabular-nums; }
.seg.small button { padding: 5px 10px; font-size: 12.5px; }
.seg.tiny { padding: 2px; }
.seg.tiny button { padding: 3px 8px; font-size: 11.5px; border-radius: 7px; }

.kinds { position: fixed; z-index: 10; top: calc(var(--head) + 12px); left: 14px; }
.kind-seg { background: rgba(255,255,255,.95); box-shadow: var(--shadow); }
.list-btn { position: fixed; z-index: 10; top: calc(var(--head) + 12px); right: 14px; box-shadow: var(--shadow); border: 0; }
.admin-link { color: #2a3fa8 !important; }

/* ---------- side panel ---------- */
.side {
  position: fixed; z-index: 15; top: calc(var(--head) + 12px); right: 12px; bottom: 12px; width: 384px;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 20px 20px 24px; overflow-y: auto;
  transform: translateX(calc(100% + 24px)); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.side.open { transform: none; }
.panel-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; z-index: 2; }
.eyebrow { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; padding-right: 40px; }
.demo-badge { background: #fff1d6; color: #8a5a00; border: 1px solid #ffd98a; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }

.inc-title, .city-name { font-size: 24px; line-height: 1.15; letter-spacing: -.02em; margin: 6px 40px 6px 0; }
.city-name { font-size: 20px; }
.inc-place { font-weight: 600; margin-bottom: 12px; }
.cat-img { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--c1), var(--c2)); margin: 10px 0 14px; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inc-body { font-size: 15px; line-height: 1.55; white-space: pre-wrap; }
.inc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.meta-k { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.meta-v { font-weight: 700; font-size: 15px; }
.meta-s { font-size: 11.5px; color: var(--muted); }
.inc-actions, .city-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.city-actions .btn { flex: 1; }

.city-temp { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 4px; }
.city-temp .big { font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.city-temp .stage { font-size: 18px; font-weight: 700; }
.arch { font-size: 22px; margin: 6px 0 6px; letter-spacing: -.01em; }
.arch-text { margin: 0 0 6px; color: #3a4357; }
.bars { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 12px; }
.bar-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px; }
.bar-track { height: 9px; border-radius: 5px; background: #eef1f6; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 5px; }
.top-cats { margin-top: 14px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- submit ---------- */
.pick-banner {
  position: fixed; z-index: 25; top: calc(var(--head) + 12px); left: 50%; transform: translateX(-50%);
  width: min(640px, calc(100vw - 24px)); background: #fff; border-radius: 16px; box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.pick-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.pick-text span { color: var(--muted); font-size: 12.5px; }
.pick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pin { width: 34px; height: 46px; position: relative; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); cursor: grab; }
.pin::before { content: ""; position: absolute; left: 3px; top: 0; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: linear-gradient(135deg, var(--hot2), var(--hot)); border: 3px solid #fff; }
.pin span { position: absolute; left: 13px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: #fff; }

.form { display: flex; flex-direction: column; gap: 6px; }
.what-is { background: #f3f6fb; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #3e4759; margin: 6px 0; }
.pin-again { align-self: flex-start; font-size: 13px; }
.lbl { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; margin-top: 10px; }
.counter { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.inp { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff; outline: none; resize: vertical; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 99, 240, .12); }
.inp.small { padding: 7px 10px; font-size: 13px; }
.warns { display: flex; flex-direction: column; gap: 4px; }
.warn { background: #fff7e0; border: 1px solid #ffe08a; color: #6e4e00; border-radius: 8px; padding: 6px 10px; font-size: 12.5px; }
.warn.block { background: #ffeef0; border-color: #ffc2ca; color: #a3132a; }

.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 6px; }
.cat-tile { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; text-align: left; position: relative; overflow: hidden; transition: border-color .12s, transform .12s; }
.cat-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--c1), var(--c2)); }
.cat-tile:hover { border-color: #c5cfdf; transform: translateY(-1px); }
.cat-tile.sel { border-color: var(--accent); background: #f0f5ff; box-shadow: 0 0 0 3px rgba(29, 99, 240, .12); }
.cat-ico { font-size: 20px; line-height: 1; }
.cat-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.cat-hint { font-size: 12px; color: var(--muted); min-height: 16px; }

.temp-box { display: flex; gap: 12px; align-items: center; margin-top: 6px; min-height: 84px; }
.temp-face { flex: none; }
.temp-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.temp-num.muted { font-size: 18px; color: var(--muted); }
.temp-stage { font-weight: 700; font-size: 15px; }
.temp-desc { font-size: 12.5px; color: #4a5366; }
.temp-range { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border-radius: 6px; margin: 8px 0 0;
  background: linear-gradient(90deg, #2f6bff 0%, #25c4e8 20%, #8fdc6a 40%, #ffd43b 60%, #ff8a2a 80%, #e3172f 100%); outline: none; }
.temp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); cursor: grab; }
.temp-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); cursor: grab; }
.temp-range.untouched { filter: saturate(.25) opacity(.7); }
.temp-range.untouched::-webkit-slider-thumb { border-color: #9aa3b2; }
.scale-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.ck { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13px; cursor: pointer; }
.ck input { margin-top: 2px; accent-color: var(--accent); }
.ck.small { margin-top: 8px; font-size: 12px; align-items: center; }
.ts-box { margin-top: 8px; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; }
.form-actions .btn.primary { flex: 1; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(15, 22, 40, .45); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.modal-back.show { opacity: 1; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow); width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 20px 20px; }
.modal.wide { width: min(580px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal p { margin: 8px 0; }
.help-faces { display: flex; gap: 6px; margin-bottom: 6px; }
.sent-face { display: flex; justify-content: center; margin: 6px 0; }
.reasons { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.reasons .ck { margin-top: 6px; }

.cap-wrap { display: flex; flex-direction: column; gap: 10px; }
.cap-canvas { width: 100%; aspect-ratio: 320 / 200; background: #f4f6fb; border-radius: 12px; touch-action: none; cursor: crosshair; border: 1.5px solid var(--line); }
.cap-canvas.ok { border-color: #2fbf71; }
.cap-bar { height: 6px; border-radius: 3px; background: #eef1f6; overflow: hidden; }
.cap-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--hot2), var(--hot)); transition: width .08s linear; }
.cap-status { font-size: 13px; color: #3e4759; }
.cap-status.err { color: #b3172c; font-weight: 600; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 120px; transform: translate(-50%, 10px); background: #1b2232; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: all .2s; font-weight: 600; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .brand-sub { max-width: 220px; }
}
@media (max-width: 760px) {
  :root { --head: 108px; }
  header#top { flex-wrap: wrap; height: var(--head); padding: 8px 10px; gap: 8px; align-content: center; }
  .brand { flex: 1 1 auto; }
  .brand img { width: 32px; height: 32px; }
  .brand-name { font-size: 17px; }
  .brand-sub { max-width: 46vw; font-size: 11px; }
  .search-wrap { order: 3; flex: 1 1 100%; max-width: none; }
  #search { height: 38px; }
  .head-actions { gap: 6px; }
  .seg, #btn-filters .lbl, #btn-help { display: none; }
  #btn-filters { padding: 0 10px; }
  #btn-add .lbl { display: none; }
  #btn-add { width: 38px; padding: 0; }
  .legend { top: calc(var(--head) + 8px); bottom: auto; left: 8px; width: 210px; padding: 10px 12px; }
  .legend .grad-labels, .legend .legend-note, .legend .foot-links { display: none; }
  .side { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 82vh; border-radius: 18px 18px 0 0; transform: translateY(105%); }
  .side.open { transform: none; }
  .pick-banner { top: auto; bottom: 110px; }
  .inc-title { font-size: 21px; }
}

/* ---------- list (Zillow-style) ---------- */
.list-panel { display: flex; flex-direction: column; gap: 10px; }
.list-panel .city { padding-right: 40px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; padding-right: 40px; }
.list-panel > .list-head:first-child { border-top: 0; padding-top: 0; margin-top: 2px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; gap: 12px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; transition: border-color .12s, box-shadow .12s; }
.li:hover { border-color: #c7d2e6; box-shadow: 0 4px 14px rgba(20, 32, 64, .08); }
.li-thumb { position: relative; flex: none; width: 112px; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.li-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.li-temp { position: absolute; left: 6px; bottom: 6px; color: #fff; font-weight: 800; font-size: 12px; border-radius: 6px; padding: 1px 6px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.li-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.li-title { font-weight: 700; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 11px; }
.li-time { color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 3px; background: #eef2f8; color: #3e4759; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 600; }
.tag.news { background: #fdecef; color: #a3132a; }
.tag.demo { background: #fff1d6; color: #8a5a00; }
.tag.cold { background: #e7f3ff; color: #1f5f9e; }
.center { text-align: center; }
.back { align-self: flex-start; margin-bottom: 4px; font-size: 13px; }

/* ---------- gallery ---------- */
.gallery { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--c1), var(--c2)); margin: 10px 0 14px; touch-action: pan-y; outline: none; }
.g-track { display: flex; height: 100%; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.g-img { flex: none; width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }
.g-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 22px; line-height: 1; box-shadow: 0 2px 8px rgba(0,0,0,.2); opacity: 0; transition: opacity .15s; }
.gallery:hover .g-nav, .gallery:focus .g-nav { opacity: 1; }
.g-nav.prev { left: 8px; } .g-nav.next { right: 8px; }
.g-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.g-dots button { width: 7px; height: 7px; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); }
.g-dots button.on { background: #fff; }
.g-count { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 11.5px; border-radius: 6px; padding: 1px 7px; }
@media (hover: none) { .g-nav { opacity: 1; } }

.src-link { display: inline-block; margin-top: 4px; font-weight: 600; font-size: 13.5px; word-break: break-all; }
.comments { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.comment { background: #f4f6ff; border-left: 3px solid #5468d4; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.comment-head { font-size: 11.5px; color: #3a4aa8; font-weight: 700; margin-bottom: 2px; }

/* ---------- submit extras ---------- */
.toggle-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.toggle-row .seg { flex: none; }
.scope-hint { font-size: 12px; color: var(--muted); }
.admin-box { background: #f4f6ff; border: 1px solid #dfe4fb; border-radius: 12px; padding: 10px 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #e8ecf3; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .main-badge { position: absolute; left: 4px; top: 4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 5px; padding: 0 5px; }
.photo .ph-actions { position: absolute; right: 3px; top: 3px; display: flex; gap: 3px; }
.photo .ph-actions button { width: 22px; height: 22px; border-radius: 6px; border: 0; background: rgba(255,255,255,.92); font-size: 12px; padding: 0; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

@media (max-width: 1100px) {
  .timecard { left: auto; right: 14px; transform: none; max-width: none; width: 380px; }
  .side.open ~ .timecard { display: none; }
}
@media (max-width: 760px) {
  .kinds { top: auto; bottom: 150px; left: 8px; }
  .kind-seg button { padding: 6px 9px; font-size: 12.5px; }
  .list-btn { top: auto; bottom: 150px; right: 8px; }
  .timecard { left: 8px; right: 8px; bottom: 8px; width: auto; min-width: 0; padding: 10px 12px; }
  .li-thumb { width: 92px; }
  .admin-link .lbl { display: none; }
}

/* ---------- map type ---------- */
.maptype { position: fixed; z-index: 10; right: 14px; bottom: 44px; display: flex; align-items: stretch; gap: 4px; background: rgba(255,255,255,.97); border-radius: 14px; padding: 5px; box-shadow: var(--shadow); }
.mt-btn { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px; width: 76px; padding: 4px 4px 5px; margin: 0; border: 2px solid transparent; background: none; border-radius: 10px; color: var(--muted); }
.mt-btn:hover { background: #f3f6fb; }
.mt-btn.on { border-color: var(--accent); color: var(--accent); background: #f0f5ff; }
.mt-thumb { display: block; width: 64px; height: 46px; border-radius: 7px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); flex: none; }
.mt-thumb svg, .mt-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mt-label { display: block; height: 14px; line-height: 14px; font-size: 12px; font-weight: 700; text-align: center; white-space: nowrap; }
.side.open ~ .maptype { right: 410px; }
@media (max-width: 1100px) { .maptype { bottom: auto; top: calc(var(--head) + 60px); } .side.open ~ .maptype { display: none; } }
@media (max-width: 760px) { .maptype { top: auto; bottom: 196px; right: 8px; } .mt-btn { width: 60px; } .mt-thumb { width: 50px; height: 36px; } }

/* ---------- demo switch ---------- */
.kinds { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.switch-pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.95); box-shadow: var(--shadow); border-radius: 999px; padding: 7px 12px 7px 8px; font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; line-height: 1; }
.switch-pill input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 32px; height: 18px; border-radius: 999px; background: #cfd6e2; transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch-pill input:checked + .switch { background: var(--accent); }
.switch-pill input:checked + .switch::after { transform: translateX(14px); }
.switch-pill input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.translate { align-self: flex-start; margin: 2px 0 6px; }
