/* ============ DESIGN TOKENS ============ */
:root {
  --bg: #0b0d12; --surface: #12151c; --surface-2: #191d26; --surface-3: #222734;
  --border: #262b37; --border-strong: #343a49;
  --text: #f1f3f7; --muted: #8a93a6; --faint: #5e6678;
  --accent: #ffb020; --accent-strong: #ff9500; --on-accent: #1a1200;
  --accent-soft: rgba(255, 176, 32, .14);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .15);
  --danger: #ff5d5d; --danger-soft: rgba(255, 93, 93, .14);
  --link: #7cc4ff;
  --route: #ffb020;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-2: 0 2px 6px rgba(0,0,0,.5), 0 20px 50px rgba(0,0,0,.5);
  --glass: rgba(18, 21, 28, .88);
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --tap: 46px;
  --c-start: #34d399; --c-meta: #ff5d5d; --c-prom: #38bdf8; --c-nocleg: #c084fc;
  --c-tankowanie: #facc15; --c-atrakcja: #fb923c; --c-inne: #94a3b8;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
:root { --text-2: #b7becd; }
html[data-theme="light"] {
  --bg: #f3f4f7; --surface: #ffffff; --surface-2: #f6f7fa; --surface-3: #eceef3;
  --border: #e2e5ec; --border-strong: #cdd2dc;
  --text: #141822; --text-2: #3a4152; --muted: #6b7386; --faint: #9aa2b3;
  --accent: #e8890c; --accent-strong: #d97706; --on-accent: #fff; --accent-soft: rgba(232, 137, 12, .12);
  --ok: #059669; --ok-soft: rgba(5, 150, 105, .12);
  --danger: #dc2626; --danger-soft: rgba(220, 38, 38, .1);
  --link: #1d4ed8; --route: #e8890c;
  --shadow-1: 0 1px 2px rgba(20,24,34,.06), 0 8px 24px rgba(20,24,34,.08);
  --shadow-2: 0 2px 6px rgba(20,24,34,.08), 0 20px 50px rgba(20,24,34,.16);
  --glass: rgba(255,255,255,.9);
  color-scheme: light;
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; display: flex; flex-direction: column;
  padding-bottom: calc(64px + var(--safe-b));
}
@media (min-width: 900px) { body { font-size: 16px; padding-bottom: 0; } }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .35; cursor: default; }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
::selection { background: var(--accent-soft); }

/* ============ SHELL ============ */
.topbar {
  position: sticky; top: 0; z-index: 900; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-in { display: flex; align-items: center; gap: 14px; padding: 10px 16px; max-width: 1200px; margin: 0 auto; }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.brand .name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; }
