:root {
  color-scheme: light;
  --ink: #18322c;
  --muted: #64756f;
  --forest: #123c33;
  --forest-2: #1d5a4c;
  --cream: #fff9ea;
  --paper: #fffef9;
  --line: #dce4df;
  --gold: #f4b942;
  --open: #177245;
  --closed: #8a443c;
  --shadow: 0 10px 30px rgba(18, 60, 51, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f4f6f3; color: var(--ink); min-height: 100vh; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 16px max(18px, env(safe-area-inset-left)); color: white;
  background: linear-gradient(135deg, #0d342b, #1e594b); box-shadow: 0 3px 20px rgba(15, 48, 40, .2);
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand h1 { margin: 0; font-size: 1.18rem; letter-spacing: .04em; }
.brand p { margin: 3px 0 0; color: #d9ebe4; font-size: .8rem; }
.icon-button { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; background: transparent; color: white; font-weight: 800; cursor: pointer; }

main { width: min(760px, 100%); margin: 0 auto; padding: 18px 16px 48px; }
.summary { display: flex; justify-content: space-between; align-items: end; gap: 18px; padding: 22px; background: var(--cream); border: 1px solid #eadfbf; border-radius: 18px; box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .1em; }
.summary-number { margin: 0; line-height: 1; }
.summary-number strong { font: 800 3rem/1 Georgia, serif; color: var(--forest); }
.summary-number span { margin-left: 5px; font-size: .95rem; font-weight: 700; }
.summary-side { text-align: right; }
.summary-side p { margin: 4px 0; color: var(--muted); font-size: .84rem; }
.summary-side p:first-child { color: var(--forest); }

.controls { margin-top: 18px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 15px; min-height: 50px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.search-icon { font-size: 1.5rem; color: var(--muted); transform: rotate(-18deg); }
.search input { width: 100%; border: 0; outline: 0; color: var(--ink); font-size: 1rem; background: transparent; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-clear { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #e7ece8; color: var(--forest); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.search-clear[hidden] { display: none; }
.search-submit { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--forest); color: white; font-size: 1.3rem; font-weight: 800; cursor: pointer; }
.search-clear:focus-visible, .search-submit:focus-visible { outline: 3px solid rgba(245, 183, 58, .5); outline-offset: 2px; }
.view-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; padding: 4px; background: #e7ece8; border-radius: 13px; }
.tab { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: #5f706a; font-size: .84rem; font-weight: 800; cursor: pointer; }
.tab.active { background: white; color: var(--forest); box-shadow: 0 2px 8px rgba(20,55,45,.08); }
.view-hint { margin: 9px 3px 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.filter-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 15px; }
.filter-field { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .06em; }
.filter-field select { width: 100%; min-width: 0; min-height: 48px; padding: 0 36px 0 13px; border: 1px solid #bfd0c8; border-radius: 12px; background-color: white; color: var(--forest); font: inherit; font-size: 1rem; font-weight: 800; letter-spacing: 0; cursor: pointer; }
.filter-field select:focus-visible { outline: 3px solid rgba(245, 183, 58, .45); outline-offset: 2px; }

.results-head { display: flex; justify-content: space-between; align-items: center; min-height: 46px; padding: 8px 2px 2px; }
.results-head p { margin: 0; color: var(--muted); font-size: .84rem; font-weight: 700; }
.text-button { border: 0; background: transparent; color: var(--forest-2); font-size: .82rem; font-weight: 800; cursor: pointer; }
.store-list { display: grid; gap: 12px; }
.store-card { padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 5px 20px rgba(18,60,51,.05); }
.card-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.badges { display: flex; gap: 6px; margin-bottom: 7px; }
.category-badge, .area-badge { display: inline-flex; padding: 4px 8px; border-radius: 6px; background: #e6eee9; color: #345a4f; font-size: .7rem; font-weight: 800; }
.area-badge { background: #f1efe8; color: #716b59; }
.store-name { margin: 0; font-size: 1.15rem; letter-spacing: .02em; }
.status-badge { flex: 0 0 auto; padding: 7px 9px; border-radius: 8px; font-size: .76rem; font-weight: 900; }
.status-badge.open { color: var(--open); background: #dff2e8; }
.status-badge.later { color: #7a5a12; background: #faedc8; }
.status-badge.closed { color: var(--closed); background: #f5e3e0; }
.store-details { margin: 15px 0 0; border-top: 1px solid #edf0ed; }
.store-details div { display: grid; grid-template-columns: 54px 1fr; gap: 8px; padding-top: 10px; }
.store-details dt { color: var(--muted); font-size: .8rem; font-weight: 700; }
.store-details dd { margin: 0; font-size: .9rem; font-weight: 700; }
.store-note { margin: 10px 0 0; color: #795d1c; font-size: .8rem; line-height: 1.55; }
.card-actions { display: grid; grid-template-columns: 1fr 88px; gap: 9px; margin-top: 16px; }
.card-actions a { display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 12px; text-decoration: none; font-size: .92rem; font-weight: 900; }
.call-button { color: white; background: var(--forest); }
.map-button { color: var(--forest); border: 1px solid #bfd0c8; background: white; }
.verified { margin: 10px 1px 0; color: #8a9691; font-size: .7rem; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--ink); font-size: 1.1rem; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: auto; border-radius: 50%; background: #e5ebe7; color: var(--forest); font-weight: 900; font-size: 1.3rem; }

dialog { width: min(520px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 25px 80px rgba(10,40,32,.3); }
dialog::backdrop { background: rgba(6,30,24,.58); backdrop-filter: blur(2px); }
.dialog-card { position: relative; padding: 28px 24px 24px; }
.dialog-card h2 { margin: 0 0 14px; font-size: 1.3rem; }
.dialog-card > p:not(.eyebrow) { line-height: 1.8; color: #4f615b; }
.dialog-close { position: absolute; right: 14px; top: 12px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #eef2ef; color: var(--ink); font-size: 1.35rem; cursor: pointer; }
.source-note { display: grid; gap: 4px; margin-top: 18px; padding: 15px; border-radius: 12px; background: #f3f5f2; }
.source-note span, .source-note small { color: var(--muted); font-size: .75rem; }

@media (min-width: 720px) {
  main { padding-top: 26px; }
  .store-list { grid-template-columns: 1fr 1fr; align-items: start; }
  .summary { padding: 26px 30px; }
}

@media (prefers-reduced-motion: no-preference) {
  .store-card { animation: card-in .28s ease both; }
  @keyframes card-in { from { opacity: 0; transform: translateY(6px); } }
}
