:root {
  --shell-width: 460px;
  --ink: #0d0b09;
  --surface: #18140f;
  --surface-2: #201a14;
  --surface-raised: #241d16;
  --line: rgba(244,239,230,0.09);
  --line-strong: rgba(244,239,230,0.16);
  --text: #f4efe6;
  --text-muted: #96897a;
  --text-dim: #5f564a;

  --heat-2: #7a3b22;
  --heat-4: #ff5a2e;
  --heat-5: #ffb35c;
  --trust: #3fbba6;
  --trust-soft: rgba(63,187,166,0.14);
  --danger: #ff8a5c;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.35);
  --shadow-lg: 0 24px 60px -16px rgba(0,0,0,0.6);
  --shadow-glow: 0 4px 20px -4px rgba(255,90,46,0.35);

  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

* { box-sizing: border-box; }
/* Bez tego jakikolwiek element z własnym `display` (np. .field: display:flex)
   zostaje widoczny mimo atrybutu [hidden] — specyficzność obu reguł jest
   równa, więc o wygranej decyduje kolejność w arkuszu, a reguła UA dla
   [hidden] ładuje się przed jakimkolwiek CSS-em autora. Złapane na #caLiczbaWystapienField. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(255,90,46,0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(63,187,166,0.06), transparent 55%),
    var(--ink);
  color: var(--text);
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: ui-monospace, "SF Mono", "Menlo", monospace; }

.app-shell {
  width: 100%; /* bez tego .app-shell jako element flex w body (od 860px)
    kurczy się do treści zamiast rosnąć do max-width — flex nie rozciąga
    na głównej osi tak jak zwykły blok. */
  max-width: var(--shell-width);
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* env(safe-area-inset-*) = 0 na urządzeniach bez wcięcia/paska gestów, więc
     ten sam kod działa wszędzie — nie tylko na iPhone z notchem. */
  padding: calc(1rem + env(safe-area-inset-top)) 1.1rem 1rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(24,20,15,0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--heat-4);
  box-shadow: 0 0 0 0 rgba(255,90,46,0.45); animation: pulse 2.1s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,90,46,0.5); } 70% { box-shadow: 0 0 0 9px rgba(255,90,46,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,46,0); } }
.wordmark { font-family: ui-monospace, monospace; font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; font-size: 1.02rem; }
.conn-badge { margin-left: auto; font-family: ui-monospace, monospace; font-size: 0.64rem; color: var(--text-dim); display: flex; align-items: center; gap: 0.3rem; }
.conn-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.conn-badge.ok { color: var(--trust); }
.conn-badge.err { color: var(--danger); }

.notif-bell {
  position: relative; background: none; border: none; color: var(--text-muted);
  font-size: 1.05rem; line-height: 1; cursor: pointer; padding: 0.2rem 0 0.2rem 0.6rem;
}
.notif-bell:active { transform: scale(0.92); }
.notif-badge {
  position: absolute; top: -0.3rem; right: -0.15rem; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; background: var(--heat-4); color: #17120c;
  font-family: ui-monospace, monospace; font-size: 0.6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.notif-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.9rem; }
.notif-head .scr-title { margin: 0; }
.notif-section-label {
  font-family: ui-monospace, monospace; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim); margin: 1.1rem 0 0.6rem;
}
.notif-row {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.75rem 0.9rem; margin-bottom: 0.5rem; font-size: 0.84rem; display: flex; gap: 0.6rem; align-items: flex-start;
}
.notif-row.unread { border-color: rgba(255,90,46,0.35); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--heat-4); flex: none; margin-top: 0.35rem; }
.notif-row-body { flex: 1; min-width: 0; }
.notif-row-text { color: var(--text); line-height: 1.5; }
.notif-row-meta { color: var(--text-dim); font-family: ui-monospace, monospace; font-size: 0.68rem; margin-top: 0.25rem; }
.notif-row-mark { background: none; border: none; color: var(--trust); font-size: 0.72rem; cursor: pointer; flex: none; padding: 0.2rem; }
.notif-empty { color: var(--text-dim); font-size: 0.85rem; padding: 0.4rem 0 1rem; }