.brand .dates { color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (min-width: 900px) and (max-width: 1280px) { .brand .dates { display: none; } }
.countdown { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.countdown b { font-size: 15px; }
.nav { display: none; gap: 2px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; position: relative; }
.nav a:hover { color: var(--text); background: var(--surface-3); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--surface-3); }
.nav a svg { width: 18px; height: 18px; }
.badge { background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center; line-height: 16px; }
.nav .badge { margin-left: 2px; }
.me { display: flex; align-items: center; gap: 4px; margin-left: auto; }
@media (min-width: 900px) { .nav { display: flex; } .me { margin-left: 0; } }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 12px; flex: none; letter-spacing: .02em; text-shadow: 0 1px 1px rgba(0,0,0,.3); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.iconbtn { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.iconbtn:hover { background: var(--surface-3); color: var(--text); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn.danger:hover { color: var(--danger); background: var(--danger-soft); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: flex; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); padding-bottom: var(--safe-b);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--accent); }
.tabbar a:hover { text-decoration: none; }
.tabbar .badge { position: absolute; top: 4px; left: calc(50% + 6px); }
@media (min-width: 900px) { .tabbar { display: none; } }

/* ============ LAYOUT ============ */
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.page { width: 100%; max-width: 820px; margin: 0 auto; padding: 20px 16px 40px; }
.page.wide { max-width: 1100px; }
.hero { margin-bottom: 20px; }
.hero h1 { margin-bottom: 4px; }
.hero .sub { color: var(--muted); }
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.stat { flex: 1; min-width: 120px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.stat .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; }
.card + .card { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }

/* ============ CONTROLS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: 12px;
  background: var(--surface-3); color: var(--text); font-weight: 700; font-size: 15px; white-space: nowrap; border: 1px solid transparent; transition: transform .08s, background .15s;
}
.btn:hover { background: var(--border-strong); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ok { background: var(--ok-soft); color: var(--ok); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn.block { width: 100%; }
.btn.wa { background: #22c55e; color: #052e16; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; min-height: 28px; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.ghost { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); }
.chip svg { width: 14px; height: 14px; }
button.chip { cursor: pointer; }
button.chip:hover { filter: brightness(1.15); }
.chip .dot { margin: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 40px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.input, input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.bar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .35s; }
.check { position: relative; width: 30px; height: 30px; flex: none; }
.check input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.check span { position: absolute; inset: 0; border: 2px solid var(--border-strong); border-radius: 9px; transition: all .15s; }
.check input:checked + span { background: var(--ok); border-color: var(--ok); }
.check input:checked + span::after { content: ''; position: absolute; left: 9px; top: 4px; width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.check.lg { width: 36px; height: 36px; }
.check.lg span { border-radius: 11px; }
.check.lg input:checked + span::after { left: 12px; top: 5px; width: 8px; height: 16px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 8px; }

/* ============ OVERLAYS ============ */
.toast { position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translateX(-50%); background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-2); z-index: 3000; max-width: 92vw; font-weight: 600; font-size: 14px; animation: pop .18s ease-out; }
.toast.error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
@media (min-width: 900px) { .toast { bottom: 24px; } }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 2000; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { background: var(--surface); border: 1px solid var(--border); border-radius: 20px 20px 0 0; width: 100%; max-height: 88vh; overflow: auto; padding: 8px 8px calc(16px + var(--safe-b)); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); } to { transform: none; } }
.sheet .handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 6px auto 10px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; text-align: left; font-weight: 600; color: var(--text); }
.menu-item:hover { background: var(--surface-3); }
.menu-item svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }
.menu-item .sub { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 13px; }
.menu-title { padding: 8px 14px 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.popover { position: fixed; z-index: 2000; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-2); padding: 6px; min-width: 220px; animation: pop2 .12s ease-out; }
@keyframes pop2 { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.popover .menu-item { min-height: 42px; font-size: 14px; }
.modal-wrap { align-items: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-2); animation: pop2 .15s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 18px; }
@media (max-width: 600px) { .modal-wrap { align-items: flex-end; padding: 0; } .modal { border-radius: 20px 20px 0 0; max-width: none; padding-bottom: var(--safe-b); } }

