/* Blutr — Report Pollution screen styles */

:root {
  --teal: #5BB8C7;
  --teal-dark: #3FA0B0;
  --teal-soft: #E5F4F7;
  --teal-soft-2: #D6EBF1;
  --ink: #111827;
  --ink-2: #374151;
  --ink-3: #6B7280;
  --line: #E5E7EB;
  --line-2: #F3F4F6;
  --bg: #FFFFFF;
  --bg-soft: #F9FAFB;
  --danger: #E94B4B;
  --shadow-card: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.06);
  --shadow-sheet: 0 -10px 40px rgba(17, 24, 39, 0.18);
  --radius-card: 18px;
  --radius-tile: 16px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #EFEFF3;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ==============  Page (canvas)  ============== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 64px;
  gap: 28px;
  background:
    radial-gradient(1200px 600px at 80% -10%, #DCEEF2 0%, transparent 60%),
    radial-gradient(900px 600px at 10% 110%, #E8E6F0 0%, transparent 55%),
    #F4F4F8;
}

.page-header {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-family: "SF Pro Display", -apple-system, system-ui, sans-serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.page-header .lede {
  color: var(--ink-3);
  font-size: 14px;
  margin: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal) 0%, #7DD0DC 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

/* ==============  Frames row  ============== */
.frames-row {
  width: 100%;
  max-width: 1400px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 32px;
  align-items: start;
  justify-items: center;
}

.frame-caption {
  text-align: center;
  margin-top: 14px;
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ==============  Phone frame  ============== */
.phone {
  width: 390px;
  max-width: 100%;
  aspect-ratio: 390 / 844;
  background: #fff;
  border-radius: 54px;
  border: 9px solid #1a1a1a;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.phone-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #FFF;
  overflow: hidden;
}

.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 30px;
  background: #1a1a1a;
  border-radius: 999px;
  z-index: 30;
}

.home-indicator {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 4px;
  background: #1a1a1a;
  border-radius: 4px;
  z-index: 30;
}

/* ==============  Status / search / alert / nav  ============== */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px 6px;
  flex-shrink: 0;
}

.status-time {
  font-weight: 600;
  font-size: 15px;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-bar {
  margin: 6px 16px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
}

.search-text {
  color: #9CA3AF;
  font-size: 15px;
}

.alert-banner {
  margin: 0 16px;
  background: #E5EEF8;
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 22px 1fr 18px;
  gap: 12px;
  align-items: start;
  flex-shrink: 0;
}

.alert-icon {
  padding-top: 2px;
}

.alert-title-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.alert-title-row strong {
  color: #1F4E83;
  font-size: 14px;
  font-weight: 700;
}

.alert-meta {
  color: #1F4E83;
  font-size: 13px;
  margin-top: 1px;
}

.alert-sub {
  color: #4B6480;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}

.alert-x {
  background: transparent;
  border: none;
  color: var(--ink-2);
  font-size: 14px;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

.bottom-nav {
  margin-top: auto;
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 16px 22px;
  position: relative;
  z-index: 5;
}

.nav-tab {
  background: none;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 0;
}

.nav-tab.is-active {
  color: var(--teal);
}

.nav-plus {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--teal);
  border: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px -4px rgba(91, 184, 199, 0.75);
  transition: transform 0.1s, background 0.15s;
  flex-shrink: 0;
  margin-bottom: 4px;
}

.nav-plus:hover {
  background: #4FA8B7;
}

.nav-plus:active {
  transform: scale(0.93);
}

/* ==============  Map page + sheet  ============== */
.map-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  position: relative;
}

.map-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 220px;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
  transition: transform 0.1s;
}

.map-pin:hover {
  transform: translate(-50%, -100%) scale(1.15);
}

.map-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: 0 -6px 20px rgba(17, 24, 39, 0.10);
  z-index: 4;
  transition: height 0.3s cubic-bezier(.2, .7, .2, 1);
  display: flex;
  flex-direction: column;
  touch-action: none;
}

.map-sheet.is-peek {
  height: 120px;
  overflow: hidden;
  cursor: pointer;
}

.map-sheet.is-peek .sheet-list {
  display: none;
}

.map-sheet.is-peek .sheet-handle {
  width: 36px;
  height: 3px;
  margin-top: 10px;
  background: rgba(156, 163, 175, 0.55);
  border-radius: 3px;
}

.map-sheet.is-expanded {
  height: 50%;
  overflow-y: auto;
}

.map-sheet--detail {
  height: auto;
  max-height: 50%;
  padding-bottom: 14px;
  overflow-y: auto;
}