#root { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

.screen {
  display: none; flex: 1; flex-direction: column;
  padding: 1.4rem 1.1rem calc(1rem + env(safe-area-inset-bottom));
  animation: screen-in .32s var(--ease-out); overflow-y: auto; min-height: 0;
}
.screen.active { display: flex; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

.scr-title {
  font-family: ui-monospace, monospace; font-weight: 800; text-transform: uppercase;
  font-size: 1.7rem; line-height: 1.05; margin: 0 0 0.55rem; letter-spacing: -0.02em;
}
.scr-sub { color: var(--text-muted); font-size: 0.88rem; line-height: 1.55; margin: 0 0 1.3rem; max-width: 40ch; }
.section-h { font-family: ui-monospace, monospace; font-weight: 700; text-transform: uppercase; font-size: 0.92rem; letter-spacing: 0.02em; margin: 0 0 0.9rem; color: var(--text-muted); }

.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.1rem; font-size: 0.82rem; color: var(--text-muted); }
.field input, .field select, .field textarea {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.85rem 0.95rem; font-size: 1rem; color: var(--text); font-family: ui-monospace, monospace;
  transition: border-color .18s, box-shadow .18s;
}
.field textarea { resize: vertical; font-family: -apple-system, sans-serif; font-size: 0.9rem; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--heat-4); box-shadow: 0 0 0 3px rgba(255,90,46,0.15);
}

.fab {
  position: absolute; right: 1.1rem; bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--heat-4), var(--heat-5));
  color: #17120c; font-size: 1.7rem; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow); cursor: pointer; z-index: 20;
}
.fab:hover { filter: brightness(1.05); }

.checkbox-field {
  display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 1.1rem;
  font-size: 0.78rem; line-height: 1.45; color: var(--text-muted);
}
.checkbox-field input { margin-top: 0.15rem; flex: none; accent-color: var(--heat-4); width: 16px; height: 16px; }
.checkbox-field a { color: var(--trust); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn {
  border: none; border-radius: 12px; padding: 0.85rem 1rem; font-size: 0.9rem; font-weight: 700;
  font-family: -apple-system, sans-serif; cursor: pointer;
  transition: transform .15s var(--ease-spring), filter .15s, opacity .15s, box-shadow .15s;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(155deg, var(--heat-5), var(--heat-4) 55%);
  color: #1a0f08; box-shadow: var(--shadow-glow);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 6px 26px -4px rgba(255,90,46,0.5); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); margin-top: 0.5rem; }
.btn-ghost:hover { border-color: var(--line-strong); }
.btn-danger { color: var(--danger); border-color: rgba(255,138,92,0.3); }
.btn-danger:hover { border-color: var(--danger); background: rgba(255,138,92,0.08); }
.btn-block { width: 100%; }
.btn-small { padding: 0.48rem 0.7rem; font-size: 0.76rem; border-radius: 9px; }

.error-text { color: var(--danger); font-size: 0.8rem; min-height: 1.2em; margin-top: 0.6rem; }

.location-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.chip {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.45rem 0.8rem; font-size: 0.76rem; color: var(--text); cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.chip:hover { border-color: var(--heat-4); }
.chip:active { transform: scale(0.96); }
.loc-label { font-size: 0.68rem; color: var(--text-dim); font-family: ui-monospace, monospace; }

.template-row { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.3rem; margin-bottom: 1.1rem; }
.template-item { display: flex; align-items: center; gap: 0.15rem; flex: none; }
.template-row .chip { flex: none; white-space: nowrap; }
.template-row .chip.wlasny { border-color: rgba(63,187,166,0.35); }
.template-delete {
  flex: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--danger); font-size: 0.8rem; width: 1.5rem; height: 1.5rem; cursor: pointer; line-height: 1;
}

.pole-row { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; }
.pole-row input { flex: 1; min-width: 0; }
.pole-row button {
  flex: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  color: var(--danger); font-size: 0.9rem; width: 2.4rem; cursor: pointer;
}

.controls-row { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 1.1rem; flex-wrap: wrap; }

/* ---- segmentowana kontrolka zasięgu ---- */
.segmented {
  position: relative; display: flex; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px;
}
.seg-btn {
  position: relative; z-index: 1; background: none; border: none; color: var(--text-muted);
  font-family: -apple-system, sans-serif; font-size: 0.74rem; font-weight: 600;
  padding: 0.42rem 0.6rem; border-radius: 8px; cursor: pointer;
  transition: color .2s;
}
.seg-btn.on { color: #1a0f08; }
.seg-thumb {
  position: absolute; top: 3px; left: 3px; bottom: 3px; border-radius: 8px;
  background: linear-gradient(155deg, var(--heat-5), var(--heat-4) 55%);
  box-shadow: 0 2px 8px -2px rgba(255,90,46,0.5);
  transition: transform .28s var(--ease-spring), width .28s var(--ease-spring);
  z-index: 0;
}
.slider-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.72rem; color: var(--text-muted); flex: 1; min-width: 140px; }
.slider-field input[type="range"] { accent-color: var(--heat-4); }

.map-box {
  height: 230px; border-radius: 14px; overflow: hidden; margin-bottom: 1.1rem;
  border: 1px solid var(--line); flex: none; background: var(--surface-2); box-shadow: var(--shadow-sm);
}

/* Leaflet renderuje własne, jasne popupy domyślnie — nadpisujemy na ciemny motyw. */
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-popup-content-wrapper { box-shadow: var(--shadow-md); border-radius: 12px; }
.leaflet-popup-content { margin: 0.7rem 0.8rem; font-family: -apple-system, sans-serif; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-muted); }
.leaflet-control-attribution { background: rgba(23,20,15,0.75) !important; color: var(--text-dim) !important; font-size: 0.62rem !important; }
.leaflet-control-attribution a { color: var(--text-muted) !important; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; }

/* Jedyny puls na mapie, zarezerwowany dla aktywności "TERAZ" — zasada żaru. */
.heat-marker-live { animation: heat-pulse 1.5s ease-in-out infinite; }
@keyframes heat-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .heat-marker-live, .card-live::before { animation: none; } }

