:root {
  /* 基本: 白 / セカンド: 黒 / ポイント: 赤 */
  --bg: #ffffff;
  --surface: #ffffff;
  --subtle: #f4f4f4;
  --text: #111111;
  --muted: #6b6b6b;
  --line: #e3e3e3;
  --ink: #111111;          /* セカンドカラー（黒） */
  --ink-text: #ffffff;
  --accent: #d7262d;       /* ポイントカラー（赤） */
  --accent-ink: #ffffff;
  --accent-soft: #fdecec;
  --danger: #d7262d;
  --ok: #111111;
  /* 種別の色: 黒の濃淡を基本に、レースだけ赤 */
  --t-jog: #111111; --t-lsd: #333333; --t-pace: #111111; --t-tempo: #333333;
  --t-interval: #111111; --t-hill: #333333; --t-race: #d7262d; --t-walk: #8a8a8a;
  --t-cross: #555555; --t-rest: #bdbdbd; --t-other: #555555;
  --radius: 10px;
  --shadow: none;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
}
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* header */
.topbar { background: var(--ink); color: var(--ink-text); border-bottom: 3px solid var(--accent); position: sticky; top: 0; z-index: 10; }
.topbar a { text-decoration: none; }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; color: var(--ink-text); letter-spacing: .02em; }
.brand:hover { color: var(--ink-text); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { color: #bdbdbd; padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-size: 14px; position: relative; }
.nav a.on, .nav a:hover { color: var(--ink-text); background: #2a2a2a; }
.nav a.on { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 6px 6px 0 0; }
.dot { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center; vertical-align: 1px; }
.btn-new { white-space: nowrap; }
@media (max-width: 720px) {
  .topbar-inner { gap: 8px; padding-top: 6px; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 6px; gap: 0; justify-content: space-between; }
  .nav a { padding: 6px 6px; font-size: 13px; }
  .btn-new { margin-left: auto; }
}

/* layout */
main { padding-top: 20px; padding-bottom: 32px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } .side-col { order: -1; } }
.narrow { max-width: 440px; margin: 0 auto; }
.page-title { font-size: 22px; margin: 0 0 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-title { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; }
.card-title .more { font-size: 13px; font-weight: normal; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.footer { color: var(--muted); font-size: 13px; padding-bottom: 40px; }
.inline { display: inline; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; line-height: 1.3; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.05); border-color: var(--accent); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-small { padding: 4px 10px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* flash */
.flash { padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); margin-bottom: 14px; }
.flash-success { background: #e6f4ea; color: #1e5f2c; }
.flash-error { background: #fdeaea; color: var(--danger); }

/* summary */
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.side-col .stat .num { font-size: 18px; }
.side-col .stat { padding: 8px; }
.stat { background: var(--bg); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .num { overflow-wrap: anywhere; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat .num small { font-size: 12px; font-weight: normal; margin-left: 2px; color: var(--muted); }
.stat .sub { font-size: 12px; color: var(--muted); }

/* entries */
.entry { border-left: 4px solid var(--type, var(--line)); }
.entry-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.entry-head .who { font-weight: 700; color: var(--text); }
.entry-head .when { color: var(--muted); }
.entry-link { color: inherit; display: block; }
.entry-link:hover { text-decoration: none; }
.metrics { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 6px 0; }
.metric { font-variant-numeric: tabular-nums; }
.metric b { font-size: 20px; }
.metric.pace { color: var(--muted); }
.feel { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--bg); }
.feel-5, .feel-4 { color: var(--ok); }
.feel-1, .feel-2 { color: var(--danger); }
.entry-title { font-size: 16px; margin: 4px 0; }
.entry-title.big { font-size: 22px; }
.menu { margin: 4px 0; padding: 6px 10px; background: var(--bg); border-radius: 8px; font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.body { margin: 6px 0 0; overflow-wrap: anywhere; }
.body.full p { margin: 0 0 .8em; }
.thumbs { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
.gallery img { width: 100%; border-radius: 8px; }
.thumb-del { display: flex; flex-direction: column; align-items: center; font-size: 13px; }
.detail-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.detail-metrics div { background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.detail-metrics dt { font-size: 12px; color: var(--muted); }
.detail-metrics dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sub-title { font-size: 14px; margin: 14px 0 4px; color: var(--muted); }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--type, var(--t-other)); }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge-muted { background: var(--bg); color: var(--muted); }
.type-jog { --type: var(--t-jog); } .type-lsd { --type: var(--t-lsd); } .type-pace { --type: var(--t-pace); }
.type-tempo { --type: var(--t-tempo); } .type-interval { --type: var(--t-interval); } .type-hill { --type: var(--t-hill); }
.type-race { --type: var(--t-race); } .type-walk { --type: var(--t-walk); } .type-cross { --type: var(--t-cross); }
.type-rest { --type: var(--t-rest); } .type-other { --type: var(--t-other); }
.entry .tag, .entry-detail .tag { background: var(--type); }

/* plans */
.plan-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; font-size: 14px; }
.plan-row:first-of-type { border-top: 0; }
.plan-row.done { opacity: .65; }
.plan-date { font-weight: 600; min-width: 70px; font-variant-numeric: tabular-nums; }
.plan-menu { flex: 1; min-width: 120px; }
.plan-actions { display: flex; gap: 6px; align-items: center; }
.plan-row .tag { background: var(--type, var(--t-other)); }
.members { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.form-inline input { flex: 1; min-width: 200px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], input:not([type]), select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }
.help { color: var(--muted); font-size: 12px; }
.error { color: var(--danger); font-size: 13px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.pace-preview { color: var(--muted); font-size: 14px; min-height: 1em; }
.field ul { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted); }

/* calendar */
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-nav { display: flex; gap: 6px; }
.calendar { padding: 0; overflow: hidden; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 64px; }
.cal-labels span { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--line); }
.cal-labels .sat { color: #1c7ed6; } .cal-labels .sun { color: var(--danger); }
.cal-cell { min-height: 84px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-cell.out { background: var(--bg); opacity: .55; }
.cal-cell.today .cal-day { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 6px; }
.cal-day { font-size: 12px; align-self: flex-start; font-variant-numeric: tabular-nums; }
.cal-entry { font-size: 11px; color: #fff; background: var(--type); border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-plan { font-size: 11px; color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-cell.wk { border-right: 0; justify-content: center; align-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; background: var(--bg); }
.cal-cell.wk small { font-weight: normal; color: var(--muted); }
.stat .num small { white-space: nowrap; }
@media (max-width: 560px) { .stat .num { font-size: 18px; } .ce-type.has-dist { display: none; } .cal-row { grid-template-columns: repeat(7, minmax(0, 1fr)) 44px; } .cal-cell { min-height: 64px; padding: 2px; } .cal-entry, .cal-plan { font-size: 10px; } }

/* stats */
.chart-wrap { overflow-x: auto; }
.chart { width: 100%; min-width: 480px; height: auto; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { opacity: .8; }
.chart .axis { stroke: var(--line); }
.chart text { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.chart .val { fill: var(--text); font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table input.copy { font-size: 12px; min-width: 220px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 16px 0; }
.profile-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.profile-head .summary { grid-column: 1 / -1; }
.profile-head .page-title { margin: 0; }
.profile-head p { margin: 0; }
.profile-links { display: flex; gap: 6px; }

/* ---- 白・黒・赤の調整 ---- */
.card { border-color: var(--line); }
.stat, .detail-metrics div, .menu, .feel, .cal-cell.wk { background: var(--subtle); }
.btn { border-color: var(--ink); color: var(--ink); background: #fff; text-decoration: none; }
.btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #b51f25; border-color: #b51f25; color: #fff; filter: none; }
.btn-danger { color: var(--accent); border-color: var(--accent); background: #fff; }
.btn-danger:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.topbar .btn-primary { box-shadow: none; }
.page-title { font-weight: 800; letter-spacing: .01em; }
.page-title::after { content: ""; display: block; width: 36px; height: 3px; background: var(--accent); margin-top: 6px; }
.badge { background: var(--accent-soft); color: var(--accent); font-weight: 600; text-decoration: none; }
.badge-muted { background: var(--subtle); color: var(--muted); font-weight: 400; }
.feel-5, .feel-4 { color: var(--ink); font-weight: 700; }
.feel-1, .feel-2 { color: var(--accent); }
.chart .bar { fill: var(--ink); }
.chart rect.bar:last-of-type { fill: var(--accent); }
.cal-cell.today .cal-day { background: var(--accent); }
.cal-labels .sat { color: var(--ink); } .cal-labels .sun { color: var(--accent); }
.entry-head .who, .athlete-head .who { color: var(--text); text-decoration: none; }
.entry-link, .entry-link:hover { text-decoration: none; color: inherit; }
.cal-entry, .cal-plan { text-decoration: none; }
input:focus, select:focus, textarea:focus { outline-color: var(--ink); }
.flash { background: var(--subtle); border-left: 4px solid var(--ink); }
.flash-success { background: var(--subtle); color: var(--text); border-left-color: var(--ink); }
.flash-error { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); }
.warn { color: var(--accent); font-weight: 700; }

/* ---- コーチ機能 ---- */
.comments .comment { border-top: 1px solid var(--line); padding: 10px 0; }
.comments .comment:first-of-type { border-top: 0; }
.comment.from-coach { border-left: 3px solid var(--accent); padding-left: 10px; }
.comment-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.comment-body { margin-top: 4px; overflow-wrap: anywhere; }
.coach-card { border-top: 3px solid var(--accent); }
.athletes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.athletes .card { margin: 0; }
.athlete-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 16px; }
.athlete-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; }
.athlete-stats div { background: var(--subtle); border-radius: 8px; padding: 6px 10px; }
.athlete-stats dt { font-size: 12px; color: var(--muted); }
.athlete-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.athlete-stats small { font-weight: 400; color: var(--muted); margin-left: 2px; }
.feedback .body { margin-top: 8px; }
select { max-width: 100%; }
.entry, .entry-detail { border-left: 4px solid var(--type, var(--line)); }
.stat .num { overflow-wrap: normal; white-space: nowrap; }
.side-col .stat .num { font-size: 16px; }
.entry-head .when, .members a, .card-title .more { text-decoration: none; }
.entry-head .when:hover, .members a:hover { color: var(--accent); }
@media (max-width: 720px) {
  .nav { flex-wrap: wrap; justify-content: flex-start; overflow-x: visible; }
  .nav a { padding: 4px 8px; }
}

/* ==== ユニフォームのイメージ: 黒のトップ × 白の胸 × 赤のライン、ゼッケン ==== */
/* ロゴ: セリフ体の斜体、頭文字だけ赤 */
.wordmark { font-family: "Times New Roman", Georgia, "Hiragino Mincho ProN", serif; font-style: italic; font-weight: 700; font-size: 21px; letter-spacing: .01em; }
.wordmark .wm-accent { color: var(--accent); }
/* ヘッダー: 黒地（シャツの肩）+ 白の細線 + 赤のライン（パンツのサイドライン） */
.topbar { border-bottom: 0; box-shadow: 0 2px 0 #fff, 0 6px 0 var(--accent); margin-bottom: 6px; }
/* フッター: 黒のパンツに赤のサイドライン */
.footer { max-width: none; background: var(--ink); color: #bdbdbd; padding: 18px max(16px, calc((100% - 1040px) / 2 + 16px)) 40px; position: relative; margin-top: 24px; }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--accent); }
.footer a, .footer .linklike { color: #fff; text-decoration-color: var(--accent); }
/* 見出し下: 斜めの赤ライン */
.page-title::after { width: 44px; height: 5px; transform: skewX(-24deg); transform-origin: left; }
/* 数字はゼッケン風: 白地・黒の太枠・安全ピンの穴 */
.stat, .detail-metrics div, .athlete-stats div {
  background: #fff; border: 2px solid var(--ink); border-radius: 4px; position: relative;
  background-image: radial-gradient(circle, #c9c9c9 2px, transparent 2.5px), radial-gradient(circle, #c9c9c9 2px, transparent 2.5px),
                    radial-gradient(circle, #c9c9c9 2px, transparent 2.5px), radial-gradient(circle, #c9c9c9 2px, transparent 2.5px);
  background-size: 10px 10px; background-repeat: no-repeat;
  background-position: 3px 3px, calc(100% - 3px) 3px, 3px calc(100% - 3px), calc(100% - 3px) calc(100% - 3px);
}
.stat .label, .detail-metrics dt, .athlete-stats dt { color: var(--ink); font-weight: 700; letter-spacing: .04em; }
.stat .num, .detail-metrics dd { font-family: "Helvetica Neue", Arial, "Hiragino Sans", sans-serif; font-weight: 800; letter-spacing: -.01em; }
.stat .num { font-size: 26px; }
.side-col .stat .num { font-size: 18px; }
/* カード: 胸のパネルのような白、記録カードの左に黒（レースは赤）のライン */
.entry, .entry-detail { border-left-width: 5px; }
.tag { border-radius: 3px; letter-spacing: .03em; }
.card-title { font-weight: 800; }
.form-inline select { flex: 1; min-width: 160px; width: auto; }
.form-inline { align-items: center; }
/* メンバー管理 */
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.btn-on { background: var(--ink); color: #fff; }
.table-scroll { overflow-x: auto; }
tr.inactive td { color: var(--muted); }
.remove-athlete { margin-top: 8px; text-align: right; }
.remove-athlete .linklike { color: var(--muted); }
/* 振り返り画面 */
.summary-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .summary-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chart .bar.now { fill: var(--accent); }
.chart .wlbl { text-anchor: start; }
.advice-item { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.advice-item:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.advice-form textarea { min-height: 220px; }
/* 管理者メニュー */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.staff-card { display: flex; flex-direction: column; gap: 4px; margin: 0; text-decoration: none; color: var(--text); border: 2px solid var(--ink); border-radius: 4px; }
.staff-card:hover { color: var(--text); background: var(--subtle); }
.staff-card.alert { border-color: var(--accent); }
.staff-card.alert .staff-num { color: var(--accent); }
.staff-num { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.staff-num small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 2px; }
tr.suspect td { background: var(--accent-soft); }

/* ラップ */
.laps-box summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 6px 0; }
.laps-box summary::marker { color: var(--accent); }
.laps-box .form-grid { margin-top: 8px; }
.table.laps td, .table.laps th { padding: 6px 6px; }
.lap-bar-col { width: 28%; min-width: 80px; }
.lap-bar { width: 100%; height: 8px; display: block; }
.lap-bar rect { fill: var(--ink); }
tr.fastest td { color: var(--accent); }
tr.fastest .lap-bar rect { fill: var(--accent); }

/* コース */
.course-field { display: flex; flex-direction: column; gap: 4px; }
.metric.course { color: var(--muted); font-size: 13px; }
.lap-preview { min-height: 1em; }
.course-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.course-row:first-of-type { border-top: 0; }
.course-row .name { font-weight: 700; flex: 1; min-width: 160px; }

.field ul#id_course_type, .field #id_course_type { list-style: none; padding: 0; margin: 0; display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 14px; color: var(--text); }
#id_course_type label { font-weight: 400; color: var(--text); font-size: 14px; display: flex; gap: 4px; align-items: center; }
.course-group-title { font-size: 13px; color: var(--muted); margin: 14px 0 0; font-weight: 700; }
.course-group-title:first-child { margin-top: 0; }

[hidden] { display: none !important; }
.course-line { margin: 4px 0 0; font-size: 14px; }
.detail-metrics { align-items: start; }

.course-info { color: var(--ink); font-weight: 700; min-height: 1em; }

.dist-field { display: flex; flex-direction: column; gap: 4px; }
.dist-estimate { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; padding: 6px 10px;
  border-left: 3px solid var(--accent); background: var(--subtle); }
.dist-estimate b { font-size: 16px; }

/* レース */
.race-fields { border: 2px solid var(--ink); border-radius: 4px; padding: 10px 12px 12px; position: relative; }
.race-head { font-weight: 800; letter-spacing: .08em; font-size: 13px; color: #fff; background: var(--accent); display: inline-block; padding: 1px 10px; transform: skewX(-12deg); margin-bottom: 8px; }
.race-tag { display: inline-block; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 1px 7px; transform: skewX(-12deg); vertical-align: 2px; }
.race-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0; }
.race-banner .entry-title { margin: 0; }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.pb { display: flex; flex-direction: column; border: 2px solid var(--ink); border-radius: 4px; padding: 8px 12px; text-decoration: none; color: var(--text); }
.pb:hover { background: var(--subtle); color: var(--text); }
.pb-event { font-size: 12px; font-weight: 700; color: var(--accent); }
.pb-time { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pb-meta { font-size: 12px; color: var(--muted); }

/* 定型メニュー */
.menu-desc { margin: 6px 0; border-left: 3px solid var(--accent); padding: 4px 10px; background: var(--subtle); }
.menu-desc summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.menu-desc > div, .menu-desc-body { font-size: 14px; line-height: 1.7; }
#menu-template-desc-body { white-space: pre-wrap; padding: 4px 0; }
.menu-desc-body { border-left: 3px solid var(--accent); padding: 2px 12px; margin: 8px 0; }
.menu-card .card-title { margin-bottom: 6px; }
.menu-text { margin: 2px 0 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.course-row.is-off .name { color: var(--muted); }
.menu-template-field .muted { display: block; margin-top: 4px; }
.field input[type=checkbox] { width: auto; align-self: flex-start; margin: 4px 0; }

/* アドバイスへの質問 */
.questions { margin: 10px 0 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.qa { margin: 8px 0 12px; }
.qa .q, .qa .a { display: flex; gap: 10px; align-items: flex-start; }
.qa .a { margin: 6px 0 0 20px; padding: 6px 10px; background: var(--subtle); border-left: 3px solid var(--accent); }
.qa p { margin: 2px 0; }
.qa-label { flex: none; width: 22px; height: 22px; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--ink); color: #fff; margin-top: 2px; }
.qa .a .qa-label { background: var(--accent); }
.qa .qa-wait { margin: 4px 0 0 32px; }
.answer-box { margin: 6px 0 0 32px; }
.answer-box textarea { width: 100%; margin: 6px 0; }
.question-form { margin-top: 10px; }
.question-form textarea { width: 100%; }
.question-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* 総合アドバイスの入力欄（大きく・自動で広がる） */
.advice-editor { margin-top: 18px; }
.advice-editor-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.advice-editor-head .card-title { margin: 0; }
.advice-editor textarea.advice-body { width: 100%; min-height: 420px; font-size: 16px; line-height: 1.8; padding: 14px 16px; resize: vertical; }
.advice-editor-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.advice-editor-foot .char-count { margin-left: auto; }
.write-link { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); border: 2px solid var(--accent); }
.write-link:hover { color: var(--text); background: var(--subtle); }
.week-nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 4px 0 6px; }
.chart .wlbl.future { fill: #bbb; }

/* フッターを画面の一番下に（内容が短いページでも。長いページでは最後に表示） */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
body > header, body > footer { flex: none; width: 100%; }

/* タイムラインの「仲間」: スマホでは開閉できる（既定は閉じる）。PC では常に開いた見た目 */
.members-box > summary { list-style: none; display: flex; align-items: baseline; gap: 8px; margin: 0; }
.members-box > summary::-webkit-details-marker { display: none; }
.members-box[open] > summary { margin-bottom: 10px; }
.members-toggle { display: none; }
@media (max-width: 860px) {
  .members-box > summary { cursor: pointer; }
  .members-toggle { display: inline; margin-left: auto; color: var(--muted); }
  .members-toggle::after { content: "表示 ▾"; }
  .members-box[open] .members-toggle::after { content: "隠す ▴"; }
}
@media (min-width: 861px) { .members-box > summary { pointer-events: none; } }

/* ひとこと */
.tagline { margin: 6px 0 0; padding: 4px 0 4px 10px; border-left: 3px solid var(--accent); font-size: 15px; }
.my-tagline { margin-bottom: 10px; }
.my-tagline .tagline { margin-top: 0; }
.tagline-edit { margin-top: 6px; }
.tagline-edit summary { cursor: pointer; color: var(--muted); }
.tagline-form { display: flex; gap: 8px; margin: 6px 0 2px; }
.tagline-form input[type=text] { flex: 1; min-width: 0; }
.who-tag { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.members:has(.member-tag) { flex-direction: column; gap: 6px; }
.member-tag { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.tagline-history > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; margin: 0; }
.tagline-history > summary::-webkit-details-marker { display: none; }
.tagline-history > summary::after { content: "表示 ▾"; margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; }
.tagline-history[open] > summary::after { content: "閉じる ▴"; }
.th-list { list-style: none; padding: 0; margin: 10px 0 0; border-left: 2px solid var(--line); }
.th-list li { position: relative; padding: 4px 0 8px 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.th-list li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.th-list li:first-child .th-text { font-weight: 700; }
.th-text { flex: 1; min-width: 12em; }
.profile-head .bio { grid-column: 1 / -1; font-size: 14px; line-height: 1.8; background: var(--subtle); padding: 10px 14px; border-radius: 4px; }
.profile-head .bio p { margin: 0 0 6px; }
.profile-head > p.small { grid-column: 1 / -1; }

/* お知らせ（周知） */
.notice-board { border-top: 3px solid var(--accent); }
.notice-board .card-title { display: flex; align-items: baseline; }
.notice-board .more-links { margin-left: auto; display: flex; gap: 12px; }
.notice-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.notice-row:first-of-type { border-top: 0; }
.notice-row:hover .notice-title { color: var(--accent); }
.notice-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notice-title { font-weight: 700; }
.notice-title .pin { font-size: 11px; color: var(--accent); border: 1px solid var(--accent); border-radius: 3px; padding: 0 4px; }
.notice-when { font-size: 13px; }
.notice-kind { flex: none; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: var(--ink); color: #fff; margin-top: 2px; }
.notice-kind.kind-event { background: var(--accent); }
.notice-kind.kind-tip { background: #2f6f4f; }
.notice-detail .page-title { margin-top: 8px; }
.notice-facts { display: grid; gap: 4px; margin: 8px 0 12px; }
.notice-facts div { display: flex; gap: 12px; }
.notice-facts dt { color: var(--muted); min-width: 3em; }
.notice-facts dd { margin: 0; font-weight: 700; }
.cal-event { display: block; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 3px; padding: 0 4px; margin: 1px 0; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event:hover { color: #fff; opacity: .85; }
.past-notices > summary { cursor: pointer; }
.signup-tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 3px; padding: 0 4px; width: fit-content; }

/* フォロー */
.follow-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.follow-bar a { text-decoration: none; color: var(--text); }
.follow-bar a:hover { color: var(--accent); }
.btn-following { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-following:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.lock-mark { font-size: 12px; font-weight: 700; vertical-align: middle; border: 1px solid var(--muted); color: var(--muted); border-radius: 3px; padding: 1px 6px; }
.follow-mark { font-size: 11px; color: var(--accent); }
.tl-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tl-head .page-title { margin-right: auto; }
.tabs { display: flex; gap: 0; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; width: fit-content; margin: 6px 0 14px; }
.tabs .tab { padding: 6px 16px; text-decoration: none; color: var(--text); font-size: 14px; font-weight: 700; }
.tabs .tab + .tab { border-left: 2px solid var(--ink); }
.tabs .tab.on { background: var(--ink); color: #fff; }
.person-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.person-row:first-child { border-top: 0; }
.person-main { flex: 1; min-width: 180px; }
.person-main p { margin: 2px 0 0; }
.person-main .who { font-weight: 700; text-decoration: none; color: var(--text); }
.person-actions { display: flex; gap: 10px; align-items: center; }
.card.hint { border-left: 4px solid var(--accent); font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 700; }

.footer .version { opacity: .6; font-size: 12px; }

/* 管理者: 案内メール */
.mail-compose textarea { width: 100%; box-sizing: border-box; font-size: 14px; line-height: 1.7; }
.mail-compose input[type=text] { width: 100%; box-sizing: border-box; }
.mail-compose .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* タイム欄の横の「:」ボタン（スマホのテンキー用） */
.dur-wrap { display: flex; gap: 8px; align-items: stretch; }
.dur-wrap input { flex: 1; min-width: 0; }
.dur-colon { flex: none; min-width: 52px; padding: 0 14px; font-size: 22px; font-weight: 700; line-height: 1; touch-action: manipulation; }