.sheet-handle {
  width: 38px;
  height: 4px;
  background: #D1D5DB;
  border-radius: 4px;
  margin: 8px auto 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.sheet-tabs {
  display: flex;
  gap: 8px;
  padding: 6px 14px 4px;
  border-bottom: 1px solid #F3F4F6;
  flex-shrink: 0;
}

.sheet-tab {
  background: none;
  border: 0;
  padding: 8px 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
}

.sheet-tab.is-active {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
}

.sheet-list {
  overflow-y: auto;
  flex: 1;
  padding: 10px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F4F5F7;
}

.loc-row {
  background: #fff;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 4px 10px rgba(17, 24, 39, 0.04);
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.15s;
}

.loc-row:hover {
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 6px 14px rgba(17, 24, 39, 0.08);
}

.loc-row:active {
  transform: scale(0.99);
}

.loc-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.loc-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.loc-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.loc-score {
  text-align: right;
}

.loc-score-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tr {
  font-size: 11px;
  color: var(--ink-3);
}

.tr-rising {
  color: #C73838;
}

.tr-improving {
  color: #16A34A;
}

.tr-good {
  color: #16A34A;
}

.tr-stable {
  color: #6B7280;
}

.sheet-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-3);
}

/* Detail sheet */
.sheet-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 16px 4px;
  gap: 12px;
}

.detail-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.detail-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.risk-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 16px 6px;
}

.stat-tile {
  background: #F1F2F4;
  border-radius: 14px;
  padding: 12px 10px 10px;
  text-align: left;
}

.stat-tile-num {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}

.stat-tile-lbl {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 4px;
  line-height: 1.3;
  font-weight: 500;
}

.stat-tile--danger {
  background: #E94B4B;
}

.stat-tile--danger .stat-tile-num,
.stat-tile--danger .stat-tile-lbl {
  color: #fff;
  font-weight: 600;
}

.stat-tile--danger .stat-tile-num {
  font-weight: 800;
}

.ai-card {
  margin: 12px 16px;
  background: #DEEBF8;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
}

.ai-icon {
  padding-top: 2px;
}

.ai-title {
  color: #3B5BDB;
  font-weight: 700;
  font-size: 14px;
}

.ai-text {
  color: #5A87C8;
  font-size: 12.5px;
  line-height: 1.45;
  margin-top: 4px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  padding: 4px 16px 8px;
  align-items: center;
  justify-content: center;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: #4F62D6;
}

.btn-secondary {
  background: #E5E7EB;
  color: var(--ink);
}

.btn-secondary:hover {
  background: #D1D5DB;
}

.btn-icon {
  background: #E5E7EB;
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.btn-icon:hover {
  background: #D1D5DB;
}

/* ==============  Map backdrop  ============== */
.map-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ==============  Modal sheet (mobile)  ============== */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.32);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes slide-up {
  from {
    transform: translateY(20px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

.rp-sheet {
  width: 100%;
  background: #fff;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 18px 18px 22px;
  max-height: 92%;
  overflow-y: auto;
  box-shadow: var(--shadow-sheet);
  position: relative;
  animation: slide-up 0.32s cubic-bezier(.2, .7, .2, 1);
}

.rp-sheet::-webkit-scrollbar {
  width: 0;
}

/* drag handle for sheet */
.rp-sheet::before {
  content: '';
  display: block;
  width: 38px;
  height: 4px;
  background: #E5E7EB;
  border-radius: 4px;
  margin: -6px auto 8px;
}

/* ==============  Report Pollution form  ============== */
.rp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 14px;
}

.rp-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.rp-close {
  background: none;
  border: 0;
  padding: 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.rp-close:hover {
  background: var(--line-2);
}

.rp-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rp-grid--wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.rp-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rp-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rp-label {
  font-size: 14px;
  font-weight: 700;
  margin: 0 4px 2px;
  color: var(--ink);
}

/* Photo upload */
.rp-photo {
  width: 100%;
  border: 2px dashed #CBD5E1;
  background: #FAFBFC;
  border-radius: var(--radius-card);
  padding: 28px 16px;
  display: grid;
  place-items: center;
  text-align: center;
  transition: border-color 0.18s, background 0.18s, transform 0.06s;
  cursor: pointer;
}

.rp-photo:hover {
  border-color: var(--teal);
  background: #F4FAFB;
}

.rp-photo:active {
  transform: scale(0.995);
}

.rp-photo.has-photo {
  padding: 0;
  border-style: solid;
  border-color: var(--line);
  overflow: hidden;
}

.rp-photo-preview {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}

.rp-camera-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--teal-soft);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.rp-photo-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.rp-photo-sub {
  color: var(--ink-3);
  font-size: 13px;
  margin-top: 2px;
}

/* Location */
.rp-location {
  background: #EAF2FA;
  border-radius: var(--radius-tile);
  padding: 14px 14px;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
}

.rp-location-text {
  line-height: 1.35;
}

.rp-location-title {
  color: #1F4E83;
  font-weight: 700;
  font-size: 14px;
}

.rp-location-place {
  color: #1F4E83;
  font-size: 13px;
  margin-top: 2px;
}

.rp-location-coords {
  color: #6685A8;
  font-size: 12px;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

/* Pollution type grid */
.rp-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.rp-type {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-tile);
  padding: 14px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.06s, background 0.15s;
}

.rp-type:hover {
  border-color: #B6C2CE;
}

.rp-type:active {
  transform: scale(0.98);
}

.rp-type.is-selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px rgba(91, 184, 199, 0.15);
}

.rp-type-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

/* Severity */
.rp-severity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.rp-severity-num {
  color: var(--teal-dark);
  font-weight: 700;
}

.rp-slider-wrap {
  padding: 8px 4px 4px;
}

.rp-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  outline: none;
  margin: 6px 0 8px;
}

