/* タイドグラフ 共通スタイル */
:root {
  --sea: #0b6e99;
  --sea-dark: #084f6e;
  --sea-light: #e3f2fa;
  --sand: #f7f5f0;
  --ink: #1c2b33;
  --muted: #5c6f7a;
  --line: #d8e4ea;
  --accent: #ff7043;
  --ohshio: #d84315;
  --nakashio: #0b6e99;
  --koshio: #7e9bab;
  --nagashio: #9575cd;
  --wakashio: #43a047;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--sand);
  line-height: 1.65;
}
a { color: var(--sea); }
.site-header {
  background: linear-gradient(135deg, var(--sea-dark), var(--sea));
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.site-header a.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-header .brand svg { display: block; }
.site-header .tagline { font-size: .78rem; opacity: .85; }
main { max-width: 1080px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.35rem; margin: .4em 0; }
h2 { font-size: 1.1rem; border-left: 4px solid var(--sea); padding-left: 8px; margin: 1.6em 0 .6em; }
.breadcrumb { font-size: .8rem; color: var(--muted); margin: 8px 0; }
.breadcrumb a { color: var(--muted); }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0;
}
.muted { color: var(--muted); font-size: .85rem; }
.site-footer {
  margin-top: 32px;
  padding: 20px 16px 28px;
  background: var(--sea-dark);
  color: #cfe7f3;
  font-size: .78rem;
  line-height: 1.8;
}
.site-footer a { color: #fff; }

/* チップ(お気に入り・最近見た) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .85rem;
  text-decoration: none;
  color: var(--ink);
}
.chip.fav { border-color: var(--accent); }
.chip:hover { background: var(--sea-light); }

/* 検索 */
.searchbox { position: relative; }
.searchbox input {
  width: 100%;
  font-size: 1rem;
  padding: 10px 14px;
  border: 2px solid var(--sea);
  border-radius: 10px;
}
.search-results {
  position: absolute;
  z-index: 1200;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  max-height: 300px;
  overflow: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.search-results a {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--ink);
  border-top: 1px solid var(--line);
}
.search-results a:hover { background: var(--sea-light); }
.search-results .pref { color: var(--muted); font-size: .8rem; margin-left: 6px; }

/* 地図 */
#map { height: 480px; border-radius: 12px; border: 1px solid var(--line); }
@media (max-width: 640px) { #map { height: 380px; } }
.locate-btn {
  background: #fff;
  border: 2px solid rgba(0,0,0,.2);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: .85rem;
}

/* 都道府県リスト */
.pref-columns { columns: 3; column-gap: 24px; font-size: .9rem; }
@media (max-width: 640px) { .pref-columns { columns: 2; } }
.pref-columns div { break-inside: avoid; margin-bottom: 10px; }
.pref-columns strong a { text-decoration: none; }
.pref-columns ul { margin: 2px 0 0; padding-left: 18px; }

/* 地点ページ */
.day-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 10px 0 0; }
.day-tabs button {
  flex: 1 0 auto;
  min-width: 86px;
  border: 1px solid var(--line);
  border-bottom: none;
  background: #eef4f7;
  border-radius: 10px 10px 0 0;
  padding: 8px 6px 6px;
  cursor: pointer;
  font-size: .82rem;
  line-height: 1.3;
}
.day-tabs button.active { background: #fff; font-weight: 700; color: var(--sea-dark); }
.day-tabs .tide-label { display: block; font-size: .75rem; color: var(--muted); }
.graph-card { border-top-left-radius: 0; margin-top: 0; }
#tide-graph { width: 100%; height: auto; display: block; touch-action: pan-y; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.summary-grid .item {
  background: var(--sea-light);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: .85rem;
}
.summary-grid .item b { display: block; font-size: 1.05rem; }
.tide-name-badge {
  display: inline-block;
  padding: 2px 14px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
}
table.hilo { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.hilo th, table.hilo td { border: 1px solid var(--line); padding: 6px 10px; text-align: center; }
table.hilo th { background: var(--sea-light); }
.threshold-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem; }
.threshold-row input[type="range"] { flex: 1; min-width: 140px; }

/* カレンダー */
.cal-nav { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 8px 0; }
.cal-nav button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 14px; cursor: pointer; }
table.calendar { border-collapse: collapse; width: 100%; font-size: .72rem; table-layout: fixed; }
table.calendar th, table.calendar td { border: 1px solid var(--line); padding: 3px 4px; vertical-align: top; }
table.calendar th { background: var(--sea-light); }
table.calendar td .d { font-weight: 700; }
table.calendar td .tname { border-radius: 6px; color: #fff; padding: 0 4px; display: inline-block; font-size: .68rem; }
table.calendar td.sun .d { color: #d32f2f; }
table.calendar td.sat .d { color: #1565c0; }
table.calendar td.hit { background: #fff3e0; }
table.calendar td .lows { color: var(--sea-dark); }
.spring-list { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; }
.spring-list span { background: #fbe9e7; border: 1px solid #ffccbc; border-radius: 8px; padding: 2px 10px; }
.nearby-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nearby-list a {
  display: inline-block;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 14px;
  text-decoration: none;
  font-size: .88rem;
}
.fav-btn {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: #fff;
  border-radius: 999px;
  padding: 5px 16px;
  font-size: .9rem;
  cursor: pointer;
}
.fav-btn.on { background: var(--accent); color: #fff; }
.seo-text { font-size: .9rem; }
.seo-text h2 { font-size: 1rem; }
.loading { text-align: center; color: var(--muted); padding: 28px 0; }
.notice { font-size: .78rem; color: var(--muted); }
