/* Global Styles */
:root {
  --font-sans: "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --primary-color: #3B82F6;
  --primary-dark: #2563EB;
  --text-dark: #1F2937;
  --text-gray: #6B7280;
  --bg-light: #F3F4F6;
  --white: #FFFFFF;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-lg: 12px;
  --radius-xl: 16px;
  /* z-index scale */
  --z-grid: 10;
  --z-marker: 20;
  --z-indicator: 25;
  --z-ui: 30;
  --z-toast: 50;
  --z-modal: 100;
}

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

body {
  font-family: var(--font-sans);
  overflow: hidden;
  /* Prevent scroll on mobile */
  background-color: var(--bg-light);
  color: var(--text-dark);
  letter-spacing: -0.012em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

body[data-connectivity="offline"] {
  --primary-color: #2563eb;
}

body[data-text-scale="large"] {
  font-size: 18px;
}

body[data-contrast-mode="high"] {
  --primary-color: #0f3cc9;
  --primary-dark: #072c98;
  --text-dark: #050505;
  --text-gray: #111827;
  --bg-light: #eef2ff;
  --shadow-md: 0 0 0 2px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 0 0 3px rgba(15, 23, 42, 0.22);
}

body::before,
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 15;
}

body::before {
  top: 0;
  height: 180px;
  background: linear-gradient(180deg, rgba(243, 244, 246, 0.65) 0%, rgba(243, 244, 246, 0.2) 48%, rgba(243, 244, 246, 0) 100%);
}

body::after {
  bottom: 0;
  height: 240px;
  background: linear-gradient(0deg, rgba(243, 244, 246, 0.72) 0%, rgba(243, 244, 246, 0.22) 46%, rgba(243, 244, 246, 0) 100%);
}

.skip-link {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: calc(var(--safe-left) + 12px);
  padding: 8px 12px;
  background: #111827;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  z-index: 120;
  transform: translateY(-140%);
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Map Container */
#map-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  isolation: isolate;
}

#map {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#grid-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: var(--z-grid);
  pointer-events: none;
}

/* Map Overlays */
#center-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -100%);
  /* Point to center */
  z-index: var(--z-marker);
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

#center-marker svg {
  width: 100%;
  height: 100%;
  fill: var(--primary-color);
}

/* UI Components */
/* 1. Top Search Bar */
.search-container {
  position: absolute;
  top: calc(var(--safe-top) + 12px);
  left: calc(var(--safe-left) + 16px);
  right: calc(var(--safe-right) + 16px);
  z-index: 35;
  display: flex;
  justify-content: center;
}

.search-box {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 480px;
  gap: 12px;
  transition: box-shadow 0.2s;
}

.search-box:focus-within {
  box-shadow: var(--shadow-lg);
}

.search-box.is-loading .search-btn .icon {
  animation: searchSpin 0.85s linear infinite;
  opacity: 0.75;
}

.search-input {
  border: none;
  outline: none;
  font-size: 16px;
  width: 100%;
  padding: 8px 0;
  color: var(--text-dark);
}

.search-input:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 6px;
}

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.search-btn .icon,
.fab .icon {
  width: 20px;
  height: 20px;
}

.search-btn:hover {
  color: var(--primary-color);
}

/* 2. Floating Action Buttons (Right) */
.fab-container {
  position: absolute;
  top: calc(var(--safe-top) + 76px);
  right: calc(var(--safe-right) + 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 35;
}

.fab {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--text-dark);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.fab:hover {
  background: #f0f7ff;
  box-shadow: var(--shadow-lg);
}

.fab:active {
  transform: scale(0.95);
}

.fab.active {
  color: var(--primary-color);
}

/* 3. Bottom Sheet Address Display */
.bottom-sheet {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 20px);
  left: calc(var(--safe-left) + 16px);
  right: calc(var(--safe-right) + 16px);
  z-index: var(--z-ui);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.address-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 20px 24px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
  width: 100%;
  max-width: 480px;
  max-height: min(60vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
  pointer-events: auto;
  animation: slideUp 0.3s ease-out;
}

.place-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 4px;
  min-height: 19px;
  /* Prevent layout jump */
}

.address-label {
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.gilmaru-address {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  /* Changed from primary for hierarchy */
  margin-bottom: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.03em;
}

.gilmaru-address-btn {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  text-align: center;
}

.gilmaru-address-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: 8px;
}

.gilmaru-address:active {
  opacity: 0.7;
}

.gilmaru-address .copy-icon {
  width: 16px;
  height: 16px;
  color: var(--text-gray);
  vertical-align: middle;
  margin-left: 6px;
}

.address-hint {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 8px;
}

.sentence-address {
  font-size: 14px;
  color: var(--primary-color);
  font-style: italic;
  margin-bottom: 8px;
  font-weight: 500;
  opacity: 0.9;
}