.rp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--teal);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.12s;
}

.rp-slider::-webkit-slider-thumb:hover {
  transform: scale(1.08);
}

.rp-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--teal);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.rp-slider-ticks {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0;
  padding: 0 6px;
}

.rp-slider-ticks .tick {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 0 2px;
}

.rp-slider-ticks .tick.on {
  background: var(--teal);
}

/* Submit button */
.rp-submit-wrap {
  position: sticky;
  bottom: 0;
  padding-top: 18px;
  background: linear-gradient(to bottom, transparent 0%, #fff 30%);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rp-back {
  flex-shrink: 0;
  width: 50px;
  height: 52px;
  background: #f0f5f6;
  color: #5BB8C7;
  border: 0;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.06s;
}

.rp-back:hover {
  background: #dff0f3;
}

.rp-back:active {
  transform: scale(0.97);
}

.rp-submit {
  flex: 1;
  background: var(--teal);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 18px -8px rgba(91, 184, 199, 0.7);
  transition: background 0.15s, transform 0.06s, box-shadow 0.15s;
}

.rp-submit:hover:not(:disabled) {
  background: #4FA8B7;
  box-shadow: 0 10px 22px -8px rgba(91, 184, 199, 0.85);
}

.rp-submit:active:not(:disabled) {
  transform: scale(0.99);
}

.rp-submit:disabled {
  background: #B5DCE2;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==============  Wide / desktop layout  ============== */
.web-card {
  width: 100%;
  max-width: 920px;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 22px 24px 26px;
}

/* responsive — desktop modal */
@media (max-width: 700px) {
  .web-card .rp-grid--wide {
    grid-template-columns: 1fr;
  }
}

/* ==============  Page-level helpers (events / alerts / profile)  ============== */
.page-title {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  padding: 6px 16px 12px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.chip-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 0 16px 14px;
  flex-shrink: 0;
}

.chip {
  background: #F1F5F9;
  border: 0;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.chip.is-active {
  background: var(--teal);
  color: #fff;
}

.chip:hover:not(.is-active) {
  background: #E2E8F0;
}

/* Map page FAB */
.fab-report {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: var(--teal);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px 12px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 8px 22px -6px rgba(91, 184, 199, 0.7);
  z-index: 10;
  transition: transform 0.06s, background 0.15s;
}

.fab-report:hover {
  background: #4FA8B7;
}

.fab-report:active {
  transform: scale(0.97);
}

/* Events page */
.events-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.events-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #F4F5F7;
}

.event-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 6px 16px rgba(17, 24, 39, 0.06);
}

.event-map {
  position: relative;
  height: 80px;
}

.event-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

.event-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.event-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.event-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.event-body h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
}

.event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

.event-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.event-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 6px;
  gap: 8px;
}

.event-spots {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
}

.join-btn {
  background: var(--teal);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 12px -4px rgba(91, 184, 199, 0.6);
  transition: background 0.15s, transform 0.06s;
}

.join-btn:hover {
  background: #4FA8B7;
}

.join-btn:active {
  transform: scale(0.97);
}

.join-btn.is-joined {
  background: #10B981;
}

/* Alert / notifications page */
.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notif {
  background: #FAFBFC;
  border-radius: 18px;
  padding: 14px 14px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03), 0 4px 12px rgba(17, 24, 39, 0.04);
}

.notif--danger {
  background: #FEF6F5;
}

.notif--event {
  background: #F0F8FA;
}

.notif--info {
  background: #F5FBFC;
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.notif-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}

