:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --surface-subtle: #e0e7ff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #d9e2ec;
  --soft: #e8eef8;
  --focus: #4f46e5;
  --brand: #4f46e5;
  --brand-strong: #3730a3;
  --primary-700: #3730a3;
  --primary-600: #4f46e5;
  --primary-500: #6366f1;
  --primary-100: #e0e7ff;
  --accent-pink: #2563eb;
  --info: #2563eb;
  --success: #059669;
  --warning: #d97706;
  --rail: #111827;
  --rail-accent: #818cf8;
  --danger: #dc2626;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --touch-target: 48px;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  transform: translateY(-140%);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 12px;
  box-shadow: var(--shadow);
  font-weight: 900;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

button,
input,
select {
  font: inherit;
}

button,
.link-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: var(--radius-sm);
  min-height: var(--touch-target);
  padding: 8px 10px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  overflow-wrap: anywhere;
}

button:hover,
.link-btn:hover {
  border-color: var(--primary-500);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.16);
}

.leaflet-container :focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

.offline-banner,
.update-toast {
  position: fixed;
  left: 50%;
  z-index: 1800;
  width: min(560px, calc(100vw - 24px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.35;
}

.offline-banner {
  top: max(12px, env(safe-area-inset-top));
  padding: 10px 12px;
}

.update-toast {
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.update-toast span {
  min-width: 0;
  flex: 1;
}

.update-toast button {
  min-height: 34px;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
}

[hidden] {
  display: none !important;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--line);
  z-index: 1200;
}

.sheet-controls {
  display: none;
}

.brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
  font-weight: 900;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.is-ready {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.quick-grid,
.mode-row,
.category-list,
.intent-panel,
.install-card,
.recent-searches,
.guide-panel,
.radar-panel,
.route-panel,
.prayer-panel,
.results-head,
.poi-list,
.search-box {
  margin-inline: 16px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding-top: 12px;
}

.quick-btn {
  display: grid;
  place-items: center;
  min-height: 46px;
  min-width: 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
}

.quick-primary {
  background: var(--primary-700);
  border-color: var(--primary-700);
  color: #ffffff;
}

.quick-primary:hover {
  background: var(--primary-600);
  border-color: var(--accent-pink);
}

.quick-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.quick-danger:hover {
  background: #991b1b;
  border-color: #fecaca;
}

.guide-panel {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.guide-panel[open] {
  display: block;
}

details.guide-panel:not([open]) {
  gap: 0;
  padding-block: 9px;
  background: #ffffff;
}

.guide-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  list-style-position: inside;
}

.guide-panel summary + * {
  margin-top: 9px;
}

.guide-panel-open {
  background: #eef6ff;
  border-color: #bfdbfe;
}

.emergency-panel {
  background: #fff7ed;
  border-color: #fed7aa;
}

.destination-panel {
  background: #f0fdfa;
  border-color: #99f6e4;
}

.radar-panel {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
}

.weather-now {
  min-height: 64px;
}

.weather-card,
.radar-highlight,
.radar-source-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
}

.weather-card {
  display: grid;
  gap: 8px;
}

.weather-main {
  display: grid;
  grid-template-columns: minmax(78px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.weather-main strong {
  font-size: 26px;
  line-height: 1;
}

.weather-main span,
.weather-card small,
.radar-highlight span,
.radar-source span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.weather-days,
.radar-highlights,
.radar-source-grid {
  display: grid;
  gap: 7px;
}

.weather-days {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.weather-day {
  display: grid;
  gap: 2px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 7px;
  min-width: 0;
}

.weather-day strong,
.radar-highlight strong,
.radar-source-group strong,
.radar-source strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.weather-day span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.radar-highlights {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.radar-highlight {
  display: grid;
  gap: 5px;
}

.radar-highlight small {
  width: fit-content;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 900;
}

.radar-source-group {
  display: grid;
  gap: 7px;
  padding: 0;
  overflow: hidden;
}

.radar-source-group summary {
  cursor: pointer;
  padding: 9px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.radar-source-group[open] summary {
  border-bottom: 1px solid var(--line);
}

.radar-source-list {
  display: grid;
  gap: 7px;
  padding: 9px;
}

.radar-source {
  display: grid;
  gap: 3px;
  color: var(--ink);
  text-decoration: none;
}

.radar-source:hover {
  color: var(--primary-700);
}

.destination-content {
  display: grid;
  gap: 10px;
}

.destination-actions,
.destination-filter-grid,
.destination-card-grid,
.destination-plan-grid,
.destination-links,
.destination-facts,
.destination-watch {
  display: grid;
  gap: 8px;
}

.destination-actions,
.destination-filter-grid,
.destination-plan-grid,
.destination-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.destination-empty,
.destination-alert,
.destination-card,
.destination-plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.destination-empty,
.destination-card,
.destination-plan {
  display: grid;
  gap: 7px;
}

.destination-empty span,
.destination-card p,
.destination-plan span,
.destination-watch span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
}

.destination-alert {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #075985;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.destination-filter {
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
}

.destination-filter.is-active {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #115e59;
}

.destination-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.destination-card-head strong,
.destination-plan strong {
  font-size: 13px;
  line-height: 1.25;
}

.destination-card-head span,
.destination-facts span {
  border: 1px solid #99f6e4;
  border-radius: 999px;
  background: #ecfeff;
  color: #115e59;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.destination-steps {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.destination-links a {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 7px;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.destination-links a:hover {
  border-color: #0f766e;
}

.destination-plan button {
  justify-self: start;
  min-height: 34px;
  font-size: 12px;
  font-weight: 900;
}

.chip-grid,
.intent-grid,
.link-grid,
.emergency-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chip-grid-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mode-chip,
.intent-chip,
.recent-chip,
.preset-chip,
.route-link,
.official-link,
.call-link {
  display: grid;
  place-items: center;
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 7px 8px;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.mode-chip.is-active,
.intent-chip.is-active,
.preset-chip:active {
  border-color: var(--primary-600);
  background: var(--primary-100);
  color: var(--primary-700);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.12);
}

.intent-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  background: #ffffff;
}

.intent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recent-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
  margin-top: 7px;
}

.recent-searches:empty {
  display: none;
}

.recent-chip {
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--primary-700);
}

.install-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f3f0ff 100%);
}

.install-card strong,
.install-card span {
  display: block;
}

.install-card strong {
  font-size: 13px;
}

.install-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.install-card button {
  min-height: 34px;
  font-size: 12px;
  font-weight: 900;
}

.call-link {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.call-link strong {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.call-link span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}

.address-stack,
.phrase-stack,
.official-links,
.checklist-panel,
.guide-alerts {
  display: grid;
  gap: 7px;
}

.guide-alerts:empty,
.address-stack:empty,
.phrase-stack:empty,
.official-links:empty,
.checklist-panel:empty {
  display: none;
}

.guide-alert,
.address-item,
.phrase-item,
.official-group,
.check-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  min-width: 0;
}

.guide-alert {
  border-color: #fde68a;
  background: #fffbeb;
  color: #78350f;
  font-size: 12px;
  line-height: 1.35;
}

.address-item strong,
.phrase-item strong,
.official-group strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.address-item span,
.address-item small,
.phrase-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.official-group {
  display: grid;
  gap: 7px;
}

.official-link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.subsection-title {
  margin-top: 9px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tool-grid,
.transport-pass-list,
.food-guide,
.food-alerts,
.food-link-grid,
.food-search-grid,
.canteen-list,
.privacy-list,
.stop-results {
  display: grid;
  gap: 7px;
}

.tool-grid,
.food-link-grid,
.food-search-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transport-pass-list {
  margin-top: 7px;
}

.tool-card,
.pass-card,
.food-alert,
.canteen-chip,
.privacy-item,
.stop-result {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  overflow-wrap: anywhere;
}

.tool-card,
.food-link,
.food-search {
  display: grid;
  place-items: start;
  gap: 4px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}

.tool-card strong,
.pass-card strong,
.food-alert strong,
.canteen-chip strong,
.privacy-item strong,
.stop-result strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.tool-card span,
.pass-card span,
.food-alert span,
.canteen-chip span,
.privacy-item span,
.stop-result span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.32;
}

.tool-card:hover,
.food-link:hover,
.food-search:hover,
.stop-result:hover {
  border-color: #94a3b8;
}

.pass-card {
  display: grid;
  gap: 4px;
}

.pass-card a,
.stop-result a {
  color: var(--primary-700);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.food-alert {
  border-color: #fde68a;
  background: #fffbeb;
  color: #78350f;
}

.food-alert span {
  color: #78350f;
}

.food-link,
.food-search {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 800;
}

.canteen-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.canteen-chip {
  font-size: 12px;
  font-weight: 800;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.check-item input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.notes-box {
  display: grid;
  gap: 6px;
}

.privacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.privacy-toggle input {
  width: 18px;
  height: 18px;
}

.privacy-row button {
  min-height: 34px;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
}

.privacy-list:empty,
.stop-results:empty {
  display: none;
}

.privacy-item {
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.35;
}

.notes-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.notes-box textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px;
  line-height: 1.35;
}

.notes-box.is-private-off textarea {
  display: none;
}

.notes-box.is-private-off::after {
  content: "Özel Mod kapalı; bu oturumda yeni not kaydedilmiyor.";
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  padding: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.search-box {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.search-box span,
.section-head span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
}

.search-box input:focus-visible {
  border-color: var(--primary-600);
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.mode-row button,
.route-actions button {
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
}

#favoritesOnly.is-active {
  border-color: var(--warning);
  background: #fffbeb;
  color: #92400e;
  font-weight: 900;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.cat-btn {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  justify-content: flex-start;
  min-height: 44px;
  overflow: visible;
  text-align: left;
  white-space: normal;
}

.cat-btn[aria-pressed="false"] {
  opacity: 0.48;
  background: #faf9ff;
}

.cat-btn[data-loaded="false"] {
  border-style: dashed;
}

.cat-btn[aria-busy] {
  cursor: progress;
  opacity: 0.72;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--cat-color);
}

.cat-btn span:last-child {
  min-width: 0;
  overflow: visible;
  line-height: 1.2;
}

.cat-btn small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.route-panel,
.prayer-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.prayer-panel {
  background: #fff7ed;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.section-head small,
.transit-info {
  color: var(--muted);
  font-size: 12px;
}

.route-select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 9px;
}

.stop-search,
.method-select {
  display: grid;
  gap: 6px;
}

.stop-search span,
.method-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stop-search input,
.method-select select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 9px;
}

.stop-result {
  display: grid;
  gap: 5px;
}

.stop-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.stop-route-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.stop-route-pills small {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink);
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 900;
}

.route-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.transit-info {
  min-height: 16px;
  line-height: 1.35;
  margin: 0;
}

.prayer-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(102px, 0.65fr);
  gap: 8px;
}

