:root {
  --bg-app: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --ink-primary: #0F172A;
  --ink-secondary: #475569;
  --ink-muted: #94A3B8;
  --border-light: #E2E8F0;

  --hazard: #EA580C;
  --hazard-bg: #FFF7ED;
  --pending: #D97706;
  --pending-bg: #FFFBEB;
  --dispatched: #7C3AED;
  --dispatched-bg: #F5F3FF;
  --resolved: #059669;
  --resolved-bg: #ECFDF5;
  --pin-target: #2563EB;
  --pin-target-bg: #EFF6FF;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-float: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--ink-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Simple, People-Friendly 56px Top Bar */
.topbar {
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-shrink: 0;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-logo-svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.14));
}

.brand-wordmark-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-name {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink-primary);
}

.brand-i-accent {
  color: var(--resolved);
}

.brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--bg-subtle);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

.nav-pills-bar {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  padding: 0.22rem;
  border-radius: var(--radius-md);
  gap: 0.2rem;
}

.nav-seg {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.38rem;
  transition: all 0.15s ease;
}

.nav-seg:hover {
  color: var(--ink-primary);
}

.nav-seg.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: var(--shadow-card);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.privacy-pill {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--resolved);
  background: var(--resolved-bg);
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.privacy-pill-btn {
  border: 1px solid #A7F3D0;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}

.privacy-pill-btn:hover {
  background: #D1FAE5;
}

.btn-new-fast {
  background: var(--hazard);
  color: #FFFFFF;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-new-fast:hover {
  background: #C2410C;
}

/* App Views */
.app-view {
  display: none;
  flex: 1;
  overflow: hidden;
}

.app-view.active {
  display: flex;
}

/* VIEW 1: MAP + RIGHT DRAWER */
.map-workbench {
  display: grid;
  grid-template-columns: 1fr 445px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: #E2E8F0;
}

#leaflet-map {
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: crosshair;
}

/* Floating Search & Multi-Filter Bar on Map */
.map-floating-top {
  position: absolute;
  top: 12px;
  left: 52px;
  right: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
}

.map-search-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  padding: 0.38rem 0.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  border: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.city-select {
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.42rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
}

.street-search-input {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-primary);
  padding: 0.42rem 0.65rem;
  outline: none;
  min-width: 180px;
}

.street-search-input:focus {
  border-color: var(--pin-target);
}

.btn-map-tool {
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.42rem 0.68rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  transition: all 0.12s ease;
}

.btn-map-tool:hover {
  background: var(--bg-subtle);
}

.btn-map-tool.primary {
  background: var(--pin-target);
  color: #FFFFFF;
  border-color: var(--pin-target);
}

/* Floating Category & Status Filter Row */
.map-filter-strip {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: wrap;
}

.f-chip {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-light);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.05);
  transition: all 0.12s ease;
}

.f-chip.active {
  background: var(--ink-primary);
  color: #FFFFFF;
  border-color: var(--ink-primary);
}

.map-subfilter-strip {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  width: fit-content;
}

.sub-f-chip {
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

.sub-f-chip.active {
  background: var(--pin-target);
  color: #FFFFFF;
  border-color: var(--pin-target);
}

/* Interactive Map Status & Ring Legend Card */
.map-legend-card {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.52rem 0.72rem;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  max-width: calc(100% - 28px);
}

.legend-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.71rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.legend-reset-btn {
  border: none;
  background: var(--pin-target-bg);
  color: var(--pin-target);
  font-family: var(--font-sans);
  font-size: 0.67rem;
  font-weight: 800;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
}

.legend-status-row {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: wrap;
}

.legend-status-pill {
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.12s ease;
}

.legend-status-pill:hover {
  border-color: var(--ink-secondary);
}

.legend-status-pill.active {
  background: var(--ink-primary);
  color: #FFFFFF;
  border-color: var(--ink-primary);
}

.l-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.l-dot.all { background: var(--pin-target); }
.l-dot.pending { border: 2px dashed var(--pending); background: var(--pending-bg); }
.l-dot.verified { background: var(--hazard); }
.l-dot.dispatched { background: var(--dispatched); }
.l-dot.resolved { background: var(--resolved); }

.map-bottom-helper {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: rgba(15, 23, 42, 0.92);
  color: #FFFFFF;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-float);
  pointer-events: none;
  white-space: nowrap;
}

/* Leaflet Markers */
.halka-leaflet-icon {
  background: transparent;
  border: none;
}

.ring-marker {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
  position: relative;
}

.ring-marker:hover,
.ring-marker.selected-ring {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.22), 0 6px 14px rgba(15, 23, 42, 0.3);
}

