:root {
  --fg: #1d232a; --muted: #6b7480; --line: #e3e6ea; --bg: #f6f7f8; --card: #fff; --accent: #0b6e4f;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--fg); background: var(--bg); line-height: 1.6; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .4em 0; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; }
h3 { font-size: 1rem; margin: 1em 0 .4em; }
small { font-weight: normal; }
.muted { color: var(--muted); font-size: .88rem; }

.site-header { display: flex; align-items: baseline; gap: 1em; padding: .8em 1.2em; background: var(--card); border-bottom: 1px solid var(--line); }
.site-header { flex-wrap: wrap; }
.logo { white-space: nowrap; font-weight: 800; font-size: 1.4rem; text-decoration: none; color: var(--fg); }
.tagline { color: var(--muted); font-size: .85rem; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 1em; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
@media (max-width: 1023px) { .wrap { grid-template-columns: minmax(0, 1fr); } .side { display: none; } }
.sticky { position: sticky; top: 16px; }

.panel, .intro, .legends { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1em 1.2em; margin: 0 0 1em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 1em; }
.cards > .ad { grid-column: 1 / -1; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .9em 1em; color: inherit; text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-head h3 { margin: 0; font-size: 1.1rem; }
.card-weather { font-size: .9rem; margin: .3em 0 .5em; min-height: 2.8em; }

.obs { display: flex; flex-wrap: wrap; gap: .5em 1.2em; margin: .3em 0; }
.obs > div { display: flex; align-items: center; gap: .4em; }
.k { color: var(--muted); font-size: .8rem; }
.chip { white-space: nowrap; display: inline-flex; align-items: baseline; gap: 2px; min-width: 4.2em; justify-content: center; padding: .15em .55em; border-radius: 6px; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid rgba(0,0,0,.06); }
.chip small { font-size: .7em; opacity: .85; }
.chip.big { font-size: 1.6rem; min-width: 5em; }
.arrow { display: inline-block; margin-left: 3px; }
.dir { font-size: .85rem; }
.plain { font-weight: 600; }

.button { display: inline-block; padding: .4em .9em; border-radius: 6px; background: var(--accent); color: #fff; text-decoration: none; }
.crumb { font-size: .85rem; color: var(--muted); }

table.fc { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.fc th, table.fc td { border-bottom: 1px solid var(--line); padding: .45em .5em; text-align: left; vertical-align: top; }
.pops { display: flex; flex-wrap: wrap; gap: .5em; }
.pop { display: flex; flex-direction: column; align-items: center; font-size: .78rem; }

.scroll { overflow-x: auto; }
table.hist { border-collapse: collapse; font-size: .78rem; font-variant-numeric: tabular-nums; }
table.hist th, table.hist td { padding: .3em .35em; text-align: center; min-width: 2.6em; border: 1px solid #fff; }
table.hist tbody th { text-align: left; white-space: nowrap; }

.live-now { display: flex; flex-wrap: wrap; gap: 1em 2em; margin-bottom: .5em; }
.live-now .live-item { display: flex; flex-direction: column; align-items: flex-start; gap: .2em; }
.strip { display: flex; align-items: stretch; margin: .3em 0; font-size: .7rem; overflow-x: auto; }
.strip-label { flex: 0 0 6em; color: var(--muted); align-self: center; }
.strip-cell { flex: 1 0 1.6em; text-align: center; padding: .4em 0; }
#live.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 4px rgba(11,110,79,.35); } to { box-shadow: 0 0 0 0 rgba(11,110,79,0); } }

.legend { display: grid; grid-template-columns: 9em 1fr; gap: 0 .8em; align-items: center; margin: .6em 0; font-size: .8rem; }
.legend-bar { height: 12px; border-radius: 6px; border: 1px solid var(--line); }
.legend-ticks { grid-column: 2; display: flex; justify-content: space-between; color: var(--muted); }

.ad { margin: 0 auto 1em; text-align: center; max-width: 100%; }
.ad-label { font-size: .65rem; color: var(--muted); letter-spacing: .1em; }
.ad-placeholder { display: flex; align-items: center; justify-content: center; min-height: inherit; height: 90px; border: 1px dashed #c4c9cf; color: #9aa1a9; font-size: .75rem; background: repeating-linear-gradient(45deg, #fafafa, #fafafa 8px, #f1f2f3 8px, #f1f2f3 16px); }
.ad-content1 .ad-placeholder, .ad-content2 .ad-placeholder { height: 250px; max-width: 336px; margin: 0 auto; }
.ad-side .ad-placeholder { height: 600px; }
.site-header + .ad { padding-top: 1em; }

.prose h2 { margin-top: 1.2em; }
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 1.2em; font-size: .8rem; color: var(--muted); }
.site-footer .credit { max-width: 900px; }

.tags { display: flex; flex-wrap: wrap; align-items: center; gap: .4em; margin: .3em 0; }
.tag { display: inline-block; padding: .05em .55em; border-radius: 999px; font-size: .75rem; border: 1px solid var(--line); background: var(--bg); }
.tag-ride { background: #e6f2ed; border-color: #b9dccd; }
.tag-run { background: #eef0fa; border-color: #c8cdee; }
.lead { font-size: 1.02rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5em, 1fr)); gap: .6em 1em; margin: 0 0 1em; }
.stats div { border-left: 3px solid var(--accent); padding-left: .6em; }
.stats dt { color: var(--muted); font-size: .78rem; }
.stats dd { margin: 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.course-map { height: 380px; border-radius: 8px; border: 1px solid var(--line); background: #eef0f2; z-index: 0; }
@media (max-width: 600px) { .course-map { height: 300px; } }
.map-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6em 1em; margin: .8em 0 0; }
svg.profile { width: 100%; height: auto; display: block; touch-action: pan-y; font-size: 11px; font-variant-numeric: tabular-nums; }
svg.profile text { fill: var(--muted); }
svg.profile .grid { stroke: var(--line); stroke-width: 1; }
svg.profile .line { fill: none; stroke: #1d232a; stroke-width: 1.5; }
svg.profile polygon { stroke: none; }
svg.profile .cursor { stroke: #1d232a; stroke-width: 1.5; stroke-dasharray: 3 3; }
.credits ul { padding-left: 1.2em; margin: 0; }