.next-prayer,
.qibla-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
  min-width: 0;
}

.next-prayer {
  display: grid;
  gap: 3px;
}

.next-prayer span,
.next-prayer small,
.qibla-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.next-prayer strong {
  font-size: 18px;
  line-height: 1.1;
}

.next-prayer time {
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.qibla-card {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 4px;
}

.qibla-compass {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid #0f172a;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 45%, #e0f2fe 46%);
}

.qibla-compass span {
  display: block;
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
  transform-origin: 50% 50%;
}

.qibla-card strong {
  font-size: 16px;
}

.prayer-times {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.prayer-time {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 5px;
  text-align: center;
  min-width: 0;
}

.prayer-time span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prayer-time strong {
  font-size: 13px;
}

.prayer-time.is-next {
  border-color: var(--primary-600);
  background: var(--primary-100);
}

.results-head {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.poi-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 8px 0 16px;
}

.empty-state {
  display: grid;
  gap: 6px;
  border: 1px dashed #c4b5fd;
  border-radius: 8px;
  background: #fbfaff;
  padding: 14px;
}

.empty-state strong {
  font-size: 14px;
}

.empty-state span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.poi-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  cursor: pointer;
}

.poi-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: start;
  gap: 8px;
}

.fav-btn {
  display: grid;
  place-items: center;
  min-height: 34px;
  width: 36px;
  padding: 0;
  border-color: #f4d58d;
  background: #fffbeb;
  color: #b45309;
  font-size: 16px;
  line-height: 1;
}

