:root {
  color-scheme: light;
  --navy-950: #071827;
  --navy-900: #102a43;
  --navy-800: #173f5f;
  --blue-600: #1976c9;
  --blue-100: #dcefff;
  --amber-500: #e79a16;
  --amber-100: #fff1cf;
  --ink: #17212b;
  --muted: #5f6f7f;
  --line: #d8e1e8;
  --surface: #ffffff;
  --canvas: #f3f6f8;
  --danger: #b63333;
  --shadow: 0 12px 34px rgba(16, 42, 67, 0.12);
  --radius: 12px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic",
    "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 1rem;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(25, 118, 201, 0.32);
  outline-offset: 2px;
}

.app-header {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  color: #fff;
  background: var(--navy-900);
}

.header-photo,
.header-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.header-photo {
  object-fit: cover;
  object-position: center 58%;
}

.header-shade {
  background:
    linear-gradient(90deg, rgba(7, 24, 39, 0.96) 0%, rgba(7, 24, 39, 0.76) 44%, rgba(7, 24, 39, 0.16) 100%),
    linear-gradient(0deg, rgba(7, 24, 39, 0.3), transparent 60%);
}

.header-content {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 40px));
  min-height: 190px;
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 2rem;
  line-height: 1;
}

.eyebrow,
.section-kicker,
.decision-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.eyebrow {
  color: #ffd67d;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.header-copy {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
}

.button {
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 760;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #112235;
  background: #ffc95e;
  box-shadow: 0 6px 16px rgba(7, 24, 39, 0.18);
}

.button-primary:hover {
  background: #ffd67d;
}

.button-secondary {
  color: var(--navy-900);
  border-color: var(--line);
  background: #fff;
}

.header-action {
  flex: 0 0 auto;
}

.page-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.decision-banner {
  margin-bottom: 18px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fff;
  background: var(--navy-900);
  border-left: 5px solid #ffc95e;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.decision-kicker {
  color: #ffd67d;
}

.decision-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.decision-banner .text-button {
  color: #fff;
}

.filter-panel {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue-600);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(16, 42, 67, 0.07);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-kicker {
  color: var(--blue-600);
}

.section-heading h2,
.dialog-header h2 {
  margin-bottom: 0;
  color: var(--navy-900);
  font-size: 1.3rem;
  line-height: 1.3;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.control-group,
.field-block {
  display: grid;
  gap: 7px;
}

.control-group > span,
.field-block > span,
.field-block legend {
  color: var(--navy-900);
  font-size: 0.9rem;
  font-weight: 760;
}

.field-block strong {
  color: var(--danger);
  font-size: 0.78rem;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid #bcc9d3;
  border-radius: 7px;
  background: #fff;
}

input:hover,
select:hover {
  border-color: #7f95a7;
}

.filter-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.filter-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.filter-action-buttons .text-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.input-note,
.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.text-button {
  padding: 6px 2px;
  color: var(--blue-600);
  border: 0;
  background: transparent;
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.danger-text-button {
  color: var(--danger);
}

.results-section {
  margin-top: 22px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.shop-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 5px 16px rgba(16, 42, 67, 0.06);
}

.shop-card.is-selected {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px var(--amber-100), var(--shadow);
}

.selected-ribbon {
  position: absolute;
  top: -1px;
  right: 16px;
  padding: 5px 10px;
  color: #fff;
  background: var(--navy-900);
  border-radius: 0 0 7px 7px;
  font-size: 0.78rem;
  font-weight: 800;
}

.card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.shop-name {
  margin-bottom: 2px;
  color: var(--navy-900);
  font-size: 1.2rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.shop-title-group {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.demo-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  color: var(--navy-800);
  border: 1px solid #9ab7cf;
  border-radius: 4px;
  background: #edf6fc;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #3c2c08;
  background: var(--amber-100);
  border: 1px solid #f4d58b;
  border-radius: 999px;
  font-weight: 850;
}

.rating-badge span {
  color: #c57d00;
}

.shop-facts {
  display: grid;
  gap: 9px;
  margin: 0;
}

.fact-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
}

.fact-row dt {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.fact-row dd {
  margin: 0;
  font-weight: 650;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 13px;
  border-top: 1px solid #e7edf1;
}

.select-shop-button {
  flex: 1 1 auto;
}

.mini-button,
.map-link {
  min-height: 40px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-900);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 740;
  text-decoration: none;
}

.mini-button:hover,
.map-link:hover {
  border-color: var(--blue-600);
}

.delete-button {
  color: var(--danger);
}

.empty-state {
  min-height: 270px;
  padding: 42px 24px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.66);
  border: 1px dashed #aebdca;
  border-radius: var(--radius);
}

.empty-state h2 {
  margin-bottom: 6px;
  color: var(--navy-900);
  font-size: 1.25rem;
}

.empty-state p {
  max-width: 520px;
  margin-bottom: 18px;
  color: var(--muted);
}

.empty-icon {
  margin-bottom: 10px;
  color: var(--blue-600);
  font-size: 2.4rem;
  line-height: 1;
}

.app-footer {
  padding: 0 20px 34px;
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
}

.shop-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(820px, calc(100dvh - 30px));
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(7, 24, 39, 0.32);
}

