/* Palette lifted from the Android app (MainActivity.kt lightColorScheme).
   Layout follows 06_制作物とWeb/モバイルアプリ/LocalTableJapanAndroid/DESIGN-v02.md
   (full-screen map + draggable bottom sheet) -- that pattern is designed but
   not yet built in the Android app itself; this is the first implementation
   of it, done here on the web side. Typography/editorial pass from
   2026-11-03 feedback kept on top of it. */
:root {
  --forest: #315842;
  --ink: #28352d;
  --muted: #657069;
  --paper: #f7f3ea;
  --leaf: #e6ece5;
  --sun: #e8d8b3;
  --blue: #e7eff1;
  --border: #d5ded6;
  --white: #ffffff;
  --radius: 13px;
  --radius-sm: 8px;
  --shadow: 0 3px 10px rgba(49, 88, 66, 0.08);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sheet-peek: 46vh;
  --sheet-expanded: 88vh;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #e2ded2;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.device {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  min-height: 560px;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
}

/* ---------- Map ---------- */
.map-view {
  position: absolute;
  inset: 0;
}
.map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--leaf);
}
.map-canvas[hidden] {
  display: none;
}
.map-search {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 14px;
  right: 14px;
  height: 48px;
  background: var(--white);
  border-radius: 24px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(24, 34, 28, 0.2);
}
.map-search .search-icon {
  color: var(--muted);
  font-size: 18px;
}
#search {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  font-family: var(--sans);
}
.map-area-pill {
  position: absolute;
  z-index: 2;
  top: 72px;
  left: 14px;
  height: 34px;
  border: 0;
  border-radius: 18px;
  background: var(--white);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(24, 34, 28, 0.18);
}
.map-locate {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: calc(var(--sheet-peek) + 14px);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--forest);
  font-size: 19px;
  box-shadow: 0 2px 8px rgba(24, 34, 28, 0.18);
  cursor: pointer;
}
.map-locate:disabled {
  opacity: 0.55;
  cursor: default;
}
.map-notice[hidden] {
  display: none;
}
.map-notice {
  position: absolute;
  z-index: 2;
  left: 14px;
  right: 14px;
  bottom: calc(var(--sheet-peek) + 14px);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 3px 12px rgba(36, 54, 43, 0.12);
}
.map-notice .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b98c3e;
  flex-shrink: 0;
}

/* ---------- Bottom sheet ---------- */
.sheet {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sheet-peek);
  max-height: 92vh;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 24px rgba(25, 39, 30, 0.18);
  display: flex;
  flex-direction: column;
  transition: height 0.25s ease;
}
.sheet.expanded {
  height: var(--sheet-expanded);
}
.sheet-handle {
  flex-shrink: 0;
  width: 100%;
  padding: 10px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.sheet-handle::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--border);
}
.sheet-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 24px;
  -webkit-overflow-scrolling: touch;
}

.sheet-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sheet-heading h1 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}
.sheet-heading span {
  font-size: 11px;
  color: var(--muted);
}

.help-choose-entry {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--forest);
  font-weight: 600;
  margin-bottom: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
}
.chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.chip.active {
  background: var(--forest);
  color: var(--white);
  border-color: var(--forest);
}

.cashless-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.card-list {
  display: flex;
  flex-direction: column;
}
.card {
  display: flex;
  gap: 14px;
  background: transparent;
  border-top: 1px solid var(--border);
  padding: 18px 0;
  cursor: pointer;
}
.card:first-child { border-top: none; }

.ad-slot {
  border-top: 1px solid var(--border);
  background: var(--paper);
  margin: 0 -16px;
  padding: 14px 16px 18px;
}
.ad-slot-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.card-photo {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: var(--leaf);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  border: 1px solid var(--border);
}
.card-body { flex: 1; min-width: 0; }
.card-cuisine {
  font-size: 10px;
  font-weight: 700;
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
}
.card-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 3px;
  color: var(--ink);
  line-height: 1.25;
}
.card-jp-name { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.card-meta { font-size: 12px; color: var(--muted); }
.meta-sep { color: var(--border); margin: 0 6px; }
.card-distance { color: var(--forest); font-weight: 700; }
.card-distance:empty + .meta-sep { display: none; }
.card-budget-item { white-space: nowrap; }
.card-budget-item + .card-budget-item { margin-left: 6px; }
.card-budget-icon {
  display: inline-flex;
  vertical-align: -1px;
  margin-right: 2px;
  color: var(--muted);
}
.cashless-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  position: relative;
  top: -1px;
}
.cashless-dot-yes { background: var(--forest); }
.cashless-dot-no { background: #a9731f; }
.cashless-dot-unknown { background: var(--border); }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }
.fineprint { font-size: 10px; color: var(--muted); padding: 10px 2px 4px; }

/* ---------- Detail overlay ---------- */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 53, 45, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}
.detail-overlay[hidden] { display: none; }
@media (min-width: 640px) {
  .detail-overlay { align-items: center; }
}
.detail-panel {
  background: var(--white);
  color: var(--ink);
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 0 20px;
  position: relative;
}
@media (min-width: 640px) {
  .detail-panel { border-radius: var(--radius); }
}
.detail-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  z-index: 1;
}
.detail-body { padding: 24px 20px 0; }
.detail-cuisine {
  font-size: 11px;
  font-weight: 600;
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
}
.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.detail-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--ink);
}
.detail-map-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  margin-top: 3px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--white);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.detail-map-btn svg { flex-shrink: 0; }
.detail-story {
  margin: 14px 0 4px;
  padding: 14px;
  background: var(--paper);
  border-radius: var(--radius-sm);
}
.detail-story-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}
.detail-story-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}
.detail-row {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.detail-row dt {
  width: 92px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 2px;
}
.detail-row dd { margin: 0; }
.price-split { display: flex; flex-direction: column; gap: 2px; }
.price-split span { display: block; }
.price-label {
  display: inline-block;
  min-width: 48px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-right: 6px;
}
.detail-fineprint {
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0 0;
}

/* ---------- Help me choose ---------- */
.helper-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 53, 45, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
}
.helper-overlay[hidden] { display: none; }
@media (min-width: 640px) {
  .helper-overlay { align-items: center; }
}
.helper-panel {
  background: var(--white);
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 18px 20px 24px;
  position: relative;
}
@media (min-width: 640px) {
  .helper-panel { border-radius: var(--radius); }
}
.helper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.helper-header span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest);
}
.helper-question {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
}
.helper-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.helper-option {
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.helper-option.active { background: var(--forest); color: var(--white); border-color: var(--forest); }
.helper-text-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 14px;
}
.helper-primary-btn {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--forest);
  color: var(--white);
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.helper-back {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
  cursor: pointer;
  padding: 0;
}