.fav-btn.is-active {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #ffffff;
}

.poi-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.poi-card h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.poi-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.poi-detail {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
}

.map-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #dbeafe;
}

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

.map-dock {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1100;
  display: grid;
  width: min(380px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  gap: 10px;
  overflow: auto;
  padding: 2px;
  pointer-events: auto;
  scrollbar-width: thin;
}

.map-dock .guide-panel,
.map-dock .route-panel,
.map-dock .prayer-panel {
  margin: 0;
}

.map-dock .guide-panel {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
}

.map-dock .guide-panel[open] {
  display: block;
}

.map-dock .dock-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
}

.map-dock .dock-card > summary::-webkit-details-marker {
  display: none;
}

.map-dock .dock-card > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.map-dock .dock-card[open] > summary::after {
  content: "−";
  color: var(--primary-700);
}

.map-dock .route-panel,
.map-dock .prayer-panel {
  margin-top: 10px;
  box-shadow: none;
}

.map-dock .route-link {
  margin-top: 8px;
}

.map-dock .route-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.map-dock .prayer-summary {
  grid-template-columns: minmax(0, 1fr);
}

.poi-marker {
  display: grid;
  place-items: center;
}

.poi-marker span {
  display: block;
  width: 22px;
  height: 22px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.28);
}

.poi-marker.high span {
  width: 30px;
  height: 30px;
  border-width: 4px;
}

.poi-marker.labeled span {
  display: grid;
  place-items: center;
  width: auto;
  min-width: 50px;
  height: 32px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 0 9px;
}

.poi-marker.cat-personal span,
.poi-marker.cat-emergency span,
.poi-marker.cat-official span,
.poi-marker.cat-gtt span,
.poi-marker.cat-atm span,
.poi-marker.cat-mosque span,
.poi-marker.cat-halal span {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.34), 0 0 0 4px rgba(255, 255, 255, 0.62);
}

.popup-title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.2;
}

.popup-cat,
.popup-text,
.popup-links {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.4;
}

.popup-detail-summary {
  color: var(--ink);
}

.detail-list {
  display: grid;
  gap: 6px;
  margin: 9px 0 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.detail-list dt,
.detail-list dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 900;
}

.detail-list dd {
  color: var(--ink);
}

.popup-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

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

.popup-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--primary-700);
  font-weight: 800;
  text-decoration: none;
}

.popup-fav {
  min-height: 32px;
  border-color: #f4d58d;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
}

.popup-fav.is-active {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #ffffff;
}

.rail-tooltip {
  border: 0;
  border-radius: 999px;
  background: var(--rail);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
}