.road-address {
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 12px;
  min-height: 16px;
}

.guidance-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 4px 0 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  margin-bottom: 12px;
}

.provider-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.status-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 14px;
  padding: 8px 12px;
  background: rgba(239, 246, 255, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.status-banner[hidden] {
  display: none;
}

.status-banner-warning {
  background: rgba(254, 243, 199, 0.95);
  border-color: rgba(217, 119, 6, 0.24);
  color: #92400e;
}

.utility-chip {
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(239, 246, 255, 0.92);
  color: var(--primary-color);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.utility-chip:hover {
  transform: translateY(-1px);
  background: rgba(219, 234, 254, 0.98);
}

.utility-chip[aria-pressed="true"] {
  background: linear-gradient(135deg, #2563eb, #0f766e);
  border-color: transparent;
  color: #fff;
}

.utility-chip-ghost {
  background: rgba(249, 250, 251, 0.92);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--text-gray);
}

body[data-text-scale="large"] .search-input {
  font-size: 18px;
}

body[data-text-scale="large"] .address-label,
body[data-text-scale="large"] .address-hint,
body[data-text-scale="large"] .sentence-address,
body[data-text-scale="large"] .road-address,
body[data-text-scale="large"] .status-banner,
body[data-text-scale="large"] .utility-chip,
body[data-text-scale="large"] .point-pack-summary,
body[data-text-scale="large"] .point-pack-selected-detail,
body[data-text-scale="large"] .point-pack-item-detail,
body[data-text-scale="large"] .guidance-panel-steps,
body[data-text-scale="large"] .btn {
  font-size: 15px;
}

body[data-text-scale="large"] .gilmaru-address {
  font-size: 32px;
}

body[data-contrast-mode="high"] .search-box,
body[data-contrast-mode="high"] .fab,
body[data-contrast-mode="high"] #zoom-indicator,
body[data-contrast-mode="high"] .address-card,
body[data-contrast-mode="high"] .point-pack-panel,
body[data-contrast-mode="high"] .guidance-panel,
body[data-contrast-mode="high"] .status-banner,
body[data-contrast-mode="high"] .utility-chip,
body[data-contrast-mode="high"] .btn,
body[data-contrast-mode="high"] .modal,
body[data-contrast-mode="high"] .qr-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border-width: 2px;
}

body[data-contrast-mode="high"] .search-box,
body[data-contrast-mode="high"] .address-card,
body[data-contrast-mode="high"] .point-pack-panel,
body[data-contrast-mode="high"] .modal,
body[data-contrast-mode="high"] .qr-card {
  background: #ffffff;
  border-color: #111827;
}

body[data-contrast-mode="high"] .guidance-panel,
body[data-contrast-mode="high"] .status-banner {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #0f172a;
}

body[data-contrast-mode="high"] .status-banner-warning {
  background: #fef3c7;
  border-color: #b45309;
  color: #7c2d12;
}

body[data-contrast-mode="high"] .utility-chip {
  background: #ffffff;
  border-color: #1d4ed8;
  color: #0f3cc9;
}

body[data-contrast-mode="high"] .utility-chip[aria-pressed="true"] {
  background: #0f3cc9;
  color: #ffffff;
}

body[data-contrast-mode="high"] .utility-chip-ghost {
  border-color: #111827;
  color: #111827;
}

.guidance-panel {
  text-align: left;
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.95), rgba(240, 253, 250, 0.95));
  border: 1px solid rgba(59, 130, 246, 0.14);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.guidance-panel-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.guidance-panel-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--text-dark);
  font-size: 13px;
  line-height: 1.55;
}

.guidance-panel-steps li + li {
  margin-top: 4px;
}

.point-pack-panel {
  text-align: left;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

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

.point-pack-kicker {
  font-size: 11px;
  font-weight: 800;
  color: #0f766e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.point-pack-title {
  margin: 0;
  font-size: 18px;
  color: var(--text-dark);
  letter-spacing: -0.025em;
}

.point-pack-summary {
  font-size: 13px;
  color: var(--text-gray);
  margin: 8px 0 0;
}

.point-pack-selected {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.1), rgba(15, 118, 110, 0.1));
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.point-pack-selected-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.point-pack-selected-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
}

