:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --text: #17262b;
  --muted: #566a71;
  --border: #cfdadd;
  --accent: #0a748a;       /* 白文字で 5:1 以上 */
  --accent-hover: #085f72;
  --accent-soft: #e3f3f6;
  --accent-tint: #eef8fa;  /* プランパネルの地色 */
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warn-soft: #fff6df;
  --star: #b26b00;
  --focus: #0a8ca8;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a1d;
    --surface: #17262b;
    --text: #e8f1f3;
    --muted: #9fb4ba;
    --border: #2e444b;
    --accent: #1aa6c2;
    --accent-hover: #3bb9d3;
    --accent-soft: #12333b;
    --accent-tint: #0f2328;
    --danger: #ff8a80;
    --danger-soft: #3a1c1a;
    --warn-soft: #34290f;
    --star: #ffb74d;
    --focus: #5fd0e6;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  overflow-wrap: anywhere;
}
main, .site-header, .site-footer { max-width: 720px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

.site-header { padding-top: 16px; padding-bottom: 4px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.35rem; }
.brand img { display: block; width: 32px; height: 32px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.form { margin-top: 12px; display: grid; gap: 14px; }
.field { min-width: 0; }
label, legend { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
input[type=text], input[type=date], select {
  width: 100%; min-width: 0; min-height: 48px; padding: 8px 12px; font: inherit; font-size: 16px; /* iOSの自動ズーム防止 */
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
input[type=date] { -webkit-appearance: none; appearance: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.row3 { align-items: end; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.row3 label { font-size: 0.78rem; }

.combo { position: relative; }
.suggest { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-height: 320px; overflow-y: auto; }
.suggest li { padding: 10px 12px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.suggest li[aria-selected=true], .suggest li:hover { background: var(--accent-soft); }
.suggest li.note { cursor: default; color: var(--muted); font-size: 0.85rem; min-height: 0; }
.suggest li.note:hover { background: none; }
.opt-name { display: block; font-weight: 700; }
.opt-path { display: block; font-size: 0.8rem; color: var(--muted); }

.msg { margin: 6px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 0.9rem; font-weight: 600; }
.help { margin-top: 8px; padding: 12px; border-radius: 10px; background: var(--warn-soft); }
.help p { margin: 0 0 8px; font-weight: 700; font-size: 0.9rem; }
.help ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.help button { width: 100%; text-align: left; min-height: 44px; padding: 8px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.help button:hover { background: var(--accent-soft); }

.more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--accent); }
.more-body { display: grid; gap: 14px; padding-top: 4px; }
.checks { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.checks legend { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 10px; font-weight: 500; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

button { font: inherit; }
button.primary, a.btn {
  display: block; width: 100%; min-height: 56px; padding: 12px 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 1.15rem; font-weight: 800; text-align: center; text-decoration: none;
}
@media (prefers-color-scheme: dark) { button.primary, a.btn { color: #04222a; } }
button.primary:hover, a.btn:hover { background: var(--accent-hover); }
button.primary:disabled { opacity: .65; cursor: progress; }
button.secondary { display: block; width: 100%; min-height: 48px; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  background: var(--surface); color: var(--accent); border: 2px solid var(--accent); font-weight: 700; }
button.secondary:disabled { opacity: .65; cursor: progress; }
a.btn { min-height: 48px; font-size: 1rem; padding: 12px; }
a.btn.small { min-height: 44px; font-size: 0.95rem; padding: 10px; }

.status { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.status h2 { margin: 0 0 6px; font-size: 1.05rem; }
.status p { margin: 0 0 10px; }
.status.error { border-color: var(--danger); }
.status button { max-width: 360px; }
.status > :last-child { margin-bottom: 0; }

.result-head { margin: 20px 0 8px; }
.result-head h2 { margin: 0; font-size: 1.15rem; }
.result-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.result-head .note { padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--text); }

.result-meta { display: flex; align-items: flex-start; gap: 4px; }
.result-meta p { flex: 1; min-width: 0; }
.share-btn { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 44px; min-height: 44px; margin: 0 -4px 0 8px; padding: 0 4px 0 10px;
  border: 0; border-left: 1px solid var(--border); border-radius: 0; background: none; color: var(--accent); font-size: 0.68rem; font-weight: 700; line-height: 1.1; cursor: pointer; }
.share-btn:hover { color: var(--accent-hover); }
.result-head .share-status { margin: 4px 0 0; font-size: 0.9rem; font-weight: 700; color: var(--accent); text-align: right; }
.result-head .share-status:empty { display: none; }
.share-fallback { margin-top: 6px; }
.share-fallback[hidden] { display: none; }
.result-head .share-hint { margin: 0 0 4px; font-weight: 700; color: var(--text); }
input.share-url { width: 100%; min-width: 0; min-height: 48px; padding: 8px 12px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hotel { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px 12px; padding: 12px; }
.thumb { width: 104px; height: 78px; border-radius: 8px; background: var(--accent-soft); overflow: hidden; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hotel h3 { margin: 0; font-size: 1.02rem; line-height: 1.35; }
.meta { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }
.star { color: var(--star); font-weight: 800; }
.plan { grid-column: 1 / -1; margin: 6px 0 0; font-size: 0.85rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-box { grid-column: 1 / -1; margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.price-label { margin: 0; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.price { margin: 0; font-size: 1.55rem; font-weight: 800; line-height: 1.3; }
.price small { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.price-sub { margin: 0; font-size: 0.82rem; color: var(--muted); }
.hotel .action { grid-column: 1 / -1; margin-top: 8px; display: grid; gap: 8px; }
.jump-note { margin: 0; font-size: 0.78rem; color: var(--muted); text-align: center; }
.hotel { scroll-margin-top: 8px; }
.plans { grid-column: 1 / -1; margin: 8px 0 4px; padding: 0 10px 12px; min-width: 0;
  background: var(--accent-tint); border: 2px solid var(--accent); border-radius: 12px; }
.plans-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  margin: 0 -10px 10px; padding: 4px 10px 4px 12px; min-height: 52px;
  background: var(--surface); border-bottom: 2px solid var(--accent); border-radius: 10px 10px 0 0;
  box-shadow: 0 4px 8px -4px rgba(0,0,0,.25); }
.plans-bar-text { flex: 1; min-width: 0; }
.plans-bar-text p { margin: 0; }
.plans-bar-name { font-weight: 800; font-size: 0.92rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plans-bar-count { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.plans-close { flex: none; min-width: 72px; min-height: 44px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #fff; border: 0; font-weight: 800; font-size: 0.95rem; }
@media (prefers-color-scheme: dark) { .plans-close { color: #04222a; } }
.plans-close:hover { background: var(--accent-hover); }
.plans-body > button.plans-end { margin-top: 12px; }
.plans[hidden], .plan-row[hidden] { display: none; }
.plans-title { margin: 0 0 6px; font-weight: 700; }
.plans-text { margin: 0 0 10px; font-size: 0.9rem; color: var(--muted); }
.plans-body > button.secondary { margin-top: 8px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); min-width: 0; }
.plan-row p { margin: 0; }
.plan-name { font-weight: 700; font-size: 0.95rem; line-height: 1.4; }
.plan-room { font-size: 0.82rem; color: var(--muted); }
.plan-meal { margin-top: 2px; font-size: 0.82rem; font-weight: 700; color: var(--accent); }
.plan-price { font-size: 1.25rem; font-weight: 800; line-height: 1.3; }
.plan-price small { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.plan-row .price-label { margin-top: 6px; }
.plan-row a.btn { margin-top: 8px; }
.info-link { justify-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: 0.9rem; font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.info-link:hover { color: var(--accent-hover); }
.plan-desc { margin-top: 6px; }
.plan-desc summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 0.88rem; font-weight: 700; color: var(--accent); }
.plan-desc p { margin: 0 0 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface); font-size: 0.85rem; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.no-link { margin: 0; font-size: 0.85rem; color: var(--muted); }

.more-wrap { margin: 16px 0 8px; }
.shown { margin: 0 0 8px; text-align: center; color: var(--muted); font-size: 0.9rem; }

.site-footer { margin-top: 20px; padding-top: 10px; padding-bottom: 16px; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); }
.site-footer p { margin: 0 0 6px; line-height: 1.6; }
.site-footer a { color: var(--muted); }
.field[hidden] { display: none; }
.credit img { max-width: 100%; height: auto; }
.credit a { display: inline-block; background: #fff; padding: 2px; border-radius: 4px; }

@media (min-width: 560px) {
  .hotel { grid-template-columns: 160px minmax(0, 1fr); }
  .thumb { width: 160px; height: 120px; }
}
@media (prefers-reduced-motion: no-preference) {
  .spinner { display: inline-block; width: 1em; height: 1em; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; vertical-align: -2px; margin-right: 8px; animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
}