.rail-tooltip::before {
  display: none;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.leaflet-control-attribution a {
  color: #4c1d95;
  text-decoration: underline;
}

body.low-power .app-shell {
  display: block;
  height: 100dvh;
  overflow: auto;
}

body.low-power .panel {
  position: static;
  min-height: 100dvh;
  border-right: 0;
}

body.low-power .map-wrap {
  display: none;
}

body.low-power .poi-list {
  max-height: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .panel {
    transition: none;
  }
}

@media (max-width: 839px) {
  .app-shell {
    display: block;
    height: 100dvh;
  }

  .map {
    height: 100dvh;
  }

  .panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    height: 48dvh;
    max-height: calc(100dvh - env(safe-area-inset-top));
    border-top: 1px solid var(--line);
    border-right: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 34px rgba(15, 23, 42, 0.12);
    transition: height 180ms ease;
  }

  body.sheet-compact .panel {
    height: 24dvh;
  }

  body.sheet-mid .panel {
    height: 52dvh;
  }

  body.sheet-full .panel {
    height: calc(100dvh - env(safe-area-inset-top));
  }

  .sheet-controls {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .sheet-controls button {
    min-height: 40px;
    font-size: 12px;
    font-weight: 900;
  }

  .sheet-controls button[aria-pressed="true"] {
    border-color: var(--primary-600);
    background: var(--primary-100);
    color: var(--primary-700);
  }

  body.sheet-compact .panel .brand,
  body.sheet-compact .panel .mode-row,
  body.sheet-compact .panel .category-list,
  body.sheet-compact .panel .guide-panel,
  body.sheet-compact .panel .radar-panel,
  body.sheet-compact .panel .intent-panel,
  body.sheet-compact .panel .install-card,
  body.sheet-compact .panel .recent-searches,
  body.sheet-compact .panel .route-panel,
  body.sheet-compact .panel .prayer-panel,
  body.sheet-compact .panel .results-head,
  body.sheet-compact .panel .poi-list {
    display: none;
  }

  body.sheet-compact .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-top: 8px;
  }

  body.sheet-compact .quick-grid > :nth-child(n + 5) {
    display: none;
  }

  body.sheet-mid .results-head,
  body.sheet-mid .poi-list {
    display: none;
  }

  .brand {
    padding: 12px 14px 8px;
  }

  h1 {
    font-size: 20px;
  }

  .quick-grid,
  .mode-row,
  .category-list,
  .intent-panel,
  .install-card,
  .recent-searches,
  .guide-panel,
  .radar-panel,
  .route-panel,
  .prayer-panel,
  .results-head,
  .poi-list,
  .search-box {
    margin-inline: 14px;
  }

  .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chip-grid-compact,
  .official-link-list,
  .tool-grid,
  .food-link-grid,
  .food-search-grid,
  .canteen-list,
  .radar-highlights,
  .destination-filter-grid,
  .destination-plan-grid,
  .destination-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .update-toast {
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 8px);
  }

  .map-wrap {
    height: 100dvh;
  }

  .map-dock {
    top: max(12px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    display: flex;
    align-items: flex-start;
    width: auto;
    max-height: none;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 8px;
  }

  .map-dock .guide-panel {
    flex: 0 0 auto;
    min-width: 132px;
    max-width: min(340px, calc(100vw - 20px));
    padding: 8px 10px;
  }

  .map-dock .guide-panel[open] {
    flex-basis: min(340px, calc(100vw - 20px));
    max-height: 38dvh;
    overflow: auto;
  }

  .map-dock .dock-card > summary {
    white-space: nowrap;
  }

  .map-dock .dock-card > summary::after {
    width: 20px;
    height: 20px;
    font-size: 13px;
  }

  body.sheet-full .map-dock {
    display: none;
  }
}

