:root {
  --red: #b8322a;
  --red-soft: #f7e3e0;
  --sea: #1f6f9a;
  --sea-soft: #dcebf4;
  --sand: #b07a2a;
  --sand-soft: #f5e9d4;
  --ink: #1d232a;
  --muted: #5b6672;
  --line: #e2e6ea;
  --bg: #fbfaf8;
  --card: #fff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--sea); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.small { font-size: 13px; color: var(--muted); }

header.site { background: var(--card); border-bottom: 1px solid var(--line); }
.brand { margin: 0; padding: 12px 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }

.hero h1 { font-size: 26px; line-height: 1.25; margin: 24px 0 8px; }
.hero h1 span { color: var(--red); }
.hero p { margin: 0 0 16px; color: #333; }

.controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
}
.controls label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: var(--muted); gap: 4px; }
.controls input, .controls select {
  font: inherit; font-size: 16px; color: var(--ink); padding: 9px 10px; border: 1px solid #c9d0d6;
  border-radius: 8px; background: #fff; width: 100%; min-height: 44px;
}

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin: 12px 0; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-float { background: var(--sea); }
.dot-walk { background: var(--sand); }
.sw { display: inline-block; width: 16px; height: 10px; border-radius: 2px; }
.sw-stay { background: var(--red); border-radius: 99px; }
.sw-night { background: rgba(138,147,163,.3); }

.msg { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.summary { font-size: 15px; margin: 6px 0 12px; }

.day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.day.best { border: 2px solid var(--red); }
.day header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 8px; }
.day h3 { margin: 0 6px 0 0; font-size: 18px; }
.tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.tag-best { background: var(--red); color: #fff; }
.tag-both { background: var(--red-soft); color: var(--red); }
.tag-easy { background: var(--red); color: #fff; }
.tag-float { background: var(--sea-soft); color: var(--sea); }
.tag-walk { background: var(--sand-soft); color: #7a5418; }
.tag-neither { background: #eef0f2; color: var(--muted); }

.wins { margin: 0 0 8px; display: grid; gap: 4px; }
.wins div { display: grid; grid-template-columns: 150px 1fr; gap: 8px; font-size: 15px; }
.wins dt { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.wins dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.none { color: var(--muted); font-weight: 400; }

.chart svg { width: 100%; height: auto; display: block; }
.night { fill: #8a93a3; fill-opacity: .22; }
.band-float { fill: var(--sea-soft); }
.band-walk { fill: var(--sand-soft); }
.stay { fill: var(--red); fill-opacity: .08; }
.stay-bar { fill: var(--red); }
.stay-label { font-size: 18px; font-weight: 700; fill: #fff; }
.thr { stroke-width: 1; stroke-dasharray: 4 3; }
.thr-float { stroke: var(--sea); }
.thr-walk { stroke: var(--sand); }
.thr-label { font-size: 18px; fill: var(--muted); }
.curve { fill: none; stroke: var(--ink); stroke-width: 2; }
.pt { fill: var(--ink); }
.ax { font-size: 21px; font-weight: 600; fill: var(--muted); }

.plan { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.plan h4 { margin: 0 0 6px; font-size: 15px; }
.plan ol { margin: 0; padding-left: 0; list-style: none; }
.plan li { padding: 6px 0 6px 12px; border-left: 3px solid var(--line); margin-bottom: 4px; font-size: 15px; }
.plan li .t { font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 6px; }
.plan li.step-float { border-color: var(--sea); }
.plan li.step-walk { border-color: var(--sand); }
.plan .tips { margin: 8px 0 0; padding-left: 18px; list-style: disc; font-size: 14px; color: var(--muted); }
.plan .tips li { border: 0; padding: 2px 0; margin: 0; font-size: 14px; }

.month-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 8px 0 20px; }
.month-head { display: flex; justify-content: space-between; align-items: center; }
.month-head h2 { margin: 0; font-size: 20px; }
.month-head button { font-size: 20px; width: 44px; height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 8px; margin-left: 6px; cursor: pointer; }
#month h3 { margin: 6px 0 8px; font-size: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { text-align: center; font-size: 12px; color: var(--muted); }
.cal-d {
  font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 8px; min-height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 2px;
}
.cal-d span { font-size: 14px; font-weight: 600; }
.cal-d i { display: flex; gap: 3px; height: 8px; }
.cal-d .dot { width: 7px; height: 7px; }
.cal-d.c-both { background: var(--red-soft); border-color: #e9b9b3; }
.cal-d.sel { outline: 2px solid var(--red); }
.cal-d.off { color: #b5bcc3; cursor: default; }

.cta { background: var(--red-soft); border-radius: 12px; padding: 16px; margin: 0 0 20px; }
.cta h2 { margin: 0 0 6px; font-size: 19px; }
.cta p { margin: 0 0 12px; }
.btn { display: inline-block; background: var(--red); color: #fff; text-decoration: none; font-weight: 700; padding: 11px 16px; border-radius: 8px; }
.partners { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 20px; }
.partners h2 { margin: 0 0 6px; font-size: 19px; }
.partners ul { margin: 0; padding-left: 18px; }
.partners li span { display: block; font-size: 14px; color: var(--muted); }

.content h2, .source h2 { font-size: 20px; margin: 28px 0 8px; }
.content details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.content summary { font-weight: 600; cursor: pointer; }
.source p { font-size: 14px; color: var(--muted); word-break: break-word; }

footer.site { border-top: 1px solid var(--line); margin-top: 28px; font-size: 13px; color: var(--muted); }

@media (max-width: 520px) {
  .hero h1 { font-size: 22px; }
  .wins div { grid-template-columns: 1fr; gap: 0; margin-bottom: 4px; }
}

/* ---- tide scene (prototype) ---- */
.cursor { stroke: var(--ink); stroke-width: 2; }
.cursor-dot { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.cursor-tag { fill: var(--ink); }
.cursor-txt { font-size: 20px; font-weight: 700; fill: #fff; font-variant-numeric: tabular-nums; }
.scene-svg { width: 100%; height: auto; display: block; border-radius: 10px; }
.scene-tag rect { fill: rgba(255,255,255,.9); }
.scene-tag text { font: 700 12px -apple-system, "Segoe UI", Roboto, sans-serif; }
.scene-float text { fill: var(--sea); }
.scene-walk text { fill: #7a5418; }
.scene-mid text { fill: var(--muted); }
.scene-box { margin: 10px 0 6px; }
.scene-ctl { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.scene-time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; }
.scene-ctl input { flex: 1; accent-color: var(--red); height: 32px; }
.scene-text { margin: 4px 0 0; font-size: 14px; color: #333; }
.levels { margin: 0 0 18px; }
.levels h2 { font-size: 18px; margin: 0 0 8px; }
.levels-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.levels figure { margin: 0; }
.levels figcaption { font-size: 12px; line-height: 1.4; margin-top: 4px; color: #333; }
.levels figcaption b { display: block; font-size: 13px; }
@media (max-width: 520px) { .scene-tag { display: none; } .levels .scene-tag { display: none; } }

/* ---- contextual affiliate offers ---- */
.offers { margin-top: 12px; }
.offer { background: #f6f8fa; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.offer b { display: block; font-size: 15px; }
.offer p { margin: 4px 0 6px; color: #333; }
.offer ul { margin: 0; padding-left: 18px; }
.offer a { font-weight: 700; }
.offer .note { font-size: 13px; color: var(--muted); margin-top: 0; }
.offer-water { border-left: 4px solid var(--sea); }
.offer-hotel { border-left: 4px solid var(--red); }
.aff { font-size: 12px; color: var(--muted); margin: 0; }

/* ---- picture version (index-photo.html) ---- */
.levels-photos { display: grid; grid-auto-flow: column; grid-auto-columns: 42%; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.levels-photos figure { margin: 0; scroll-snap-align: start; }
.levels-photos img { width: 100%; height: auto; aspect-ratio: 348 / 305; object-fit: cover; display: block; border-radius: 10px; }
.levels-photos figcaption { font-size: 12px; margin-top: 4px; line-height: 1.35; }
.levels-photos figcaption b { display: block; font-size: 13px; }
.cap-walk { color: #7a5418; font-weight: 600; }
.cap-mid { color: var(--muted); }
.cap-float { color: var(--sea); font-weight: 600; }
@media (min-width: 640px) { .levels-photos { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; } }
.photo-wrap { position: relative; }
.photo-wrap img { width: 100%; height: auto; display: block; border-radius: 10px; }
.photo-tag { position: absolute; left: 8px; top: 8px; background: rgba(255,255,255,.92); border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.photo-tag.scene-float { color: var(--sea); }
.photo-tag.scene-walk { color: #7a5418; }
.photo-tag.scene-mid { color: var(--muted); }

/* crossfade between tide pictures */
.fade-stack { aspect-ratio: 348 / 305; max-width: 100%; overflow: hidden; border-radius: 10px; }
.fade-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s ease; border-radius: 10px; }
.fade-stack img.on { opacity: 1; }
.fade-stack .photo-tag { z-index: 2; }
@media (prefers-reduced-motion: reduce) { .fade-stack img { transition: none; } }

/* ---- site navigation and content pages (monthly tides, best days, stay) ---- */
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; }
.brand-link { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; padding-bottom: 8px; }
@media (min-width: 640px) { .site-nav { padding-bottom: 0; } }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--red); }
.crumbs { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.page .hero h1 { margin-top: 10px; }
.page section > h2 { font-size: 20px; margin: 26px 0 8px; }
.page section > h2 small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.stat-both b { color: var(--red); }
.stat-float b { color: var(--sea); }
.stat-walk b { color: #7a5418; }
.best-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.best-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-variant-numeric: tabular-nums; font-size: 15px; }
.best-list li a { min-width: 92px; }
.best-list li > span:not(.tag) { display: inline-flex; align-items: center; gap: 6px; }
.best-list .dot, .mtable .dot { margin-right: 4px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.mtable, .ctable { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.mtable th, .mtable td, .ctable th, .ctable td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.mtable thead th, .ctable thead th { font-size: 13px; color: var(--muted); background: #f6f8fa; white-space: nowrap; }
.mtable tbody th { white-space: nowrap; font-weight: 600; }
.mtable tbody th .tag { margin-left: 6px; }
.mtable small { color: var(--muted); }
.mtable td { white-space: nowrap; }
.mtable tr.k-both th, .mtable tr.k-both td { background: #fdf4f2; }
.mtable tr.we th a { color: var(--red); }
.mtable .dim { color: #9aa3ad; }
.mtable tbody tr:last-child th, .mtable tbody tr:last-child td, .ctable tbody tr:last-child th, .ctable tbody tr:last-child td { border-bottom: 0; }
.ctable { min-width: 560px; }
.ctable tbody th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 16px 0 0; font-weight: 600; }
.month-links p { line-height: 2; }
.area-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.area { scroll-margin-top: 12px; border-top: 1px solid var(--line); margin-top: 24px; }
.hotels { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.hotel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.hotel span { font-size: 13px; color: var(--muted); flex: 1; }
.btn-sm { padding: 7px 12px; font-size: 14px; align-self: flex-start; }
.btn.placeholder { background: #c9d0d6; cursor: not-allowed; }
.stay-date { background: var(--sea-soft); color: var(--sea); border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.ferry { background: var(--sea-soft); border-radius: 12px; padding: 12px 14px; margin-top: 14px; }
.ferry h3 { margin: 0 0 4px; font-size: 16px; }
.ferry p { margin: 4px 0; }
.ferry .note { font-size: 14px; color: #7a3a14; font-weight: 600; }

/* ---- calendars: dark = both 10:00–16:00, light = both in daylight but early or late ---- */
.cal-d.c-easy { background: var(--red); border-color: var(--red); color: #fff; }
.cal-d.c-easy .dot { box-shadow: 0 0 0 1.5px #fff; }
a.cal-d { color: var(--ink); text-decoration: none; }
a.cal-d.c-easy { color: #fff; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.cal-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.sw-easy { background: var(--red); }
.sw-both { background: var(--red-soft); border: 1px solid #e9b9b3; }
.cal-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 10px; margin-top: 16px; }
.cal-box > h2 { margin-top: 10px !important; }
.mcal h3 { font-size: 16px; margin: 0 0 6px; }
.mcal h3 small { color: var(--muted); font-weight: 400; font-size: 13px; }
.mcal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.mcal.mini { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.mcal.mini .cal { gap: 3px; }
.mcal.mini .cal-d { min-height: 30px; border-radius: 6px; padding: 0; }
.mcal.mini .cal-d span { font-size: 12px; }
.mcal.mini .cal-h { font-size: 11px; }
.bm-h { font-size: 16px; margin: 16px 0 6px; }

/* ---- planner: 7-day strip + one card ---- */
.strip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 4px 0 10px; font-size: 15px; }
.strip-head span { font-size: 13px; color: var(--muted); }
.strip { display: flex; gap: 6px; align-items: stretch; margin-bottom: 14px; touch-action: pan-y; }
.strip .arr { flex: 0 0 30px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 18px; color: var(--muted); cursor: pointer; }
.strip .arr:disabled { opacity: .35; cursor: default; }
.strip .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; flex: 1; min-width: 0; }
.ds { font: inherit; color: var(--ink); border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 0 5px; display: flex; flex-direction: column; align-items: center; gap: 1px; position: relative; cursor: pointer; min-width: 0; }
.ds small { font-size: 10px; color: var(--muted); }
.ds b { font-size: 16px; line-height: 1.2; }
.ds i { display: flex; gap: 2px; height: 7px; }
.ds .dot { width: 6px; height: 6px; }
.ds.c-easy { background: var(--red); border-color: var(--red); color: #fff; }
.ds.c-easy small { color: #fde4e1; }
.ds.c-easy .dot { box-shadow: 0 0 0 1.5px #fff; }
.ds.c-both { background: var(--red-soft); border-color: #e9b9b3; }
.ds.on { outline: 3px solid var(--ink); outline-offset: 1px; }
.ds:focus-visible, .strip .arr:focus-visible { outline: 3px solid var(--sea); outline-offset: 1px; }
.ds .bb { position: absolute; top: -9px; font-size: 9px; line-height: 1.5; background: var(--ink); color: #fff; border-radius: 99px; padding: 0 5px; font-weight: 700; white-space: nowrap; }

.btn-line { background: #fff; color: var(--red); border: 1.5px solid var(--red); }

/* chart text: large for phones (the 640-wide chart shrinks to about half), smaller when the chart is shown big */
@media (min-width: 700px) { .ax { font-size: 15px; } .thr-label, .stay-label { font-size: 14px; } .cursor-txt { font-size: 15px; } }

.offer-kimono { border-left: 4px solid #8a5a9e; }
.offer-rickshaw { border-left: 4px solid var(--sand); }
.luggage { margin: 12px 4px 0; }

.foot-links { margin-top: 6px; }
.foot-links a { color: inherit; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }
.actions .btn { cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; }
.act-msg { font-size: 13px; color: var(--muted); flex-basis: 100%; }
.act-url { width: 100%; font: inherit; font-size: 13px; padding: 6px; margin-top: 4px; }

.hotel b { font-size: 15px; }
.hotel-area { font-size: 12px; color: var(--muted); }
.hotel span { color: #333; }
.hotel-links { display: flex; gap: 6px; flex: 0 !important; margin-top: 4px; }
.hotel-links .btn { padding: 6px 10px; font-size: 13px; }
[hidden] { display: none !important; }
/* guide article (2026-11-29) */
.compare-box h2 { text-align: center; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.compare img { display: block; width: 100%; height: auto; }
.compare figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.compare figcaption b { font-size: 15px; }
.compare .c-float { color: var(--sea); }
.compare .c-walk { color: #7a5418; }
.guide .content h3 { margin-top: 18px; }
@media (max-width: 330px) { .compare { grid-template-columns: 1fr; } }