.map-popup-title { font-weight: 700; font-size: 0.86rem; margin-bottom: 0.2rem; }
.map-popup-meta { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 0.5rem; }
.map-popup-reason { font-family: ui-monospace, monospace; font-size: 0.6rem; color: var(--trust); display: block; margin-bottom: 0.55rem; }
.map-popup-join { background: var(--heat-4); color: #17120c; border: none; border-radius: 8px; padding: 0.4rem 0.7rem; font-size: 0.78rem; font-weight: 700; cursor: pointer; }

.counts-row { display: flex; gap: 0.5rem; margin-bottom: 1.1rem; flex-wrap: wrap; }

.sponsored-card {
  background: linear-gradient(165deg, var(--surface-raised), var(--surface));
  border: 1px solid rgba(255,179,92,0.25); border-radius: 14px;
  padding: 0.85rem 1rem; margin-bottom: 1.1rem;
}
.sponsored-label {
  font-family: ui-monospace, monospace; font-size: 0.62rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--heat-5); background: rgba(255,179,92,0.14);
  border-radius: 999px; padding: 0.15rem 0.5rem; display: inline-block; margin-bottom: 0.4rem;
}
.sponsored-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.2rem; }
.sponsored-body { font-size: 0.82rem; color: var(--text-muted); }
.count-pill { font-family: ui-monospace, monospace; font-size: 0.65rem; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.22rem 0.6rem; }