.notif-text {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

.notif-time {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
}

/* Profile page */
.profile-head {
  padding: 6px 16px 16px;
  display: grid;
  grid-template-columns: 56px 1fr 36px;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, #7DD0DC 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.profile-name {
  font-size: 16px;
  font-weight: 700;
}

.profile-loc {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 2px;
}

.profile-settings {
  background: #F1F5F9;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.profile-settings:hover {
  background: #E2E8F0;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px 16px;
  flex-shrink: 0;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 6px;
  text-align: center;
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--teal-dark);
  letter-spacing: -0.02em;
}

.stat-lbl {
  font-size: 11.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.section-title {
  margin: 0;
  padding: 4px 18px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex-shrink: 0;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 16px 16px;
  flex-shrink: 0;
}

.badge {
  border: 1.5px solid;
  border-radius: 14px;
  padding: 12px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-emoji {
  font-size: 22px;
}

.badge-lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
}

.sev-dot {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
}

.sev-lo {
  background: #3DB85C;
}

.sev-md {
  background: #F4C53B;
  color: #6B5400;
}

.sev-hi {
  background: #E94B4B;
}

.history-title {
  font-size: 14px;
  font-weight: 700;
}

.history-meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-verified {
  background: #D1FAE5;
  color: #047857;
}

.status-urgent {
  background: #FEE2E2;
  color: #B91C1C;
}

.status-resolved {
  background: #DBEAFE;
  color: #1D4ED8;
}

/* Wide / desktop multi-page layout */
.web-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.web-tabs>div {
  flex-shrink: 0;
}

.web-tab {
  background: none;
  border: 0;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.web-tab.is-active {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
}

.web-tab:hover:not(.is-active) {
  color: var(--ink);
}

.web-content {
  padding: 22px 24px 28px;
  display: flex;
  flex-direction: column;
  height: 620px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ==============  Top bar (avatar + bell)  ============== */
.top-bar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 12px;
  align-items: center;
  padding: 6px 16px 12px;
  flex-shrink: 0;
}

.top-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, #7DD0DC 100%);
  color: #fff;
  border: 0;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.08s;
}

.top-avatar:hover {
  transform: scale(1.04);
}

.top-greet {
  line-height: 1.25;
}

.top-hello {
  font-size: 14px;
  font-weight: 700;
}

.top-loc {
  font-size: 12px;
  color: var(--ink-3);
}

.top-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #F1F5F9;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
}

.top-bell:hover {
  background: #E2E8F0;
}

.bell-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #E94B4B;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

/* notif x button */
.notif {
  position: relative;
}

.notif-x {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}

.notif-x:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.notif-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-2);
}

/* ==============  Ranking page  ============== */
.rank-mode-toggle {
  display: flex;
  gap: 8px;
  padding: 0 16px;
}

.rank-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #F1F5F9;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.rank-mode-btn.is-active {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal-dark);
}

.rank-mode-btn:hover:not(.is-active) {
  background: #E2E8F0;
}


.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  padding: 8px 16px 18px;
  flex-shrink: 0;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 110px;
}

.podium-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C7E5EB, #7DD0DC);
  color: #fff;
  border: 3px solid;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  position: relative;
}

.podium-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 18px;
  background: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.podium-name {
  font-size: 13px;
  font-weight: 700;
}

.podium-kg {
  font-size: 11px;
  color: var(--ink-3);
}

.podium-bar {
  width: 100%;
  border-radius: 10px 10px 0 0;
  display: grid;
  place-items: center;
  margin-top: 4px;
  position: relative;
}

.podium-rank {
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.rank-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px 36px 1fr auto;
  gap: 10px;
  align-items: center;
}

.rank-row.is-me {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px rgba(91, 184, 199, 0.15);
}

.rank-num {
  font-weight: 800;
  color: var(--ink-3);
  font-size: 14px;
  text-align: center;
}

.rank-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C7E5EB, #7DD0DC);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}

.rank-name {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.me-pill {
  background: var(--teal);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rank-meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.rank-stats {
  text-align: right;
}

.rank-kg {
  font-size: 16px;
  font-weight: 800;
  color: var(--teal-dark);
  letter-spacing: -0.01em;
}

.rank-kg span {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
}

.rank-reports {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ==============  Mobile direct view (real device)  ============== */
.mobile-direct {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  overflow-y: auto;
  position: relative;
}

.mobile-direct .map-page,
.mobile-direct .events-list,
.mobile-direct .notif-list,
.mobile-direct .rank-list {
  -webkit-overflow-scrolling: touch;
}

/* tablet phone-frame option */
.tablet-frame {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 4/3;
  background: #1a1a1a;
  border-radius: 28px;
  padding: 14px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.4);
}

.tablet-screen {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}