.point-pack-selected-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.point-pack-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.point-pack-badge.type {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.point-pack-badge.status {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
}

.point-pack-badge.status.status-verified {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.point-pack-badge.status.status-reported {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.point-pack-badge.status.status-temporary {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}

.point-pack-badge.status.status-inactive {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

.point-pack-selected-description,
.point-pack-selected-detail,
.point-pack-selected-guidance {
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.55;
}

.point-pack-selected-description,
.point-pack-selected-detail {
  margin-top: 6px;
}

.point-pack-selected-guidance {
  margin-top: 8px;
  color: var(--primary-color);
  font-weight: 600;
}

.point-pack-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
}

.point-pack-item {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.point-pack-item:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.point-pack-item.is-active {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.point-pack-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}

.point-pack-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.point-pack-item-detail {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 6px;
  line-height: 1.45;
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #F3F4F6;
  color: var(--text-dark);
}

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

/* Toast Message */
#toast {
  visibility: hidden;
  min-width: 250px;
  background-color: rgba(31, 41, 55, 0.9);
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 12px;
  position: fixed;
  z-index: var(--z-toast);
  left: 50%;
  bottom: calc(var(--safe-bottom) + 96px);
  /* Moved up to avoid overlap */
  /* Above the bottom sheet */
  transform: translateX(-50%);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
}

#toast.show {
  visibility: visible;
  opacity: 1;
}

/* Zoom Indicator styling within map */
#zoom-indicator {
  position: absolute;
  top: calc(var(--safe-top) + 76px);
  left: calc(var(--safe-left) + 16px);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  color: var(--text-dark);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  z-index: 35;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

#app-version {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 4px);
  right: calc(var(--safe-right) + 8px);
  font-size: 11px;
  color: rgba(0, 0, 0, 0.4);
  z-index: 35;
  pointer-events: none;
  font-weight: 500;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* Animations */
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

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

@media (min-width: 769px) {
  .search-box {
    max-width: 560px;
  }

  .address-card {
    max-width: 560px;
  }

  .modal {
    max-width: 400px;
  }
}

@media (max-width: 480px) {
  .search-container {
    top: calc(var(--safe-top) + 10px);
    left: calc(var(--safe-left) + 12px);
    right: calc(var(--safe-right) + 12px);
  }

  .search-box {
    padding: 7px 12px;
    gap: 8px;
  }

  .gilmaru-address {
    font-size: 19px;
  }

  .provider-toolbar,
  .guidance-toolbar {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .provider-toolbar::-webkit-scrollbar,
  .guidance-toolbar::-webkit-scrollbar {
    display: none;
  }

  .utility-chip {
    flex: 0 0 auto;
    justify-content: center;
    white-space: nowrap;
    min-height: 38px;
  }

  .status-stack {
    gap: 6px;
    margin-bottom: 10px;
  }

  .point-pack-panel,
  .guidance-panel {
    padding: 12px 14px;
  }

  .point-pack-list {
    max-height: 180px;
  }

  .bottom-sheet {
    bottom: var(--safe-bottom);
    left: 0;
    right: 0;
  }

  .address-card {
    padding: 14px 14px 10px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: min(48vh, 340px);
  }

  .sentence-address {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .road-address {
    margin-bottom: 10px;
  }

  .action-buttons {
    position: sticky;
    bottom: 0;
    margin-top: 12px;
    padding-top: 12px;
    padding-bottom: calc(var(--safe-bottom) + 2px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.92) 22%, rgba(255, 255, 255, 0.98) 100%);
  }

  .btn {
    min-height: 46px;
    padding: 11px 10px;
  }
}

/* Intro Modal */
.modal-overlay {
  display: none;
  /* Hidden by default */
  position: fixed;
  /* Stay in place */
  z-index: var(--z-modal);
  /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  /* Full width */
  height: 100%;
  /* Full height */
  overflow: auto;
  /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.4);
  /* Black w/ opacity */
  animation: fadeIn 0.3s;
  /* Flexbox for centering */
  justify-content: center;
  align-items: center;
}

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  width: 90%;
  max-width: 320px;
  /* Reduced for narrow screens */
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.025em;
}

.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-gray);
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.close-btn .icon {
  width: 18px;
  height: 18px;
}

.close-btn:hover {
  background-color: #f3f4f6;
}

.modal-content {
  padding: 24px 20px;
  word-break: keep-all;
}

.intro-main-text {
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 24px;
  color: #4b5563;
}

