/* Reverse Logo Hunt — ダーク（既定）とライトの2テーマ。色はすべて変数で持ち、test/contrast.test.js で組を検査する */
:root {
  --bg: #0a0e27;
  --panel: #0f1429;
  --panel-2: #152238;
  --text: #e0f7ff;
  --muted: #8da9c4;
  --accent: #00d9ff;
  --accent-2: #ff2a6d;
  --accent-3: #d1f366;
  --on-accent: #000000;
  --primary-from: #00d9ff;
  --primary-to: #ff2a6d;
  --border: #1a2847;
  --control-border: #4a6488;
  --focus: #ffd34d;
  --logo-bg: #ffffff;
  --logo-note: #3d4a5c;
  --glow-cyan: 0 0 20px rgba(0, 217, 255, 0.5);
  --glow-pink: 0 0 20px rgba(255, 42, 109, 0.5);
  --overlay: rgba(10, 14, 39, 0.88);
  --backdrop: rgba(0, 0, 0, 0.85);
}

[data-theme="light"] {
  --bg: #f0f4f8;
  --panel: #ffffff;
  --panel-2: #e3eaf1;
  --text: #1a2332;
  --muted: #5a6c7d;
  --accent: #00739e;
  --accent-2: #c2185b;
  --accent-3: #4d7a1f;
  --on-accent: #ffffff;
  --primary-from: #00739e;
  --primary-to: #b0144f;
  --border: #d0dae5;
  --control-border: #7a8ca0;
  --focus: #b0005a;
  --glow-cyan: 0 2px 8px rgba(0, 115, 158, 0.2);
  --glow-pink: 0 2px 8px rgba(194, 24, 91, 0.2);
  --overlay: rgba(240, 244, 248, 0.92);
  --backdrop: rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
  overflow-x: hidden;
}

a { color: var(--accent); }

[hidden] { display: none !important; }

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

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

.noscript {
  margin: 0;
  padding: 12px 16px;
  background: var(--panel-2);
  color: var(--text);
}

/* ---- ヘッダー ---- */
header {
  padding: 16px 20px;
  border-bottom: 2px solid var(--accent);
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(255, 42, 109, 0.1));
  box-shadow: var(--glow-cyan);
}

.header-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
}

.header-title { flex: 1 1 320px; min-width: 0; }

h1 {
  margin: 0 0 4px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: var(--glow-cyan);
  overflow-wrap: anywhere;
}

.subtitle { margin: 0; color: var(--muted); font-size: 14px; }

.header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 44px;
  background: var(--panel);
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--glow-cyan);
}

.header-button:hover { background: var(--bg); }
.header-button .button-label { white-space: nowrap; line-height: 1; }
.github-icon { width: 18px; height: 18px; flex-shrink: 0; display: block; }
.help-icon-text, .theme-icon { font-size: 18px; line-height: 1; }

/* ---- ボタン ---- */
button {
  font: inherit;
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.2), rgba(255, 42, 109, 0.2));
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 8px 12px;
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
}

button:hover { box-shadow: var(--glow-cyan); }

button.primary {
  background: linear-gradient(135deg, var(--primary-from), var(--primary-to));
  color: var(--on-accent);
  border: none;
  font-weight: 700;
}

button.primary:hover { box-shadow: var(--glow-pink); }

button.secondary {
  background: var(--panel);
  border: 1px dashed var(--accent);
  color: var(--accent);
  font-weight: 600;
}

button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- レイアウト ---- */
main {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

#left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#right { min-width: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px;
  box-shadow: inset 0 0 30px rgba(0, 217, 255, 0.05);
}

