:root {
  --bg: #eef3f4;
  --surface: #ffffff;
  --surface-2: #f1f5f6;
  --text: #0d1b22;
  --muted: #5b6b73;
  --border: #dbe4e7;
  --accent: #0d9488;
  --accent-ink: #ffffff;
  --accent-soft: #d6f3ef;
  --up: #0e7490;
  --down: #c2410c;
  --danger: #dc2626;
  --glass: rgba(255, 255, 255, 0.9);
  --shadow: 0 6px 24px rgba(10, 30, 40, 0.18);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b1419;
    --surface: #13212a;
    --surface-2: #1b2c36;
    --text: #e8f1f3;
    --muted: #93a6ae;
    --border: #284350;
    --accent: #2dd4bf;
    --accent-ink: #042f2b;
    --accent-soft: #123f3a;
    --up: #67e8f9;
    --down: #fb923c;
    --danger: #f87171;
    --glass: rgba(19, 33, 42, 0.92);
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button svg, .pin svg, .th svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#map { position: fixed; inset: 0; background: #d9e4e6; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.7) !important; }

.glass { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); }

/* ---------- Viršus */
.topbar {
  position: fixed; z-index: 500; top: calc(var(--safe-top) + 10px); left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; }
.brand-text span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; display: inline-block; }
.dot.on { background: #22c55e; }
.dot.off { background: #f59e0b; }
.side { display: flex; flex-direction: column; gap: 8px; }
.tool {
  position: relative; width: 56px; height: 56px; border-radius: 16px; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.tool span { font-size: 9.5px; font-weight: 600; color: var(--muted); }
.tool:active { transform: scale(.95); }
.tool-dot { position: absolute; top: 6px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: #dc2626; border: 2px solid #fff; }

/* Taisyklės */
.rl-card { border-radius: 14px; padding: 12px; margin-bottom: 8px; background: var(--surface-2); border-left: 4px solid var(--border); }
.rl-card.active { border-left-color: #dc2626; }
.rl-card.soon { border-left-color: #f59e0b; }
.rl-card.year { border-left-color: #64748b; }
.rl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rl-badge { flex: none; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.rl-badge.on { background: #fee2e2; color: #b91c1c; }
.rl-badge.soon { background: #fef3c7; color: #92400e; }
.rl-what { margin: 4px 0; }
.rl-places { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.rl-places li { margin: 3px 0; }
.rl-card details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 6px; }
.rl-basin { font-size: 12px; font-weight: 700; color: var(--muted); margin: 8px 0 4px; }
.rl-rivers { display: flex; flex-wrap: wrap; gap: 4px; }
.rl-rivers span, .rl-fish span { background: var(--surface); border-radius: 8px; padding: 3px 8px; font-size: 13px; }
.rl-fish { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.rl-fish small { color: var(--muted); }
.rl-free { background: #dcfce7; color: #166534; border-radius: 12px; padding: 10px 12px; font-weight: 600; margin-top: 10px; }
.rl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rl-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.rl-table td { padding: 7px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rl-table tr.on td { background: #fee2e2; }
.rl-item { font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.rl-ref { font-weight: 700; color: var(--accent); margin-right: 4px; }
mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.search-row { display: flex; gap: 8px; }
.search-row .input { flex: 1; }
.mic { width: 46px; height: 46px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.mic.listening { background: #dc2626; color: #fff; animation: blink 1.2s infinite; }

/* Vanduo */
.wl-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface-2); margin-bottom: 8px; width: 100%; text-align: left; }
.wl-card .nm b { display: block; font-size: 15px; }
.wl-card .nm span { font-size: 12px; color: var(--muted); }
.wl-card .val { text-align: right; }
.wl-card .val b { font-size: 22px; }
.wl-card .val div { font-size: 12px; color: var(--muted); }
.wl-card canvas { grid-column: 1 / -1; width: 100%; height: 36px; }
.wl-river { margin-bottom: 12px; }
.wl-rhead { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 2px 4px 6px; text-align: left; }
.wl-rhead b { font-size: 17px; }
.wl-rhead span { font-size: 13px; color: var(--accent); font-weight: 600; }
.wl-card .nm { text-align: left; }
.wl-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); width: 100%; text-align: left; }
.wl-row div { flex: 1; }
.wl-row small { color: var(--muted); }
.star { font-size: 22px; line-height: 1; color: var(--muted); padding: 4px; }
.star.on { color: #f59e0b; }
.chart { width: 100%; height: 200px; display: block; touch-action: pan-y; }
.chart-wrap { background: var(--surface-2); border-radius: 14px; padding: 8px 6px 4px; }

/* Balsas */
.vc-text { font-size: 17px; font-style: italic; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; color: var(--text); }
.vc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vc-grid .field { margin-top: 0; }
.vc-where { font-size: 13px; color: var(--muted); margin-top: 10px; }

.round { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.round.dark { background: rgba(0,0,0,.45); color: #fff; width: 44px; height: 44px; }
.locate { position: fixed; z-index: 500; right: 12px; bottom: calc(var(--safe-bottom) + 112px); }
.locate.follow { color: var(--accent); }
.locate.nogps { color: var(--down); }

.trackbtn { position: fixed; z-index: 500; left: 12px; bottom: calc(var(--safe-bottom) + 112px); }
.trackbtn.on { background: #dc2626; color: #fff; }

.track-pill {
  position: fixed; z-index: 550; top: calc(var(--safe-top) + 66px); left: 12px;
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 999px;
}
.track-pill .rec { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.tp-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.tp-info b { font-variant-numeric: tabular-nums; font-size: 16px; }
.tp-info span { font-size: 12px; color: var(--muted); }

.layer-panel {
  position: fixed; z-index: 800; top: calc(var(--safe-top) + 10px); right: 76px;
  width: min(300px, calc(100vw - 88px)); border-radius: 20px; padding: 12px 14px 14px;
  max-height: calc(100vh - var(--safe-top) - 130px); overflow-y: auto;
}
.lp-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.lp-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px;
  background: var(--surface-2); font-size: 12px; font-weight: 600; border: 2px solid transparent;
}
.lp-grid button b { font-size: 22px; line-height: 1; font-weight: 400; }
.lp-grid button.on { border-color: var(--accent); background: var(--accent-soft); }
.lp-toggle { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; }
.lp-toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.depth-legend { margin: 0 0 6px 30px; }
.dl-bar { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #c6f2f2, #8fd7ea, #4f9fe6, #2b5fd6, #1b2fa8, #0b0b5e); }
.dl-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 3px 0 4px; }
.depth-pop b { font-size: 16px; }

/* Draudžiami ruožai ir telkinio kortelė */
.bl-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 3px 0; }
.bl-row i { width: 26px; height: 0; flex: none; border-top: 4px solid #dc2626; border-radius: 2px; }
.bl-row i.bl-lim { border-top-color: #f59e0b; }
.bl-row i.bl-off { border-top: 3px dotted #dc2626; opacity: 0.6; }
.spot-pop { font-size: 14px; line-height: 1.4; max-width: 250px; }
.spot-pop > div + div { margin-top: 4px; }
.sp-title b { font-size: 16px; }
.sp-ban { font-weight: 600; color: var(--muted); }
.sp-ban.on { color: #dc2626; }
.sp-ban.lim { color: #b45309; }
.sp-lease { font-weight: 600; color: #7c3aed; }
.sp-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.wc-lease { border-radius: 14px; padding: 12px; background: var(--surface-2); border-left: 4px solid #64748b; font-size: 14px; line-height: 1.45; }
.wc-lease > b:first-child { display: block; font-size: 15px; margin-bottom: 2px; }
.wc-lease.leased { border-left-color: #7c3aed; }
.wc-lease.free { border-left-color: #16a34a; }
.wc-lease a { display: inline-block; margin-top: 6px; color: var(--accent); }
.rl-card.wc-mark { outline: 2px solid #facc15; }
.rl-card [data-show-ban] { margin-top: 8px; }
.wc-miss { margin-top: 6px; }
.wc-about { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 6px; }
.wc-about td { padding: 5px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.wc-about td:first-child { color: var(--muted); width: 42%; }
.wc-actions { display: flex; gap: 8px; margin: 14px 0 6px; }
.wc-actions .btn { flex: 1; }
.iso-label { background: none; border: 0; font-size: 11px; font-weight: 700; color: #fff; text-align: center; text-shadow: 0 0 3px #0b1f4a, 0 0 2px #0b1f4a; pointer-events: none; }
.lp-toggle.small { padding: 4px 0; font-size: 13px; justify-content: space-between; }

.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 9px; border-radius: 10px; font-weight: 650; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.layer-panel .seg button { font-size: 12px; padding: 7px 4px; }
.metrics.three { grid-template-columns: repeat(3, 1fr); }
.sec > .metrics .metric { background: var(--surface-2); }
.link-card { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px; border-radius: 14px; background: var(--accent-soft); margin-top: 10px; }
.link-card b { display: block; }

/* ---------- Apačios juosta */
.dock {
  position: fixed; z-index: 600; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 20px);
  display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 26px;
  width: min(440px, calc(100vw - 24px)); justify-content: space-between;
}
.dock-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; min-width: 58px; border-radius: 16px; font-size: 11px; color: var(--muted); }
.dock-btn:active { background: var(--surface-2); }
.dock-btn svg { color: var(--text); }
.dock-main {
  width: 76px; height: 76px; margin-top: -30px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  box-shadow: 0 8px 22px rgba(13, 148, 136, .45), 0 0 0 5px var(--glass);
  font-size: 10px; font-weight: 600;
}
.dock-main svg { width: 32px; height: 32px; stroke-width: 2.6; }
.dock-main:active { transform: scale(.95); }

/* ---------- Žymekliai */
.pin-wrap { background: none; border: 0; }
.pin {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  background: var(--c); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35);
  display: grid; place-items: center; color: #fff;
}
.pin::after {
  content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  border: 7px solid transparent; border-top: 8px solid #fff; border-bottom: 0;
}
.leaflet-container .leaflet-marker-pane .pin img { width: 100% !important; height: 100%; border-radius: 50%; object-fit: cover; }
.pin svg { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.pin-ring { position: absolute; inset: -3px; border-radius: 50%; box-shadow: 0 0 0 3px var(--c); pointer-events: none; }
.pin-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #111827; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}
.pin-wrap.active .pin { transform: scale(1.18); transition: transform .15s; }
.cluster-wrap { background: none; }
.cluster {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35);
}
.me { position: relative; width: 22px; height: 22px; }
.me i { position: absolute; inset: 0; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
.me::before { content: ''; position: absolute; inset: -10px; border-radius: 50%; background: rgba(37,99,235,.35); animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.press-pop .leaflet-popup-content { margin: 10px; }

/* ---------- Apatinis lapas */
.sheet {
  position: fixed; z-index: 700; left: 0; right: 0; bottom: 0;
  height: 60vh; max-height: calc(100vh - var(--safe-top) - 12px);
  background: var(--surface); color: var(--text);
  border-radius: 24px 24px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.25);
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1), height .28s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
.sheet.open { transform: translateY(0); }
.sheet.full { height: calc(100vh - var(--safe-top) - 12px); }
.sheet.peek { transform: translateY(calc(100% - 64px)); }
.grip { padding: 10px 0 6px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.grip span { width: 44px; height: 5px; border-radius: 3px; background: var(--border); }
.sheet-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; z-index: 2; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 16px calc(var(--safe-bottom) + 28px); -webkit-overflow-scrolling: touch; }

@media (min-width: 900px) {
  .sheet { left: 16px; right: auto; top: calc(var(--safe-top) + 72px); bottom: 16px; width: 420px; height: auto !important; border-radius: 22px; transform: translateX(-110%); }
  .sheet.open, .sheet.peek { transform: translateX(0); }
  .grip { display: none; }
  .sheet-body { padding-top: 16px; }
}

.sheet-head { padding-right: 44px; margin-bottom: 6px; }
.title-input {
  width: 100%; border: 0; background: transparent; font-size: 22px; font-weight: 750; padding: 4px 0; outline: none;
}
.title-input::placeholder { color: var(--muted); opacity: .8; }
.sub { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.date-input { border: 0; background: var(--surface-2); border-radius: 10px; padding: 6px 8px; color: var(--text); font-size: 14px; }
h2.view-title { margin: 4px 44px 12px 0; font-size: 22px; }

.sec { margin-top: 18px; }
.sec-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec-title .src { text-transform: none; letter-spacing: 0; font-weight: 500; text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface);
  font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.chip.on { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); color: #fff; font-weight: 600; }
.chip.on i { background: #fff; }
.chip.ghost { border-style: dashed; color: var(--muted); }

.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ph { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); padding: 0; position: relative; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; color: var(--muted); border: 1.5px dashed var(--border); }
.ph.add svg { color: var(--accent); }

.card { background: var(--surface-2); border-radius: 16px; padding: 12px; }
.wx-main { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.wx-icon { font-size: 40px; line-height: 1; }
.wx-temp { font-size: 30px; font-weight: 800; line-height: 1; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric { background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.metric .l { font-size: 12px; color: var(--muted); }
.metric .v { font-size: 20px; font-weight: 750; }
.metric .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.trend { font-weight: 650; }
.trend.up { color: var(--up); }
.trend.down { color: var(--down); }
.foot { font-size: 12px; margin-top: 8px; }
.state { padding: 14px; border-radius: 12px; background: var(--surface); color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.warn { margin-top: 8px; font-size: 12px; color: var(--down); }

.field { display: block; margin-top: 10px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface);
  padding: 10px 12px; font-size: 16px; outline: none;
}
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); }

.catch { display: grid; grid-template-columns: 1fr 62px 62px 44px 36px; gap: 6px; align-items: center; margin-bottom: 6px; }
.catch select, .catch input { min-height: 44px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); padding: 6px 8px; font-size: 15px; width: 100%; }
.catch .tag-in { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.catch .tag-in span { white-space: nowrap; }
.catch .tag-in input { flex: 1; min-height: 38px; font-size: 15px; }
.pin-tag {
  position: absolute; bottom: 2px; left: -6px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; display: grid; place-items: center; font-size: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.tog { height: 44px; border-radius: 10px; border: 1.5px solid var(--border); font-size: 18px; }
.tog.on { background: var(--accent-soft); border-color: var(--accent); }
.x { height: 44px; font-size: 22px; color: var(--muted); }

.btn { min-height: 46px; padding: 10px 16px; border-radius: 14px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.soft { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-soft { background: transparent; color: var(--danger); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.block { width: 100%; margin-top: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.meta-foot { font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; }
a.btn { text-decoration: none; color: inherit; }

/* ---------- Žurnalas */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stats .metric { background: var(--surface-2); text-align: center; }
.items { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; text-align: left; padding: 8px; border-radius: 16px; background: var(--surface-2); }
.item .th { width: 64px; height: 64px; border-radius: 12px; background: var(--c); display: grid; place-items: center; overflow: hidden; color: #fff; }
.item .th img { width: 100%; height: 100%; object-fit: cover; }
.item .th svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.item b { display: block; font-size: 16px; }
.item .m { font-size: 13px; color: var(--muted); }
.item .tags { display: flex; gap: 10px; font-size: 13px; margin-top: 3px; flex-wrap: wrap; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--c); display: inline-block; margin-right: 10px; vertical-align: -2px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.colors button { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid transparent; }
.colors button.on { border-color: var(--text); }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* ---------- Pranešimai, dialogai */
.toast {
  position: fixed; z-index: 2000; left: 50%; bottom: calc(var(--safe-bottom) + 120px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #111827; color: #fff; padding: 12px 18px; border-radius: 14px; max-width: calc(100vw - 32px);
  box-shadow: var(--shadow); transition: all .25s; font-size: 14px; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.pick-banner {
  position: fixed; z-index: 900; top: calc(var(--safe-top) + 70px); left: 50%; transform: translateX(-50%);
  padding: 8px 8px 8px 16px; border-radius: 16px; display: flex; align-items: center; gap: 12px; font-weight: 600; width: max-content; max-width: calc(100vw - 24px);
}
/* Taško patikslinimas */
.place-banner {
  position: fixed; z-index: 900; top: calc(var(--safe-top) + 66px); left: 12px; right: 76px;
  border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.pb-text { display: flex; flex-direction: column; line-height: 1.25; }
.pb-text span { font-size: 13px; color: var(--muted); }
.pb-text small { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.pb-btns { display: flex; gap: 8px; justify-content: flex-end; }
.place-wrap { background: none; border: 0; }
.place-tip {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%); white-space: nowrap;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.place-pin {
  position: absolute; left: 50%; bottom: 0; width: 34px; height: 34px; transform: translateX(-50%) translateY(-12px) rotate(-45deg);
  border-radius: 50% 50% 50% 0; background: #dc2626; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.45);
}
.place-pin i { position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.place-wrap::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: rgba(220,38,38,.5); box-shadow: 0 0 0 6px rgba(220,38,38,.2);
}
.dock-main .ic-ok, .dock-main.placing .ic-add { display: none; }
.dock-main.placing .ic-ok { display: block; }
.dock-main.placing { background: #dc2626; box-shadow: 0 8px 22px rgba(220,38,38,.45), 0 0 0 5px var(--glass); }

.modal-wrap { position: fixed; inset: 0; z-index: 1500; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .2s; }
.modal-wrap.show { opacity: 1; }
.modal { background: var(--surface); color: var(--text); border-radius: 22px; padding: 20px; width: min(420px, 100%); box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 8px; font-size: 19px; }
.modal-body { color: var(--muted); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.lightbox { position: fixed; inset: 0; z-index: 1200; background: #000; display: grid; place-items: center; touch-action: pan-y; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-top { position: absolute; top: calc(var(--safe-top) + 10px); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; color: #fff; font-size: 14px; }
.lb-top div { display: flex; gap: 8px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }

.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--accent); animation: rot 0.9s linear infinite; display: inline-block; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }
