:root {
  --ink: #1b2430;
  --sub: #5d6978;
  --line: #dde3ea;
  --bg: #f4f6f9;
  --card: #ffffff;
  --brand: #1d4f7c;
  --brand-d: #143a5d;
  --brand-soft: #e6eef6;
  --accent: #b9791f;
  --accent-soft: #fbf1df;
  --warn: #a8530a;
  --warn-soft: #fef3e2;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --muted: #eceff3;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', Meiryo, sans-serif; line-height: 1.7; font-size: 15px; }
a { color: var(--brand); }
button { font: inherit; cursor: pointer; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1120px; }

.hdr { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.hdr .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .02em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #2f6fa8, #143a5d); display: grid; place-items: center; color: #fff; font-size: 15px; }
.brand small { font-weight: 500; color: var(--sub); font-size: 11px; }
.hdr nav { display: flex; gap: 14px; font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
.hdr nav a { text-decoration: none; color: var(--sub); padding: 4px 0; }
.hdr nav a:hover, .hdr nav a.on { color: var(--brand); }

.demo-note { background: var(--warn-soft); color: var(--warn); font-size: 12.5px; padding: 8px 0; border-bottom: 1px solid #f6dcae; }
.demo-note .wrap { display: flex; gap: 8px; align-items: flex-start; }

h1 { font-size: 22px; line-height: 1.4; margin: 22px 0 6px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 6px; }
.lead { color: var(--sub); margin: 0 0 16px; font-size: 14px; }
.crumb { font-size: 13px; margin: 14px 0 0; }
.crumb a { text-decoration: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

/* hero & search */
.hero { background: linear-gradient(135deg, #143a5d, #1d4f7c 60%, #2f6fa8); color: #fff; padding: 26px 0 70px; }
.hero h1 { margin: 0 0 4px; font-size: 24px; }
.hero p { margin: 0; color: #d3e2f0; font-size: 14px; }
.search { margin-top: -50px; box-shadow: 0 8px 24px rgba(20,58,93,.14); }
.search.flat { margin-top: 0; box-shadow: none; }
.search-grid { display: grid; grid-template-columns: 1fr 1fr 110px auto; gap: 10px; align-items: end; }
.field { margin-bottom: 12px; }
.search-grid .field { margin: 0; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 5px; }
.field label em { font-style: normal; font-size: 11px; background: var(--danger-soft); color: var(--danger); border-radius: 4px; padding: 1px 6px; margin-left: 6px; font-weight: 600; }
.field input, .field select, .field textarea, .inline input, .inline select { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field.err input, .field.err textarea { border-color: var(--danger); }
.field .msg { color: var(--danger); font-size: 12.5px; margin-top: 4px; display: none; }
.field.err .msg { display: block; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 700; font-size: 15px; background: var(--brand); color: #fff; text-decoration: none; }
.btn:hover { background: var(--brand-d); }
.btn.gold { background: var(--accent); }
.btn.gold:hover { background: #96620f; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: #f4f6f9; }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

/* hotel cards */
.hotels { display: grid; gap: 14px; margin-top: 16px; }
.hcard { display: grid; grid-template-columns: 220px 1fr; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.hcard:hover { box-shadow: 0 6px 18px rgba(20,58,93,.12); }
.hcard .ph, .hotel-hero .ph { position: relative; min-height: 150px; }
.hcard .ph svg, .hotel-hero .ph svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hcard .bd { padding: 14px 16px; }
.hcard .bd h3 { font-size: 17px; margin-bottom: 2px; }
.hcard .meta { font-size: 12.5px; color: var(--sub); }
.hcard .desc { font-size: 13.5px; color: #3b4756; margin: 8px 0; }
.price-from { font-size: 13px; color: var(--sub); }
.price-from b { font-size: 20px; color: var(--accent); }
.tag { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; font-weight: 600; background: var(--brand-soft); color: var(--brand); margin-right: 4px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.ng { background: var(--muted); color: #6b7682; }
.tag.stop { background: var(--danger-soft); color: var(--danger); }
.tag.gold { background: var(--accent-soft); color: var(--accent); }

.hotel-hero { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; margin: 12px 0 14px; }
.hotel-hero .ph { min-height: 170px; }
.hotel-hero .bd { padding: 14px 16px 16px; }

/* rooms */
.room { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.room.dim { background: #f8f9fb; }
.room.dim h3 { color: #7a8593; }
.room .spec { font-size: 12.5px; color: var(--sub); }
.room .desc { font-size: 13.5px; margin-top: 4px; }
.room .rt { text-align: right; min-width: 150px; }
.room .rt .p { font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1.3; }
.room .rt .sub { font-size: 12px; color: var(--sub); }
.room .left { display: block; font-size: 12.5px; font-weight: 700; color: var(--danger); margin-bottom: 4px; }
.room.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px #fbbf24; } }

.summary { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; background: #fff; }
.summary div { display: flex; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 14px; gap: 8px; }
.summary div:last-child { border: 0; }
.summary .k { width: 110px; color: var(--sub); flex: none; }
.summary .tot { background: var(--accent-soft); font-weight: 700; }

.alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; display: flex; gap: 8px; }
.alert.err { background: var(--danger-soft); color: var(--danger); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--brand-soft); color: var(--brand-d); }

.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 32px; margin: 8px auto 10px; }
.code-box { text-align: center; background: var(--brand-soft); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.code-box b { font-size: 24px; letter-spacing: .12em; color: var(--brand-d); display: block; }
.mail { background: #fafbfc; border: 1px dashed #b9c4cd; border-radius: 12px; padding: 14px; font-size: 13px; white-space: pre-wrap; color: #3b4756; }
.mail-h { font-size: 12px; color: var(--sub); margin: 14px 0 6px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); background: #1b2430; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13.5px; opacity: 0; transition: .3s; z-index: 50; max-width: calc(100% - 32px); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
footer { text-align: center; color: var(--sub); font-size: 12px; padding: 26px 16px 40px; }

/* admin */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; background: #eef2f6; color: var(--sub); font-weight: 600; padding: 9px 10px; white-space: nowrap; }
.tbl td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi b { display: block; font-size: 24px; line-height: 1.2; }
.kpi span { font-size: 12px; color: var(--sub); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--sub); }
.tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline input, .inline select { width: auto; padding: 8px 10px; font-size: 14px; }
.switch { display: inline-flex; align-items: center; gap: 10px; }
.switch button { position: relative; width: 52px; height: 30px; border-radius: 999px; border: 0; background: #b9c4cd; transition: .2s; flex: none; }
.switch button::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; }
.switch button.on { background: var(--brand); }
.switch button.on::after { left: 25px; }
.scope-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
.scope-bar select { border: 1.5px solid var(--line); border-radius: 9px; padding: 6px 10px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); max-width: 100%; }
.scope-bar .role { background: var(--accent-soft); color: var(--accent); font-weight: 700; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; }

/* inventory heat table */
.inv { border-collapse: separate; border-spacing: 3px; font-size: 12px; width: 100%; }
.inv th { font-weight: 600; color: var(--sub); text-align: center; padding: 2px; white-space: nowrap; }
.inv th.sat { color: #1d4ed8; } .inv th.sun { color: #c2410c; }
.inv td.nm { font-weight: 600; white-space: nowrap; padding-right: 8px; font-size: 12.5px; }
.inv td.c { text-align: center; border-radius: 6px; padding: 7px 2px; min-width: 38px; font-weight: 600; }
.inv td.c.l1 { background: #e7f6ec; color: #15803d; }
.inv td.c.l2 { background: #fdf0d5; color: #8a5a07; }
.inv td.c.l3 { background: #fbd9d4; color: #9c1c10; }
.inv td.c.l4 { background: #b42318; color: #fff; }

/* lab */
.log { background: #0f1720; color: #d7e3ee; border-radius: 12px; padding: 12px 14px; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; max-height: 420px; overflow: auto; line-height: 1.6; }
.log .w { color: #4ade80; } .log .l { color: #fca5a5; } .log .d { color: #8aa0b4; }
.result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.result .kpi b { font-size: 30px; }
.result .win b { color: var(--ok); } .result .lose b { color: var(--danger); }
.nightbars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0 4px; }
.nb { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; font-size: 12.5px; }
.nb b { display: block; font-size: 22px; }
.nb .pips { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.nb .pips i { width: 16px; height: 16px; border-radius: 4px; background: var(--muted); display: block; }
.nb .pips i.on { background: var(--brand); }

@media (max-width: 719px) {
  .search-grid { grid-template-columns: 1fr 1fr; }
  .search-grid .field.g, .search-grid .btn { grid-column: span 2; }
  .hcard { grid-template-columns: 1fr; }
  .hcard .ph { min-height: 110px; }
  .room { grid-template-columns: 1fr; }
  .room .rt { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
  .nightbars { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .hdr .wrap { flex-direction: column; align-items: flex-start; gap: 0; padding-top: 8px; padding-bottom: 6px; }
  .hdr nav { gap: 14px; justify-content: flex-start; }
  .brand small { display: block; }
}
@media (min-width: 720px) {
  body { font-size: 16px; }
  h1 { font-size: 26px; }
  .hero h1 { font-size: 30px; }
}