.panel h2 { margin: 4px 0 6px; font-size: 20px; }
.panel-note { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.small, .meta { font-size: 12px; color: var(--muted); }

/* ---- 画像の読み込み ---- */
.dropzone {
  display: block;
  position: relative;
  cursor: pointer;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  background: rgba(0, 217, 255, 0.05);
}

.dropzone:hover, .dropzone.drag { border-color: var(--accent-2); box-shadow: var(--glow-pink); }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone span { display: block; font-size: 14px; }

.image-list, .marked-logos, .history-list, .candidate-list, .modal-selected-rois { list-style: none; margin: 0; padding: 0; }
.image-list { display: grid; gap: 8px; margin-top: 12px; max-height: 260px; overflow: auto; }

.image-item, .marked-logo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.image-item.selected, .marked-logo-item.selected { border: 2px solid var(--accent); box-shadow: var(--glow-cyan); }

.image-item-open, .marked-logo-open {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  padding: 8px;
  border-radius: 8px;
}

.image-item-open:hover, .marked-logo-open:hover { box-shadow: none; background: var(--bg); }
.image-item-open canvas { width: 64px; height: 64px; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.image-item-info, .marked-logo-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }

.remove-image-btn, .remove-marked-logo, .remove-roi-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-right: 6px;
  padding: 0;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
  font-size: 18px;
  line-height: 1;
}

.marked-logos { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow: auto; }
.marked-logo-preview { width: 60px; height: 60px; border: 1px solid var(--border); border-radius: 4px; flex-shrink: 0; }
.marked-logo-text { font-weight: 600; }

.marked-logo-status {
  margin-left: auto;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  white-space: nowrap;
}

.status-done .marked-logo-status { border-color: var(--accent-3); }
.status-error .marked-logo-status, .status-nohit .marked-logo-status, .status-noquery .marked-logo-status { border-color: var(--accent-2); }
.marked-empty, .history-empty { color: var(--muted); padding: 16px; text-align: center; }

/* ---- タブ ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.tab-button {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.tab-button.active {
  background: var(--panel);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  box-shadow: var(--glow-cyan);
}

.tab {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 520px;
}

.tab h3 { margin: 4px 0 10px; }

/* ---- 根拠・照合 ---- */
.empty-state { padding: 24px 12px; color: var(--muted); }
.empty-state h3 { color: var(--text); text-align: center; }
.empty-state .instructions { max-width: 560px; margin: 16px auto; color: var(--text); line-height: 1.8; }
.empty-state .note { max-width: 600px; margin: 16px auto 0; padding: 12px; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; }

.value-proposition {
  max-width: 600px;
  margin: 16px auto;
  padding: 16px 20px;
  border: 2px solid var(--accent);
  border-radius: 12px;
}

.value-proposition h4 { margin: 0 0 8px; color: var(--accent); text-align: center; }
.value-proposition ul { margin: 0; padding-left: 20px; color: var(--text); font-size: 13px; line-height: 1.7; }

.justify-content { display: flex; flex-direction: column; gap: 14px; }
.justify-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.justify-top h3, .query-box h3, .candidates h3, .justify-bottom h3 { margin: 0 0 8px; font-size: 16px; }
.roi-figure, .commons-figure { margin: 0; min-width: 0; }
.roi-figure canvas { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; }

#commonsThumb {
  display: block;
  max-width: 100%;
  max-height: 220px;
  padding: 8px;
  background: var(--logo-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

#commonsMeta { overflow-wrap: anywhere; }
.query-box { border-top: 1px dashed var(--border); padding-top: 10px; }
.ocr-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; color: var(--text); }
.query-choices-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 4px 14px; border-radius: 999px; font-size: 13px; }
.chip[aria-pressed="true"] { border-width: 2px; font-weight: 700; }
.query-form { display: flex; gap: 8px; margin-top: 8px; }

.query-form input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  font-size: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  background: var(--bg);
  color: var(--text);
}

.result-message { min-height: 1.2em; margin: 8px 0 0; font-size: 14px; }

.close-call {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent-2);
  background: var(--panel-2);
  font-size: 14px;
}

.candidate-list { display: grid; gap: 10px; }

.candidate {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.candidate.selected { border: 2px solid var(--accent); box-shadow: var(--glow-cyan); }

.candidate-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 4px;
  background: var(--logo-bg);
  border-radius: 6px;
}