.card-list { display: flex; flex-direction: column; gap: 0.7rem; padding-bottom: 1rem; }
.card {
  background: linear-gradient(165deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--line); border-radius: 14px; padding: 0.95rem 1.05rem;
  display: flex; flex-direction: column; gap: 0.32rem; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .18s var(--ease-out), box-shadow .18s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--heat, var(--heat-4));
  box-shadow: 0 0 12px -2px var(--heat, var(--heat-4));
}
.card-live::before { animation: heat-pulse 1.5s ease-in-out infinite; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.card-title { font-weight: 700; font-size: 0.95rem; }
.card-title-btn {
  background: none; border: none; color: var(--text); text-align: left; padding: 0;
  font-family: -apple-system, sans-serif; cursor: pointer;
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-title-btn:hover { text-decoration: underline; text-decoration-color: var(--heat-4); }
.star-btn {
  flex: none; background: none; border: none; font-size: 1rem; line-height: 1;
  color: var(--text-dim); cursor: pointer; padding: 0 0.15rem;
}
.star-btn.active { color: var(--heat-5); }
.star-btn:active { transform: scale(0.9); }
.card-meta { font-size: 0.72rem; color: var(--text-dim); }
.card-reason {
  align-self: flex-start; font-family: ui-monospace, monospace; font-size: 0.62rem; color: var(--trust);
  background: var(--trust-soft); border-radius: 999px; padding: 0.16rem 0.5rem;
}
.card-reason.surprise { color: var(--heat-5); background: rgba(255,179,92,0.12); }
.series-badge { color: var(--trust); }

.tag-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.3rem 0; }
.tag-pill {
  font-family: ui-monospace, monospace; font-size: 0.68rem; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.12rem 0.55rem;
}
.card-actions { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.card-actions .btn { flex: 1; }

.card-photo {
  width: calc(100% + 2.1rem); height: 120px; object-fit: cover;
  margin: -0.95rem -1.05rem 0.32rem; border-radius: 14px 14px 0 0; display: block;
}

.detail-photo { width: 100%; height: 160px; object-fit: cover; border-radius: 14px; margin-bottom: 0.9rem; }
.empty-note { color: var(--text-dim); font-size: 0.82rem; text-align: center; padding: 2rem 1rem; }

/* ---- szkielety ładowania ---- */
.skeleton-card { gap: 0.5rem; }
.skeleton-card::before { background: var(--line); box-shadow: none; }
.skel-line, .skel-pill {
  border-radius: 6px;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--line-strong) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skel-line { height: 12px; }
.skel-line.w60 { width: 60%; }
.skel-line.w40 { width: 40%; }
.skel-pill { height: 18px; width: 34%; border-radius: 999px; margin-top: 0.2rem; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -20% 0; } }
@media (prefers-reduced-motion: reduce) { .skel-line, .skel-pill { animation: none; } }

/* ---- bento: profil ---- */
.bento-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin-bottom: 0.9rem; }
.bento-tile {
  background: linear-gradient(165deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--line); border-radius: 14px; padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow-sm);
}
.bento-tile.wide { grid-column: 1 / -1; }
.bento-label { font-size: 0.64rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.35rem; font-family: ui-monospace, monospace; }
.bento-value { font-weight: 800; font-size: 1.15rem; }
.bento-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }

.profile-actions { margin-top: auto; display: flex; flex-direction: column; gap: 0.3rem; padding-top: 0.6rem; }
#profileBox, #compassBox, .premium-box, .referral-box {
  background: linear-gradient(165deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--line); border-radius: 14px;
  padding: 0.95rem 1.05rem; margin-bottom: 0.9rem; font-size: 0.84rem; box-shadow: var(--shadow-sm);
}
.premium-box { border-color: rgba(255,179,92,0.25); }
.referral-box { border-color: rgba(63,187,166,0.25); }
.referral-code {
  font-size: 1.1rem; font-weight: 800; letter-spacing: 0.14em; text-align: center;
  color: var(--trust); background: var(--trust-soft); border-radius: 10px; padding: 0.5rem; margin-top: 0.6rem;
}
.referral-note {
  font-size: 0.82rem; color: var(--trust); background: var(--trust-soft); border-radius: 10px;
  padding: 0.55rem 0.8rem; margin: -0.4rem 0 1rem;
}
.kv-row { display: flex; justify-content: space-between; padding: 0.35rem 0; border-bottom: 1px solid var(--line); font-size: 0.8rem; gap: 0.8rem; }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--text-muted); }
.kv-row .v { font-family: ui-monospace, monospace; text-align: right; }
.detail-pola:not(:empty) {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.3rem 0.9rem; margin-bottom: 1rem;
}

