/* タイム＆ペース解析 */
.fg { margin-bottom: 20px; }
.field-label .small { font-weight: 400; margin-left: 4px; }
.two-g { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.two-g .field { margin-top: 0; margin-bottom: 14px; }
.hint { margin-top: 6px; }
.add-chip { border-style: dashed; color: var(--blue); }
.quick { display: flex; gap: 7px; overflow-x: auto; margin: 12px -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { flex: none; }
.chips.center { justify-content: center; }

/* 計測中 */
.run { display: flex; flex-direction: column; }
.run-master { background: var(--night); color: #fff; text-align: center; padding: 6px 16px 14px; }
.run-master span { display: block; font-size: 12px; color: #b9c9db; }
.run-master output { font-size: 52px; font-weight: 300; line-height: 1.1; letter-spacing: -.01em; }
.run-list { display: grid; gap: 10px; padding: 12px 16px; max-width: 1040px; margin: 0 auto; width: 100%; }
.racer { background: #fff; border: 1px solid var(--hair); border-radius: 14px; padding: 11px 12px 12px; }
.racer.done { background: var(--tile); }
.racer header { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.racer header span { font-size: 13px; color: var(--ink-3); }
.racer-times { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 2px 0 8px; }
.racer-t { font-size: 34px; font-weight: 500; line-height: 1.2; }
.racer-l { font-size: 14px; color: var(--ink-2); }
.racer-acts { display: grid; grid-template-columns: minmax(0, 1fr) 68px 68px; gap: 7px; }
.btn-lap { min-height: 66px; border: 0; border-radius: 11px; background: var(--blue); color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .12em; cursor: pointer; touch-action: manipulation; }
.btn-lap:active { background: var(--night); }
.btn-lap[disabled] { background: #c5d2df; cursor: default; }
.btn-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid #bccada; border-radius: 11px; background: #fff; color: var(--night); font-size: 17px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.btn-side small { font-size: 10.5px; font-weight: 400; color: var(--ink-3); }
.run-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px; max-width: 1040px; margin: 0 auto; width: 100%; }

/* 結果 */
.res { padding: 14px; }
.res-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.res-name { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.res-name b { font-size: 16px; }
.res-name .input { max-width: 150px; min-height: 40px; padding: 6px 9px; }
.res-t { font-size: 32px; font-weight: 600; line-height: 1.1; color: var(--night); }
.res-sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.tag .ic { margin-right: 3px; }
.tbl-wrap { overflow-x: auto; margin: 10px -2px 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl caption { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 14px 0 5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 4px 6px 5px 0; border-bottom: 1px solid #c3d0de; white-space: nowrap; }
.tbl td { padding: 8px 6px 8px 0; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.tbl .r { text-align: right; }
.lap-t td, .lap-t th { padding-right: 7px; }
.stk { width: 44px; height: 34px; border: 1px solid #bccada; border-radius: 6px; text-align: center; font-size: 15px; background: #fff; }
.res-note { margin-top: 14px; }

/* 計算 */
.calc-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--night); padding: 4px; border-radius: 11px; gap: 2px; }
.calc-tabs button { min-height: 42px; padding: 2px; border: 0; border-radius: 8px; background: none; color: #c5d3e2; font-size: 13px; font-weight: 600; cursor: pointer; }
.calc-tabs button.on { background: var(--gold); color: var(--night); }
.calc-body { margin-top: 12px; }
.unit-wrap { position: relative; display: block; }
.unit-wrap em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--ink-3); pointer-events: none; }
.time { font-size: 18px; letter-spacing: .02em; }
.step-l { margin-top: 0; }
.conv-g { margin-top: 14px; }
.big { margin-top: 16px; padding: 14px; background: var(--night); color: #fff; border-radius: 12px; text-align: center; }
.big span { display: block; font-size: 12px; color: #d9c083; }
.big output { font-size: 42px; font-weight: 500; line-height: 1.2; }
.big small { font-size: 14px; font-weight: 400; margin-left: 4px; color: #c5d3e2; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.mini-stats div { background: var(--tile); border-radius: 9px; padding: 8px 10px; }
.mini-stats b { display: block; font-size: 21px; font-weight: 600; color: var(--night); line-height: 1.25; }
.note { font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.note.lead { margin: 0 0 14px; }
.c-hint { margin-top: 14px; padding: 12px; background: var(--tile); border-radius: 9px; font-size: 13.5px; color: var(--ink-2); }
.zones { margin-top: 14px; }
.zone { padding: 10px 0 10px 12px; border-left: 4px solid var(--aqua); border-top: 1px solid var(--hair); }
.zone header { display: flex; align-items: baseline; gap: 7px; }
.zone header b { font-size: 14.5px; }
.zone header span { font-size: 12.5px; color: var(--ink-2); }
.zone header output { margin-left: auto; font-size: 15.5px; font-weight: 600; white-space: nowrap; }
.zone p { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.zone-s { color: var(--ink-3); }
.z0 { border-left-color: #cfe7f1; } .z1 { border-left-color: #9ad2e3; } .z2 { border-left-color: #0aa6c9; } .z3 { border-left-color: #0b5fb0; } .z4 { border-left-color: #0b2340; } .z5 { border-left-color: #c29a45; }

/* ペースクロック設定 */
.circle-pick { text-align: center; }
.circle-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 2px 0 12px; }
.circle-v { font-size: 60px; font-weight: 300; line-height: 1.1; min-width: 150px; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 1px solid #bccada; background: #fff; color: var(--night); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pc-opts { margin-top: 18px; }
.pc-opt { padding: 12px 0; border-top: 1px solid var(--hair); }
.pc-opt .field-label { margin-bottom: 7px; }
.pc-opt:first-child { display: flex; justify-content: space-between; align-items: center; }
.pc-opt:first-child .field-label { margin: 0; }
.row-opt { display: flex; justify-content: space-between; align-items: center; }
.row-opt .field-label { margin: 0; }
.toggle { width: 54px; height: 32px; border: 0; border-radius: 16px; background: #b6c5d4; position: relative; cursor: pointer; }
.toggle i { position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--blue); }
.toggle.on i { left: 25px; }
.pc-total { text-align: center; margin: 8px 0 12px; }

/* 全画面のペースクロック */
.pc { position: fixed; inset: 0; z-index: 100; background: var(--night); color: #fff; display: flex; flex-direction: column; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px calc(env(safe-area-inset-bottom, 0px) + 14px); overflow: hidden; }
.pc-top { width: 100%; max-width: 640px; display: flex; justify-content: space-between; align-items: baseline; }
.pc-rep b { font-size: 46px; font-weight: 500; line-height: 1; color: var(--gold); margin-right: 6px; }
.pc-rep span { color: #c5d3e2; font-size: 15px; }
.pc-circle { color: #c5d3e2; font-size: 15px; }
.pc-center { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.pc-dial { width: min(92vw, 62dvh); height: auto; }
.pc-digit { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; padding-top: 19vmin; }
.pc-digit span { font-size: 13px; color: #d9e3ee; background: rgba(11, 35, 64, .8); padding: 0 8px; border-radius: 4px; }
.pc-digit output { font-size: min(21vw, 13dvh); font-weight: 600; line-height: 1; text-shadow: 0 0 12px var(--night), 0 0 4px var(--night); }
.pc.soon .pc-digit output { color: var(--gold); }
.pc.finished .pc-digit output { color: var(--gold); font-size: min(15vw, 10dvh); }
.pc-bar { width: 100%; max-width: 640px; height: 5px; background: #24446b; border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.pc-bar i { display: block; height: 100%; width: 0; background: var(--aqua); }
.pc-btns { display: flex; align-items: center; gap: 22px; }
.pc-btns button { width: 56px; height: 56px; border-radius: 50%; border: 1px solid #47617f; background: none; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pc-btns .main { width: 72px; height: 72px; background: var(--gold); border-color: var(--gold); color: var(--night); }
@media (orientation: landscape) and (max-height: 520px) {
  .pc { display: grid; grid-template-columns: 1fr minmax(0, 88dvh) 1fr; grid-template-rows: auto minmax(0, 1fr) auto; align-items: center; }
  .pc-top { grid-column: 1; grid-row: 1 / 3; flex-direction: column; gap: 6px; align-self: start; }
  .pc-center { grid-column: 2; grid-row: 1 / 4; height: 100%; }
  .pc-dial { width: 86dvh; }
  .pc-bar { grid-column: 1; grid-row: 3; margin: 0; }
  .pc-btns { grid-column: 3; grid-row: 1 / 4; flex-direction: column; gap: 10px; }
  .pc-digit output { font-size: 24dvh; }
  .pc-digit { padding-top: 26dvh; }
}

/* 記録 */
.hist-mode { max-width: 240px; margin: 0 auto 12px; }
.filters { padding: 12px; margin-top: 0; }
.filter-row { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr; gap: 8px; align-items: end; }
.filter-row .field { margin: 0; }
.filter-row .input { padding-left: 8px; padding-right: 4px; font-size: 14.5px; }
.filter-row .seg button { min-height: 40px; font-size: 13px; }
.stat.best b { color: #e2c170; }
.chart { position: relative; margin-top: 4px; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; }
.chart-tip { position: absolute; top: -2px; transform: translateX(-50%); background: var(--night); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.legend-note { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.legend-note i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 6px 0 0; padding: 0; font-size: 13px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.sub-t { font-size: 15.5px; font-weight: 700; margin: 20px 0 8px; letter-spacing: .05em; }
.pb-tag { margin-left: 8px; }
.row-main b.num { font-size: 17px; display: flex; align-items: center; }
.rec-t { font-size: 40px; font-weight: 600; line-height: 1.2; }
.form-err { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 8px; }
.rows.inner { border-radius: 10px; margin-top: 4px; }
.pred { margin-top: 2px; }

@media (min-width: 720px) {
  .quick { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .run-list.multi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .run-list.multi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