.candidate-thumb img { max-width: 100%; max-height: 64px; object-fit: contain; }
.candidate-nologo { font-size: 12px; color: var(--logo-note); text-align: center; }
.candidate-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.candidate-label { overflow-wrap: anywhere; }
.candidate-qid, .candidate-place { font-size: 12px; color: var(--muted); }
.candidate-desc { margin: 4px 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.candidate-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--control-border); }
.candidate-scores { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.candidate-selected { font-size: 13px; font-weight: 700; color: var(--accent); }
.justify-bottom { border-top: 1px dashed var(--border); padding-top: 10px; }
.score-table { width: 100%; border-collapse: collapse; }
.score-table th, .score-table td { border-bottom: 1px solid var(--border); padding: 6px; text-align: left; }

.log {
  max-height: 120px;
  overflow-y: auto;
  margin-top: 12px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- 地図・関係図 ---- */
.map, .graph { height: 520px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.graph { position: relative; }
.legend { margin-top: 8px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-left: 8px; border: 1px solid var(--border); }
.legend .dot.hq, .legend .dot.company { background: #ffcc00; }
.legend .dot.shot { background: #ff6a6a; }
.legend .dot.related { background: #4aa3ff; }
.legend .line-key { display: inline-block; width: 24px; margin-left: 8px; border-top: 2px dashed #ff6a6a; }
.distance-box { margin-top: 10px; }
.distance-box h4 { margin: 0 0 6px; font-size: 15px; color: var(--accent); }

.graph-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.graph-control-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; min-width: 0; max-width: 100%; }
.graph-control-group label { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
.graph-control input { accent-color: var(--accent); width: 18px; height: 18px; }

.graph-control select, .edge-adjust-field select {
  min-height: 44px;
  font-size: 16px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--control-border);
  border-radius: 6px;
  padding: 4px 8px;
}

.graph-control-hint { margin: 0; width: 100%; font-size: 12px; color: var(--muted); }
.graph-control select { max-width: 100%; min-width: 0; }
.distance-table { table-layout: fixed; }
.distance-table th, .distance-table td { overflow-wrap: anywhere; }
.group-summary { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.group-summary h4 { margin: 0 0 6px; font-size: 15px; color: var(--accent); }
.group-list { margin: 0; padding-left: 20px; line-height: 1.7; }

.edge-adjust-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--glow-cyan), 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 10001;
}

.edge-adjust-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--accent);
}

.edge-adjust-header h4 { margin: 0; font-size: 16px; }
.close-edge-adjust, .close-help-modal, .close-modal-btn {
  width: 44px;
  padding: 0;
  border-color: var(--accent-2);
  color: var(--accent-2);
  background: var(--panel);
}
.edge-adjust-body { padding: 16px; }
.edge-adjust-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.edge-adjust-field label { min-width: 100px; font-size: 13px; color: var(--muted); font-weight: 600; }
.edge-adjust-field input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--accent); }
.edge-adjust-field output { min-width: 40px; text-align: right; font-size: 13px; color: var(--accent); font-weight: 700; }
.edge-adjust-actions { display: flex; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--border); }
.edge-adjust-actions button { flex: 1; }

/* ---- 履歴・書き出し ---- */
.history { display: flex; flex-direction: column; gap: 10px; }

.history-list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: var(--panel);
}

.history-item { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-bottom: 1px solid var(--border); }
.history-date, .history-images { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.export { display: flex; flex-wrap: wrap; gap: 8px; }
footer { margin: 12px 16px; min-height: 20px; }

/* ---- ヘルプ ---- */
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--backdrop);
}

.help-modal-content {
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: 16px;
}

.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 2px solid var(--accent);
}

