:root {
  --bg: #FFFBF2; --card: #FFFFFF; --ink: #1F2937; --muted: #6B7280; --line: #EADFC8;
  --pri: #1E40AF; --pri-ink: #FFFFFF; --pri-soft: #DBEAFE; --acc: #DC2626; --sand: #FEF3C7; --amber: #B45309;
  --ok: #047857; --bad: #B91C1C; --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0F172A; --card: #1E293B; --ink: #F1F5F9; --muted: #94A3B8; --line: #334155;
    --pri: #93C5FD; --pri-ink: #0F172A; --pri-soft: #1E3A8A; --sand: #3B2F14; --amber: #FBBF24; --ok: #34D399; --bad: #F87171; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--pri); }
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(76px + var(--safe-b)); }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: .2px; }
.logo { width: 32px; height: 32px; border-radius: 8px; }
.net { margin-left: auto; font-size: 12px; background: var(--acc); color: #fff; padding: 2px 8px; border-radius: 99px; }
main { padding: 14px 16px; }
h2 { font-size: 19px; margin: 18px 0 10px; }
h3 { font-size: 16px; margin: 14px 0 8px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.btn { border: 0; border-radius: 10px; padding: 10px 14px; background: var(--pri); color: var(--pri-ink); font-weight: 600; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--pri); border: 1px solid var(--line); }
.btn.soft { background: var(--pri-soft); color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { padding: 6px 10px; font-size: 14px; border-radius: 8px; }
.btn:disabled { opacity: .5; }
input[type=text], input[type=email], input[type=date], input[type=number], select {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
label.field { display: block; margin: 10px 0; }
label.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.suggest { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.suggest li { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.suggest li:last-child { border-bottom: 0; }
.suggest li:active { background: var(--pri-soft); }

/* informacje o miejscu */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-grid div { background: var(--sand); border-radius: 10px; padding: 8px 10px; }
.info-grid b { display: block; font-size: 17px; }
.info-grid small { color: var(--muted); font-size: 12px; }
.forecast { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 10px; text-align: center; font-size: 12px; }
.forecast div { background: var(--pri-soft); border-radius: 8px; padding: 6px 2px; }
.forecast .ic { font-size: 18px; display: block; }
.forecast .t { font-weight: 600; }

/* atrakcje */
.attr { padding: 0; overflow: hidden; }
.attr .ph { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--sand); }
.attr .ph.empty { display: flex; align-items: center; justify-content: center; font-size: 42px; }
.attr .body { padding: 12px 14px 14px; }
.attr h3 { margin: 0 0 4px; font-size: 17px; }
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--sand); color: var(--amber); margin-right: 6px; }
.dist { font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.star.on { background: #FBBF24; color: #1F2937; }
.more { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.gallery { display: flex; gap: 6px; overflow-x: auto; margin: 8px -2px; padding-bottom: 4px; }
.gallery img { height: 110px; border-radius: 8px; flex: none; }
.facts { margin: 8px 0; padding: 0; list-style: none; font-size: 14px; }
.facts li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: 0; }
.facts b { color: var(--muted); font-weight: 600; }
.fees { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0; }
.fees td { padding: 4px 0; border-bottom: 1px solid var(--line); }
.fees td:last-child { text-align: right; white-space: nowrap; }
.agency { padding: 8px 0; border-bottom: 1px solid var(--line); }
.agency:last-child { border-bottom: 0; }
.notice { background: var(--sand); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.err { background: #FEE2E2; color: #7F1D1D; border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.loading { text-align: center; padding: 30px 10px; color: var(--muted); }
.spin { width: 34px; height: 34px; border: 4px solid var(--pri-soft); border-top-color: var(--pri); border-radius: 50%; margin: 0 auto 12px; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* mapa */
#map { height: 62vh; border-radius: var(--radius); border: 1px solid var(--line); }
.mnum { background: var(--acc); color: #fff; border-radius: 50%; width: 26px; height: 26px; line-height: 26px; text-align: center; font-weight: 700; font-size: 13px; border: 2px solid #fff; }
.mlist { margin-top: 10px; }
.mlist div { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mlist .n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--acc); color: #fff; text-align: center; font-size: 12px; line-height: 24px; }

/* ustawienia */
.toggle { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.toggle:last-child { border-bottom: 0; }
.sw { position: relative; width: 48px; height: 28px; flex: none; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; }
.sw span::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.sw input:checked + span { background: var(--pri); }
.sw input:checked + span::before { transform: translateX(20px); }
input[type=range] { width: 100%; }

/* admin */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stats div { background: var(--pri-soft); border-radius: 10px; padding: 10px; }
.stats b { display: block; font-size: 22px; }
.stats small { color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; margin-top: 8px; }
.bars i { flex: 1; background: var(--pri); border-radius: 3px 3px 0 0; min-height: 2px; }
.user { border-bottom: 1px solid var(--line); padding: 10px 0; }
.user:last-child { border-bottom: 0; }
.user .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--line); }
.badge.bad { background: var(--bad); color: #fff; }
.badge.adm { background: var(--pri); color: var(--pri-ink); }
.ev { font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line); }

/* odtwarzacz */
.player { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(66px + var(--safe-b)); width: min(720px, 100%); background: var(--pri); color: var(--pri-ink); padding: 8px 14px 10px; z-index: 30; box-shadow: 0 -4px 14px rgba(0,0,0,.15); }
.pl-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-bar { height: 6px; background: rgba(255,255,255,.35); border-radius: 3px; margin: 6px 0; cursor: pointer; }
.pl-bar div { height: 100%; width: 0; background: #FBBF24; border-radius: 3px; }
.pl-btns { display: flex; justify-content: space-around; }
.pl-btns button { background: transparent; border: 0; font-size: 24px; padding: 2px 14px; cursor: pointer; color: inherit; }
#app.has-player { padding-bottom: calc(160px + var(--safe-b)); }

/* zakładki */
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(720px, 100%); display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 40; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px 2px 8px; font-size: 11px; color: var(--muted); cursor: pointer; }
.tabs button span { display: block; font-size: 21px; line-height: 1.2; }
.tabs button.on { color: var(--pri); font-weight: 700; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--safe-b)); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; font-size: 14px; max-width: 90%; }
.login { max-width: 420px; margin: 30px auto; text-align: center; }
.login img { width: 96px; height: 96px; border-radius: 22px; }
.print-area { display: none; }

@media print {
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; color: #000; background: #fff; }
  .print-area .pa { page-break-inside: avoid; border-bottom: 1px solid #ccc; padding: 10px 0; }
  .print-area img { max-width: 100%; max-height: 260px; }
  .print-area h1 { font-size: 24px; }
}
