:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --ink: #000000;
  --muted: #6b7280;
  --line: #e5e7eb;
  --fill: #f3f4f6;
  --lime: #2cde6e;
  --lime-ink: #053516;
  --danger: #e11d48;
  --ok: #057a3a;
  --radius: 20px;
  --tap: 52px;
  --pad: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.app {
  width: min(480px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
}

.chrome {
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) var(--pad) 14px;
  background: #000;
  color: #fff;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  background: #000 url("icon-192.png") center/cover no-repeat;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
}

.topbar h1 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-page .topbar {
  align-items: flex-start;
  padding: calc(20px + env(safe-area-inset-top)) var(--pad) 22px;
}

.login-page .topbar-brand {
  align-items: flex-start;
  gap: 14px;
}

.login-page .logo {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-radius: 16px;
  box-shadow: none;
  margin-top: 2px;
}

.login-page .eyebrow {
  font-size: 18px;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.login-page .topbar h1 {
  font-size: 26px;
  line-height: 1.15;
}

.main {
  padding: 20px var(--pad) 28px;
}

.pwa-banner {
  margin: 0 0 16px;
}

.secret-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
}

.secret-modal:not(.is-armed) .secret-dialog {
  pointer-events: none;
}

.secret-modal[hidden] {
  display: none;
}

.secret-dialog {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 22px 18px 18px;
}

