:root {
  --ink: #17251f;
  --muted: #6c776f;
  --forest: #16392f;
  --forest-2: #235345;
  --coral: #e75b3e;
  --cream: #f6f3ec;
  --paper: #fffdf8;
  --line: #dedbd1;
  --gold: #d99b36;
  --shadow: 0 16px 48px rgba(22, 57, 47, .11);
  font-family: 'Hiragino Sans', 'Yu Gothic', 'Meiryo', system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--cream); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(231,91,62,.18), transparent 24%),
    radial-gradient(circle at 80% 78%, rgba(217,155,54,.18), transparent 27%),
    var(--forest);
}
.login-card {
  width: min(440px, 100%);
  padding: 42px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(0,0,0,.26);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 19px;
  color: white;
  background: var(--coral);
  font: 700 30px 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  transform: rotate(-3deg);
}
.brand-mark.small { width: 46px; height: 46px; border-radius: 14px; font-size: 23px; }
.eyebrow { margin: 0 0 4px; color: var(--coral); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.login-card h1, .topbar h1, h2, h3 { font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif; }
.login-card h1 { margin: 14px 0 10px; font-size: 38px; }
.login-copy { margin: 0 0 30px; color: var(--muted); line-height: 1.8; }
.login-card label, .field-label { display: grid; gap: 8px; color: #34453e; font-size: 12px; font-weight: 600; }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 8px; }
input, select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
  color: var(--ink);
  background: white;
  outline: none;
}
input:focus, select:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(35,83,69,.12); }
.primary-button, .refresh-button {
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--forest);
  font-weight: 700;
}
.primary-button { padding: 0 24px; }
.form-error { min-height: 20px; margin: 10px 0 0; color: #b6322b; font-size: 12px; }

.app-shell { min-height: 100dvh; }
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: white;
  background: var(--forest);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .eyebrow { color: #e9b564; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: .03em; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.usage-pill { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; font-size: 11px; background: rgba(255,255,255,.08); }
.usage-dot { width: 7px; height: 7px; border-radius: 50%; background: #88d09b; box-shadow: 0 0 0 3px rgba(136,208,155,.15); }
.icon-button { width: 40px; height: 40px; border: 0; border-radius: 50%; color: white; background: rgba(255,255,255,.1); }
.icon-button:hover { background: rgba(255,255,255,.18); }

.mobile-view-tabs { display: none; }
.workspace { display: grid; grid-template-columns: 286px minmax(340px, 1fr) minmax(390px, .82fr); height: calc(100dvh - 118px); min-height: 620px; }
.filters-panel { overflow-y: auto; padding: 24px 20px; border-right: 1px solid var(--line); background: var(--paper); }
.filters-heading, .results-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filters-heading h2, .results-header h2 { margin: 0; font-size: 21px; }
.text-button { padding: 6px; border: 0; color: var(--forest-2); background: transparent; font-size: 11px; font-weight: 700; }
.filter-group, .field-label, .toggle-row { margin-top: 20px; }
.filter-label { display: block; margin-bottom: 9px; color: #34453e; font-size: 12px; font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip span { display: block; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 11px; font-weight: 600; }
.check-chip input:checked + span { border-color: var(--forest); color: white; background: var(--forest); }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type="range"] { min-height: 26px; padding: 0; accent-color: var(--coral); box-shadow: none; border: 0; }
.toggle-row { display: flex; align-items: center; gap: 9px; color: #34453e; font-size: 12px; font-weight: 600; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 99px; background: #c9cdc9; transition: .2s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-row input:checked + .toggle { background: var(--coral); }
.toggle-row input:checked + .toggle::after { transform: translateX(16px); }
.segment-control { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.segment-control button { min-height: 36px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; font-size: 10px; font-weight: 600; }
.segment-control button.active { border-color: var(--forest); color: white; background: var(--forest); }
.refresh-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; padding: 13px 14px; text-align: left; box-shadow: 0 8px 20px rgba(22,57,47,.18); }
.refresh-button:hover { background: var(--forest-2); }
.refresh-button:disabled { cursor: wait; opacity: .65; }
.refresh-button small { display: block; margin-top: 2px; opacity: .7; font-size: 9px; font-weight: 400; }
.refresh-icon { font-size: 24px; }
.progress-wrap { margin-top: 16px; }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
progress { width: 100%; height: 7px; margin-top: 6px; accent-color: var(--coral); }

.map-panel { position: relative; min-width: 0; background: #e9e4d8; }
#map { width: 100%; height: 100%; }
.map-placeholder { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; color: #6f756f; background-color: #e9e4d8; background-image: linear-gradient(rgba(22,57,47,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(22,57,47,.055) 1px, transparent 1px); background-size: 42px 42px; }
.map-placeholder-icon { margin: auto; font-size: 42px; color: var(--forest-2); }
.map-placeholder p { margin: 0; font-size: 12px; line-height: 1.8; }
.map-info { max-width: 230px; }
.map-info strong { display: block; margin-bottom: 4px; }
.map-info a { color: var(--coral); }

.results-panel { position: relative; overflow-y: auto; padding: 22px 20px 48px; background: var(--cream); }
.results-header { position: sticky; top: -22px; z-index: 3; margin: -22px -20px 15px; padding: 22px 20px 14px; background: rgba(246,243,236,.94); backdrop-filter: blur(12px); }
.results-header select { min-height: 36px; width: 145px; font-size: 10px; }
.empty-state { max-width: 320px; margin: 80px auto; text-align: center; color: var(--muted); }
.empty-state h3 { margin: 22px 0 8px; color: var(--ink); font-size: 18px; }
.empty-state p { margin: 0; font-size: 12px; line-height: 1.8; }
.empty-action { min-height: 44px; margin-top: 18px; padding: 0 18px; border: 0; border-radius: 11px; color: white; background: var(--forest); font-size: 11px; font-weight: 700; }
.empty-action:hover { background: var(--forest-2); }
.empty-illustration { display: flex; justify-content: center; gap: 7px; color: var(--coral); font-size: 36px; }
.empty-illustration span:nth-child(2) { color: var(--forest); transform: translateY(-12px); }
.restaurant-list { display: grid; gap: 12px; }
.restaurant-card { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 3px 12px rgba(22,57,47,.035); transition: transform .18s, box-shadow .18s, border-color .18s; }
.restaurant-card:hover { transform: translateY(-2px); border-color: #c7c1b4; box-shadow: var(--shadow); }
.card-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.genre { margin: 0 0 4px; color: var(--coral); font-size: 10px; font-weight: 700; }
.restaurant-card h3 { margin: 0; font-size: 17px; line-height: 1.45; }
.favorite-button { flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: #a5aaa6; background: white; font-size: 18px; }
.favorite-button.active { border-color: #efc0b6; color: var(--coral); background: #fff2ee; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.rating { color: #805d18; font-weight: 700; }
.star { color: var(--gold); }
.open { color: #247648; font-weight: 700; }
.closed { color: #a33e35; font-weight: 700; }
.address { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.hours { margin: 8px 0 0; padding: 7px 9px; border-radius: 8px; color: #59665f; background: #f1eee6; font-size: 10px; }
.card-actions { display: flex; align-items: center; gap: 7px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #ece8df; }
.status-button, .maps-link { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; font-size: 10px; font-weight: 700; text-decoration: none; }
.status-button.active { border-color: var(--forest); color: white; background: var(--forest); }
.maps-link { margin-left: auto; color: var(--forest-2); }
.google-attribution { margin: 20px 4px 0; text-align: right; color: #737a76; font-size: 10px; }
.google-attribution span { font-weight: 700; }
.provider-attribution { margin-top: 8px; color: #8a908c; font-size: 9px; }

footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 22px; color: #6f776f; background: #ebe7de; font-size: 9px; }
footer nav { display: flex; gap: 14px; }
footer a { color: inherit; }
.toast { position: fixed; z-index: 100; right: 20px; bottom: 20px; max-width: min(360px, calc(100% - 40px)); padding: 12px 16px; border-radius: 12px; color: white; background: var(--forest); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #983c33; }
input:disabled { cursor: not-allowed; opacity: .5; background: #efede7; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 268px 1fr 390px; }
}

@media (max-width: 840px) {
  .topbar { height: 68px; padding: 0 14px; }
  .topbar h1 { font-size: 18px; }
  .brand .eyebrow { display: none; }
  .usage-pill { padding: 7px 9px; }
  .mobile-view-tabs { height: 56px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
  .view-tab { border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
  .view-tab.active { color: white; background: var(--forest); }
  .workspace { height: auto; min-height: calc(100dvh - 124px); display: block; }
  .filters-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 15px; }
  .filters-heading { cursor: pointer; }
  .map-panel { height: 58dvh; display: none; }
  .results-panel { min-height: 55dvh; padding: 18px 14px 44px; }
  .results-header { top: -18px; margin: -18px -14px 14px; padding: 18px 14px 12px; }
  .workspace[data-view="map"] .filters-panel, .workspace[data-view="map"] .results-panel { display: none; }
  .workspace[data-view="map"] .map-panel { display: block; height: calc(100dvh - 124px); }
  .workspace[data-view="split"] .map-panel { display: block; }
  .workspace[data-view="list"] .map-panel { display: none; }
  footer { align-items: start; flex-direction: column; padding: 12px 14px; }
  .view-tab, .icon-button, .segment-control button, .status-button, .maps-link, .favorite-button { min-height: 44px; }
  .icon-button, .favorite-button { width: 44px; height: 44px; }
  .check-chip span { min-height: 44px; display: grid; place-items: center; }
  .text-button { min-height: 44px; padding: 10px; }
  .empty-state { margin: 30px auto; }
  .results-header select, input[type="range"] { min-height: 44px; }
  footer a { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 520px) {
  .brand-mark.small { width: 40px; height: 40px; }
  .usage-pill { font-size: 9px; }
  .login-card { padding: 30px 22px; }
  .login-card h1 { font-size: 32px; }
  .password-row { grid-template-columns: 1fr; }
  .primary-button { min-height: 46px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .filters-panel { max-height: 48dvh; }
  .restaurant-card { padding: 14px; }
  .card-actions { flex-wrap: wrap; }
  .maps-link { margin-left: 0; }
}

@media (max-width: 840px) and (max-height: 740px) {
  .empty-illustration { display: none; }
  .empty-state { margin: 18px auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.content-page { min-height: 100dvh; padding: 44px 20px; background: var(--forest); }
.content-page main { width: min(760px, 100%); margin: auto; padding: 42px; border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.content-page h1 { margin: 6px 0 0; font: 700 34px 'Yu Mincho', 'Hiragino Mincho ProN', serif; }
.content-page h2 { margin: 30px 0 8px; font-size: 18px; }
.content-page p { color: #55645c; font-size: 13px; line-height: 1.9; }
.content-page a { color: var(--forest-2); }
.content-page .back-link { display: inline-block; margin-bottom: 28px; font-size: 12px; font-weight: 700; text-decoration: none; }
.content-page .updated { margin-top: 8px; color: #8a938e; font-size: 10px; }
@media (max-width: 520px) {
  .content-page { padding: 0; background: var(--paper); }
  .content-page main { padding: 28px 20px 48px; border-radius: 0; box-shadow: none; }
  .content-page h1 { font-size: 28px; }
}