.shop-dialog::backdrop {
  background: rgba(7, 24, 39, 0.64);
  backdrop-filter: blur(2px);
}

.shop-dialog form {
  display: grid;
  max-height: inherit;
}

.dialog-header,
.dialog-footer {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
}

.dialog-header {
  border-bottom: 1px solid var(--line);
}

.dialog-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.dialog-body {
  padding: 20px 22px 24px;
  display: grid;
  gap: 18px;
  overflow-y: auto;
  background: #f9fbfc;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--navy-900);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 1.6rem;
  line-height: 1;
}

.field-block {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.day-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-picker label {
  position: relative;
}

.day-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.day-picker span {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--navy-900);
  border: 1px solid #bcc9d3;
  border-radius: 7px;
  background: #fff;
  font-weight: 750;
}

.day-picker input:checked + span {
  color: #fff;
  border-color: var(--navy-900);
  background: var(--navy-900);
}

.day-picker input:focus-visible + span {
  outline: 3px solid rgba(25, 118, 201, 0.32);
  outline-offset: 2px;
}

.time-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
}

.time-range label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.time-divider {
  padding-bottom: 10px;
  color: var(--muted);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  font-weight: 700;
}

.check-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--navy-900);
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 24px;
  min-width: min(360px, calc(100% - 32px));
  padding: 12px 16px;
  transform: translateX(-50%);
  color: #fff;
  background: var(--navy-950);
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
  font-weight: 720;
}

.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;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .header-content {
    align-items: flex-end;
  }

  .brand-mark {
    display: none;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-header,
  .header-content {
    min-height: 210px;
  }

  .header-shade {
    background: linear-gradient(90deg, rgba(7, 24, 39, 0.92), rgba(7, 24, 39, 0.44));
  }

  .header-content {
    width: min(100% - 28px, 1160px);
    padding: 22px 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 16px;
  }

  .header-copy {
    font-size: 0.9rem;
  }

  .header-action {
    width: 100%;
  }

  .page-shell {
    width: min(100% - 24px, 1160px);
    padding-top: 18px;
  }

  .filter-panel,
  .shop-card {
    padding: 16px;
  }

  .section-heading,
  .filter-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .filter-action-buttons {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card-top {
    padding-right: 4px;
  }

  .card-actions {
    flex-wrap: wrap;
  }

  .select-shop-button {
    flex-basis: 100%;
  }

  .mini-button,
  .map-link {
    flex: 1 1 auto;
  }

  .decision-banner {
    align-items: flex-start;
  }

  .shop-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 12px);
    margin: auto 0 0;
    border-radius: 14px 14px 0 0;
  }

  .dialog-header,
  .dialog-footer,
  .dialog-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dialog-footer .button {
    flex: 1;
  }
}

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