.ring-marker.status-verified { border: 3px solid var(--hazard); }
.ring-marker.status-pending { border: 3px dashed var(--pending); }
.ring-marker.status-dispatched { border: 3px solid var(--dispatched); }
.ring-marker.status-resolved { border: 3px solid var(--resolved); }

.ring-count-badge {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: var(--ink-primary);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 999px;
  border: 1.5px solid #FFFFFF;
}

.dropped-pin-marker {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--pin-target);
  color: #FFFFFF;
  border: 3px solid #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.28), 0 6px 16px rgba(15, 23, 42, 0.35);
  animation: pulsePin 1.5s infinite;
}

@keyframes pulsePin {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* RIGHT SIDEBAR: SIMPLE CITIZEN DRAWER */
.side-drawer {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.drawer-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
  padding: 0.3rem;
  gap: 0.25rem;
  flex-shrink: 0;
}

.drawer-tab {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.79rem;
  font-weight: 800;
  color: var(--ink-secondary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.drawer-tab.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: var(--shadow-card);
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.step-card {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.step-title {
  font-size: 0.81rem;
  font-weight: 800;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.step-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.place-input-highlight {
  font-weight: 700;
  border-color: var(--pin-target);
  background: #FFFFFF;
}

.media-upload-btn {
  background: var(--bg-subtle);
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  color: var(--ink-primary);
  font-weight: 700;
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink-primary);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 153 Main Category Grid (8 Clear Everyday Categories) */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.cat-tile {
  border: 1.5px solid var(--border-light);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.12s ease;
}

.cat-tile:hover {
  border-color: var(--ink-muted);
}

.cat-tile.active {
  border-color: var(--ink-primary);
  background: var(--ink-primary);
  color: #FFFFFF;
}

.cat-tile-icon {
  font-size: 1.15rem;
}

.cat-tile-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}

/* Sub-Category Short Pills (e.g. Yol/Zemin, Elektrik, Su, Peyzaj) */
.subcat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.subcat-pill {
  border: 1.5px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-radius: 999px;
  padding: 0.36rem 0.72rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.subcat-pill:hover {
  border-color: var(--ink-secondary);
}

.subcat-pill.active {
  border-color: var(--hazard);
  background: var(--hazard-bg);
  color: var(--hazard);
}

.auto-dept-pill {
  margin-top: 0.55rem;
  background: var(--resolved-bg);
  border: 1px solid #A7F3D0;
  color: #065F46;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mini-input,
.mini-textarea {
  width: 100%;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 0.52rem 0.68rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-primary);
  outline: none;
}

.mini-textarea {
  min-height: 58px;
  resize: vertical;
}

.mini-input:focus,
.mini-textarea:focus {
  border-color: var(--pin-target);
}

/* Photo or Video Upload Button */
.media-upload-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.media-upload-box:hover {
  border-color: var(--pin-target);
  color: var(--pin-target);
}

.quick-spot-bar,
.media-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: 0.4rem;
}

.spot-chip {
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.71rem;
  font-weight: 700;
  padding: 0.24rem 0.56rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.spot-chip:hover {
  border-color: var(--pin-target);
  color: var(--pin-target);
}

.spot-chip.active {
  background: var(--pin-target-bg);
  border-color: var(--pin-target);
  color: var(--pin-target);
}

.media-preview-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--resolved);
}

.media-preview-box img,
.media-preview-box video {
  width: 58px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.btn-seal-submit {
  width: 100%;
  background: var(--hazard);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.78rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.22);
}

.btn-seal-submit:hover {
  background: #C2410C;
}

/* Search & Filter Box inside List Mode */
.list-filter-box {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.filter-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
}

.dept-legend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.dept-legend-item {
  border: 1px solid var(--border-light);
  background: var(--bg-app);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.12s ease;
}

.dept-legend-item:hover {
  border-color: var(--pin-target);
  background: var(--pin-target-bg);
}

/* Selected Issue Card */
.selected-issue-card {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.status-badge {
  font-size: 0.69rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.status-badge.verified { background: var(--hazard-bg); color: var(--hazard); }
.status-badge.pending { background: var(--pending-bg); color: var(--pending); }
.status-badge.dispatched { background: var(--dispatched-bg); color: var(--dispatched); }
.status-badge.resolved { background: var(--resolved-bg); color: var(--resolved); }

.taxonomy-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--pin-target);
  background: var(--pin-target-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.consensus-mini-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.c-step {
  height: 6px;
  border-radius: 999px;
  background: var(--border-light);
}

.c-step.done {
  background: var(--resolved);
}

.action-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.btn-mini-act {
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.btn-mini-act.primary {
  background: var(--ink-primary);
  color: #FFFFFF;
  border-color: var(--ink-primary);
}

.btn-mini-act.success {
  background: var(--resolved);
  color: #FFFFFF;
  border-color: var(--resolved);
}

.feed-mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.feed-mini-item {
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 0.62rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  transition: all 0.12s ease;
}

.feed-mini-item:hover {
  background: var(--bg-app);
}

.feed-mini-item.selected {
  border-color: var(--ink-primary);
  background: var(--pin-target-bg);
}

/* Secondary Full Views */
.scroll-view-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.clean-container {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.clean-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.stats-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.stat-box-val {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 0.2rem;
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-msg {
  background: var(--ink-primary);
  color: #FFFFFF;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-float);
  border-left: 4px solid var(--resolved);
  max-width: 380px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  max-width: 560px;
  width: 100%;
  padding: 1.25rem;
  box-shadow: var(--shadow-float);
}

/* Official Legal Notice & Compliance Styles */
.legal-notice-mini {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--resolved);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.68rem;
  font-size: 0.69rem;
  line-height: 1.42;
  color: var(--ink-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.legal-notice-mini strong {
  color: var(--ink-primary);
}

.legal-link-inline {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--pin-target);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.legal-link-inline:hover {
  text-decoration: underline;
}

.legal-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.legal-article-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.legal-article-card h3 {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.legal-article-card p {
  font-size: 0.81rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.legal-law-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--pin-target);
  background: var(--pin-target-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.legal-footer-bar {
  height: 30px;
  background: var(--ink-primary);
  color: #CBD5E1;
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  flex-shrink: 0;
  z-index: 1000;
}

.legal-footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.legal-footer-left strong {
  color: #FFFFFF;
}

.dot-sep {
  color: #64748B;
}

.legal-footer-btn {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #38BDF8;
  font-family: var(--font-sans);
  font-size: 0.69rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.legal-footer-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.blockchain-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Mobile & Tablet Responsive Architecture */
@media (max-width: 960px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  .topbar {
    height: auto;
    padding: 0.55rem 0.75rem;
    flex-wrap: wrap;
    gap: 0.45rem;
    position: sticky;
    top: 0;
  }

  .brand-tag {
    display: none;
  }

  .nav-pills-bar {
    order: 3;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-pills-bar::-webkit-scrollbar {
    display: none;
  }

  .nav-seg {
    flex-shrink: 0;
    padding: 0.42rem 0.7rem;
    font-size: 0.76rem;
  }

  .app-view.active {
    display: block;
    overflow: visible;
  }

  .map-workbench {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .map-stage {
    height: 390px;
    flex-shrink: 0;
  }

  .map-floating-top {
    top: 8px;
    left: 46px;
    right: 8px;
    gap: 0.35rem;
  }

  .map-search-bar {
    padding: 0.3rem 0.4rem;
    gap: 0.3rem;
  }

  .city-select {
    font-size: 0.74rem;
    padding: 0.36rem 0.45rem;
  }

  .street-search-input {
    min-width: 110px;
    font-size: 0.76rem;
    padding: 0.36rem 0.5rem;
  }

  .map-filter-strip,
  .map-subfilter-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    max-width: 100%;
  }

  .map-filter-strip::-webkit-scrollbar,
  .map-subfilter-strip::-webkit-scrollbar {
    display: none;
  }

  .f-chip,
  .sub-f-chip {
    flex-shrink: 0;
  }

  .map-legend-card {
    bottom: 8px;
    left: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
    padding: 0.4rem 0.55rem;
  }

  .legend-status-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .legend-status-row::-webkit-scrollbar {
    display: none;
  }

  .legend-status-pill {
    flex-shrink: 0;
  }

  .side-drawer {
    border-left: none;
    border-top: 1px solid var(--border-light);
    height: auto;
    overflow: visible;
  }

  .drawer-scroll {
    overflow: visible;
    padding: 0.85rem;
  }

  .mini-input,
  .mini-textarea {
    font-size: 16px;
  }

  .filter-row-3 {
    grid-template-columns: 1fr;
  }

  .stats-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dept-legend-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blockchain-stats-grid {
    grid-template-columns: 1fr;
  }

  .legal-grid-2 {
    grid-template-columns: 1fr;
  }

  .scroll-view-container {
    padding: 0.9rem;
    overflow: visible;
  }

  .legal-footer-bar {
    height: auto;
    padding: 0.55rem 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .legal-footer-left {
    white-space: normal;
    flex-wrap: wrap;
    line-height: 1.35;
  }
}

@media (max-width: 480px) {
  .privacy-pill-text {
    display: none;
  }
  .dept-legend-grid {
    grid-template-columns: 1fr;
  }
}