.help-modal-header h2 { margin: 0; font-size: 22px; }
.help-modal-body { padding: 20px; overflow-y: auto; }
.help-section { margin-bottom: 24px; }
.help-section h3 { margin: 0 0 10px; font-size: 18px; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.help-section p, .help-section ul, .help-section ol { line-height: 1.8; }
.shortcut-table { width: 100%; border-collapse: collapse; }
.shortcut-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.shortcut-table td:first-child { width: 140px; font-weight: 600; }

kbd {
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
  color: var(--text);
}

/* ---- ロゴ領域を選ぶ画面 ---- */
.marking-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--backdrop);
}

.marking-modal-content {
  position: relative;
  width: 92vw;
  height: 88dvh;
  max-width: 1600px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: 16px;
}

.marking-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--accent);
}

.marking-modal-header h3 { margin: 0; font-size: 18px; color: var(--accent); overflow-wrap: anywhere; }
.marking-modal-body { display: flex; flex: 1; min-height: 0; gap: 16px; padding: 16px; }

.marking-canvas-wrapper {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--accent);
  border-radius: 12px;
  overflow: hidden;
}

.marking-canvas-wrapper canvas { display: block; max-width: 100%; max-height: 100%; cursor: crosshair; touch-action: none; }
.marking-modal-sidebar { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.marking-instructions { border: 1px solid var(--accent); border-radius: 8px; padding: 10px 12px; }
.marking-instructions h4 { margin: 0 0 6px; font-size: 14px; color: var(--accent); }
.marking-instructions ol { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.6; }
.marking-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.ocr-lang { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.ocr-lang select {
  flex: 1 1 180px;
  min-width: 0;
  min-height: 44px;
  font-size: 16px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--control-border);
  border-radius: 6px;
}
.marking-controls button { flex: 1 1 130px; }
.marking-status { min-height: 1.2em; margin: 0; font-size: 13px; }
.selected-rois-container h4 { margin: 0 0 8px; font-size: 14px; color: var(--accent); }
.modal-selected-rois { display: flex; flex-direction: column; gap: 8px; }

.roi-preview {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.roi-preview canvas { width: 80px; height: 80px; border: 1px solid var(--border); border-radius: 4px; flex-shrink: 0; }
.roi-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.roi-headline { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.roi-badge { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--accent-2); color: var(--accent-2); font-size: 11px; }

.modal-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay);
  border-radius: 16px;
}

.loading-content {
  min-width: min(320px, 90vw);
  padding: 28px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 16px; margin-bottom: 8px; font-weight: 600; }
.loading-subtext { font-size: 13px; color: var(--muted); min-height: 20px; overflow-wrap: anywhere; }

/* ---- 狭い画面 ---- */
@media (max-width: 1100px) {
  main { grid-template-columns: minmax(0, 1fr); padding: 12px; }
}

@media (max-width: 900px) {
  .marking-modal-content { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; }
  .modal-loading { border-radius: 0; }
  .marking-modal-body { flex-direction: column; overflow-y: auto; padding: 10px; gap: 10px; }
  .marking-canvas-wrapper { flex: 0 0 auto; height: 52dvh; }
  .marking-modal-sidebar { width: 100%; overflow: visible; }
}

@media (max-width: 600px) {
  header { padding: 12px; }
  h1 { font-size: 22px; }
  .header-button .button-label { display: none; }
  .justify-top { grid-template-columns: minmax(0, 1fr); }
  .candidate { grid-template-columns: 80px minmax(0, 1fr); }
  .candidate-action { grid-column: 1 / -1; }
  .candidate-action button { width: 100%; }
  .query-form { flex-direction: column; }
  .export { flex-direction: column; }
  .export button { width: 100%; }
  .map, .graph { height: 420px; }
  .distance-table { font-size: 13px; }
  .distance-table th, .distance-table td { padding: 6px 4px; }
  .tab { min-height: 0; }
}

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

/* Leaflet の拡大・縮小ボタンもタップしやすい大きさに（leaflet.css があとから読まれるので #map で詳細度を上げる） */
#map .leaflet-bar a {
  width: 44px;
  height: 44px;
  line-height: 44px;
  font-size: 22px;
}