.xp-track { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 0.7rem; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--heat-4), var(--heat-5)); transition: width .4s var(--ease-out); }
.xp-label { font-size: 0.68rem; color: var(--text-dim); margin-top: 0.35rem; font-family: ui-monospace, monospace; }

.axis-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; font-size: 0.72rem; }
.axis-row .aname { width: 100px; flex: none; color: var(--text-muted); }
.axis-track { flex: 1; height: 5px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.axis-fill { height: 100%; background: linear-gradient(90deg, var(--heat-4), var(--heat-5)); transition: width .4s var(--ease-out); }

/* ---- pasek zakładek: pływający pasek ---- */
.tabbar {
  display: flex; justify-content: space-around; padding: 0.5rem; margin: 0.6rem 0 0.2rem; flex: none;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem; font-size: 0.62rem;
  color: var(--text-dim); background: none; border: none; font-family: -apple-system, sans-serif;
  cursor: pointer; padding: 0.45rem 0.9rem; border-radius: 11px; transition: color .2s, background .2s;
}
.tab .ico { font-size: 1.1rem; }
.tab.on { color: var(--heat-5); background: rgba(255,90,46,0.12); }

.tab-panel { display: none; flex: 1; flex-direction: column; overflow-y: auto; min-height: 0; }
.tab-panel.active { display: flex; }

#screen-app.active {
  padding: 1.2rem 1.1rem calc(0.9rem + env(safe-area-inset-bottom));
  overflow: hidden; min-height: 0;
}

.quiz-card { background: linear-gradient(165deg, var(--surface-raised), var(--surface)); border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem 0.95rem; margin-bottom: 0.7rem; box-shadow: var(--shadow-sm); }
.quiz-sit { font-size: 0.84rem; margin-bottom: 0.65rem; }
.quiz-opts { display: flex; flex-direction: column; gap: 0.4rem; }
.quiz-opt {
  text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.6rem 0.75rem; font-size: 0.82rem; color: var(--text); cursor: pointer; font-family: -apple-system, sans-serif;
  transition: border-color .15s, background .15s, transform .1s;
}
.quiz-opt:active { transform: scale(0.98); }
.quiz-opt.picked { border-color: var(--heat-4); background: rgba(255,90,46,0.1); color: var(--heat-5); }

/* ---- rezonans Kompasów (dolny arkusz aktywności) ---- */
.constellation-list { display: flex; flex-direction: column; gap: 0.7rem; overflow-y: auto; flex: 1; }
.const-row {
  display: flex; align-items: center; gap: 0.8rem; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 13px; padding: 0.7rem 0.9rem;
}
.const-shape { flex: none; filter: drop-shadow(0 0 0 transparent); transition: filter .3s; }
.const-shape.res-high { filter: drop-shadow(0 0 6px var(--trust)); animation: resonate 1.8s ease-in-out infinite; }
.const-shape.res-mid { filter: drop-shadow(0 0 3px rgba(63,187,166,0.5)); }
@keyframes resonate { 0%, 100% { filter: drop-shadow(0 0 4px var(--trust)); } 50% { filter: drop-shadow(0 0 11px var(--trust)); } }
@media (prefers-reduced-motion: reduce) { .const-shape.res-high { animation: none; } }
.const-info { flex: 1; }
.const-name { font-weight: 700; font-size: 0.88rem; display: flex; align-items: center; gap: 0.4rem; }
.const-badge { font-size: 0.6rem; color: var(--trust); background: var(--trust-soft); border-radius: 999px; padding: 0.1rem 0.4rem; }
.const-badge.premium { color: var(--heat-5); background: rgba(255,179,92,0.14); }
.const-resonance { font-size: 0.72rem; color: var(--text-dim); font-family: ui-monospace, monospace; margin-top: 0.15rem; }
.const-resonance.strong { color: var(--trust); }