/* ============ LOGIN ============ */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%); }
.login { width: 100%; max-width: 400px; }
.login .logo { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.login .logo svg { width: 30px; height: 30px; }
.login h1 { margin-bottom: 6px; }
.login .sub { color: var(--muted); margin-bottom: 22px; }
.error-msg { color: var(--danger); font-weight: 600; min-height: 22px; margin: 4px 0 8px; font-size: 14px; }

/* ============ MAP ============ */
.map-page { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--surface-2); z-index: 1; }
.map-days { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 500; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; -webkit-overflow-scrolling: touch; pointer-events: none; }
.map-days::-webkit-scrollbar { display: none; }
.map-days > * { pointer-events: auto; }
.daychip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--border); font-weight: 700; font-size: 14px; color: var(--text); box-shadow: var(--shadow-1); display: inline-flex; align-items: center; gap: 6px; }
.daychip.active { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.daychip .n { opacity: .6; font-size: 12px; }
.map-tools { position: absolute; right: 12px; top: 62px; z-index: 500; display: flex; flex-direction: column; gap: 6px; }
.tool { width: 44px; height: 44px; border-radius: 12px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--border); color: var(--text); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-1); position: relative; }
.tool svg { width: 20px; height: 20px; }
.tool.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.tool[data-tip]:hover::after { content: attr(data-tip); position: absolute; right: 52px; top: 50%; transform: translateY(-50%); background: var(--surface-3); color: var(--text); padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-1); }
.map-hint { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); z-index: 500; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; box-shadow: var(--shadow-1); display: flex; gap: 8px; align-items: center; }
.map-panel { position: absolute; z-index: 500; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border); box-shadow: var(--shadow-2); overflow: hidden; display: flex; flex-direction: column; }
@media (min-width: 900px) { .map-panel { left: 12px; bottom: 12px; width: 360px; max-height: calc(100% - 80px); border-radius: var(--r-lg); } .map-panel .handle { display: none; } }
@media (max-width: 899px) { .map-panel { left: 0; right: 0; bottom: 0; border-radius: 20px 20px 0 0; max-height: 46vh; transition: max-height .25s; } .map-panel.collapsed { max-height: 58px; } .map-panel.collapsed .panel-body { display: none; } .map-page { padding-bottom: 0; } }
.map-panel .handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; flex: none; cursor: pointer; }
.panel-head .no { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.panel-head .t { font-weight: 800; font-size: 16px; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head .s { font-size: 12px; color: var(--muted); }
.panel-body { overflow: auto; padding: 0 16px 14px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: flex; gap: 10px; padding: 7px 0; align-items: flex-start; position: relative; cursor: pointer; border-radius: 8px; }
.tl li:hover { background: var(--surface-3); margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.tl .pt { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex: none; box-shadow: 0 0 0 3px var(--surface); }
.tl .nm { font-weight: 600; font-size: 14px; }
.tl .nt { font-size: 12px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.stop-marker { background: transparent; border: 0; }
.stop-marker .pin { width: 32px; height: 32px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2.5px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; transition: transform .1s; }
.stop-marker:hover .pin { transform: rotate(-45deg) scale(1.1); }
.stop-marker .pin svg { width: 16px; height: 16px; transform: rotate(45deg); color: #fff; }
.stop-marker.editing .pin { border-style: dashed; border-color: var(--accent); }
.stop-marker.dim .pin { opacity: .45; }
.leaflet-popup-content-wrapper { background: var(--surface); color: var(--text); border-radius: 14px; box-shadow: var(--shadow-2); border: 1px solid var(--border); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 14px 16px; font-size: 14px; min-width: 220px; line-height: 1.45; }
.popup h3 { margin-bottom: 4px; }
.popup .meta { color: var(--muted); font-size: 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.popup .notes { white-space: pre-wrap; margin-bottom: 8px; color: var(--text-2); }
.popup .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.popup .field { margin-bottom: 8px; }
.popup input, .popup select, .popup textarea { min-height: 38px; padding: 6px 10px; border-radius: 9px; }
.popup textarea { min-height: 60px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); font-size: 22px; padding: 8px 10px 0 0; }
.leaflet-container { font-family: inherit; }
.leaflet-bar { border: 1px solid var(--border) !important; box-shadow: var(--shadow-1) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-bar a { background: var(--glass) !important; color: var(--text) !important; width: 44px !important; height: 44px !important; line-height: 44px !important; font-size: 20px !important; border-bottom-color: var(--border) !important; }
.leaflet-top.leaflet-left { top: 62px; }
.leaflet-control-attribution { background: var(--glass) !important; color: var(--muted) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
:root:not([data-theme="light"]) .leaflet-tile { filter: brightness(.8) contrast(1.05) saturate(.8); }
.leaflet-tooltip { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; font-weight: 600; box-shadow: var(--shadow-1); }
.leaflet-tooltip::before { display: none; }

/* ============ PLAN ============ */
.day { padding: 0; overflow: hidden; }
.day-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px 0; }
.day-no { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex: none; letter-spacing: -.02em; }
.day-title { flex: 1; min-width: 0; }
.day-title h2 { font-size: 18px; overflow-wrap: anywhere; }
.day-title .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.day-title .tags span + span::before { content: '·'; margin-right: 6px; color: var(--faint); }
.day-body { padding: 12px 18px 16px; }
.day-desc { color: var(--text-2); white-space: pre-wrap; margin-bottom: 12px; }
.overnight { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; margin-bottom: 12px; }
.overnight svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.overnight .on-t { flex: 1; min-width: 0; }
.overnight .on-t b { display: block; font-size: 14px; }
.overnight .on-t span { font-size: 12px; color: var(--muted); }
.day-foot { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 16px; }
.trip-gpx { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-top: 12px; }
.trip-gpx svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.trip-gpx .t { flex: 1; min-width: 0; font-size: 14px; }
.trip-gpx .t b { display: block; }
.trip-gpx .t span { color: var(--muted); font-size: 12px; }
.edit-form { padding: 16px 18px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.stop-edit { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }

/* ============ CHECKLISTY ============ */
.cl-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
#list { padding-bottom: 8px; }
.cl-group { margin-bottom: 8px; }
.cl-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 6px; min-height: 60px; transition: background .15s; }
.cl-item.done { background: transparent; }
.cl-item.done .text { text-decoration: line-through; color: var(--muted); }
.cl-item.dragging { opacity: .4; }
.cl-item.over { border-color: var(--accent); }
.cl-item .body { flex: 1; min-width: 0; }
.cl-item .text { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.cl-item .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--muted); }
.cl-item .grip { color: var(--faint); cursor: grab; display: none; }
@media (min-width: 900px) { .cl-item .grip { display: block; } }
.avatars { display: inline-flex; }
.avatars .avatar { margin-left: -6px; border: 2px solid var(--surface); box-sizing: content-box; }
.avatars .avatar:first-child { margin-left: 0; }
.avatars .avatar.off { opacity: .25; filter: grayscale(1); }
.progress-list { display: grid; gap: 10px; }
.prog { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.prog .bar { grid-column: 1 / -1; }
.prog .who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.prog .cnt { font-variant-numeric: tabular-nums; font-weight: 700; }
.addbar { position: sticky; bottom: calc(64px + var(--safe-b)); background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 14px; padding: 8px; display: flex; gap: 8px; margin-top: 14px; box-shadow: var(--shadow-1); }
@media (min-width: 900px) { .addbar { bottom: 12px; } }
.addbar input { flex: 1; min-width: 0; }

/* ============ EKIPA ============ */
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.member { display: flex; flex-direction: column; gap: 12px; position: relative; }
.member.mine { border-color: var(--accent); }
.member .top { display: flex; align-items: center; gap: 12px; }
.member .nm { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.member .rl { color: var(--muted); font-size: 13px; font-weight: 600; }
.member dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.member dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; align-self: center; }
.member dd { margin: 0; overflow-wrap: anywhere; }
.member .you { position: absolute; top: 14px; right: 14px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.swatch.sel { border-color: var(--text); }

/* ============ GADKA ============ */
.talk-layout { flex: 1; display: flex; flex-direction: row; min-height: 0; max-width: 1200px; width: 100%; margin: 0 auto; }
.threads { width: 320px; flex: none; border-right: 1px solid var(--border); overflow: auto; padding: 8px; }
.thread { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--text); min-height: 56px; }
.thread:hover { background: var(--surface-2); text-decoration: none; }
.thread.active { background: var(--surface-3); }
.thread .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; flex: none; color: var(--muted); font-weight: 800; font-size: 13px; }
.thread.active .ic { background: var(--accent); color: var(--on-accent); }
.thread .ic svg { width: 18px; height: 18px; }
.thread .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread .tt { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread .tm { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.chat-head h2 { font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .back { display: none; }
.messages { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 78%; margin-top: 8px; }
.msg.cont { margin-top: 0; }
.msg.cont .avatar { visibility: hidden; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: var(--surface-2); border-radius: 18px; padding: 8px 14px; min-width: 0; }
.msg.mine .bubble { background: var(--accent-soft); }
.mhead { font-size: 12px; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.mhead .del { width: 24px; height: 24px; opacity: 0; }
.msg:hover .mhead .del { opacity: 1; }
.mhead .del svg { width: 14px; height: 14px; }
.mbody { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.mbody code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: 90%; }
.composer { display: flex; gap: 8px; padding: 10px 16px calc(10px + var(--safe-b)); border-top: 1px solid var(--border); align-items: flex-end; background: var(--surface); }
.composer textarea { flex: 1; min-height: var(--tap); max-height: 160px; resize: none; border-radius: 22px; }
.composer .btn { width: var(--tap); padding: 0; border-radius: 50%; }
@media (max-width: 899px) {
  .talk-layout { position: fixed; inset: 0; bottom: calc(64px + var(--safe-b)); top: 57px; }
  .threads { width: 100%; border-right: 0; }
  .chat { display: none; }
  body.chat-open .threads { display: none; }
  body.chat-open .chat { display: flex; }
  body.chat-open .talk-layout { bottom: 0; }
  body.chat-open .tabbar { display: none; }
  .chat-head .back { display: inline-flex; }
}

/* ============ USTAWIENIA ============ */
.settings h2 { margin-bottom: 12px; }
.settings code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; font-size: 90%; }

/* ============ ATRAKCJE ============ */
.tip h3 { margin-bottom: 6px; }
.tip p { margin: 0; color: var(--text-2); white-space: pre-wrap; }
.seg#seg { flex-wrap: wrap; }
.seg#seg button { flex: 1 0 auto; min-width: 44px; padding: 0 10px; }
.gl { display: grid; gap: 8px; }
.gl-item { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 14px 12px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.gl-item.hl { border-left: 4px solid var(--accent); }
.gl-item.wp { background: transparent; }
.gl-km { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 2px; font-variant-numeric: tabular-nums; }
.gl-km b { font-size: 18px; letter-spacing: -.02em; }
.gl-km span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.gl-body h3 { margin-bottom: 4px; }
.gl-body p { margin: 0 0 4px; color: var(--text-2); }
.gl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.gl-ic { font-size: 18px; }
@media (max-width: 520px) { .gl-item { grid-template-columns: 44px 1fr; gap: 8px; } .gl-km b { font-size: 15px; } }

/* ============ BUDŻET ============ */
.exp { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 6px; }
.exp-ic { font-size: 20px; width: 32px; text-align: center; flex: none; }
.exp-body { flex: 1; min-width: 0; cursor: pointer; }
.exp-t { font-weight: 700; overflow-wrap: anywhere; }
.exp-m { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.exp-amt { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.exp-amt b { font-size: 15px; }
.pos { color: var(--ok); } .neg { color: var(--danger); }
.settle { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.settle span { display: inline-flex; align-items: center; gap: 6px; }
.settle .arrow { color: var(--accent); font-weight: 700; }
.bar.bal { position: relative; } .bar.bal > span { position: absolute; top: 0; }
.bar.bal::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--border-strong); }

/* ============ GADKA – zdjęcia ============ */
.mimg { display: block; margin: 2px 0 4px; }
.mimg img { max-width: min(100%, 320px); max-height: 320px; border-radius: 12px; display: block; }
.lightbox { align-items: center; justify-content: center; background: rgba(0,0,0,.92); cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }
.composer .iconbtn { flex: none; margin-bottom: 3px; }

/* ============ POGODA ============ */
.weather { padding: 0 18px 10px; font-size: 13px; }
.weather:empty { display: none; }
.wx { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--surface-2); padding: 6px 10px; border-radius: 10px; }

/* ============ OFFLINE ============ */
.netchip { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 950; background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.netchip svg { width: 16px; height: 16px; }
body.offline .btn.primary { opacity: .5; }