@media (max-width: 390px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-list {
    grid-template-columns: 1fr;
  }

  .chip-grid,
  .intent-grid,
  .link-grid,
  .emergency-grid,
  .official-link-list,
  .tool-grid,
  .food-link-grid,
  .food-search-grid,
  .canteen-list,
  .weather-days,
  .radar-highlights,
  .destination-actions,
  .destination-filter-grid,
  .destination-plan-grid,
  .destination-links {
    grid-template-columns: 1fr;
  }

  .prayer-times {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .install-card {
    grid-template-columns: 1fr;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Map-first product shell ------------------------------------------------- */

body {
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(360px, 1fr) 360px;
  grid-template-rows: 72px minmax(0, 1fr);
  grid-template-areas:
    "topbar topbar topbar"
    "filters map details";
  height: 100dvh;
  background: var(--bg);
}

.app-topbar {
  grid-area: topbar;
  position: relative;
  z-index: 1300;
  display: grid;
  grid-template-columns: 220px minmax(280px, 620px) minmax(300px, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.brand.brand-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--brand), #796cf5);
  color: #fff;
  box-shadow: 0 9px 22px rgba(91, 76, 240, 0.25);
  font-size: 20px;
  font-weight: 900;
}

.brand-link .eyebrow {
  display: block;
  margin-bottom: 1px;
  color: var(--brand-strong);
  letter-spacing: 0.08em;
}

.brand-title {
  display: block;
  font-size: 20px;
  line-height: 1.05;
  font-weight: 900;
}

.search-area {
  position: relative;
  min-width: 0;
}

.app-topbar .search-box {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0 10px 0 14px;
  border: 1px solid #cbd2dd;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.app-topbar .search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(91, 76, 240, 0.12), 0 8px 24px rgba(15, 23, 42, 0.08);
}

.search-icon {
  width: 15px;
  height: 15px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  display: block;
  width: 7px;
  height: 2px;
  margin: 11px 0 0 10px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: var(--muted);
}

.app-topbar .search-box input {
  min-height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  font-size: 15px;
}

.app-topbar .search-box input:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none;
}

.search-box kbd {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--muted);
  font: 700 12px/1 Inter, system-ui, sans-serif;
}

.app-topbar .recent-searches {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: none;
  width: min(100%, 620px);
  max-height: 180px;
  margin: 0;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.search-area:focus-within .recent-searches:not(:empty) {
  display: flex;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.topbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding-inline: 12px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.topbar-action span:first-child {
  color: var(--brand);
  font-size: 17px;
  font-weight: 900;
}

.topbar-action:hover {
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--ink);
}

.topbar-action-danger span:first-child {
  color: var(--danger);
}

.app-topbar .status-pill {
  padding: 7px 10px;
  background: var(--surface-alt);
}

.filters-panel {
  grid-area: filters;
  display: flex;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0 20px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  scrollbar-width: thin;
}

.panel-mobile-head {
  display: none;
}

.task-navigation {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 14px 12px;
  border-bottom: 1px solid #e8ebf0;
  background: var(--surface);
}

.task-navigation button {
  display: grid;
  min-width: 0;
  min-height: 58px;
  place-items: center;
  gap: 3px;
  padding: 6px 3px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.task-navigation button span {
  color: var(--brand);
  font-size: 16px;
  line-height: 1;
}

.task-navigation button[aria-pressed="true"] {
  border-color: #c7d2fe;
  background: var(--surface-subtle);
  color: var(--brand-strong);
}

.rail-section {
  margin: 0;
  padding: 20px 16px;
  border-bottom: 1px solid #e8ebf0;
}

.rail-section .section-head {
  margin: 0 0 12px;
}

.rail-welcome h2 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.18;
}

.rail-welcome .section-head {
  align-items: flex-start;
}

.filters-panel .chip-grid,
.filters-panel .intent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.filters-panel .chip-grid button,
.filters-panel .intent-grid button {
  min-height: 48px;
  border-radius: var(--radius-sm);
}

.filters-panel .intent-panel,
.filters-panel .category-list,
.filters-panel .install-card {
  margin-inline: 0;
}

.category-section {
  flex: 1;
}

.category-section .section-head {
  align-items: center;
}

.text-action {
  min-height: 36px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.filters-panel .category-list {
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 0;
}

.filters-panel .cat-btn {
  align-items: center;
  min-height: 48px;
  padding: 9px 11px;
  border-color: transparent;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

.filters-panel .cat-btn[aria-pressed="false"] {
  border-color: transparent;
  background: transparent;
  opacity: 1;
  color: var(--muted);
}

.filters-panel .cat-btn[aria-pressed="false"] .dot {
  opacity: 0.48;
}

.filters-panel .cat-btn[aria-pressed="true"] {
  border-color: #d8d4ff;
  background: var(--surface-subtle);
  box-shadow: inset 3px 0 0 var(--brand);
}

.filters-panel .install-card {
  margin: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.map-wrap {
  grid-area: map;
  position: relative;
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(rgba(91, 76, 240, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 76, 240, 0.045) 1px, transparent 1px),
    #eef1f5;
  background-size: 32px 32px;
}

.map-context {
  position: absolute;
  bottom: 18px;
  left: 18px;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(215, 220, 227, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  backdrop-filter: blur(12px);
}

.context-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

.map-dock {
  top: 16px;
  right: auto;
  left: 16px;
  display: flex;
  align-items: flex-start;
  width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  gap: 8px;
  overflow: visible;
  padding: 0;
  pointer-events: none;
}

.map-dock .guide-panel {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0;
  border-color: rgba(215, 220, 227, 0.95);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.11);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.map-dock .dock-card > summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.map-dock .dock-card > summary > span {
  color: var(--brand);
  font-size: 15px;
}

.map-dock .dock-card > summary::after {
  display: none;
}

.map-dock .guide-panel[open] {
  width: min(390px, calc(100vw - 280px - 360px - 32px));
  min-width: 330px;
  max-height: calc(100dvh - 122px);
  overflow: auto;
  padding: 0 14px 14px;
  border-radius: var(--radius-md);
}

.map-dock .guide-panel[open] > summary {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -14px 10px;
  padding-inline: 14px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: rgba(255, 255, 255, 0.98);
}

.map-dock .guide-panel[open] > summary::after {
  content: "×";
  display: grid;
  width: 24px;
  height: 24px;
  margin-left: auto;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.map-dock .radar-panel,
.map-dock .guide-panel,
.map-dock .route-panel,
.map-dock .prayer-panel {
  margin-inline: 0;
}

.results-panel {
  grid-area: details;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.sheet-grabber {
  display: none;
}

.selected-poi {
  max-height: 54dvh;
  overflow-y: auto;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 100% 0, rgba(91, 76, 240, 0.1), transparent 42%),
    var(--surface);
}

.selected-poi-empty {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.selected-poi-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-subtle);
  color: var(--brand);
  font-size: 22px;
}

.selected-poi h2 {
  margin: 2px 0 5px;
  font-size: 20px;
  line-height: 1.18;
}

.selected-poi p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.contribution-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 8px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.contribution-link:hover {
  text-decoration: underline;
}

.selected-place-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.selected-place-head .fav-btn {
  width: 48px;
  min-height: 48px;
  border-radius: 14px;
}

.selected-category {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.selected-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.trust-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.trust-badge.is-verified,
.trust-badge.is-offline {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.trust-badge.needs-network {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #b45309;
}

.selected-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.selected-actions a,
.selected-actions button {
  display: grid;
  min-width: 0;
  min-height: 48px;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.selected-actions .primary-action {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.selected-actions .is-saved {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

.selected-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.selected-secondary a,
.selected-secondary button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.selected-secondary a:hover,
.selected-secondary button:hover {
  background: var(--surface-alt);
}

.nearby-places {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.nearby-places > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nearby-places > div {
  display: grid;
  gap: 6px;
}

.nearby-places button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px 9px;
  border-color: transparent;
  background: var(--surface-alt);
  text-align: left;
}

.nearby-places button strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nearby-places button small {
  color: var(--muted);
  font-size: 10px;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
}

.results-toolbar .eyebrow {
  margin-bottom: 3px;
}

.results-toolbar strong {
  font-size: 16px;
}

.active-filter-status {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.icon-action {
  width: 48px;
  padding: 0;
  border-radius: 14px;
  color: var(--brand-strong);
  font-size: 20px;
}

.results-panel .mode-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0 16px 10px;
}

.results-panel .mode-row button {
  min-height: 42px;
  border-color: transparent;
  background: var(--surface-alt);
}

.results-panel .mode-row button:hover,
.results-panel .mode-row button.is-active {
  border-color: #d8d4ff;
  background: var(--surface-subtle);
  color: var(--brand-strong);
}

.results-panel .poi-list {
  flex: 1;
  gap: 8px;
  margin: 0;
  padding: 0 16px 20px;
  scrollbar-width: thin;
}

.results-panel .poi-card {
  padding: 13px;
  border-color: #e1e5eb;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

.results-panel .poi-card:hover,
.results-panel .poi-card.is-selected {
  transform: translateY(-1px);
  border-color: #c8c2ff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.09);
}

.results-panel .poi-card h2 {
  font-size: 15px;
}

.results-panel .fav-btn {
  width: 40px;
  min-height: 40px;
  border-radius: 12px;
}

.results-panel .pill {
  padding: 3px 7px;
  background: var(--surface-alt);
  font-size: 10px;
  font-weight: 700;
}

.results-panel .poi-detail {
  color: var(--muted);
  font-size: 12px;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1360px) and (min-width: 840px) {
  .app-shell {
    grid-template-columns: 250px minmax(320px, 1fr) 330px;
  }

  .app-topbar {
    grid-template-columns: 200px minmax(250px, 1fr) auto auto;
  }

  .topbar-action span:last-child {
    display: none;
  }

  .topbar-action {
    width: 44px;
    padding: 0;
  }

  .map-dock .guide-panel[open] {
    width: min(360px, calc(100vw - 250px - 330px - 32px));
    min-width: 300px;
  }
}

@media (min-width: 840px) and (max-width: 1199px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-areas:
      "topbar topbar"
      "filters map";
  }

  .results-panel {
    position: fixed;
    top: 84px;
    right: 12px;
    bottom: 12px;
    z-index: 1240;
    width: 330px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
  }

  .map-dock {
    width: calc(100% - 370px);
  }

  .map-dock .guide-panel[open] {
    width: min(350px, calc(100vw - 300px));
    min-width: 0;
  }
}

@media (max-width: 839px) {
  body {
    background: #e7ebf0;
  }

  .app-shell {
    display: block;
    height: 100dvh;
  }

  .app-topbar {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    left: 10px;
    z-index: 1350;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: 62px;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(215, 220, 227, 0.92);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
  }

  .brand.brand-link {
    width: 48px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-link > span:last-child,
  .app-topbar .status-pill,
  .search-box kbd {
    display: none;
  }

  .app-topbar .search-box {
    grid-template-columns: 18px minmax(0, 1fr);
    min-width: 0;
    border: 0;
    box-shadow: none;
    background: var(--surface-alt);
  }

  .app-topbar .search-box input {
    min-width: 0;
    background: transparent;
    font-size: 14px;
  }

  .topbar-actions {
    gap: 0;
  }

  .topbar-action {
    display: none;
  }

  #locateBtn.topbar-action {
    display: grid;
    width: 48px;
    min-height: 48px;
    place-items: center;
    padding: 0;
    border-color: transparent;
    background: var(--surface-subtle);
  }

  #locateBtn.topbar-action span:last-child {
    display: none;
  }

  .app-topbar .recent-searches {
    width: calc(100vw - 20px - 104px);
  }

  .map-wrap,
  .map {
    width: 100vw;
    height: 100dvh;
  }

  .map-context {
    display: none;
  }

  .filters-panel,
  .results-panel {
    position: fixed;
    right: 8px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: 8px;
    z-index: 1250;
    width: auto;
    max-height: calc(100dvh - 92px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border: 1px solid rgba(215, 220, 227, 0.96);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.985);
    box-shadow: 0 -12px 38px rgba(15, 23, 42, 0.16);
    transition: transform 180ms ease, opacity 160ms ease, height 180ms ease;
  }

  .filters-panel {
    display: none;
    height: 56dvh;
    padding: 0 0 16px;
    overflow-y: auto;
    border-right: 1px solid var(--line);
  }

  body.sheet-mid .filters-panel {
    display: flex;
  }

  .panel-mobile-head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
  }

  .panel-mobile-head > div {
    display: grid;
    gap: 2px;
  }

  .panel-mobile-head button {
    width: 48px;
    padding: 0;
    border: 0;
    background: var(--surface-alt);
    font-size: 22px;
  }

  .rail-section {
    padding: 16px;
  }

  .filters-panel .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-panel {
    display: none;
  }

  body.sheet-compact .results-panel,
  body.sheet-full .results-panel {
    display: flex;
  }

  body.sheet-compact .results-panel {
    height: 174px;
  }

  body.sheet-compact.has-selected-poi .results-panel {
    height: 252px;
  }

  body.sheet-full .results-panel {
    height: calc(100dvh - 92px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .sheet-grabber {
    display: block;
    flex: 0 0 auto;
    width: 42px;
    height: 5px;
    margin: 8px auto 0;
    border-radius: 999px;
    background: #cbd2dd;
  }

  .selected-poi {
    padding: 12px 16px;
  }

  body.sheet-compact .selected-poi {
    flex: 1;
    display: grid;
    align-items: center;
    border-bottom: 0;
  }

  body.sheet-compact .selected-trust-row,
  body.sheet-compact .selected-secondary,
  body.sheet-compact .nearby-places,
  body.sheet-compact .contribution-link {
    display: none;
  }

  body.sheet-compact .selected-place-head p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.sheet-compact .results-toolbar,
  body.sheet-compact .mode-row,
  body.sheet-compact .poi-list {
    display: none;
  }

  body.sheet-full .selected-poi {
    flex: 0 0 auto;
  }

  .results-panel .poi-list {
    padding-bottom: 16px;
  }

  .map-dock {
    top: calc(max(10px, env(safe-area-inset-top)) + 72px);
    right: 10px;
    left: 10px;
    display: flex;
    width: auto;
    max-height: calc(100dvh - 270px);
    gap: 7px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 2px 2px 8px;
    scrollbar-width: none;
  }

  .map-dock::-webkit-scrollbar {
    display: none;
  }

  .map-dock .guide-panel {
    min-width: 0;
    max-width: calc(100vw - 20px);
    padding: 0;
  }

  .map-dock .dock-card > summary {
    min-height: 48px;
    padding-inline: 11px;
  }

  .map-dock .guide-panel[open] {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100vw - 24px);
    min-width: 0;
    max-height: min(52dvh, 460px);
    padding: 0 14px 14px;
  }

  body.sheet-full .map-dock,
  body.sheet-mid .map-dock {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1400;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(215, 220, 227, 0.95);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
  }

  .mobile-nav button {
    display: grid;
    min-height: 52px;
    place-items: center;
    gap: 1px;
    padding: 3px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-nav button span {
    font-size: 19px;
    line-height: 1;
  }

  .mobile-nav button[aria-pressed="true"] {
    color: var(--brand-strong);
  }

  .mobile-nav button[aria-pressed="true"] span {
    display: grid;
    width: 34px;
    height: 25px;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-subtle);
  }

  .offline-banner {
    top: calc(max(10px, env(safe-area-inset-top)) + 66px);
  }

  .update-toast {
    bottom: calc(74px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px) {
  .filters-panel .category-list {
    grid-template-columns: 1fr;
  }

  .selected-poi-empty {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .selected-poi-icon {
    width: 36px;
    height: 36px;
  }

  .selected-poi h2 {
    font-size: 17px;
  }

  .selected-poi p {
    font-size: 12px;
  }

  .selected-actions {
    gap: 6px;
  }
}

/* Shopping-first discovery ------------------------------------------------ */

.topbar-link {
  text-decoration: none;
}

.utility-secondary {
  display: none;
}

.shopping-panel {
  padding: 18px 16px;
  border-bottom: 1px solid #e8ebf0;
  background: linear-gradient(155deg, #f8fafc, #eef2ff);
}

.shopping-panel .section-head {
  align-items: flex-start;
  margin: 0 0 12px;
}

.shopping-panel h2 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.15;
}

.shopping-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.shopping-filter-grid button {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.shopping-filter-grid button small {
  color: var(--muted);
  font-size: 10px;
}

.shopping-filter-grid button[aria-pressed="true"] {
  border-color: #a5b4fc;
  background: #fff;
  color: var(--brand-strong);
  box-shadow: inset 3px 0 0 var(--brand), 0 5px 14px rgba(15, 23, 42, 0.06);
}

.shopping-filter-grid button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.shopping-filter-grid button[data-shopping-filter="supermarket"] span,
.shopping-filter-grid button[data-shopping-filter="market"] span {
  color: #166534;
}

.shopping-filter-grid button[data-shopping-filter="kitchenware"] span,
.shopping-filter-grid button[data-shopping-filter="houseware"] span {
  color: #92400e;
}

.shopping-filter-grid button[data-shopping-filter="second_hand"] span {
  color: #6d28d9;
}

.shopping-filter-grid button[data-shopping-filter="clothing"] span {
  color: #be123c;
}

.filters-panel > .rail-welcome,
.filters-panel > .intent-panel {
  display: none;
}

.task-navigation {
  order: 2;
}

.shopping-panel {
  order: 1;
}

.category-section {
  order: 3;
}

.filters-panel .install-card {
  order: 4;
}

.results-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sort-control select {
  width: 116px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 28px 0 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.poi-meta .pill.is-open {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.poi-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #edf0f4;
}

.poi-card-actions a,
.poi-card-actions button,
.poi-card-actions span {
  display: grid;
  min-width: 0;
  min-height: 38px;
  place-items: center;
  padding: 5px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-alt);
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.poi-card-actions span {
  color: var(--muted);
  font-weight: 650;
}

.leaflet-tooltip.poi-hover-card {
  width: 240px;
  padding: 12px;
  border: 1px solid rgba(217, 226, 236, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
  color: var(--ink);
  white-space: normal;
  backdrop-filter: blur(14px);
}

.map.leaflet-container {
  background-color: #e8eef4;
  background-image:
    linear-gradient(30deg, rgba(79, 70, 229, 0.055) 12%, transparent 12.5%, transparent 87%, rgba(79, 70, 229, 0.055) 87.5%),
    linear-gradient(150deg, rgba(79, 70, 229, 0.055) 12%, transparent 12.5%, transparent 87%, rgba(79, 70, 229, 0.055) 87.5%),
    linear-gradient(30deg, rgba(255, 255, 255, 0.6) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.6) 87.5%);
  background-position: 0 0, 0 0, 24px 42px;
  background-size: 48px 84px;
}

.poi-hover-card::before {
  display: none;
}

.hover-card-title {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.hover-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.hover-card-meta span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hover-color);
}

.hover-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.hover-card-badges b {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 9px;
}

.hover-card-badges .is-open,
.hover-card-badges .is-verified {
  background: #ecfdf5;
  color: #047857;
}

.poi-hover-card > small {
  display: block;
  margin-top: 8px;
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 800;
}

.selected-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0 0;
}

.selected-facts div {
  min-width: 0;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface-alt);
}

.selected-facts dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.selected-facts dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.selected-facts dd.is-open {
  color: #047857;
}

.collection-list {
  display: grid;
  gap: 7px;
  margin: 10px 0;
}

.collection-list > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 9px 11px;
  background: var(--surface-alt);
  text-align: left;
}

.collection-list > button > span {
  display: grid;
  gap: 2px;
}

.collection-list small {
  color: var(--muted);
  font-size: 9px;
}

.collection-list b {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 11px;
}

.collection-list > button.is-active {
  border-color: #a5b4fc;
  background: var(--surface-subtle);
}

.collection-form {
  display: grid;
  gap: 5px;
  margin: 12px 0;
}

.collection-form > label {
  font-size: 11px;
  font-weight: 850;
}

.collection-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.collection-form input {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
}

.save-dialog {
  width: min(430px, calc(100vw - 24px));
  max-height: min(620px, calc(100dvh - 32px));
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
}

.save-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.dialog-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.dialog-head button {
  width: 48px;
  padding: 0;
  font-size: 22px;
}

.dialog-poi-name {
  margin: 16px 16px 8px;
  font-weight: 850;
}

.save-collection-options {
  display: grid;
  gap: 7px;
  padding: 8px 16px;
}

.save-collection-options button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.save-collection-options button[aria-pressed="true"] {
  border-color: #a5b4fc;
  background: var(--surface-subtle);
}

.save-collection-options small {
  color: var(--muted);
}

.dialog-note {
  margin: 8px 16px 16px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 839px) {
  .shopping-panel {
    padding: 14px;
  }

  .shopping-filter-grid {
    display: flex;
    margin-inline: -14px;
    overflow-x: auto;
    padding: 0 14px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .shopping-filter-grid button {
    flex: 0 0 auto;
    min-width: 104px;
    scroll-snap-align: start;
  }

  body.sheet-compact .selected-facts {
    display: none;
  }

  .sort-control select {
    width: 105px;
  }

  .utility-secondary {
    display: none !important;
  }
}