/* ---- dolny arkusz (bottom sheet) ---- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(8,6,4,0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .28s var(--ease-out); z-index: 20;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; width: 100%; max-width: var(--shell-width); transform: translate(-50%, 100%);
  background: var(--surface); border: 1px solid var(--line-strong); border-bottom: none;
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  max-height: 82vh; display: flex; flex-direction: column;
  padding: 0.6rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom));
  transition: transform .34s var(--ease-spring); z-index: 21; overflow-y: auto;
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle { width: 36px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 0 auto 0.9rem; flex: none; }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { transition: none; } }

.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%) translateY(10px);
  background: var(--trust); color: #062420; font-weight: 700; font-size: 0.82rem;
  padding: 0.65rem 1.1rem; border-radius: 11px; opacity: 0; pointer-events: none; box-shadow: var(--shadow-md);
  transition: opacity .2s, transform .2s; z-index: 30; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: #2a0f04; }

/* =========================================================================
   Klasyczny komputer: ten sam HTML/JS, inny układ, nie osobna aplikacja.
   Poniżej 860px NOW zachowuje się jak pełnoekranowa aplikacja telefoniczna
   (edge-to-edge, 100dvh) — dokładnie tak, jak wygląda po dodaniu do ekranu
   głównego na iOS/Android. Powyżej 860px byłaby to po prostu wąska kolumna
   zawieszona w morzu czerni, więc zamiast "wersji desktopowej" jako osobnego
   bytu, ten sam interfejs dostaje: oprawę okna, więcej miejsca poziomego i
   dwukolumnowy układ na ekranie odkrywania, gdzie mapa i lista i tak
   koncepcyjnie są dwoma osobnymi rzeczami. ========================== */
@media (min-width: 860px) {
  :root { --shell-width: 940px; }

  body {
    display: flex; align-items: center; justify-content: center;
    padding: 2.5rem 1.5rem; min-height: 100vh;
  }

  .app-shell {
    height: min(920px, calc(100vh - 5rem));
    border: 1px solid var(--line-strong);
    border-radius: 26px;
    box-shadow: var(--shadow-lg);
  }
  .topbar { border-radius: 26px 26px 0 0; }

  /* Ekran odkrywania: kolumna z mapą/filtrami po lewej (stała szerokość,
     nie przewija się razem z listą), lista wyników po prawej. Ten sam DOM,
     który na telefonie po prostu leci jeden pod drugim w kolumnie. */
  #tab-discover.active {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.4rem;
    align-items: stretch; /* obie kolumny wypełniają wysokość wiersza siatki,
                              inaczej height:100% na dzieciach nie ma się do
                              czego odnieść i wewnętrzny scroll nie zadziała */
    overflow: hidden;
    min-height: 0;
  }
  .discover-left { display: flex; flex-direction: column; overflow-y: auto; min-height: 0; padding-right: 0.2rem; }
  .discover-right.card-list { min-height: 0; overflow-y: auto; }
  .map-box { height: 280px; }

  /* Bento profilu zostaje przy dwóch kolumnach nawet tutaj — są dokładnie
     dwa zwykłe kafle (Poziom, Seria) plus jeden szeroki (XP); trzecia
     kolumna zostawiałaby widoczną pustą dziurę bez żadnej treści do niej. */

  /* Arkusz szczegółów podąża za szerokością ramki zamiast zostawać wąski —
     inaczej wyglądałby jak telefon przyklejony do szerokiego okna. */
  .sheet { border-radius: 22px; }

  /* Logowanie zostaje wygodną kolumną do czytania i wypełniania nawet w
     szerokiej ramce — panel rośnie, formularz nie musi rosnąć razem z nim. */
  #screen-phone, #screen-code, #tab-profile, #screen-quiz.active {
    max-width: 560px; margin: 0 auto; width: 100%;
  }

  /* Pulsujący punkt w topbarze i tak reaguje na prawdziwe dane — na szerokim
     ekranie zostaje bez zmian, to nie jest coś, co "dopasowuje się do
     komputera", tylko stały element marki. */
}

/* Bardzo szerokie okna (>1400px): oprawa nie rośnie w nieskończoność, żeby
   NOW nie zamieniło się w rozciągniętą, nieczytelną tablicę ogłoszeń. */
@media (min-width: 1400px) {
  :root { --shell-width: 1080px; }
  #tab-discover.active { grid-template-columns: 360px 1fr; }
}