.intro-main-text b {
  color: var(--primary-color);
  font-size: 18px;
  display: block;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.highlight {
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  box-shadow: inset 0 -4px 0 rgba(59, 130, 246, 0.1);
  font-weight: 600;
}

.comparison-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.comp-item {
  flex: 1;
  text-align: center;
}

.comp-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.comp-desc {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 2px;
  word-break: keep-all;
}

.comp-note {
  font-size: 12px;
  color: #9ca3af;
  word-break: keep-all;
}

.comp-vs {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  margin: 0 12px;
}

.highlight-item .comp-desc {
  color: var(--primary-color);
}

.highlight-item .comp-note {
  color: var(--primary-color);
  opacity: 0.8;
}

.intro-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.intro-features li {
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #374151;
  word-break: keep-all;
  line-height: 1.5;
}

.modal-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.modal-footer-text {
  font-size: 12px;
  color: #9ca3af;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Sentence Highlight */
.highlight-word {
  color: var(--primary-color);
  font-weight: 700;
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  padding-bottom: 1px;
}

/* Tech Specs (Details/Summary) */
.tech-specs {
  margin-top: 16px;
  border-top: 1px solid #f3f4f6;
  padding-top: 12px;
  font-size: 13px;
}

.tech-specs summary {
  cursor: pointer;
  color: #6b7280;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.tech-specs summary::-webkit-details-marker {
  display: none;
}

.summary-chevron {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.tech-specs[open] .summary-chevron {
  transform: rotate(225deg) translateY(1px);
}

.specs-content {
  margin-top: 12px;
  background: #f9fafb;
  padding: 12px;
  border-radius: 8px;
  text-align: left;
  animation: fadeIn 0.3s ease;
}

.specs-content p {
  margin-bottom: 6px;
  color: #4b5563;
  line-height: 1.4;
}

.specs-content p:last-child {
  margin-bottom: 0;
}

.specs-content b {
  color: #374151;
  font-weight: 600;
}

.specs-content .sub-text {
  margin-top: 8px;
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
}

/* QR Card Styles */
.qr-card {
  background: white;
  width: 100%;
  padding: 30px 20px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-sizing: border-box;
}

.qr-card .logo {
  font-weight: 800;
  color: #3b82f6;
  margin-bottom: 20px;
  font-size: 16px;
  letter-spacing: -0.5px;
}

.qr-card .qr-box {
  background: #fff;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-card .qr-box img {
  display: block;
}

.qr-card .gilmaru-address {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
  line-height: 1.3;
  word-break: keep-all;
  letter-spacing: -0.03em;
}

.qr-card .gilmaru-address .highlight-word {
  color: #2563eb;
  padding: 0 2px;
  border-bottom: none;
}

.qr-card .road-address {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  font-weight: 400;
}

.qr-card .footer-note {
  margin-top: 25px;
  font-size: 12px;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
  padding-top: 15px;
  width: 100%;
}

/* Search Divider (was inline) */
.search-divider {
  width: 1px;
  height: 20px;
  background: #ddd;
  margin: 0 8px;
  flex-shrink: 0;
}

/* Intro Button Highlight (was inline) */
.btn-intro-highlight {
  color: var(--primary-color);
}

/* Zoom Icon (was inline) */
.zoom-icon {
  width: 16px;
  height: 16px;
  color: var(--primary-color);
}

/* Intro Feature Icons */
.intro-icon-shell {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(15, 118, 110, 0.12));
  border: 1px solid rgba(37, 99, 235, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

.intro-icon {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
}

/* Modal Footer Contact (was inline) */
.modal-footer-contact {
  margin-top: 4px;
}

.modal-footer-link {
  color: #9ca3af;
  text-decoration: none;
}

.modal-footer-link:hover {
  text-decoration: underline;
}

@keyframes searchSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

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

/* QR Modal Container (was inline) */
.qr-modal-container {
  max-width: 360px;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

/* QR Actions (was inline) */
.qr-actions {
  margin-top: 20px;
  text-align: center;
  gap: 10px;
  display: flex;
  justify-content: center;
}

.qr-save-btn {
  background: var(--primary-color);
  border: none;
  color: white;
  height: auto;
  padding: 8px 16px;
}

.btn .button-icon,
.qr-save-icon {
  width: 18px;
  height: 18px;
  margin-right: 4px;
}

.btn.is-busy,
.search-btn.is-busy {
  opacity: 0.72;
  cursor: progress;
}

.btn.is-busy .icon,
.search-btn.is-busy .icon {
  animation: searchSpin 0.85s linear infinite;
}

.qr-save-label {
  line-height: 1.2;
}

.qr-close-btn {
  background: white;
  color: #333;
}

.qr-fallback {
  font-size: 13px;
  color: #6b7280;
  padding: 18px 12px;
  text-align: center;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--white);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-top: 4px;
  overflow-x: hidden;
  z-index: 31;
}

.search-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.15s;
  border-bottom: 1px solid #f3f4f6;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover,
.search-item.active {
  background-color: #f0f7ff;
}

.search-item[aria-selected="true"] {
  background-color: #e8f1ff;
}

.search-item-empty {
  padding: 14px 16px;
  color: var(--text-gray);
  font-size: 13px;
}

.search-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.search-item-addr {
  font-size: 12px;
  color: var(--text-gray);
}

/* Focus Visible (Keyboard Navigation) */
.search-btn:focus-visible,
.fab:focus-visible,
.btn:focus-visible,
.close-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

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