/* ============================================
   インターバルタイマー  v1
   - ダーク基調 / WrestleInsight 系のディープブルー
   - 巨大数字優先 / マットサイド・ジムでも読める
   ============================================ */

:root {
  /* ベースカラー（ダーク） */
  --bg: #0a1422;
  --bg-elev: #0f1d31;
  --surface: #18283f;
  --border: #2a3a55;

  /* テキスト */
  --text: #e8eef7;
  --text-dim: #9aabc4;

  /* ブランド系アクセント */
  --brand: #2e6cf6;      /* WrestleInsight ブルー想定 */
  --brand-strong: #1f54d6;

  /* 状態色 */
  --work: #ff6b35;       /* 作業中＝活性 */
  --rest: #4cc9f0;       /* 休憩中＝沈静 */
  --done: #06d6a0;       /* 完了 */

  /* 共通 */
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --duration: 200ms;

  /* タイポ */
  --font-num: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Meiryo", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

body {
  /* セーフエリア対応 */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button {
  font-family: inherit;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: 0.4; }

input {
  font-family: inherit;
  font-size: 1rem;
}

/* ============================================
   レイアウト
   ============================================ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1rem;
  max-width: 720px;
  margin: 0 auto;
}

/* トップバー */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.topbar__title {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  white-space: nowrap;
}
.topbar__brand {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.topbar__meta {
  flex: 1;
  text-align: center;
}
.round-label {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  transition: background var(--duration);
}
.icon-btn:hover { background: var(--bg-elev); }

/* ============================================
   メインディスプレイ（巨大数字＋円形プログレス）
   ============================================ */
.display {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  max-width: min(80vmin, 520px);
  width: 100%;
  margin: 0 auto;
  align-self: center;
}

.progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.progress__track {
  fill: none;
  stroke: var(--surface);
  stroke-width: 8;
}
.progress__bar {
  fill: none;
  stroke: var(--work);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 250ms linear, stroke 300ms ease;
}

.display__inner {
  position: relative;
  text-align: center;
}
.display__time {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: clamp(4rem, 22vmin, 11rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.display__phase {
  margin-top: 0.6rem;
  font-size: clamp(1rem, 3vmin, 1.4rem);
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.15em;
}

/* 状態クラス（body に付与） */
body[data-phase="work"] .progress__bar { stroke: var(--work); }
body[data-phase="work"] .display__phase { color: var(--work); }
body[data-phase="rest"] .progress__bar { stroke: var(--rest); }
body[data-phase="rest"] .display__phase { color: var(--rest); }
body[data-phase="done"] .progress__bar { stroke: var(--done); }
body[data-phase="done"] .display__phase { color: var(--done); }

/* 終了時のフラッシュ */
body[data-flash="true"] .display__time {
  animation: flashWhite 0.35s ease 3;
}
@keyframes flashWhite {
  0%, 100% { color: var(--text); }
  50% { color: #ffffff; text-shadow: 0 0 24px rgba(255,255,255,0.6); }
}

/* ============================================
   操作ボタン
   ============================================ */
.controls {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  min-height: 56px;
  padding: 0 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--surface);
  color: var(--text);
  transition: transform var(--duration), background var(--duration);
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn--primary {
  background: var(--brand);
  color: white;
  min-width: 140px;
}
.btn--primary:hover:not(:disabled) { background: var(--brand-strong); }
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover:not(:disabled) { background: var(--surface); }
.btn--small {
  min-height: 40px;
  padding: 0 1rem;
  font-size: 0.9rem;
}

.hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: -0.5rem 0 0;
}

/* ユーティリティチップ */
.utility {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding-bottom: 0.3rem;
}
.chip {
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  font-size: 0.85rem;
  transition: background var(--duration), color var(--duration);
}
.chip[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--brand);
}
.chip:hover { background: var(--bg-elev); color: var(--text); }

/* ============================================
   設定モーダル
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}
.modal__panel {
  position: relative;
  width: min(92vw, 480px);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
}
.modal__title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}
.modal__subtitle {
  margin: 1rem 0 0.6rem;
  font-size: 0.95rem;
  color: var(--text-dim);
}
.modal__actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.2rem;
}

.field {
  margin-bottom: 0.9rem;
}
.field > label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}
.time-input {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.time-input input {
  width: 64px;
  padding: 0.5rem 0.6rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.time-input input:focus,
.single-num:focus,
.preset-save input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.single-num {
  width: 80px;
  padding: 0.5rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* プリセットリスト */
.preset-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.preset-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.preset-item__name {
  flex: 1;
  font-weight: 600;
}
.preset-item__detail {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.preset-item__load,
.preset-item__delete {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.preset-item__load:hover { background: var(--bg); }
.preset-item__delete { color: #ff8585; }
.preset-empty {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.6rem 0;
}

.preset-save {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.preset-save input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

/* ============================================
   モード切替タブ
   ============================================ */
.tabs {
  display: flex;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem;
  align-self: center;
  width: min(100%, 360px);
}
.tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background var(--duration), color var(--duration);
}
.tab.is-active {
  background: var(--brand);
  color: white;
}
.tab:hover:not(.is-active) {
  color: var(--text);
}

.mode { display: none; }
.mode.is-active {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  flex: 1;
}
/* ストップウォッチ時はラウンド表示を非表示 */
body[data-mode="stopwatch"] .round-label { visibility: hidden; }

/* ============================================
   ストップウォッチ
   ============================================ */
.sw-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
}
.sw-label__hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding-left: 0.4rem;
}
.sw-label {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
}
.sw-label:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.sw-display {
  display: grid;
  place-items: center;
  padding: 1rem 0;
}
.sw-display__time {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: clamp(3rem, 16vmin, 7.5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}
body[data-sw="running"] .sw-display__time { color: var(--work); }
body[data-sw="stopped"] .sw-display__time { color: var(--done); }

.sw-display__hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* 種目チップ・名簿ボタン */
.event-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.event-chip[aria-pressed="true"] {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

/* 名前ボタングリッド（計測中のゴール記録） */
.name-grid-wrap {
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
}
.name-grid__hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  margin: 0 0 0.5rem;
}
.name-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.name-chip {
  min-height: 56px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--work);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.3rem 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  overflow: hidden;
}
.name-chip:active:not(:disabled) { transform: scale(0.96); }
.name-chip:disabled {
  opacity: 0.5;
  border-color: var(--border);
}
.name-chip__rank {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--done);
}

/* ストップ後の名前割り当てモード */
.assign-wrap {
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border: 2px solid var(--work);
  border-radius: 14px;
  padding: 0.8rem;
}
.assign-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.assign-target {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--work);
  font-variant-numeric: tabular-nums;
}
.assign-progress {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.assign-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

/* 名簿モーダル */
.roster-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 0.6rem;
  line-height: 1.5;
}
.roster-textarea {
  width: 100%;
  min-height: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  resize: vertical;
}
.roster-textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* 結果カードのプレビュー */
.card-preview-wrap {
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  max-height: 60vh;
  overflow: auto;
}
.card-preview {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* ラップ記録ボタン（実行中だけ表示） */
.btn--lap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 86px;
  border-radius: 18px;
  background: var(--work);
  color: white;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: none;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.35);
  transition: transform var(--duration), background var(--duration);
}
.btn--lap:hover { background: #ff7e4d; }
.btn--lap:active { transform: scale(0.98); }
.btn--lap__sub {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0;
}

/* ラップリスト */
.lap-list-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  max-height: 200px;
  overflow-y: auto;
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
}
.lap-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.lap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.lap-list li {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  padding: 0.25rem 0.2rem;
  border-bottom: 1px dashed var(--border);
}
.lap-list li:last-child { border-bottom: none; }
.lap-list li.is-new {
  animation: lapFlash 0.5s ease;
}
@keyframes lapFlash {
  0% { background: rgba(255, 107, 53, 0.35); }
  100% { background: transparent; }
}
.lap-list__rank {
  color: var(--work);
  font-weight: 800;
}
.lap-list__time {
  color: var(--text);
  font-weight: 700;
}
.lap-list__diff {
  color: var(--text-dim);
  font-size: 0.78rem;
}
.pb-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(90deg, #ffb703, #ff8800);
  color: #1a1100;
  white-space: nowrap;
}
.pb-badge--first {
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ============================================
   記録一覧
   ============================================ */
.records {
  margin-top: 0.4rem;
  padding: 0 0.2rem;
}
.records__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.records__head-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.chip--accent {
  border-color: var(--work);
  color: var(--text);
}
.records__title {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0;
  font-weight: 600;
}
.records__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.records__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}
.records__dt {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
}
.records__label {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.records__label--empty {
  color: var(--text-dim);
  font-style: italic;
}
.records__time {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.records__empty {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0.6rem 0;
  text-align: center;
}

/* 一覧モーダル内のテーブル */
.modal__panel--wide { width: min(92vw, 620px); }

.records-tools {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.copy-status {
  font-size: 0.8rem;
  color: var(--done);
  min-height: 1.2em;
  margin: 0 0 0.4rem;
}
.records-table-wrap {
  max-height: 50vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.records-table {
  width: 100%;
  min-width: 540px;  /* モバイルでは横スクロール */
  border-collapse: collapse;
  font-size: 0.88rem;
}
.records-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.records-table tbody td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.records-table tbody tr:last-child td { border-bottom: none; }
.records-table .col-dt { width: 5.5rem; white-space: nowrap; }
.records-table .col-time { width: 5rem; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.records-table .col-actions { width: 3rem; text-align: right; }
.records-table .col-label { min-width: 7rem; }
.records-table .col-lap { width: 2.5rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.records-table .col-name { min-width: 7rem; }
.records-table .col-dt,
.records-table tbody td.col-dt { color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.records-table .label-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.88rem;
}
.records-table .col-label__text {
  color: var(--text);
  font-size: 0.88rem;
}
.records-table .col-label__text--empty {
  color: var(--text-dim);
  font-style: italic;
}
.records-table .label-input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
.records-table .row-delete {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: #ff8585;
}
.records-table .row-delete:hover { background: rgba(255,133,133,0.08); }

/* ============================================
   筋トレ記録モード（Max測定日用）
   ============================================ */
.st-head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.st-date-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.st-date-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.st-date {
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.st-date:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.st-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

.st-grid-wrap {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.st-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.st-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.st-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}
.st-table thead th.st-col-name {
  text-align: left;
  padding-left: 0.7rem;
}
.st-unit {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-dim);
  opacity: 0.8;
}
.st-table tbody td {
  padding: 0.35rem 0.35rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}
.st-table tbody tr:last-child td { border-bottom: none; }
.st-table td.st-name {
  text-align: left;
  padding-left: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
}
.st-table td.st-name .st-name__id {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.st-cell-input {
  width: 100%;
  min-width: 3.4rem;
  max-width: 4.6rem;
  padding: 0.45rem 0.3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.95rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.st-cell-input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
.st-cell-input.is-pb {
  border-color: #ffb703;
}
.st-cell-wrap {
  position: relative;
  display: inline-block;
}
.st-pb-mark {
  position: absolute;
  top: -6px;
  right: -2px;
  font-size: 0.7rem;
  line-height: 1;
  pointer-events: none;
}

.st-records-table { min-width: 560px; }
.st-records-table thead th,
.st-records-table tbody td { text-align: center; }
.st-records-table thead th.col-dt,
.st-records-table thead th.col-name,
.st-records-table tbody td.col-dt,
.st-records-table tbody td.st-rec-name { text-align: left; }
.st-records-table .st-rec-name { white-space: nowrap; font-weight: 600; }

/* ============================================
   レスポンシブ
   ============================================ */
@media (orientation: landscape) and (max-height: 520px) {
  /* マットサイド・ジム壁掛け想定の横向き */
  .app {
    grid-template-rows: auto 1fr auto;
    gap: 0.6rem;
    padding: 0.6rem;
  }
  .display { max-width: min(70vmin, 360px); }
  .display__time { font-size: clamp(3rem, 28vmin, 8rem); }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