.secret-dialog p {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.secret-actions {
  display: grid;
  gap: 8px;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.lede {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.panel-head .lede { margin-bottom: 16px; }

.push-card {
  background: var(--fill);
  border-radius: 18px;
  padding: 16px;
  margin: 0 0 18px;
}

.push-status {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.push-status.is-on {
  color: var(--ok);
  font-weight: 700;
}

.push-actions {
  display: grid;
  gap: 8px;
}

.push-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.push-steps {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.push-steps li + li {
  margin-top: 6px;
}

.btn-quiet {
  background: #fff;
  color: #111827;
  border: 1px solid var(--line);
}

.stack {
  display: grid;
  gap: 16px;
}

label, .field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

input[type="password"],
input[type="text"],
textarea {
  width: 100%;
  border: 0;
  background: var(--fill);
  color: var(--ink);
  border-radius: 16px;
  padding: 16px;
  font: inherit;
  font-size: 16px;
  outline: none;
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(44, 222, 110, 0.35);
}

.hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hint {
  appearance: none;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 11px 14px;
  min-height: 44px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.hint:hover { background: #eef1f4; }

.hint.is-active {
  background: var(--lime);
  color: var(--lime-ink);
  box-shadow: none;
}

.lucky {
  --lucky-angle: 0deg;
  position: relative;
  isolation: isolate;
  margin-top: 14px;
  border-radius: 999px;
}

.lucky-halo,
.lucky-ring {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  padding: 3px;
  pointer-events: none;
  background: conic-gradient(
    from var(--lucky-angle),
    #ff2d55,
    #ff9f0a,
    #ffd60a,
    #32d74b,
    #64d2ff,
    #bf5af2,
    #ff2d55
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.lucky-halo {
  inset: -8px;
  padding: 7px;
  filter: blur(8px);
  opacity: 0.85;
}

.lucky-btn {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: #0a0a0a;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lucky-btn:hover { background: #141414; }
.lucky-btn:disabled { opacity: 1; }

.geo-status {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.geo-status.is-ok { color: var(--ok); }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.48);
}

.sheet[hidden] { display: none !important; }

.sheet-card {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 24px;
  padding: 22px 18px 16px;
  display: grid;
  gap: 10px;
}

.sheet-card h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.sheet-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.btn-plain {
  background: var(--fill);
  color: var(--ink);
}

.btn-maps {
  background: #1a73e8;
  color: #fff;
  margin-top: 12px;
}

.btn-maps:hover { background: #1558b0; }

.send-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.send-overlay.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.send-stage {
  width: min(260px, calc(100% - 48px));
  text-align: center;
  color: #fff;
}

.send-orb {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #000;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.send-orb::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--lime);
  animation: send-spin 0.7s linear infinite;
}

.send-overlay.is-done .send-orb {
  background: var(--lime);
}

.send-overlay.is-done .send-orb::before {
  animation: none;
  border-color: var(--lime);
}

.send-check {
  width: 22px;
  height: 12px;
  margin-top: -4px;
  border-left: 3.5px solid #fff;
  border-bottom: 3.5px solid #fff;
  transform: rotate(-45deg) scale(0);
  opacity: 0;
}

.send-overlay.is-done .send-check {
  border-color: var(--lime-ink);
  animation: send-pop 0.42s cubic-bezier(0.2, 0.85, 0.3, 1.25) forwards;
}

.send-text {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

@keyframes send-spin {
  to { transform: rotate(1turn); }
}

@keyframes send-pop {
  0% { transform: rotate(-45deg) scale(0.2); opacity: 0; }
  100% { transform: rotate(-45deg) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .send-orb::before { animation: none; border-color: var(--lime); }
  .send-overlay.is-done .send-check { animation: none; opacity: 1; transform: rotate(-45deg) scale(1); }
}

.hint.is-spin {
  background: #111;
  color: #fff;
  box-shadow: none;
  transform: scale(1.03);
}

.hint.is-landed {
  animation: hint-pop 0.5s ease;
}

@keyframes hint-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hint.is-landed { animation: none; }
}

.uploader {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}

.uploader input { display: none; }

.uploader-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background:
    linear-gradient(#000, #000) center/16px 2px no-repeat,
    linear-gradient(#000, #000) center/2px 16px no-repeat,
    var(--lime);
  margin-bottom: 8px;
}

.uploader-title {
  font-weight: 800;
  font-size: 15px;
}

.uploader-note {
  color: var(--muted);
  font-size: 13px;
}

.preview {
  display: none;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 10px;
}

.preview.is-on { display: block; }

button, .btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 16px;
}

.btn-primary {
  background: #000;
  color: #fff;
}

.btn-primary:hover { background: #1a1a1a; }

.btn-block {
  width: 100%;
  min-height: var(--tap);
  font-size: 16px;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
  flex: 0 0 auto;
}

.btn-danger {
  background: #fff1f2;
  color: var(--danger);
  min-height: 40px;
  font-size: 13px;
}

.btn-sos {
  background: #e11d48;
  color: #fff;
  letter-spacing: 0.04em;
}

.btn-sos:hover { background: #be123c; }

.flash {
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 14px;
}

.flash.ok { background: #d8ffe8; color: var(--ok); }
.flash.error, .error { background: #ffe4e6; color: var(--danger); }

.dock {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 10px;
  padding: 12px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(243, 244, 246, 0));
}

.has-dock .main {
  padding-bottom: 88px;
}

.list {
  display: grid;
  gap: 12px;
}

.item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  scroll-margin-top: 160px;
}

.item header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.item-id {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.item-time {
  margin: 3px 0 0;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.item-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.45;
}

.item-photo {
  display: block;
  margin-top: 12px;
}

.item-photo img,
.item-video {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 14px;
}

.item-video {
  margin-top: 12px;
  background: #000;
  object-fit: contain;
}

.empty {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lime);
  margin-bottom: 10px;
}

.empty p { margin: 0; font-weight: 600; }
.empty.compact { padding: 18px 16px; }
.empty-cta { margin-top: 16px; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1.1fr 0.85fr 1.15fr;
  gap: 6px;
  padding: 0 var(--pad) 12px;
  background: #000;
}

.tabs-admin {
  grid-template-columns: 1fr 1fr;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border-radius: 999px;
  background: #1f1f1f;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  padding: 0 6px;
}

.tab.is-active {
  background: var(--lime);
  color: var(--lime-ink);
}

.tab-vlog {
  background: #111827;
}

.tab-vlog.is-active {
  background: var(--lime);
  color: var(--lime-ink);
}

.tab-sos {
  background: #e11d48;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.15;
  padding: 0 6px;
}

.tab-sos:hover { background: #be123c; }

.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--lime-ink);
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}

.item-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.item-link.has-unread {
  box-shadow: inset 4px 0 0 var(--lime);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-nowe { background: #111827; color: #fff; }
.status-w_trakcie { background: var(--lime); color: var(--lime-ink); }
.status-zakonczone { background: #e5e7eb; color: #4b5563; }

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.status-btn {
  background: var(--fill);
  color: var(--ink);
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.status-btn.is-active.status-nowe,
.status-btn:disabled.status-nowe { background: #111827; color: #fff; }
.status-btn.is-active.status-w_trakcie,
.status-btn:disabled.status-w_trakcie { background: var(--lime); color: var(--lime-ink); }
.status-btn.is-active.status-zakonczone,
.status-btn:disabled.status-zakonczone { background: #d1d5db; color: #111827; }
.status-btn:disabled { opacity: 1; }

.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 12px;
  padding: 6px;
  background: #111827;
  border-radius: 18px;
}

.view-switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 14px;
  background: transparent;
  color: #d1d5db;
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
}

.view-switch-btn.is-active {
  background: #fff;
  color: #111827;
}

.view-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #374151;
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

.view-switch-btn.is-active .view-count {
  background: #111827;
  color: #fff;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
}

.filter-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  background: var(--fill);
  color: #111827;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
}

.filter-chip.is-active {
  background: #000;
  color: #fff;
}

.vlog-panel.is-shooting h2,
.vlog-panel.is-shooting .lede {
  display: none;
}

.vlog-stage {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #000;
  height: min(68dvh, 640px);
  margin: 0 0 16px;
}

.vlog-panel.is-shooting .vlog-stage {
  height: calc(100dvh - 168px);
}

.vlog-stage video,
.vlog-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.vlog-canvas {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.vlog-stage.is-front #vlog-live {
  transform: scaleX(-1);
}

.vlog-stage.is-recording {
  box-shadow: inset 0 0 0 3px #e11d48;
}

.vlog-stage.is-review .vlog-hud {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 28%);
}

.vlog-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62) 0%, transparent 34%, transparent 70%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

.vlog-hud button {
  pointer-events: auto;
}

.vlog-hud-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.vlog-timer {
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.vlog-status {
  margin: 0;
  max-width: 90%;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.vlog-start {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(280px, calc(100% - 48px));
}

.vlog-shutter-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 84px;
}

.vlog-icon-btn,
.vlog-text-btn,
.vlog-shutter-btn {
  appearance: none;
  border: 0;
  font: inherit;
}

.vlog-icon-btn {
  width: 48px;
  height: 48px;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.vlog-icon-btn svg {
  width: 22px;
  height: 22px;
}

.vlog-shutter-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #e11d48;
  box-shadow: 0 0 0 6px #fff;
}

.vlog-shutter-btn.is-recording {
  background: #e11d48;
}

.vlog-shutter-btn.is-recording::after {
  content: "";
  display: block;
  width: 26px;
  height: 26px;
  margin: 25px auto;
  border-radius: 6px;
  background: #fff;
}

.vlog-text-btn {
  justify-self: end;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-weight: 800;
  font-size: 14px;
}

.vlog-page.has-dock .main {
  padding-bottom: 20px;
}

.vlog-native-fallback {
  position: relative;
  margin: 0 0 16px;
  overflow: hidden;
}

.vlog-native-fallback input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.chevron {
  margin-left: auto;
  color: #9ca3af;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}

.wait-note { margin: 12px 0 0; }

.notice {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--lime-ink);
  font-size: 12px;
  font-weight: 800;
}

.meta-quiet {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.thread {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.bubble {
  background: #ecfff3;
  border-radius: 16px;
  padding: 12px 14px;
}

.bubble-meta {
  margin: 0 0 6px;
  color: var(--ok);
  font-size: 12px;
  font-weight: 800;
}

.reply-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.reply-form textarea { min-height: 96px; }

.back {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.ticket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  margin: 22px 0 10px;
  font-size: 18px;
  font-weight: 800;
}

@media (min-width: 720px) {
  body { background: #e8eaee; }
  .app {
    min-height: 100dvh;
    box-shadow: 0 0 0 1px #e5e7eb, 0 24px 60px rgba(0, 0, 0, 0.08);
  }
}

@media (max-width: 380px) {
  .topbar h1 { font-size: 13px; }
  .login-page .topbar h1 { font-size: 22px; }
  .login-page .eyebrow { font-size: 16px; }
  .panel h2 { font-size: 24px; }
  .hint { font-size: 13px; padding: 10px 12px; }
  .tab { font-size: 12px; }
  .tab-sos { font-size: 9px; }
}
