:root {
  --bg: #e9eef6;
  --panel: #fbfdff;
  --ink: #1b1f23;
  --muted: #5b6b80;
  --line: #d5deec;
  --accent: #1f3a5f;
  --accent-2: #b34d3e;
  --accent-3: #2f6fa3;
  --soft: #dde5f1;
  --shadow: 0 18px 45px rgba(20, 38, 63, 0.14);
  --app-stable-vh: 100vh;
}

@supports (height: 100svh) {
  :root {
    --app-stable-vh: 100svh;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.mobile-round-scroll-locked {
  height: var(--app-stable-vh);
  min-height: var(--app-stable-vh);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(150, 175, 210, 0.28), transparent 34vw),
    linear-gradient(180deg, #eef2f8 0%, var(--bg) 46%, #dde7f3 100%);
  color: var(--ink);
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

.kana-input {
  ime-mode: active;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(16px);
  background: #1f3a5f;
  color: #fff;
  padding: 12px 26px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(17, 28, 45, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2000;
}
.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.save-error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #c0392b;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: none;
}
.save-error-banner:not([hidden]) {
  display: flex;
}
.save-error-banner span { flex: 1; }
.save-error-banner button {
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.save-error-banner button:hover { background: rgba(255,255,255,0.15); }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px clamp(14px, 3vw, 28px);
  border-bottom: 1px solid rgba(95, 115, 150, 0.28);
  background: rgba(251, 253, 255, 0.58);
  backdrop-filter: blur(10px);
}

.header-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}
.brand-reload {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.user-menu a {
  color: var(--accent);
  text-decoration: none;
}

.user-menu a:hover {
  text-decoration: underline;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  font-weight: 760;
  white-space: nowrap;
}

h2 {
  font-size: 14px;
  white-space: nowrap;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.meta,
.panel-header p {
  color: var(--muted);
  font-size: 12px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 10px clamp(14px, 3vw, 28px) 28px;
}

main {
  min-width: 0;
  padding: 0;
}

.club-view-active .app-shell {
  width: min(1600px, 100%);
  padding-right: clamp(8px, 1vw, 14px);
  padding-left: clamp(8px, 1vw, 14px);
  padding-bottom: 8px; /* 表の下に無駄な余白を残さない(既定28pxを詰める) */
}





.side-menu {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  align-self: start;
  position: sticky;
  top: 0;
  z-index: 5;
  width: 100%;
}

.side-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(251, 253, 255, 0.94);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.side-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.side-tab.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.side-tab-round-mobile {
  display: none;
}

.app-view[hidden] {
  display: none;
}

/* 分析(ラウンド分析/クラブ分析/クラブHDCP)のサブタブ */
.analysis-subtabs {
  display: inline-flex;
  gap: 6px;
  margin: 0 0 10px;
}
/* 未選択も白く塗って背景と同化させない(トップのタブと同じ見え方に) */
.analysis-subtab {
  padding: 7px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
/* メモは同一ビュー内で切り替えるため button を使う。見た目は上のリンク版と揃える。 */
button.analysis-subtab {
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  appearance: none;
}
.analysis-subtab:hover {
  border-color: var(--accent);
}
.analysis-subtab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (max-width: 640px) {
  /* タブ数が多いメモ(6つ)でも横1列に入るよう、隙間は詰める。 */
  .analysis-subtabs { display: flex; width: 100%; gap: 4px; }
  .analysis-subtab { flex: 1; min-width: 0; text-align: center; padding: 9px 0; font-size: 12px; }
}

.master-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}



.admin-view-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 高さと文字の大きさは基本設定のボタン(.settings-form button)に揃える */


.jga-import-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#updateCourseMaster,
#editCourseMaster,
#dryRunJgaImport,
#executeJgaImport {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

#updateCourseMaster:disabled,
#editCourseMaster:disabled,
#dryRunJgaImport:disabled,
#executeJgaImport:disabled {
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
  opacity: 1;
}

.jga-import-body {
  display: grid;
  gap: 10px;
  padding: 12px 16px;
}

/* パネルの途中に置く紺帯なので、上端は丸めない */
.jga-import-panel .panel-header-accent {
  border-radius: 0;
}

/* hole別Yards。ゴルフ場を選ぶボタンと説明を一列で */
.import-prep-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.import-prep-hint {
  color: var(--muted);
  font-size: 13px;
}

/* PCはファイル選択の右に、スマホは下に、ボタンを一列で並べる。
   折り返しに任せず格子にして、必ず右に来るようにする。 */
.jga-import-file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-content: start;
  align-items: center;
  gap: 12px;
}

.jga-import-file-row .jga-import-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 標準のファイル入力は隠し、ボタンと選択状態の表記を自前で出す */
.jga-import-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.jga-import-file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  /* スマホはファイル選択の下に、3つを一列で */
  .jga-import-file-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .jga-import-file-row .jga-import-actions {
    grid-column: 1 / -1;
  }

  .jga-import-file-row .jga-import-actions button {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* 出す内容が無いときは行ごと畳んで、無駄な余白を作らない */
.jga-import-status:empty {
  display: none;
}

.jga-import-status {
  min-height: 22px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.jga-import-status.is-busy {
  border-color: #d8c774;
  background: #fff8d9;
  color: #5e4d00;
  font-weight: 700;
}

.jga-import-status.is-success {
  border-color: #9bd0a1;
  background: #e8f7e9;
  color: #176325;
  font-weight: 700;
}

.jga-import-status.is-error {
  border-color: #e2aaa2;
  background: #fff0ee;
  color: #9b2b20;
  font-weight: 700;
}

.jga-import-result {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
  max-width: 960px;
}

.jga-import-result div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.jga-import-result dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.jga-import-result dd {
  margin: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}



















.course-alias-panel,
.course-side-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.course-alias-actions,
.course-side-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.course-alias-actions button,
.course-side-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

#updateCourseAlias,
#editCourseAlias,
#updateCourseSide,
#editCourseSide {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.course-alias-actions button:disabled,
.course-side-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#updateCourseAlias:disabled,
#editCourseAlias:disabled,
#updateCourseSide:disabled,
#editCourseSide:disabled {
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
  opacity: 1;
}

.course-alias-wrap,
.course-side-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: auto;
}

.course-alias-table,
.course-side-table {
  width: 100%;
  table-layout: fixed;
  font-size: 12px;
  height: auto !important;
}

.course-alias-table th,
.course-alias-table td,
.course-side-table th,
.course-side-table td {
  height: 22px !important;
  padding: 1px 10px !important;
  line-height: 1.05 !important;
  text-align: left;
  vertical-align: middle;
}

.course-alias-table thead,
.course-alias-table tbody,
.course-side-table thead,
.course-side-table tbody {
  height: auto !important;
}

.course-alias-table thead tr,
.course-alias-table tbody tr,
.course-side-table thead tr,
.course-side-table tbody tr {
  height: 22px !important;
}

.course-alias-table thead th,
.course-side-table thead th {
  background: var(--accent);
  color: #fff;
  text-align: center;
}

.course-alias-table .sort-button,
.course-side-table .sort-button {
  width: 100%;
  min-height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 760;
  text-align: inherit;
}

.course-alias-table tbody tr:nth-child(odd),
.course-side-table tbody tr:nth-child(odd) {
  background: #eef2f8;
}

.course-alias-table tbody tr:nth-child(even),
.course-side-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.course-alias-table .course-alias-select-col,
.course-side-table .course-side-select-col {
  width: 46px;
  text-align: center;
}

.course-alias-table .course-alias-id-col,
.course-side-table .course-side-id-col {
  width: 90px;
}

.course-alias-table .course-alias-course-id-col,
.course-side-table .course-side-course-id-col,
.course-side-table .course-side-order-col {
  width: 90px;
}

.course-alias-table .course-alias-course-name-col,
.course-side-table .course-side-course-name-col {
  width: 220px;
}

.course-alias-table .course-alias-type-col,
.course-side-table .course-side-source-col {
  width: 140px;
}

.course-admin-loading-row {
  height: 44px !important;
  text-align: center !important;
  color: var(--muted);
  font-weight: 700;
}

.course-admin-error-row {
  height: 44px !important;
  text-align: center !important;
  color: #9f1d1d;
  background: #fff5f5;
  font-weight: 700;
}

.course-alias-edit-input,
.course-side-edit-input {
  width: 100%;
  height: 20px;
  min-height: 20px;
  padding: 0 8px;
  font-size: 12px;
}

.course-alias-table input[type="checkbox"],
.course-side-table input[type="checkbox"] {
  width: 13px;
  height: 13px;
  min-height: 0;
  padding: 0;
  margin: 0;
}

button,
select,
input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

button {
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 4px 8px;
  margin-bottom: 3px;
}
.filters .filter-year { flex: 0 0 120px; }
.filters .filter-course { flex: 1 1 200px; min-width: 170px; }
/* 検索はフル幅にせず、クラブHDCPの「ゴルフ場」と同程度の幅に収める(/listのみ。homeclubの操作ボタン群には効かせない) */
.filters:not(.homeclub-filters) .filter-search { flex: 0 1 340px; min-width: 200px; }
/* メタ行(最新のラウンド/計算対象)は常に独立した全幅1行・右寄せ。
   検索ボックスやボタンと同じ行に乗って潰さないようにする。 */
.filters .latest-round-meta { flex: 0 0 100%; margin-left: auto; }

.search-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  min-width: 0;
}

.search-filter-row button {
  min-width: 64px;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
}

/* ゴルフ場フィルター(スマホ): 検索モーダルを開くタップ欄。PCでは非表示。 */
.mobile-course-btn {
  display: none;
  align-items: center;
  gap: 8px;
  height: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  box-sizing: border-box;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
}
.mobile-course-btn #mobileCourseBtnLabel,
.mobile-course-btn #homeclubCourseBtnLabel,
.mobile-course-btn .mcb-label { overflow: hidden; text-overflow: ellipsis; }
.mobile-course-btn.has-value { color: var(--accent); }
.mobile-course-btn .mcb-chev { margin-left: auto; flex: 0 0 auto; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--muted); }

/* ゴルフ場検索モーダル(ボトムシート) */
.course-modal-dim { position: fixed; inset: 0; background: rgba(15,26,45,.42); z-index: 60; }
.course-modal-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; display: flex; flex-direction: column; max-height: 85vh; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(17,28,45,.25); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.course-modal-handle { width: 40px; height: 5px; border-radius: 3px; background: #cdd6e4; margin: 9px auto 4px; }
.course-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 10px; }
.course-modal-head h3 { font-size: 16px; font-weight: 800; color: var(--accent); margin: 0; }
.course-modal-x { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 15px; font-weight: 800; cursor: pointer; }
.course-modal-search { margin: 0 16px 8px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--accent); border-radius: 11px; background: #fff; padding: 0 12px; height: 46px; }
.course-modal-search svg { flex: 0 0 auto; }
.course-modal-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 700; color: var(--ink); }
.course-modal-options { overflow: auto; -webkit-overflow-scrolling: touch; padding: 0 10px 10px; }
.course-modal-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 12px; border: 0; background: transparent; border-radius: 11px; font-size: 15px; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.course-modal-opt.sel { background: #eaf1fb; color: var(--accent); font-weight: 800; }
.course-modal-opt.course-modal-all { font-weight: 800; color: var(--accent); }
.cmo-name { flex: 1; min-width: 0; }
.cmo-sub { font-size: 11px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.cmo-chk { margin-left: auto; flex: 0 0 auto; color: var(--accent); font-weight: 800; }
.course-modal-divi { height: 1px; background: #eef2f8; margin: 2px 12px; }
.course-modal-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

.input-panel {
  margin-bottom: 10px;
}

.round-form {
  display: grid;
  /* 上段(日付〜グリーン)も下段(19項目のパレット)も1行に収まる分割数 */
  grid-template-columns: repeat(38, minmax(0, 1fr));
  gap: 6px 8px;
  padding: 8px 12px 10px;
}

.round-form label {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.round-form .field-small {
  text-align: center;
}

.round-form .percent-field::after {
  content: "%";
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 20;
  padding: 5px 8px;
  border-radius: 4px;
  background: #1b1f23;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.12s ease;
}

.round-form .percent-field:focus-within::after,
.round-form .percent-field:hover::after {
  opacity: 1;
}

.round-form input,
.round-form select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.field-small input {
  padding: 0 6px;
}

.round-form input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.round-form input[type="number"]::-webkit-inner-spin-button,
.round-form input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.round-form.view-mode input {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.round-form.view-mode .field-small input {
  text-align: center;
}

.round-form.view-mode input[readonly] {
  background: transparent;
  color: var(--ink);
}

.round-form.view-mode input:focus {
  outline: none;
}

.field-date,
.field-normal {
  grid-column: span 4;
}

.field-course {
  grid-column: span 9;
}

.field-sub-course,
.field-front-course,
.field-back-course,
.field-tee-input,
.field-color-input,
.field-green-input {
  grid-column: span 4;
}

.field-jga-actions {
  display: flex;
  align-items: end;
  gap: 6px;
  grid-column: span 5;
}

/* サイズ・書体は /list の「クリア」(.search-filter-row button)に合わせる。色は各所のまま。 */
.field-jga-actions button,
.field-jga-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.field-jga-actions button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* 保存・クリア・削除は縮めない(枠からはみ出させない) */
.field-schedule-save button {
  flex: 0 0 auto;
}

.field-color-input,
.field-start-input {
  grid-column: span 3;
}

.field-tee-input {
  grid-column: span 4;
}

.field-sub-course,
.field-green-input {
  grid-column: span 5;
}

.field-small {
  grid-column: span 2;
}


.field-score,
.field-yards,
.field-cr,
.field-sr,
.field-shots,
.field-putts,
.field-ob,
.field-fw,
.field-par-on,
.field-bogey-on,
.field-adjustment,
.field-adjusted-score,
.field-diff,
.field-hdcp,
.field-bunker,
.field-penalty {
  grid-column: span 2;
}

/* パレット(スコア〜推定HDCPの19項目)。PCは横1行に並べる。
   自動配置に任せると、表示モードで「エリア検索」が消えたぶん上段に入り込んで
   途中で折り返すため、専用の枠を作って19分割にしている。 */
/* 19項目を均等割りで1行に並べる。
   「スクランブル率」「Putts per GIR」は枠より少し長いが、
   見出しは折り返さず枠の外へはみ出させる（隣は短い見出しなのでぶつからない）。 */
.round-metrics {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(19, minmax(0, 1fr));
  gap: 6px 8px;
  min-width: 0;
}

.round-metrics .field-small {
  grid-column: auto;
  min-width: 0;
  overflow: visible;
}

.field-scramble,
.field-pgir,
.field-sga {
  grid-column: span 2;
}

/* 19項目を1行に並べるため、見出しは小さめ。折り返さない。 */
.round-form .field-small {
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

.field-yards {
  grid-column: 1 / span 2;
}

.round-form input[readonly] {
  background: var(--soft);
  color: var(--muted);
}

.round-form.view-mode input,
.round-form.view-mode input[readonly] {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.round-form.view-mode .percent-field::after {
  opacity: 0;
}

.round-form.view-mode .field-jga-actions {
  display: none;
}

.round-form.view-mode .percent-field.has-percent-value::after {
  content: "%";
  top: 50%;
  right: 7px;
  left: auto;
  z-index: 1;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  opacity: 1;
  transform: translateY(4px);
}

.round-form.view-mode .field-small {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  min-height: 58px;
  height: 58px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
  text-align: center;
}

.round-form.view-mode .field-small input,
.round-form.view-mode .field-small input[readonly] {
  min-height: 22px;
  padding: 0;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.round-form.view-mode .field-small.percent-field.has-percent-value::after {
  top: 50%;
  right: 7px;
  left: auto;
}

.form-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  margin-top: 6px;
}

.form-actions button {
  min-height: 28px;
  padding: 0 10px;
}

.form-actions button:first-child,
.form-actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.confirm-dialog {
  width: min(360px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(27, 31, 35, 0.22);
}

.confirm-dialog form {
  display: grid;
  gap: 16px;
  padding: 4px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-actions button:last-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.error {
  color: var(--accent-2) !important;
}

.round-load-error-row td {
  padding: 18px 12px;
  color: var(--accent-2);
  font-weight: 700;
  text-align: center;
  white-space: normal;
  background: #fff7f5;
}

.login-page {
  min-height: 100vh;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.login-panel {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 253, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin-bottom: 4px;
}

.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-panel input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
}

.login-panel .password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.login-panel .password-field input {
  padding-right: 42px;
}

.login-panel button {
  min-height: 34px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.login-panel button.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-height: 26px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}

.login-panel button.password-toggle:hover,
.login-panel button.password-toggle:focus-visible {
  border-color: var(--accent);
  background: #fff;
  color: var(--accent);
}

.login-error {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

.login-success {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.login-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.filters label {
  position: relative;
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.filters select,
.filters input {
  width: 100%;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  box-sizing: border-box;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-suggestions button {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.search-suggestions button:last-child {
  border-bottom: 0;
}

.input-course-suggestions {
  top: calc(100% + 2px);
  font-size: 12px;
  white-space: normal;
}

.input-course-area-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.input-course-area-row:last-child {
  border-bottom: 0;
}

.input-course-area-row span {
  color: var(--muted);
}

.input-course-area-empty {
  padding: 20px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.input-course-area-panel {
  grid-column: 1 / -1;
  /* round-form の左右 padding(12px) を打ち消し、ラウンド情報/詳細のヘッダ帯と同じパネル全幅にする */
  margin-left: -12px;
  margin-right: -12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.input-course-area-header {
  display: grid;
  grid-template-columns: minmax(64px, auto) 1fr minmax(64px, auto);
  align-items: center;
  min-height: 42px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.input-course-area-header span {
  text-align: center;
}

.input-course-area-header button {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.input-course-area-header button:first-child {
  text-align: left;
}

.input-course-area-header button:last-child {
  text-align: right;
}

.input-course-area-list {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.round-field-suggestions {
  top: calc(100% + 2px);
  font-size: 12px;
  white-space: normal;
}

.latest-round-meta:empty { display: none; } /* 文言が空のときは高さを取らない */
.latest-round-meta {
  align-self: end;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.stats-title {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
}

.stat {
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.stat .value {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 253, 255, 0.94);
  box-shadow: var(--shadow);
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}

.round-detail-link {
  display: inline;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.round-detail-link:hover {
  color: var(--accent);
  background: transparent;
}

.score-detail-panel {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  font-size: 14px;
}

.round-work-view-active .input-panel,
.round-work-view-active .score-detail-panel,
.round-work-view-active .round-form,
.round-work-view-active .score-detail-section,
.round-work-view-active .score-detail-meta,
.round-work-view-active .score-detail-meta dl,
.round-work-view-active .score-detail-meta div,
.round-work-view-active .score-detail-meta dt,
.round-work-view-active .score-detail-meta dd,
.round-work-view-active .score-detail-memo,
.round-work-view-active .score-detail-memo textarea,
.round-work-view-active .score-detail-tables,
.round-work-view-active .score-table-wrap,
.round-work-view-active .score-detail-table,
.round-work-view-active .score-detail-table th,
.round-work-view-active .score-detail-table td {
  background: #fff;
}

.round-work-view-active .input-panel > .panel-header,
.round-work-view-active .score-detail-panel > .panel-header {
  border-bottom-color: var(--accent);
  background: var(--accent);
  color: #fff;
  /* パネル(角丸8px)からヘッダーの角がはみ出さないよう上端を丸める */
  border-radius: 8px 8px 0 0;
}

.round-work-view-active .input-panel > .panel-header h2,
.round-work-view-active .score-detail-panel > .panel-header h2 {
  color: inherit;
}

.round-work-view-active .input-panel > .panel-header p,
.round-work-view-active .score-detail-panel > .panel-header p {
  color: rgba(255, 255, 255, 0.9);
}

.score-detail-panel-header {
  align-items: center; /* 見出し「ラウンド詳細」を帯の上下中央に */
}

.score-detail-panel-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.score-detail-actions {
  display: flex;
  gap: 8px;
}

/* ハイパー入力/戻る: /list の「クリア」と同じサイズ・書体(色は既存のまま) */
.score-detail-actions button {
  min-width: 64px;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

#saveScoreDetail {
  border-color: #1f3a5f;
  background: #1f3a5f;
  color: #fff;
}

.score-detail-section {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.score-detail-section:last-child {
  border-bottom: 0;
}

.score-detail-section h3,
.score-side h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.score-detail-meta dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0 0 10px;
  border-top: 1px solid var(--line);
}

.score-detail-meta:empty {
  display: none;
}

.score-detail-meta div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.score-detail-meta dt,
.score-detail-meta dd {
  margin: 0;
  padding: 9px 10px;
}

.score-detail-meta dt {
  background: transparent;
  font-weight: 700;
}

.score-course-row dd {
  display: grid;
  gap: 10px;
}

.score-inline-select {
  display: grid;
  gap: 4px;
  font-weight: 700;
}

.score-inline-select select {
  width: 100%;
  height: 36px;
}

.score-detail-value {
  display: inline-block;
  min-height: 22px;
}

.score-detail-memo {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.score-detail-memo textarea {
  width: 100%;
  box-sizing: border-box;
  max-height: 220px;
  font-size: 14px;
  background: transparent;
  resize: vertical;
  overflow: auto;
}

.score-detail-memo textarea:disabled {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  opacity: 1;
}

.score-detail-memo-view {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.score-detail-meta dt,
.score-detail-table th,
.score-detail-table td {
  background: transparent;
}

.score-detail-tables {
  display: grid;
  gap: 16px;
}

.score-side-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-course-name {
  min-width: 80px;
  max-width: 100%;
  color: var(--muted);
  font-weight: 700;
}

.score-course-select {
  width: min(220px, 100%);
  min-height: 30px;
  padding: 3px 8px;
  font-weight: 700;
}

.score-table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 0.5px solid #dde5f1;
  border-radius: var(--border-radius-md);
}

.score-detail-table {
  min-width: 720px;
  table-layout: fixed;
  font-size: 13px;
}

.score-detail-table th {
  font-weight: 800;
}

.score-detail-table thead th {
  border-top: 0;
  background: #eef2f8;
}

.score-detail-table thead th:first-child {
  background: #dde5f1;
}

.score-detail-table th,
.score-detail-table td {
  width: 58px;
  padding: 2px 4px;
  text-align: center;
}

.score-detail-table th:first-child {
  width: 96px;
  text-align: left;
}

.score-detail-score-row th,
.score-detail-score-row td,
.score-detail-score-row .score-detail-total,
.score-detail-score-row .score-detail-cell-value,
.score-detail-score-row .score-detail-input {
  font-weight: 800;
}

/* round-work-view では `.score-detail-table th{background:#fff}` の強制白が効くため、
   同じ .round-work-view-active 接頭辞＋高い詳細度で色を上書きする。 */
/* HOLE行(thead): 紺＋白抜き数字 */
.round-work-view-active .score-detail-table thead th {
  background: #1f3a5f;
  color: #fff;
}
/* PAR行: 淡色を塗る(項目名セル th も含む) */
.round-work-view-active .score-detail-table tr.score-row-par th,
.round-work-view-active .score-detail-table tr.score-row-par td {
  background: #eef2f8;
}
/* 下段の控えめ交互ゼブラ(項目名セル th も含めて塗る) */
.round-work-view-active .score-detail-table tr.score-row-putts th,
.round-work-view-active .score-detail-table tr.score-row-putts td,
.round-work-view-active .score-detail-table tr.score-row-penalty th,
.round-work-view-active .score-detail-table tr.score-row-penalty td,
.round-work-view-active .score-detail-table tr.score-row-teeShot th,
.round-work-view-active .score-detail-table tr.score-row-teeShot td {
  background: #f6f9fd;
}
.score-detail-cell-value.score-zero {
  color: #aeb6c4;
  font-weight: 400;
}

.score-detail-par-row th,
.score-detail-par-row td,
.score-detail-par-row .score-detail-total,
.score-detail-par-row .score-detail-cell-value {
  color: var(--muted);
  font-weight: 800;
}

.score-detail-input {
  width: 44px;
  height: 28px;
  box-sizing: border-box;
  padding: 3px;
  font-size: 13px;
  text-align: center;
}

.score-detail-cell-value {
  display: inline-block;
  box-sizing: border-box;
  min-width: 20px;
  min-height: 18px;
  line-height: 18px;
}

.score-result {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  line-height: 1;
  font-weight: 800;
  isolation: isolate;
}

.score-result-birdie,
.score-result-eagle {
  border: 2px solid #d23b36;
  border-radius: 999px;
}

.score-result-eagle {
  box-shadow: 0 0 0 2px #d23b36 inset;
}

.score-result-bogey {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  overflow: visible;
}

.score-result-bogey::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -2;
  width: 25px;
  height: 23px;
  background: #1f3a5f;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  pointer-events: none;
  transform: translate(-50%, -52%);
}

.score-result-bogey::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 21px;
  height: 19px;
  background: #fbfdff;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  pointer-events: none;
  transform: translate(-50%, -47%);
}

.score-result-double {
  border: 2px solid #7db9de;
}

.score-result-triple {
  border: 3px double #315da8;
}

.tee-shot-input {
  width: 48px;
}

.tee-club-input {
  font-size: 11px;
}

.score-detail-total {
  font-weight: 800;
}
/* 閲覧専用スコアカードの「閉じる」(左下) */
.score-detail-close-row { padding: 4px 16px 16px; }
.score-detail-close-row button {
  border: 1px solid var(--line, #d7e0ee);
  border-radius: 8px;
  background: #fff;
  color: #1f3a5f;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  cursor: pointer;
}
.score-detail-close-row button:hover { background: #f6f9fe; }

/* holeShots が真実のホールは集計セルを編集不可(自動集計)として淡く塗る */
.score-cell-derived {
  background: #eef7ea;
}

/* ===== PCラウンド詳細: ハイパー入力モーダル(B案) ===== */
/* 可視制御は .open クラス一本。閉状態は必ず display:none(全画面要素がクリックを奪うのを防ぐ)。 */
.pch-overlay { position: fixed; inset: 0; z-index: 1200; display: none; }
.pch-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.pch-backdrop { position: absolute; inset: 0; background: rgba(17, 28, 45, 0.5); }
.pch-modal {
  position: relative; z-index: 1; margin: 3vh auto; width: min(880px, 94vw); max-height: 94vh;
  display: flex; flex-direction: column; background: #fff; border: 1px solid #d7e0ee; border-radius: 14px;
  box-shadow: 0 18px 48px rgba(17, 28, 45, 0.28); overflow: hidden;
}
.pch-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #eef2f8; }
.pch-title { font-size: 17px; font-weight: 800; color: #1f3a5f; }
.pch-title span { display: block; font-size: 12px; font-weight: 600; color: #6b7686; margin-top: 3px; }
.pch-close { border: 1px solid #d7e0ee; border-radius: 8px; background: #fff; color: #6b7686; font-size: 13px; font-weight: 700; padding: 8px 14px; cursor: pointer; }
.pch-close:hover { background: #f6f9fe; }
.pch-pager { display: flex; gap: 5px; padding: 10px 14px; overflow-x: auto; align-items: center; border-bottom: 1px solid #eef2f8; background: #f8fafd; }
.pch-grp { font-size: 10px; color: #6b7686; font-weight: 800; margin: 0 4px; }
.pch-hole { min-width: 40px; padding: 6px 0; border: 1px solid #d7e0ee; border-radius: 8px; background: #fff; color: #1b1f23; font-weight: 800; font-size: 13px; position: relative; cursor: pointer; }
.pch-hole small { display: block; font-size: 8px; color: #6b7686; font-weight: 700; }
.pch-hole.on { background: #1f3a5f; color: #fff; border-color: #1f3a5f; }
.pch-hole.on small { color: #c9d6ea; }
.pch-hole.done::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: #2f6b3f; }
.pch-body { padding: 16px 18px; overflow-y: auto; }
.pch-cur { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.pch-cur-main { display: flex; align-items: center; gap: 14px; }
.pch-nav-head { flex: 0 0 auto; }
.pch-hole-badge { background: #1f3a5f; color: #fff; border-radius: 10px; padding: 6px 18px; text-align: center; }
.pch-hole-badge small { display: block; font-size: 10px; opacity: .85; }
.pch-hole-badge b { font-size: 22px; }
.pch-par { color: #6b7686; font-weight: 700; }
.pch-par b { color: #1b1f23; font-size: 18px; }
.pch-totals { display: flex; gap: 10px; }
.pch-tot { border: 1px solid #d7e0ee; border-radius: 10px; padding: 6px 16px; text-align: center; min-width: 92px; background: #f6f9fe; }
.pch-tot .k { font-size: 11px; color: #6b7686; font-weight: 700; }
.pch-tot .v { font-size: 24px; font-weight: 800; color: #1f3a5f; line-height: 1.1; }
.pch-tot .auto { font-size: 9px; color: #2f6b3f; font-weight: 800; border: 1px solid #cfe6c6; border-radius: 5px; padding: 0 3px; }
/* ホール単位のピン位置・傾斜(1打目の実効飛距離の補正) */
/* 選択肢と数値は内容ぶんの幅だけにして1列に並べる(.pch-sel/.pch-num の width:100% を打ち消す) */
.pch-adj { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.pch-adj .k { flex: 0 0 auto; font-size: 12px; font-weight: 800; color: var(--muted); }
.pch-adj .pch-sel { flex: 0 0 auto; width: 108px; height: 32px; font-size: 13px; }
.pch-adj .pch-num { flex: 0 0 auto; width: 76px; height: 32px; font-size: 13px; }
/* 数値欄の後ろに小さく単位を出す */
.pch-adj-num { flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 3px; }
.pch-adj-num i { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }
.pch-adj b { flex: 0 0 auto; font-size: 13px; font-weight: 800; color: var(--accent); }
.pch-adj-note { flex: 0 1 auto; min-width: 0; margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); text-align: right; }
.pch-shots { display: flex; flex-direction: column; gap: 10px; }
.pch-shot { border: 1px solid #d7e0ee; border-radius: 12px; padding: 12px 14px; }
.pch-shot.putt { background: #fff; border-color: #d7e0ee; }
.pch-shot-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pch-no { width: 28px; height: 28px; border-radius: 50%; background: #1f3a5f; color: #fff; font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.pch-lbl { font-weight: 800; font-size: 14px; color: #1f3a5f; }
.pch-shot.putt .pch-lbl { color: #1f3a5f; }
.pch-del { margin-left: auto; border: 0; background: transparent; color: #9aa6b6; font-size: 18px; font-weight: 800; cursor: pointer; line-height: 1; }
.pch-del:hover { color: #c8102e; }
.pch-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.pch-f { display: flex; flex-direction: column; gap: 4px; }
.pch-f > span { font-size: 10px; color: #6b7686; font-weight: 800; padding-left: 2px; }
.pch-sel, .pch-num { height: 40px; border: 1px solid #d7e0ee; border-radius: 9px; background: #fff; color: #1b1f23; font-weight: 700; font-size: 14px; padding: 0 10px; width: 100%; }
.pch-num { text-align: right; }
.pch-fx { height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #1f3a5f; border-radius: 9px; color: #1f3a5f; font-weight: 800; font-size: 13px; }
.pch-fx.pch-putt { border-color: #1f3a5f; color: #1f3a5f; }
.pch-fx.pch-na { border-style: dashed; border-color: #d7e0ee; color: #b7c0cd; }
/* 参照モードの表(案②): 見出しは1行だけ・数値右揃え・クラブ/飛距離を強調 */
.pch-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pch-table th { color: #7a8699; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 11px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid #d7e0ee; }
.pch-table td { height: 52px; padding: 0 12px; font-size: 14px; font-weight: 700; color: #7a8699; border-bottom: 1px solid #eef2f8; }
.pch-table tbody tr:nth-child(odd) { background: #f8fafd; }
.pch-table .pch-c { text-align: center; }
.pch-table .pch-r { text-align: right; }
.pch-pill { display: inline-block; font-size: 11px; font-weight: 800; color: #1f3a5f; background: #e9eff9; border-radius: 5px; padding: 2px 9px; }
.pch-table .pch-club { font-size: 18px; font-weight: 800; color: #1b1f23; }
.pch-table .pch-carryv { font-size: 19px; font-weight: 800; color: #1f3a5f; }
.pch-table .pch-rem { font-size: 15px; font-weight: 800; color: #1b1f23; }
.pch-table .pch-st { font-size: 13px; font-weight: 700; color: #7a8699; }
.pch-table .pch-dirv { font-size: 16px; font-weight: 800; color: #1f3a5f; }
.pch-u { font-size: 10px; color: #7a8699; font-weight: 600; margin-left: 1px; }
.pch-dash { color: #c3cbd8; }
.pch-shot.penalty { background: #fdf0f0; border-color: #f0c7c7; }
.pch-shot.penalty .pch-lbl { color: #c8102e; }
.pch-dirs { display: flex; gap: 4px; height: 40px; }
.pch-dirs .pch-dir { flex: 1; border: 1px solid #d7e0ee; border-radius: 8px; background: #fff; color: #6b7686; font-size: 14px; font-weight: 800; cursor: pointer; }
.pch-dir.on { background: #1f3a5f; color: #fff; border-color: #1f3a5f; }
.pch-dir.ok.on { background: #2f6b3f; border-color: #2f6b3f; }
.pch-carry { height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d7e0ee; border-radius: 9px; background: #fff; color: #1f3a5f; font-weight: 800; font-size: 14px; }
.pch-empty { color: #6b7686; font-size: 13px; padding: 18px; text-align: center; border: 1px dashed #d7e0ee; border-radius: 12px; }
.pch-add { margin-top: 12px; width: 100%; border: 1px dashed #d7e0ee; border-radius: 12px; background: #f6f9fe; color: #1f3a5f; font-size: 14px; font-weight: 800; padding: 13px; cursor: pointer; }
.pch-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pch-counters { display: flex; gap: 10px; }
.pch-counters .c { min-width: 92px; border: 1px solid #d7e0ee; border-radius: 10px; padding: 7px 12px; text-align: center; color: #6b7686; font-size: 12px; font-weight: 700; background: #f6f9fe; }
.pch-counters .c b { display: block; color: #1b1f23; font-size: 18px; }
.pch-nav { display: flex; gap: 8px; }
.pch-prev { border: 1px solid #d7e0ee; border-radius: 10px; background: #fff; color: #1f3a5f; font-size: 13px; font-weight: 800; padding: 11px 18px; cursor: pointer; }
.pch-prev:disabled { opacity: .4; cursor: default; }
.pch-next { border: 0; border-radius: 10px; background: #2f6b3f; color: #fff; font-size: 14px; font-weight: 800; padding: 12px 22px; cursor: pointer; }
.pch-note { color: #6b7686; font-size: 11px; line-height: 1.6; margin-top: 12px; }
/* 参照モードのフッター: バンカー/OB/ペナルティの右に注記を下辺揃えで置く */
.pch-foot-ro { display: flex; align-items: flex-end; gap: 16px; margin-top: 14px; }
.pch-note-side { flex: 1; margin: 0; color: #6b7686; font-size: 11px; line-height: 1.6; }
@media (max-width: 720px) {
  .pch-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== ラウンド分析 ===== */
.round-analysis-root { padding: 12px 16px 20px; }
/* フィルタは /list と同じ .filters を流用(見た目・幅も共通)。 */
.round-analysis-root .filters { margin-bottom: 10px; }
/* KPIは指標ごとに独立したパレット(カード)。 */
/* KPIは11指標を必ず1行に収める(幅は等分・文字は詰める)。 */
.ra-kpi { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.ra-k { border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 5px 7px; min-width: 0; }
.ra-klab { font-size: 9px; color: var(--muted); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.ra-kval { position: relative; font-size: 15px; font-weight: 800; color: var(--accent); white-space: nowrap; text-align: center; }
/* 1ホール当たりの平均パット。大きい数字は中央のまま、小さい数字だけ右端に寄せる。 */
.ra-ksub { position: absolute; right: 0; bottom: 0; font-size: 10px; font-weight: 700; color: var(--muted); }
/* 説明チップ: 1マスが細いので折り返して出す。右端の3つは画面外に出ないよう右寄せにする。 */
.ra-k.has-tooltip::after { width: max-content; max-width: 240px; white-space: normal; line-height: 1.5; text-align: left; }
.ra-k.has-tooltip:nth-last-child(-n+3)::after { left: auto; right: 0; transform: none; }
.ra-k.has-tooltip:nth-child(-n+2)::after { left: 0; transform: none; }
/* タブはPCでは非表示(全セクションを一覧)。スマホのみ表示。 */
.ra-tabs { display: none; }
/* 左右をペアにして同じ行で揃える(左:HOLE PAR別平均 ↔ 右:カップイン率 …) */
.ra-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; align-items: start; }
.ra-cell { min-width: 0; }
.ra-sec { margin-bottom: 14px; }
.ra-sech { font-size: 12px; font-weight: 800; color: var(--accent); margin: 0 0 5px; }
.ra-sech em { font-size: 10px; color: var(--muted); font-weight: 700; font-style: normal; margin-left: 6px; }
/* 表は白カードに載せてページ背景(淡い青灰)と分離する。 */
.ra-secw { overflow-x: auto; background: #fff; border: 1px solid #c9d5e6; border-radius: 10px; padding: 8px 12px 10px; box-shadow: 0 1px 2px rgba(20, 38, 63, .06); }
/* table-layout:fixed で、各表のデータ列を等幅に揃える。 */
/* 見出し列は内容ぶんの最小幅にして、数値列に幅を回す(table-layout:auto + width:1px) */
.ra-tbl { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; table-layout: auto; }
/* 罫線は横線のみ。塗り(紺ベタ・薄青・ゼブラ)は使わず、数字のコントラストを優先。 */
.ra-tbl th, .ra-tbl td { border: 0; padding: 5px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ヘッダー行のみ紺色。データ行は薄い水色と白の交互(ラウンド入力と同じ色)。 */
.ra-tbl thead th { background: var(--accent); color: #fff; font-weight: 800; font-size: 11px; text-align: right; }
.ra-tbl thead th:first-child { text-align: left; }
/* PCは見出し列を共通幅に固定し、上下に並ぶ表で列位置を揃える(最長「ダブルボギー以上」が収まる幅)。 */
.ra-tbl thead th:first-child, .ra-tbl .ra-rh { width: 168px; min-width: 168px; white-space: nowrap; }
/* データ列は同じ指定幅を与えて残り幅を等分させる(見出し列は内容幅のまま) */
.ra-tbl thead th:not(:first-child), .ra-tbl td.ra-num { width: 100px; }
/* 行ラベル列も明細行と同じ交互色にする(行の色を継承) */
.ra-tbl .ra-rh { background: inherit; color: #111820; font-weight: 700; text-align: left; }
.ra-tbl td.ra-num { text-align: right; font-weight: 700; color: #111820; }
.ra-tbl tbody tr:nth-child(odd) { background: #eef2f8; }
.ra-tbl tbody tr:nth-child(even) { background: #fbfdff; }
.ra-diff { color: var(--accent-2); font-weight: 800; }
.ra-n { color: var(--muted); font-size: 10px; font-weight: 600; }
/* コース距離別は6列に母数まで入って横に長いので、見出し列と余白を詰める。
   この表は上下に並ぶ表と列を揃える必要がないため、見出し列は内容ぶんでよい。 */
.ra-tbl-course thead th:first-child, .ra-tbl-course .ra-rh { width: 1px; min-width: 0; }
.ra-tbl-course th, .ra-tbl-course td { padding: 5px 6px; }
.ra-placeholder { border: 1px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.8; }
.ra-legend { font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 3px; }
/* 凡例: PCは「 / 」区切りで1行、スマホは1件ずつ改行。 */
.ra-legend-lines .ra-lg + .ra-lg::before { content: "　/　"; }
/* 表はPCが通常・スマホが転置。既定はPC。 */
.ra-t-mb { display: none; }
/* スマホ用KPIパレット(=/list の Stats と同じ見た目)はPCでは出さない。 */
.ra-kpi-panel { display: none; }
/* 画面が狭くなっても1行を維持(文字だけさらに詰める)。 */
@media (max-width: 1200px) {
  .ra-kpi { gap: 4px; }
  .ra-k { padding: 4px 5px; }
  .ra-klab { font-size: 8px; }
  .ra-kval { font-size: 13px; }
}
@media (max-width: 640px) {
  .round-analysis-root { padding: 8px 10px 16px; }
  /* スマホは /list と同じ Stats パレット(見出し=KPI・折りたたみ可)を使う */
  .ra-kpi { display: none; }
  .ra-kpi-panel { display: block; margin-bottom: 10px; }
  .ra-kpi-panel.summary-collapsed .summary-wrap { display: none; }
  /* 列の多い表は転置版に差し替える */
  .ra-t-pc { display: none; }
  .ra-t-mb { display: block; }
  /* 転置後は横スクロール不要。overflow-x:auto は overflow-y も auto になり
     入れ子スクロール(スクロールが終わらない挙動)の原因になるため解除する(白カードは維持)。 */
  .ra-secw { overflow: visible; padding: 6px 10px 8px; }
  /* スマホは幅が狭いので見出し列は内容ぶんの最小幅に戻す(数値の省略を防ぐ) */
  .ra-tbl thead th:first-child, .ra-tbl .ra-rh { width: 1px; min-width: 0; }
  /* 凡例は1件ずつ改行(区切り記号は出さない) */
  .ra-legend-lines .ra-lg { display: block; }
  .ra-legend-lines .ra-lg + .ra-lg::before { content: none; }
  /* パター別は転置せず5列出すため、狭い端末でも入るよう余白と見出しを詰める */
  .ra-tbl-putters th, .ra-tbl-putters td { padding: 5px 4px; }
  .ra-tbl-putters thead th { font-size: 10px; }
  /* スマホはセグメント(4つ1段・全幅)。 */
  .ra-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-bottom: 10px; }
  .ra-tab { border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--accent); font-size: 12px; font-weight: 800; padding: 9px 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ra-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
  .ra-pair { display: block; }
  .ra-active-score [data-ra-group]:not([data-ra-group="score"]),
  .ra-active-putt [data-ra-group]:not([data-ra-group="putt"]),
  .ra-active-approach [data-ra-group]:not([data-ra-group="approach"]),
  .ra-active-shot [data-ra-group]:not([data-ra-group="shot"]) { display: none; }
}

.settings-panel {
  max-width: 920px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

/* 3列のときだけ、左端から始めるカードを決める。
   これが無いと、後ろのカードが前の行の空きに入り込む。
   2列・1列のときは詰めて並べたいので、この指定は当てない。 */
@media (min-width: 901px) {
  .settings-card-newline {
    grid-column: 1;
  }
}

.settings-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 253, 255, 0.88);
}

.settings-card h3 {
  margin: 0;
  font-size: 13px;
}

.settings-info {
  display: grid;
  gap: 8px;
  margin: 0;
}

.settings-info div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
}

.settings-info dt,
.settings-form label,
.settings-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-info dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.settings-form label {
  display: grid;
  gap: 4px;
}

.settings-form input {
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
}

.settings-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  height: 34px;
  min-height: 34px;
  min-width: 92px;
  font-size: 13px;
  font-weight: 700;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  text-align: center;
  line-height: 1;
}

.mfa-setup-panel,
.mfa-disable-form {
  display: grid;
  gap: 8px;
}

.mfa-setup-panel[hidden],
.mfa-disable-form[hidden] {
  display: none;
}

.mfa-qr-code {
  display: grid;
  place-items: center;
  width: 196px;
  min-height: 196px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mfa-qr-code[hidden] {
  display: none;
}

.mfa-qr-code img,
.mfa-qr-code canvas,
.mfa-qr-code svg {
  width: 180px;
  height: 180px;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.table-check {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.table-check input {
  min-height: 0;
}

.summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.summary-actions label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-actions input {
  min-height: 0;
}
.scb-short { display: none; } /* PCでは長い文言。スマホでのみ短縮表示に切替 */
/* 計算対象カウント(クラブHDCP Stats): 「全て計算対象」チェックの左に置く */
.homeclub-calc-count { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.homeclub-calc-count:empty { display: none; }

.summary-collapse-toggle {
  display: none;
}

.table-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 28px;
  padding: 0 8px;
  text-align: center;
  white-space: nowrap;
}

.table-tools input {
  width: 180px;
  min-height: 28px;
  padding: 0 8px;
}

.table-tools .table-check input[type="checkbox"] {
  width: 13px;
  height: 13px;
  min-height: 0;
  padding: 0;
}

.table-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

canvas {
  display: block;
  width: 100%;
  height: 320px;
}

.ranking {
  display: grid;
  gap: 10px;
  padding: 14px 16px 18px;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 52px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  font-weight: 760;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank-count {
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.table-panel {
  margin-top: 8px;
}

.summary-panel {
  margin-bottom: 8px;
}

.club-compare-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
}

.cc-period-group,
.cc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cc-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.cc-sep {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.cc-sel {
  font-size: 13px;
  font-weight: 700;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  height: 30px;
  min-height: 30px;
  width: 115px;
  box-sizing: border-box;
  background: #fff;
}
.club-compare-inline button {
  font-size: 13px;
  padding: 0 14px;
  height: 30px;
  min-height: 30px;
  min-width: 62px;
  box-sizing: border-box;
  border-radius: 4px;
}
.club-compare-collapse-toggle {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  min-width: 34px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.club-compare-collapse-toggle:hover,
.club-compare-collapse-toggle:focus-visible {
  border-color: var(--accent);
  background: #fff;
  color: var(--accent);
}
/* クラブセッティング比較の見出し帯を /list の「Stats」帯と同一高さにする。
   既定の .panel-header(padding 6px 12px)＋既定 h2(14px)をそのまま使い、
   トグルは h2 の高さに収まるサイズにして帯の高さを h2 基準に揃える。 */
.club-compare-panel .club-compare-collapse-toggle { width: 26px; min-width: 26px; height: 20px; min-height: 20px; font-size: 15px; border-radius: 5px; }
.cc-btn-compare {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cc-btn-compare:hover { opacity: 0.85; }

.club-compare-table td.num {
  font-weight: 700;
}

/* デスクトップ: テーブル表示 */
.club-compare-desktop { display: block; }
.club-compare-mobile.cc-palette-grid { display: none; }

/* スマホ: パレット表示 */
.cc-palette-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 12px;
}
.cc-palette-title {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 4px;
}
.cc-palette-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  min-width: 0;
}
.cc-palette-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
  text-align: center;
}
.cc-palette-value {
  font-size: 16px;
  font-weight: 700;
}
.cc-palette-diff {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.club-comparison-result.club-compare-collapsed > * {
  display: none !important;
}
/* 折りたたみ時は期間・比較/クリアのフォームも隠す */
.club-comparison-form.club-compare-collapsed {
  display: none !important;
}
/* パネル単位でも確実に畳む(描画順に依存しない保険) */
.club-compare-panel.club-compare-collapsed .club-comparison-form,
.club-compare-panel.club-compare-collapsed .club-comparison-result {
  display: none !important;
}
.club-compare-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px 12px;
}
.club-compare-actions button { min-width: 64px; }
.club-compare-warning {
  padding: 8px 12px;
  color: #c0392b;
  font-weight: 600;
  font-size: 13px;
}
.club-view-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 100%;
}
.club-compare-panel {
  width: 100%;
}
.club-compare-table-wrap {
  padding: 0 12px 12px;
  overflow-x: auto;
}
.club-compare-table.summary-table td,
.club-compare-table.summary-table th { white-space: nowrap; }
.club-compare-period-label { font-size: 12px; min-width: 72px; }
.club-compare-row-diff td,
.club-compare-row-diff .club-compare-period-label { font-weight: 700; background: var(--soft); }
.club-compare-good { color: #1f3a5f; }
.club-compare-bad  { color: #c0392b; }

.club-panel {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.club-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.club-year-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.club-year-tab {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.club-year-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.club-actions,
.club-setting-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: 6px;
}

.club-actions button,
.club-setting-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  text-align: center;
  white-space: nowrap;
}

.club-settings {
  display: grid;
  gap: 8px;
  align-items: start;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 8px 2px;
  overflow-x: auto;
  overflow-y: visible;
}

.club-setting {
  overflow: hidden;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 253, 255, 0.9);
}

.club-setting-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
}

.club-date-input {
  width: 150px;
  min-height: 28px;
  font-weight: 700;
}

/* 変更メモ: PCでは日付のすぐ右から左寄せで伸ばす。閲覧時は枠なしのテキスト風、編集時は入力欄。 */
.club-setting-memo {
  flex: 1 1 auto;
  min-width: 120px;
  min-height: 28px;
  box-sizing: border-box;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  border: 0.5px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.club-setting-memo:disabled {
  border-color: transparent;
  background: transparent;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  opacity: 1;
}

.club-setting-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 14px;
  padding: 1px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.club-setting-stats-empty {
  color: var(--muted);
  font-size: 11px;
}
.club-stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.club-stat-label {
  color: var(--muted);
  font-size: 11px;
}
.club-stat-item strong {
  font-weight: 700;
  font-size: 12px;
}
/* グリップ〜バランスの表示切替ボタン(統計バー右端) */
.club-spec-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  height: 20px;
  min-height: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 0 9px;
  cursor: pointer;
}
.club-spec-toggle:hover { background: var(--panel); }
/* 折りたたみ時はグリップ〜バランス行を隠す */
.club-table.spec-collapsed .club-spec-detail { display: none; }
/* スマホ「クラブ分析」カード(既定=非表示。モバイル幅で表示) */
.club-mobile-analysis { display: none; }
.cma-title { font-size: 16px; font-weight: 800; color: var(--ink); margin: 2px 2px 8px; }
.cma-datebar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cma-datebar label { font-size: 12px; font-weight: 800; color: var(--muted); }
.cma-datebar select { flex: 1; font-size: 15px; font-weight: 800; color: var(--accent); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: #fff; }
.cma-memo { font-size: 11px; color: var(--muted); font-weight: 700; margin: -2px 2px 10px; }
.cma-segs { display: flex; gap: 6px; margin-bottom: 10px; }
.cma-segs button { flex: 1; font-size: 12px; font-weight: 800; border: 1px solid var(--line); border-radius: 8px; padding: 7px 4px; background: #fff; color: var(--accent); }
.cma-segs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cma-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 10px; overflow: hidden; }
.cma-head { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-bottom: 1px solid #eef2f8; }
.cma-badge { background: var(--accent); color: #fff; border-radius: 8px; font-weight: 800; font-size: 15px; padding: 5px 12px; min-width: 46px; text-align: center; }
.cma-name { font-weight: 800; font-size: 13px; line-height: 1.25; }
.cma-name small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; margin-top: 1px; }
.cma-use { margin-left: auto; text-align: right; }
.cma-use b { font-size: 15px; font-weight: 800; color: var(--accent); }
.cma-use b i { font-size: 10px; font-style: normal; }
.cma-use small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.cma-body { padding: 11px 13px 12px; }
.cma-dist { display: flex; gap: 8px; margin-bottom: 11px; }
.cma-dist3 { flex-direction: column; gap: 6px; } /* TEE/OTHER(FW)/OTHER(ラフ) を縦積み */
.cma-box { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.cma-dist3 .cma-v { font-size: 19px; }
/* クラブ分析カード: 見出しの横に主値、詳細は次行で折り返す(横あふれ防止) */
.cma-dline { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cma-dline .cma-k { flex: 0 0 auto; }
.cma-ave { flex: 0 0 auto; font-size: 15px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.cma-sub { margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.45; white-space: normal; word-break: break-word; }
.cma-k { font-size: 10px; color: var(--muted); font-weight: 800; }
.cma-v { font-size: 22px; font-weight: 800; color: var(--accent); line-height: 1.15; }
.cma-v .u { font-size: 12px; color: var(--muted); }
.cma-inl { font-size: 11px; color: var(--muted); font-weight: 700; }
.cma-r { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.cma-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid #eef2f8; font-size: 12px; }
.cma-lab { color: var(--muted); font-weight: 800; white-space: nowrap; }
.cma-chips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.cma-chip { font-size: 11px; font-weight: 800; border-radius: 6px; padding: 2px 8px; background: #eef3fb; color: var(--accent); }
.cma-chip.cma-g { background: #eef7ea; color: #2f6b3f; }
.cma-chip.cma-dash { color: #b7c0cd; background: #f3f5f9; }
.cma-faint { color: #b7c0cd; }
.cma-spec { border-top: 1px solid #eef2f8; }
.cma-spec summary { list-style: none; cursor: pointer; padding: 9px 13px; font-size: 12px; font-weight: 800; color: var(--accent); }
.cma-spec summary::-webkit-details-marker { display: none; }
.cma-spec dl { padding: 4px 13px 12px; display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 12px; }
.cma-spec dt { color: var(--muted); font-weight: 700; }
.cma-spec dd { text-align: right; font-weight: 700; }
.cma-empty { color: var(--muted); font-size: 12px; padding: 20px; text-align: center; }
.cma-note { color: var(--muted); font-size: 11px; line-height: 1.6; padding: 2px 4px 8px; }
/* 統計セクションのバンド行・小見出し・薄字
   (案1: 濃紺ベタをやめ、淡い帯＋紺文字でグループを示す) */
/* グループ見出し行(使用回数/TEE実効飛距離/方向傾向 等)は中間の紺＋白文字。
   ヘッダー(濃紺 var(--accent))との段階差をつけ、見出しであることを明確にする。 */
.club-table tbody tr.club-stat-band { background: #33507a; }
.club-table .club-stat-band th {
  background: #33507a;
  color: #fff;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}
.club-table .club-stat-sub {
  font-weight: 700;
  color: var(--accent-2, #1b2430);
}
.club-table .club-stat-faint { color: #b7c0cd; }
.club-table .club-stat-n { color: var(--muted); font-size: 10px; font-weight: 600; }

/* ラウンド分析と同じ「白カード＋軽い罫線」に統一(案1)。 */
.club-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  background: #fff;
  border: 1px solid #c9d5e6;
  border-radius: 10px;
  padding: 6px 10px 4px;
  box-shadow: 0 1px 2px rgba(20, 38, 63, .06);
}

/* 文字サイズ・行の縦幅はラウンド分析(.ra-tbl: 12px / 上下padding 5px / line-height normal / 行27.5px)に合わせる。 */
.club-table {
  width: max-content;
  min-width: 100%;
  font-size: 12px;
  line-height: normal;
  table-layout: fixed;
}

/* 行ラベル列も明細行と同じ交互色にする(行の色を継承)。 */
.club-table .club-field-label {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 108px;
  min-width: 108px;
  max-width: 108px;
  background: inherit;
  color: #111820;
  font-weight: 700;
  text-align: left;
}

.club-table th,
.club-table td {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
  padding: 5px 10px; /* ラウンド分析と同じ(行27.5px) */
  white-space: nowrap;
}

/* データ行は薄い水色と白の交互(ラウンド入力と同じ色)。セルは行の色を継承。 */
.club-table td { background: inherit; color: #111820; }
.club-table tbody tr:nth-child(odd) { background: #eef2f8; }
.club-table tbody tr:nth-child(even) { background: #fbfdff; }
/* カーソル行をハイライトして横方向に読み違えないように(縦幅は不変・PCのみ) */
.club-table tbody tr:hover { background: #e3edfa; }

/* 1行目(クラブ種類)はヘッダー行: 紺色。 */
.club-table tr:first-child .club-field-label,
.club-table tr:first-child td {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  border-bottom: 0;
}

.club-input {
  width: 100%;
  min-height: 20px;
  padding: 0 3px;
  overflow: hidden;
  font-size: 12px;
  line-height: normal;
  text-overflow: ellipsis;
}

.club-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 0 3px;
  overflow: hidden;
  background: transparent;
  color: inherit;
  font-size: 12px;
  line-height: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

select.club-input {
  text-align: center;
  text-align-last: center;
}

.club-table tr:nth-child(n + 8):nth-child(-n + 13) .club-value {
  justify-content: flex-end;
  text-align: right;
}

.club-table tr:nth-child(14) .club-value {
  justify-content: center;
}

.club-table tr:nth-child(-n + 7) .club-input {
  text-align: center;
}

.club-table tr:nth-child(n + 8):nth-child(-n + 13) .club-input {
  text-align: right;
}

.club-table tr:nth-child(14) .club-input {
  text-align: center;
}

.club-table tr:first-child .club-input {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-weight: 800;
}

.club-calculated {
  background: var(--soft);
  color: var(--muted);
}

.club-calculated-value {
  color: var(--muted);
}

.club-view-input {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.club-table tr:first-child .club-view-input {
  border-color: transparent;
  background: transparent;
  color: #fff;
}

.club-changed-value,
.club-changed-input {
  font-weight: 700;
}

/* 変更箇所のハイライト(PC・スマホ共通色)。計算セルのグレーが残らないよう内側背景は透明化。 */
.club-table td.club-changed-cell {
  background: #fbf3c4;
}
.club-changed-cell .club-value,
.club-changed-cell .club-input,
.club-changed-cell .club-calculated,
.club-changed-cell .club-calculated-value,
.club-changed-cell .club-view-input {
  background: transparent;
}

.club-mobile-summary {
  display: none;
}

.empty-club-year {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  max-height: 560px;
  overflow: auto;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.table-panel .table-wrap {
  max-height: none;
}

/* クラブ分析の表は縦スクロールさせず、内容の高さのまま伸ばす。
   .club-table-wrap は .table-wrap も併せ持つため、後方にある .table-wrap の
   max-height:560px に負けていた。ここで明示的に打ち消す。 */
.club-panel .club-table-wrap {
  max-height: none;
  overflow-y: visible;
  /* 縦スクロールしないのでスクロールバー用の予約幅(15px)は不要。右端の余白差の原因。 */
  scrollbar-gutter: auto;
}

.summary-wrap {
  max-height: none;
  overflow: visible;
}

.summary-total-palette {
  display: none;
}

.round-table {
  width: 100%;
  min-width: 1260px;
  font-size: 12px;
  table-layout: fixed;
}

.round-table th {
  background: var(--accent);
  color: #fff;
}

.round-table thead th {
  background: var(--accent);
  color: #fff;
}

.round-table thead th:nth-child(6),
.round-table thead th:nth-child(9) {
  border-right: 0 !important;
  border-left: 0 !important;
  box-shadow: none !important;
}

.summary-table {
  font-size: 12px;
  table-layout: fixed;
}

.summary-table .summary-hdcp-col {
  min-width: 62px;
  white-space: nowrap;
}

.summary-table th,
.summary-table td {
  min-width: 54px;
  white-space: nowrap;
}

.summary-table th:nth-child(2),
.summary-table td:nth-child(2),
.summary-table th:nth-child(6),
.summary-table td:nth-child(6),
.summary-table th:nth-child(7),
.summary-table td:nth-child(7),
.summary-table th:nth-child(8),
.summary-table td:nth-child(8) {
  min-width: 68px;
}

.round-table th,
.round-table td {
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
}

.round-table .course-col {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.round-table .sub-course-col {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round-table .tee-col {
  width: 96px;
  text-align: left;
  white-space: nowrap;
}

.round-table .green-col {
  width: 64px;
  text-align: left;
  white-space: nowrap;
}

.round-table .ob-col {
  width: 32px;
}

.round-table .metric-col {
  width: 54px;
  white-space: normal;
}

.round-table .adjusted-score-col {
  width: 46px;
  max-width: 46px;
  white-space: normal;
}

.round-table td.num {
  text-align: center;
}

.mobile-round-info {
  display: none;
}

.round-table th:nth-child(1),
.round-table td:nth-child(1) {
  width: 74px;
}

.round-table th:nth-child(6),
.round-table td:nth-child(6) {
  width: 46px;
}

.round-table th:nth-child(7),
.round-table td:nth-child(7) {
  width: 54px;
}

.round-table th:nth-child(8),
.round-table td:nth-child(8) {
  width: 46px;
}

.round-table th:nth-child(13),
.round-table td:nth-child(13) {
  width: 54px;
}

.round-table th:nth-child(14),
.round-table td:nth-child(14) {
  width: 40px;
}

.round-table th:nth-child(15),
.round-table td:nth-child(15) {
  width: 40px;
}

.round-table th:nth-child(16),
.round-table td:nth-child(16) {
  width: 32px;
}

.round-table th:nth-child(18),
.round-table td:nth-child(18),
.round-table th:nth-child(19),
.round-table td:nth-child(19) {
  width: 46px;
}

.summary-table th,
.summary-table td {
  text-align: center;
}

.summary-table td.num {
  text-align: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.summary-table th,
.summary-table td,
.round-table th,
.round-table td {
  height: 20px;
  padding-top: 2px;
  padding-bottom: 2px;
  line-height: 1.05;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e9eef6;
  color: #14263f;
  font-size: 12px;
}

/* 表の見出しは紺地に白。ゴルフ場マスターを消したとき、同じ規則に
   .master-table が並んでいたため規則ごと消してしまい、Stats と
   クラブセッティング比較の見出しが薄い水色になった(2026-09-10)。 */
.summary-table thead th,
.round-table thead th,
.course-alias-table thead th,
.course-side-table thead th {
  background: var(--accent);
  color: #fff;
}

.course-alias-table thead th,
.course-alias-table thead .sort-button,
.course-side-table thead th,
.course-side-table thead .sort-button {
  text-align: center;
}

.has-tooltip {
  position: relative;
  cursor: help;
}

.summary-table th.has-tooltip {
  position: sticky;
}

.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 10;
  min-width: max-content;
  padding: 5px 8px;
  border-radius: 4px;
  background: #1b1f23;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.12s ease;
}

.has-tooltip:hover::after {
  opacity: 1;
}

.sort-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
}

.sort-button:hover {
  color: var(--accent);
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 明細の縞。上と同じ理由で消してしまい、全部白になった(2026-09-10)。 */
.summary-table tbody tr:nth-child(odd),
.round-table tbody tr:nth-child(odd) {
  background: #eef2f8;
}

.summary-table tbody tr:nth-child(even),
.round-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.summary-table tbody tr.summary-muted-row {
  background: #eeeeee;
}

.summary-table tbody tr.summary-total-row {
  background: #e9eef6;
  font-weight: 800;
}

.summary-table tbody tr.summary-recent-row {
  background: #eef2f8;
  font-weight: 800;
}

.manual-row {
  background: inherit;
}

.source-badge {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .app-header {
    align-items: center;
    flex-direction: row;
    padding: 6px 14px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding-top: 8px;
  }

  .dashboard-view-active {
    min-height: var(--app-stable-vh);
  }

  .club-view-active,
  .settings-view-active {
    min-height: var(--app-stable-vh);
  }

  .dashboard-view-active .app-shell {
    min-height: calc(var(--app-stable-vh) - 54px);
  }

  .club-view-active .app-shell,
  .settings-view-active .app-shell {
    min-height: calc(var(--app-stable-vh) - 54px);
  }

  .side-menu {
    position: static;
    flex-wrap: nowrap;
    flex-direction: row;
    overflow-x: auto;
  }

  .side-tab {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 9px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }

  .filter-year {
    grid-column: span 1;
  }

  .filter-course {
    grid-column: span 3;
  }

  .filter-search,
  .latest-round-meta {
    grid-column: 1 / -1;
  }

  .round-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .summary-wrap {
    max-width: 100%;
    max-height: none;
    overflow: visible;
    touch-action: pan-x pan-y;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .summary-total-palette {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    min-width: 0;
    margin-bottom: 6px;
  }
  /* スマホのパレットには Yards/CR/SR を出さない
     (.summary-palette-item の display:grid が後方にあるため詳細度を上げる) */
  .summary-palette-item.summary-palette-course { display: none !important; }

  .summary-actions {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
  }

  .summary-actions label {
    display: none;
  }
  /* クラブHDCPのStats見出し帯(スマホ)は 計算対象カウント +「全て計算対象」チェックを表示する */
  .summary-actions {
    gap: 6px;
  }
  .homeclub-calc-count { font-size: 11px; }
  .summary-actions label.summary-calc-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
  }
  .summary-calc-all .scb-long { display: none; }
  .summary-calc-all .scb-short { display: inline; }

  .summary-collapse-toggle {
    display: inline-grid;
    place-items: center;
    width: 34px;
    min-width: 34px;
    min-height: 30px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--accent);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
  }

  .summary-collapse-toggle:hover,
  .summary-collapse-toggle:focus-visible {
    border-color: var(--accent);
    background: #fff;
    color: var(--accent);
  }

  .summary-panel.summary-collapsed .summary-wrap {
    display: none;
  }

  .summary-panel.summary-collapsed {
    margin-bottom: 8px;
  }

  .dashboard-view-active .table-panel .table-wrap {
    background: var(--panel);
    border-radius: 0 0 8px 8px;
  }

  .summary-palette-item {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 5px 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    text-align: center;
  }

  .summary-palette-item span {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .summary-palette-item strong {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .summary-table {
    display: none;
  }

  .summary-table th:first-child,
  .summary-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    background: inherit;
    box-shadow: 1px 0 0 var(--line);
  }

  .summary-table th:first-child {
    z-index: 4;
    background: var(--accent);
    color: #fff;
  }

  .summary-table th,
  .summary-table td {
    min-width: 64px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .club-panel {
    align-self: stretch;
    width: 100%;
    min-height: auto;
  }

  .club-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .club-year-tabs {
    gap: 3px;
  }

  .club-year-tab {
    min-height: 24px;
    padding: 0 7px;
  }

  .club-settings {
    width: 100%;
    padding: 6px;
    overflow: visible;
  }

  .club-setting {
    justify-self: stretch;
    width: 100%;
  }

  /* スマホ: クラブ画面は「クラブ分析」カードのみ表示(編集・一覧・ヘッダは隠す)。編集はPC。 */
  .club-panel > .panel-header { display: none; }
  .club-settings .club-setting { display: none; }
  .club-settings .empty-club-year { display: none; }
  .club-mobile-analysis { display: block; }
  /* overflow-x:auto は overflow-y も auto に変換され入れ子スクロールになる。
     スマホは横スクロールする表を出さないので解除し、ページのスクロールを1つに保つ。 */
  .club-settings { overflow: visible; }

  .club-setting-header {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .club-date-input {
    width: 132px;
  }

  .club-setting-actions {
    justify-content: flex-end;
    gap: 4px;
    margin-left: auto;
  }

  /* スマホ: 日付+ボタンの下に、メモを全幅で独立した1行として落とす。 */
  .club-setting-memo {
    order: 3;
    flex: 1 0 100%;
    min-height: 30px;
  }

  .club-setting-actions button {
    min-height: 28px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .club-table {
    display: none;
  }

  .club-table-wrap {
    width: 100%;
    display: none;
  }

  .club-compare-desktop { display: none; }
  .club-compare-mobile.cc-palette-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
  }
  .cc-palette-item {
    min-height: 54px;
    padding: 5px 6px 18px;
    border-radius: 8px;
  }
  .cc-palette-label {
    overflow: hidden;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cc-palette-value {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cc-palette-diff {
    bottom: 3px;
    right: 6px;
    font-size: 12px;
  }
  .club-compare-inline {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
  }
  .cc-period-group {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto minmax(0, 1fr);
    grid-column: 1 / -1;
    width: 100%;
  }
  .cc-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    width: 100%;
  }
  .club-compare-collapse-toggle {
    margin-left: auto;
  }
  .cc-sel { width: 100%; font-size: 12px; }

  .club-mobile-summary {
    display: grid;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .club-mobile-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 34px;
    border-bottom: 1px solid var(--line);
    background: #fbfdff;
  }

  .club-mobile-row:nth-child(odd) {
    background: #eef2f8;
  }

  .club-mobile-row:last-child {
    border-bottom: 0;
  }

  .club-mobile-row.club-mobile-changed {
    background: #fbf3c4;
  }

  .club-mobile-detail,
  .club-mobile-type {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 6px 8px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .club-mobile-detail {
    justify-content: flex-start;
  }

  .club-mobile-type {
    justify-content: center;
    border-right: 1px solid var(--line);
    background: var(--accent);
    color: #fff;
  }

  .club-table th,
  .club-table td {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    padding: 1px 2px;
  }

  .club-table .club-field-label {
    width: 104px;
    min-width: 104px;
    max-width: 104px;
  }

  /* スマホは従来どおり各欄を .round-form の格子に直接並べる（枠は無いものとして扱う） */
  .round-metrics {
    display: contents;
  }

  .field-date,
  .field-normal,
  .field-course,
  .field-small,
  .score-start {
    grid-column: auto;
  }

  .field-date,
  .field-normal,
  .field-course {
    grid-column: 1 / -1;
  }

  .field-date {
    grid-column: 1 / 3;
  }

  .field-course {
    grid-column: 3 / -1;
  }

  .field-jga-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .field-front-course {
    grid-column: 1 / 3;
  }

  .field-back-course {
    grid-column: 3 / -1;
  }

  .field-tee-input {
    grid-column: 2;
  }

  .field-color-input {
    grid-column: 3;
  }

  .field-green-input {
    grid-column: 4;
  }

  .score-start {
    grid-column-start: 1;
  }

  .field-yards {
    grid-column: 1;
  }

  .field-cr {
    grid-column: 2;
  }

  .field-sr {
    grid-column: 3;
  }

  .field-score {
    grid-column: 1;
  }

  .field-shots {
    grid-column: 2;
  }

  .field-putts {
    grid-column: 3;
  }

  .field-ob {
    grid-column: 4;
  }

  .field-fw {
    grid-column: 1;
  }

  .field-par-on {
    grid-column: 2;
  }

  .field-bogey-on {
    grid-column: 3;
  }

  .field-adjustment {
    grid-column: 4;
  }

  .field-adjusted-score {
    grid-column: 1;
  }

  .field-diff {
    grid-column: 2;
  }

  .field-hdcp {
    grid-column: 3;
  }

  .round-form.view-mode .field-small {
    height: 58px;
    min-height: 58px;
    padding: 6px 7px;
  }

  .round-form.view-mode .field-small input,
  .round-form.view-mode .field-small input[readonly] {
    min-height: 20px;
    font-size: 13px;
    line-height: 1.1;
  }

  .round-form.view-mode .field-small.percent-field.has-percent-value::after {
    top: 50%;
    right: 6px;
    left: auto;
    font-size: 13px;
  }

  .score-detail-actions {
    gap: 6px;
  }

  .score-detail-actions button {
    min-width: 58px;
    min-height: 30px;
    padding: 0 12px;
  }

  .score-detail-section {
    padding: 8px 6px;
  }

  .score-detail-tables {
    gap: 10px;
  }

  .score-side-title {
    gap: 6px;
  }

  .score-table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

  .score-detail-table {
    width: 100%;
    min-width: 0;
    font-size: 11px;
  }

  .score-detail-table th,
  .score-detail-table td {
    width: auto;
    padding: 2px 1px;
  }

  .score-detail-table th:first-child {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    font-size: 11px;
    white-space: nowrap;
  }

  .score-detail-input {
    width: 26px;
    height: 26px;
    min-height: 26px;
    padding: 1px;
    font-size: 12px;
  }

  .tee-shot-input {
    width: 30px;
    font-size: 11px;
  }

  .tee-club-input {
    width: 30px;
    font-size: 10px;
  }

  .score-detail-total {
    width: 28px;
    min-width: 28px;
  }

  canvas {
    height: 280px;
  }
}

@media (max-width: 900px) {
  /* 3列だと1枚が狭くなりすぎる幅。2列に落とす。 */
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .round-table th:nth-child(1),
  .round-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
    background: inherit;
  }

  .round-table th:nth-child(1) {
    z-index: 4;
    background: var(--accent);
    color: #fff;
  }

  .round-table .course-col {
    position: sticky;
    left: 74px;
    z-index: 2;
    background: inherit;
  }

  .round-table th.course-col {
    z-index: 4;
    background: var(--accent);
    color: #fff;
  }
}

@media (max-width: 640px) {
  .side-tab-round-pc {
    display: none;
  }

  .side-tab-round-mobile {
    display: flex;
  }

  h2 {
    font-size: 13px;
  }

  .master-panel .panel-header {
    align-items: start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .master-panel .panel-header h2 {
    flex: 1 1 auto;
    min-width: 150px;
  }

  .admin-view-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .admin-view-tabs {
    width: 100%;
  }

  .admin-view-tabs .side-tab {
    flex: 1 1 88px;
    min-height: 36px;
  }




  .settings-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .settings-info div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .filters {
    display: grid;
    align-items: end;
    grid-template-columns: 120px minmax(0, 1fr); /* 年(120px=クラブHDCPと同じ) + 検索 を一列に */
    grid-auto-rows: min-content;
    gap: 2px 8px;
    margin-bottom: 8px; /* Stats〜ラウンド一覧の間隔(8px)と揃える */
  }

  .filter-year,
  .filter-course,
  .filter-search {
    grid-column: auto;
    grid-template-rows: 16px 40px;
    gap: 1px;
    line-height: 1.1;
  }

  /* 年=1列目(120px)、検索=2列目(残り) で一列に並べる */
  .filter-year { grid-column: 1; }
  .filter-search { grid-column: 2; }

  .filters select,
  .filters input {
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    font-size: 16px;
    font-weight: 700;
  }

  /* クラブHDCP: セット/編集/クリアの縦幅をイベント等のセレクトに合わせる。 */
  .homeclub-filter-actions button {
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
  }

  .search-filter-row {
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 6px;
  }

  .search-filter-row button {
    height: 40px;
    min-height: 40px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 700;
  }

  /* スマホは検索テキストの代わりにモーダルを開くタップ欄を表示 */
  .filter-search #searchFilter,
  .filter-search #homeclubCourseSearch,
  .filter-search .ra-course-search { display: none; }
  .filter-search .search-suggestions { display: none; }
  .mobile-course-btn {
    display: flex;
    height: 40px;
    min-height: 40px;
    font-size: 16px;
    font-weight: 700;
  }

  .search-suggestions {
    top: calc(100% + 6px);
    max-height: 220px;
  }

  .input-course-suggestions,
  .round-field-suggestions {
    max-height: min(52vh, 320px);
    z-index: 80;
  }

  .search-suggestions button {
    min-height: 44px;
    font-size: 15px;
    font-weight: 700;
  }

  .round-form {
    grid-template-columns: minmax(118px, 0.8fr) repeat(3, minmax(0, 1fr));
    gap: 5px 8px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .round-form.view-mode {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .field-date {
    grid-column: 1 / span 2;
    max-width: 180px;
  }

  .field-course {
    grid-column: 1 / -1;
  }

  .field-date input {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 14px;
    text-align: center;
  }

  .round-form.view-mode .field-small {
    height: 64px;
    min-height: 64px;
    padding: 7px 5px;
    border-radius: 8px;
    line-height: 1.1;
  }

  .round-form.view-mode .field-small input,
  .round-form.view-mode .field-small input[readonly] {
    min-height: 22px;
    font-size: 14px;
  }

  .round-form.view-mode .field-small.percent-field.has-percent-value::after {
    top: 50%;
    right: 6px;
    left: auto;
    font-size: 14px;
  }

  .table-panel .panel-header {
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .table-tools {
    align-items: stretch;
    width: 100%;
  }

  .table-panel .table-wrap {
    overflow: auto;
    touch-action: pan-x pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .round-table {
    width: max-content;
    min-width: 1324px;
    table-layout: fixed;
  }

  .round-table th:nth-child(1),
  .round-table td:nth-child(1) {
    width: 154px;
    min-width: 154px;
    max-width: 154px;
    left: 0;
    text-align: left;
  }

  .round-table th:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 7;
    background: var(--accent) !important;
    color: #fff;
  }

  .round-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fbfdff;
    box-shadow: 1px 0 0 var(--line);
  }

  .round-table tbody tr:nth-child(odd) td:nth-child(1) {
    background: #eef2f8;
  }

  .round-table tbody tr:nth-child(even) td:nth-child(1) {
    background: #fbfdff;
  }

  .round-table th:nth-child(1) .sort-button {
    font-size: 0;
  }

  .round-table th:nth-child(1) .sort-button::before {
    content: "日付/ゴルフ場";
    font-size: 13px;
  }

  .round-table .course-col,
  .round-table .sub-course-col,
  .round-table .tee-col,
  .round-table .green-col {
    display: none;
  }

  .round-table .desktop-date {
    display: none;
  }

  .round-table .mobile-round-info {
    display: grid;
    gap: 5px;
    min-height: 70px;
    align-content: center;
    padding-right: 0;
    position: relative;
  }

  .round-table .mobile-round-info::after {
    content: none;
    display: none !important;
    border: 0 !important;
  }

  .round-table .mobile-round-date,
  .round-table .mobile-round-meta {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .round-table .mobile-round-course {
    display: block;
    max-width: 10em;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .round-table th,
  .round-table td {
    box-sizing: border-box;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 6px;
    padding-right: 6px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .round-table td.num {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: clip;
  }

  .round-table th:nth-child(6),
  .round-table td:nth-child(6),
  .round-table th:nth-child(7),
  .round-table td:nth-child(7),
  .round-table th:nth-child(8),
  .round-table td:nth-child(8) {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
  }

  .round-table th:nth-child(9),
  .round-table td:nth-child(9) {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
  }

  .round-table th:nth-child(10),
  .round-table td:nth-child(10),
  .round-table th:nth-child(11),
  .round-table td:nth-child(11),
  .round-table th:nth-child(12),
  .round-table td:nth-child(12) {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    white-space: normal;
  }

  .round-table th:nth-child(13),
  .round-table td:nth-child(13) {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
  }

  .round-table th:nth-child(14),
  .round-table td:nth-child(14),
  .round-table th:nth-child(15),
  .round-table td:nth-child(15),
  .round-table th:nth-child(16),
  .round-table td:nth-child(16),
  .round-table th:nth-child(18),
  .round-table td:nth-child(18),
  .round-table th:nth-child(19),
  .round-table td:nth-child(19) {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
  }

  .round-table th:nth-child(17),
  .round-table td:nth-child(17) {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
  }

  .round-table th,
  .round-table thead th {
    background: var(--accent) !important;
    color: #fff;
    font-size: 13px;
  }

  .round-table th:nth-child(1),
  .round-table th.course-col {
    background: var(--accent) !important;
    color: #fff;
  }

  .club-year-tabs .club-year-tab:nth-child(n+4) {
    display: none;
  }
}

/* Master view: make only the table body area consume the remaining viewport height. */










/* Course alias view: match the master screen's dense table viewport behavior. */
body.course-alias-view-active,
body.course-side-view-active {
  height: 100vh;
  overflow: hidden;
}

.course-alias-view-active .app-shell,
.course-side-view-active .app-shell {
  height: calc(100vh - 74px);
  box-sizing: border-box;
  overflow: hidden;
  padding-bottom: 20px;
}

.course-alias-view-active main,
.course-side-view-active main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.course-alias-view-active #courseAliasesView,
.course-side-view-active #courseSidesView {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.course-alias-view-active .course-alias-panel,
.course-side-view-active .course-side-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.course-alias-view-active .course-alias-wrap,
.course-side-view-active .course-side-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none !important;
  box-sizing: border-box;
  padding-bottom: 20px;
  overflow-x: auto;
  overflow-y: auto;
}

.course-alias-view-active .course-alias-table,
.course-side-view-active .course-side-table {
  height: auto !important;
  table-layout: fixed;
}

.course-alias-view-active .course-alias-table thead,
.course-alias-view-active .course-alias-table tbody,
.course-side-view-active .course-side-table thead,
.course-side-view-active .course-side-table tbody {
  height: auto !important;
}

.course-alias-view-active .course-alias-table thead tr,
.course-alias-view-active .course-alias-table tbody tr,
.course-side-view-active .course-side-table thead tr,
.course-side-view-active .course-side-table tbody tr {
  height: 22px !important;
}

.course-alias-view-active .course-alias-table th,
.course-alias-view-active .course-alias-table td,
.course-side-view-active .course-side-table th,
.course-side-view-active .course-side-table td {
  height: 22px !important;
  padding: 1px 10px !important;
  line-height: 1.05 !important;
  vertical-align: middle;
}

.course-alias-view-active .course-alias-edit-input,
.course-side-view-active .course-side-edit-input {
  height: 20px !important;
  min-height: 20px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

@media (max-width: 640px) {
  .course-alias-panel .panel-header,
  .course-side-panel .panel-header {
    align-items: start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .course-alias-panel .panel-header h2,
  .course-side-panel .panel-header h2 {
    flex: 1 1 auto;
    min-width: 150px;
  }

  .course-alias-actions,
  .course-side-actions {
    display: grid;
    grid-template-columns: auto repeat(4, minmax(48px, 1fr));
    gap: 6px;
    width: 100%;
  }

  .course-alias-actions p,
  .course-side-actions p {
    align-self: center;
    margin: 0;
    white-space: nowrap;
  }

  .course-alias-actions button,
  .course-side-actions button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 1.1;
  }

  .course-alias-table,
  .course-side-table {
    min-width: 0;
    table-layout: auto;
  }

  .course-alias-view-active .course-alias-table thead,
  .course-alias-view-active .course-alias-table tbody,
  .course-side-view-active .course-side-table thead,
  .course-side-view-active .course-side-table tbody {
    display: block;
  }

  .course-alias-view-active .course-alias-table thead,
  .course-side-view-active .course-side-table thead {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .course-alias-view-active .course-alias-table thead tr,
  .course-alias-view-active .course-alias-table tbody tr,
  .course-side-view-active .course-side-table thead tr,
  .course-side-view-active .course-side-table tbody tr {
    display: grid;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    height: auto !important;
  }

  .course-alias-view-active .course-alias-table thead tr,
  .course-alias-view-active .course-alias-table tbody tr {
    grid-template-columns: 26px 44px minmax(0, 1fr) minmax(0, 1fr);
  }

  .course-side-view-active .course-side-table thead tr,
  .course-side-view-active .course-side-table tbody tr {
    grid-template-columns: 26px 44px repeat(3, minmax(0, 1fr));
  }

  .course-alias-view-active .course-alias-table tbody tr,
  .course-side-view-active .course-side-table tbody tr {
    border-bottom: 1px solid var(--line);
  }

  .course-alias-view-active .course-alias-table th,
  .course-alias-view-active .course-alias-table td,
  .course-side-view-active .course-side-table th,
  .course-side-view-active .course-side-table td {
    display: block;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-width: 0;
    padding: 5px 6px !important;
    overflow: hidden;
    line-height: 1.25 !important;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .course-alias-view-active .course-alias-table thead tr,
  .course-side-view-active .course-side-table thead tr {
    background: var(--accent);
  }

  .course-alias-view-active .course-alias-table thead th,
  .course-side-view-active .course-side-table thead th {
    position: static;
    min-height: 30px;
    border-bottom: 0 !important;
    background: var(--accent) !important;
    color: #fff !important;
  }

  .course-alias-view-active .course-alias-table .sort-button,
  .course-side-view-active .course-side-table .sort-button {
    border: 0 !important;
    box-shadow: none !important;
  }

  .course-alias-view-active .course-alias-table .course-alias-type-col,
  .course-side-view-active .course-side-table .course-side-source-col {
    display: none !important;
  }

  .course-alias-view-active .course-alias-table th:nth-child(1),
  .course-alias-view-active .course-alias-table td:nth-child(1),
  .course-side-view-active .course-side-table th:nth-child(1),
  .course-side-view-active .course-side-table td:nth-child(1) {
    grid-column: 1;
  }

  .course-alias-view-active .course-alias-table th:nth-child(2),
  .course-alias-view-active .course-alias-table td:nth-child(2),
  .course-side-view-active .course-side-table th:nth-child(2),
  .course-side-view-active .course-side-table td:nth-child(2) {
    grid-column: 2;
  }

  .course-alias-view-active .course-alias-table th:nth-child(3),
  .course-alias-view-active .course-alias-table td:nth-child(3),
  .course-side-view-active .course-side-table th:nth-child(3),
  .course-side-view-active .course-side-table td:nth-child(3) {
    grid-column: 3 / -1;
  }

  .course-alias-view-active .course-alias-table td:nth-child(1),
  .course-alias-view-active .course-alias-table td:nth-child(2),
  .course-side-view-active .course-side-table td:nth-child(1),
  .course-side-view-active .course-side-table td:nth-child(2) {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    grid-row: span 2;
  }

  .course-alias-view-active .course-alias-table td:nth-child(4),
  .course-alias-view-active .course-alias-table td:nth-child(5),
  .course-side-view-active .course-side-table td:nth-child(4),
  .course-side-view-active .course-side-table td:nth-child(5),
  .course-side-view-active .course-side-table td:nth-child(6) {
    border-top: 0 !important;
    padding-top: 0 !important;
    text-align: center;
  }

  .course-alias-view-active .course-alias-table th:nth-child(4),
  .course-alias-view-active .course-alias-table td:nth-child(4) {
    grid-column: 3;
  }

  .course-alias-view-active .course-alias-table th:nth-child(5),
  .course-alias-view-active .course-alias-table td:nth-child(5) {
    grid-column: 4;
  }

  .course-alias-view-active .course-alias-table tbody td:nth-child(5) {
    text-align: left;
  }

  .course-side-view-active .course-side-table th:nth-child(4),
  .course-side-view-active .course-side-table td:nth-child(4) {
    grid-column: 3;
  }

  .course-side-view-active .course-side-table th:nth-child(5),
  .course-side-view-active .course-side-table td:nth-child(5) {
    grid-column: 4;
  }

  .course-side-view-active .course-side-table th:nth-child(6),
  .course-side-view-active .course-side-table td:nth-child(6) {
    grid-column: 5;
  }

  .course-alias-view-active .course-alias-table td:nth-child(3),
  .course-side-view-active .course-side-table td:nth-child(3) {
    border-bottom: 0 !important;
    padding-bottom: 2px !important;
    font-size: 13px;
    font-weight: 760;
  }






























}

.summary-table th:first-child,
.summary-table td:first-child,
.round-table th:nth-child(1),
.round-table td:nth-child(1),
.round-table .course-col,
.round-table th.course-col {
  border-left: 0 !important;
  border-right: 0 !important;
  box-shadow: none !important;
}
/* Mobile round input flow */
.mobile-round-view { width: 100%; }
body.mobile-round-view-active {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--app-stable-vh);
  min-height: var(--app-stable-vh);
  overflow: hidden;
  overscroll-behavior: none;
}
.mobile-round-view-active .app-shell {
  width: min(1600px, 100%);
  height: calc(var(--app-stable-vh) - 54px);
  max-height: calc(var(--app-stable-vh) - 54px);
  box-sizing: border-box;
  padding: 10px clamp(14px, 3vw, 28px) 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
}
.mobile-round-view-active main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.mobile-round-view-active #mobileRoundView {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.mobile-round-view-active #mobileRoundRoot {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.mobile-round-view-active .mobile-round-basic-panel {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
}
.mobile-round-view-active .mobile-round-basic-fields {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.mobile-round-view-active main { max-width: none; padding: 0; }
.mobile-round-basic-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 10px;
}
.mobile-round-basic-panel .panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  gap: 10px;
}
.mobile-round-basic-panel .admin-view-title {
  min-width: 0;
  justify-self: start;
}
.mobile-round-basic-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.mobile-round-basic-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.mobile-round-basic-table th,
.mobile-round-basic-table td {
  height: 32px !important;
  padding: 3px 10px !important;
  vertical-align: middle;
}
.mobile-round-basic-table .mobile-round-basic-label-col {
  width: 116px;
  color: var(--muted);
  font-weight: 760;
  white-space: nowrap;
}
.mobile-round-basic-table .mobile-round-basic-value-col {
  width: auto;
}
.mobile-round-basic-table .mobile-round-basic-input {
  width: 100%;
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.mobile-round-basic-table select.mobile-round-basic-input {
  padding-right: 22px;
}
.mobile-round-basic-clubs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 30px;
  padding: 4px 0;
}
.mobile-round-basic-clubs span {
  display: inline-flex;
  align-items: center;
  max-width: 68px;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dde5f1;
  color: var(--accent);
  font-size: 11px;
  font-weight: 780;
  line-height: 1;
  white-space: nowrap;
}
.mobile-round-basic-bottom-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  margin-top: 6px;
  border: 1px solid #aaa;
  border-radius: 6px;
  background: #fff;
  color: #555;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.mobile-course-search-wrap {
  position: relative;
  width: 100%;
}
.mobile-course-candidates {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.mobile-course-candidate {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.mobile-course-candidate:last-child { border-bottom: none; }
.mobile-course-candidate:active { background: #f0f0f0; }
/* 新レイアウト: フィールドリスト */
.mobile-round-basic-fields {
  width: 100%;
  background: var(--bg, #f2f2f7);
}
.mobile-field-section {
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid var(--line, #ddd);
}
.mobile-field-label {
  padding: 4px 16px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #666);
  background: var(--bg, #f2f2f7);
}
.mobile-field-req { color: #d00; margin-left: 2px; }
.mobile-field-value-row {
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 16px;
  gap: 10px;
  background: var(--panel, #fff);
  min-height: 36px;
}
.mobile-field-value {
  flex: 1 1 0;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink, #111);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-field-value.mobile-field-unset { color: var(--muted, #aaa); }
.mobile-field-select-btn {
  flex-shrink: 0;
  padding: 5px 16px;
  border: 1px solid var(--line, #ccc);
  border-radius: 8px;
  background: var(--panel, #fff);
  color: var(--ink, #333);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.mobile-field-select-wrap {
  position: relative;
  flex-shrink: 0;
}
.mobile-field-date-wrap {
  position: relative;
  flex-shrink: 0;
}
.mobile-field-native-select {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: auto;
  appearance: auto;
}
.mobile-field-date-input {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  opacity: 0.01;
  cursor: pointer;
  border: 0;
  padding: 0;
  -webkit-appearance: auto;
  appearance: auto;
}
.mobile-round-basic-bottom {
  padding: 14px 16px;
}
/* クラブグリッドボタン */
.mobile-clubs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 16px 0;
  background: #f2f2f7;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}
.mobile-club-grid-spacer {
  visibility: hidden;
}
.mobile-club-grid-btn {
  padding: 9px 0;
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 2px solid var(--accent, #1f3a5f);
  background: #fff;
  color: var(--accent, #1f3a5f);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1;
}
.mobile-club-grid-btn.active {
  background: var(--accent, #1f3a5f);
  color: #fff;
}
/* ピッカーオーバーレイ */
.mobile-picker-overlay {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f2f2f7;
}
.mobile-picker-header {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  background: var(--accent, #1f3a5f);
  color: #fff;
  padding: 10px 4px;
  min-height: 48px;
  box-sizing: border-box;
}
.mobile-picker-back {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.mobile-picker-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin: 0;
  color: #fff;
}
.mobile-picker-search-bar {
  padding: 10px 12px;
  background: #f2f2f7;
}
.mobile-picker-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px 8px 34px;
  border: none;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  color: #111;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.099zm-5.242 1.656a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-color: #fff;
}
.mobile-picker-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.mobile-picker-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  text-align: left;
  padding: 14px 16px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  border-bottom: 1px solid #e5e5ea;
  cursor: pointer;
}
.mobile-picker-nav-disabled { color: #aaa; cursor: default; }
.mobile-picker-chevron { font-size: 18px; color: #c7c7cc; }
.mobile-picker-candidates { margin-top: 20px; }
.mobile-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  text-align: left;
  padding: 14px 16px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  border-bottom: 1px solid #e5e5ea;
  cursor: pointer;
}
.mobile-picker-item:active { background: #f0f0f5; }
.mobile-picker-item[hidden] { display: none; }

/* 予定からセットの候補。1行目に日付・時刻・ゴルフ場、2行目にコース/ティー/グリーン */
.mobile-schedule-item { align-items: flex-start; }

.mobile-schedule-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  text-align: left;
}

.mobile-schedule-head { font-size: 15px; color: #111; }

.mobile-schedule-detail {
  color: var(--muted);
  font-size: 13px;
}

/* GPS検索のときだけ出る距離。名前が長くても距離が潰れないようにする */
.mobile-picker-distance {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.mobile-picker-kana-heading {
  padding: 8px 16px;
  background: #efeff2;
  color: #777;
  font-size: 13px;
  font-weight: 800;
  border-bottom: 1px solid #e2e2e6;
}
.mobile-picker-kana-heading[hidden] { display: none; }
.mobile-picker-empty {
  padding: 40px 16px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}
/* クラブトグル */
.mobile-clubs-list { margin-top: 0; }
.mobile-club-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e5ea;
  cursor: pointer;
}
.mobile-club-name { font-size: 15px; color: #111; }
.mobile-toggle-switch {
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: #ccc;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.mobile-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}
.mobile-toggle-switch.active { background: #34c759; }
.mobile-toggle-switch.active::after { transform: translateX(20px); }
.mobile-picker-footer { padding: 16px; }
.mobile-picker-done-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent, #1f3a5f);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.mobile-round-basic-action-row th,
.mobile-round-basic-action-row td {
  padding-top: 10px !important;
}
.mobile-round-basic-bottom-start {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.mobile-round-basic-bottom-start.mobile-round-basic-bottom-resume {
  border-color: #f97316;
  background: #f97316;
}
.mobile-round-basic-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  padding: 2px 8px 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}
.mobile-round-basic-metrics b {
  color: var(--accent);
  font-weight: 900;
}
.side-tab.side-tab-resume {
  border-color: #f97316;
  background: #f97316;
  color: #fff;
}
@media (max-width: 640px) {
  .mobile-round-basic-table .mobile-round-basic-label-col {
    width: 96px;
  }

  .mobile-round-basic-table th,
  .mobile-round-basic-table td {
    padding-right: 8px !important;
    padding-left: 8px !important;
  }
}
.mobile-round-screen {
  --mobile-bg: var(--bg);
  --mobile-surface: var(--panel);
  --mobile-band: var(--soft);
  --mobile-primary: var(--accent);
  --mobile-primary-dark: #14263f;
  --mobile-primary-soft: #dde5f1;
  --mobile-green-mid: #5b6b80;
  --mobile-line: var(--line);
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 253, 255, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: visible;
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
.mobile-round-header {
  position: static;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 0;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}
.mobile-round-header h2 { margin: 0; text-align: center; font-size: 14px; letter-spacing: 0; }
.mobile-header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.mobile-round-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 8px;
  padding: 8px 12px 10px;
}
.mobile-round-screen .mobile-round-row { display: grid; gap: 4px; margin: 0; }
.mobile-round-screen .mobile-round-row span,
.mobile-round-screen .mobile-round-section-label {
  display: block;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}
.mobile-round-screen .mobile-round-row b { color: var(--accent-2); }
.mobile-round-screen .mobile-round-row input,
.mobile-round-screen .mobile-round-row select {
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid var(--mobile-line);
  background: var(--mobile-surface);
  font-size: 13px;
  border-radius: 6px;
}
.mobile-round-screen .mobile-round-field-courseName {
  grid-column: span 3;
}
.mobile-round-screen .mobile-round-field-frontCourse,
.mobile-round-screen .mobile-round-field-backCourse {
  grid-column: span 2;
}
.mobile-round-screen .mobile-round-field-tee,
.mobile-round-screen .mobile-round-field-green {
  grid-column: span 2;
}
.mobile-round-screen .mobile-round-clubs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--mobile-line);
  border-radius: 6px;
  background: var(--mobile-surface);
}
.mobile-round-screen .mobile-round-clubs span {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--mobile-primary-soft);
  font-size: 12px;
  font-weight: 700;
}
.mobile-primary-button {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 4px 0 0;
  color: #fff;
  border: 1px solid var(--mobile-primary-dark);
  border-radius: 6px;
  background: var(--mobile-primary);
  font-size: 13px;
  font-weight: 800;
}
.mobile-round-detail {
  padding-bottom: 0;
  background: var(--mobile-bg);
  touch-action: pan-y;
}
/* 上部バーもモック配色(白ボタン・紺文字)に統一 */
.mobile-score-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  background: transparent;
}
.mobile-score-top button {
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  min-height: 34px;
  padding: 0 6px;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}
.mobile-score-top-left {
  justify-self: stretch;
  font-size: 11px;
}
.mobile-score-top-center,
.mobile-score-top-right {
  justify-self: stretch;
}
/* ラウンド終了(＝実機ではメニュー)は緑/オレンジをやめ、スコアカードと同じ白に */
.mobile-score-top button.mobile-round-finish-ready {
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
}
/* ヒーローをモック配色(白カード＋紺バッジ＋グレー文字)に統一 */
.mobile-score-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.mobile-hole-nav {
  color: var(--muted);
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}
.mobile-score-course {
  font-weight: 800;
  font-size: 16px;
  text-align: center;
  color: var(--ink);
}
.mobile-score-course strong {
  font-size: 16px;
  line-height: 1.2;
}
.mobile-hole-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.mobile-hole-left,
.mobile-hole-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-hole-side {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  word-break: keep-all;
}
.mobile-hole-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 4px 16px;
  line-height: 1.1;
}
.mobile-hole-badge-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #fff;
}
.mobile-hole-badge strong { font-size: 24px; font-weight: 800; }
.mobile-par-line {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--muted);
}
.mobile-par-line strong { font-size: 20px; color: var(--ink); }
.mobile-score-body { background: var(--mobile-bg); }
.mobile-derived-note {
  margin: 10px 12px 0;
  padding: 10px 12px;
  border: 1px solid #c9d9c3;
  border-radius: 10px;
  background: #eef7ea;
  color: #2f6b3f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
.mobile-score-body.is-derived { opacity: .55; }
.mobile-score-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 12px 22px 6px;
}
.mobile-score-values button {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  min-height: 82px;
  border: 3px solid #9aa9c2;
  background: var(--mobile-surface);
  font-size: 16px;
  font-weight: 800;
}
.mobile-score-values button.active { border-color: #5b6b80; }
.mobile-score-values strong {
  font-size: 26px;
  font-weight: 700;
}
.mobile-score-values small {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  min-height: 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}
.mobile-score-values small em {
  display: block;
  font-style: normal;
  text-align: center;
}
.mobile-score-values small i {
  display: block;
  min-width: 24px;
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}
.mobile-score-values small b {
  grid-column: 3;
  min-width: 30px;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}
.mobile-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 8px;
}
.mobile-keypad button {
  aspect-ratio: 1.18;
  border: 2px solid #9aa9c2;
  border-radius: 6px;
  background: var(--mobile-surface);
  font-size: 26px;
  font-weight: 600;
}
.mobile-shot-controls {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 18px 24px;
}
.mobile-shot-counters {
  display: grid;
  gap: 30px;
}
.mobile-counter {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  grid-template-rows: auto 22px;
  align-items: center;
  gap: 3px 5px;
  padding: 0;
}
.mobile-counter::after {
  content: "";
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: center;
  height: 22px;
  border-radius: 999px;
  background: #d5deec;
  z-index: 0;
}
.mobile-counter span {
  grid-column: 1 / -1;
  grid-row: 1;
  font-size: 13px;
  font-weight: 800;
}
.mobile-counter button {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  aspect-ratio: 1 / 1;
  padding: 0;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: var(--mobile-primary);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.mobile-counter button:first-of-type {
  grid-column: 1;
  grid-row: 2;
}
.mobile-counter button:last-of-type {
  grid-column: 3;
  grid-row: 2;
}
.mobile-counter strong {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 2;
  text-align: center;
  font-size: 22px;
}
.mobile-tee-shot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
}
.mobile-tee-shot > span { align-self: flex-start; font-size: 13px; font-weight: 800; }
.mobile-tee-compass {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.tee-compass-mid {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tee-dir { display: flex; align-items: center; gap: 4px; transition: transform 0.1s ease; }
.tee-dir-v { flex-direction: column; }
.tee-dir-h { flex-direction: row; }
.tee-dir-label { font-size: 12px; font-weight: 800; color: #bbb; white-space: nowrap; }
.tee-dir-active .tee-dir-label,
.tee-dir-preview .tee-dir-label { color: var(--mobile-primary); }
.tee-dir-preview { transform: scale(1.25); }
.tee-arrow-up    { width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 17px solid #ccc; }
.tee-arrow-down  { width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top:    17px solid #ccc; }
.tee-arrow-left  { width: 0; height: 0; border-top: 11px solid transparent;  border-bottom: 11px solid transparent; border-right: 17px solid #ccc; }
.tee-arrow-right { width: 0; height: 0; border-top: 11px solid transparent;  border-bottom: 11px solid transparent; border-left:  17px solid #ccc; }
.tee-dir-active .tee-arrow-up,
.tee-dir-preview .tee-arrow-up    { border-bottom-color: var(--mobile-primary); }
.tee-dir-active .tee-arrow-down,
.tee-dir-preview .tee-arrow-down  { border-top-color:    var(--mobile-primary); }
.tee-dir-active .tee-arrow-left,
.tee-dir-preview .tee-arrow-left  { border-right-color:  var(--mobile-primary); }
.tee-dir-active .tee-arrow-right,
.tee-dir-preview .tee-arrow-right { border-left-color:   var(--mobile-primary); }
.mobile-tee-pad {
  width: 104px;
  min-height: 58px;
  color: #fff;
  border: 0;
  border-radius: 36px;
  background: var(--mobile-primary-dark);
  box-shadow: 0 3px 8px rgba(20, 38, 63, 0.24);
  font-size: 16px;
  font-weight: 900;
  touch-action: none;
  will-change: transform;
}
.mobile-tee-shot em { font-style: normal; font-size: 18px; font-weight: 900; color: var(--ink); }
.mobile-round-overlay {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  max-height: 82dvh;
  overflow: auto;
  padding: 92px 16px 24px;
  color: #fff;
  background: rgba(31, 58, 95, 0.96);
  box-shadow: 0 8px 20px rgba(20, 38, 63, 0.28);
}
.mobile-overlay-back {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 31;
  min-height: 38px;
  padding: 0 12px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 15px;
  font-weight: 800;
}
.mobile-round-overlay h3 { margin: 14px 0 10px; font-size: 20px; }
.mobile-hole-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mobile-hole-grid button {
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  border-radius: 6px;
  background: var(--mobile-surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
}
.mobile-hole-grid button small { font-size: 11px; font-weight: 700; }
.mobile-hole-grid button.active { background: var(--mobile-primary-soft); }
.mobile-scorecard { color: var(--ink); background: rgba(251, 253, 255, 0.98); overflow-x: hidden; padding-top: 36px; }
.mobile-scorecard-scroll-x { overflow-x: auto; }
.mobile-scorecard-table {
  width: 100%;
  min-width: 500px;
  margin: 6px 0;
  border-collapse: collapse;
  background: var(--mobile-surface);
}
.mobile-scorecard-table caption { padding: 3px 6px; font-weight: 900; font-size: 13px; text-align: left; }
.mobile-scorecard-table th { background: var(--mobile-primary); color: #fff; }
.mobile-scorecard-table th,
.mobile-scorecard-table td {
  border: 1px solid var(--mobile-line);
  padding: 4px 6px;
  text-align: center;
  font-size: 13px;
}
.mobile-scorecard-table .sc-total {
  background: var(--mobile-primary-dark);
  color: #fff;
  font-weight: 900;
}
/* スコアカード: 全thへ効く広域 sticky(top:0) によりヘッダー行と行ラベルthが
   上端に積み重なってボディ行に重なる不具合を解消。ヘッダー行のみ上端固定し、
   行ラベル列は左端固定に切り替える。 */
.mobile-scorecard-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--mobile-primary);
}
.mobile-scorecard-table tbody th {
  position: sticky;
  top: auto;
  left: 0;
  z-index: 2;
  background: var(--mobile-primary);
}
.mobile-scorecard-table thead th:first-child,
.mobile-scorecard-table tbody th {
  width: 90px;
}
.mobile-scorecard-table thead th:first-child {
  left: 0;
  z-index: 4;
}
.mobile-menu-overlay {
  max-height: none;
  min-height: var(--app-stable-vh);
  padding: 0;
  color: var(--ink);
  background: #f3f6fb;
  box-shadow: none;
}
.mobile-menu-title {
  display: grid;
  min-height: 56px;
  place-items: center;
  color: #fff;
  background: var(--mobile-primary-dark);
  font-size: 20px;
  font-weight: 900;
}
.mobile-menu-list {
  border-top: 1px solid var(--mobile-line);
}
.mobile-menu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--mobile-line);
  border-radius: 0;
  background: var(--mobile-surface);
  font-size: 17px;
  font-weight: 700;
  text-align: left;
}
.mobile-menu-item b {
  color: var(--muted);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}
.mobile-club-picker {
  max-height: 72dvh;
  padding: 28px 16px 20px;
}
.mobile-club-picker h3 {
  margin: 0 0 8px;
  font-size: 20px;
}
.mobile-club-context {
  margin: 0 0 14px;
  color: #dde5f1;
  font-size: 13px;
  font-weight: 800;
}
.mobile-club-context span {
  display: inline-block;
  margin-left: 6px;
  color: #fff;
}
.mobile-club-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.mobile-club-picker button {
  min-height: 48px;
  border-radius: 6px;
  border: 0;
  font-size: 18px;
  font-weight: 800;
}
.mobile-club-grid button.active {
  color: #fff;
  background: var(--mobile-primary);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.62);
}
.mobile-club-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 18px;
}
.mobile-club-actions button {
  min-width: 92px;
  min-height: 44px;
  padding: 0 16px;
}
.mobile-result-hero {
  padding: 18px 22px 20px;
  color: #fff;
  background: linear-gradient(rgba(31, 58, 95, 0.18), rgba(31, 58, 95, 0.34)), var(--mobile-primary);
}
.mobile-round-keep {
  padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
}
/* round-keep 画面は内容が縦に長くなるため固定パネル内でスクロール可能にする(ラウンド終了ボタンが見切れない) */
.mobile-round-view-active .mobile-round-keep {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-round-keep .mobile-primary-button {
  width: calc(100% - 36px);
  margin: 0 18px;
  min-height: 52px;
  font-size: 16px;
}
.mobile-result-hero div {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}
.mobile-result-hero strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}
.mobile-result-hero span {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}
.mobile-result-summary {
  width: calc(100% - 36px);
  margin: 18px;
  padding: 0;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--mobile-surface);
}
.mobile-result-summary th,
.mobile-result-summary td {
  height: 66px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--mobile-line);
  color: var(--ink);
}
.mobile-result-summary thead th {
  height: 46px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.mobile-result-summary tbody th {
  width: auto;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.mobile-result-summary th:first-child {
  width: 50%;
}
.mobile-result-summary td {
  width: 25%;
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}
.mobile-memo {
  display: block;
  padding: 16px 18px 20px;
  color: var(--muted);
  font-weight: 800;
}
.mobile-memo textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--mobile-line);
  border-radius: 6px;
  font-size: 18px;
}
@media (max-width: 900px) {
  .mobile-round-form {
    grid-template-columns: minmax(118px, 0.8fr) repeat(3, minmax(0, 1fr));
    padding-right: 8px;
    padding-left: 8px;
  }

  .mobile-round-screen .mobile-round-field-roundDate {
    grid-column: 1 / span 2;
    max-width: 180px;
  }

  .mobile-round-screen .mobile-round-field-courseName {
    grid-column: 1 / -1;
  }

  .mobile-round-screen .mobile-round-field-frontCourse,
  .mobile-round-screen .mobile-round-field-backCourse,
  .mobile-round-screen .mobile-round-field-tee,
  .mobile-round-screen .mobile-round-field-green {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .mobile-round-view-active .app-shell {
    padding-right: 8px;
    padding-left: 8px;
  }

  .mobile-round-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-round-screen .mobile-round-field-roundDate,
  .mobile-round-screen .mobile-round-field-frontCourse,
  .mobile-round-screen .mobile-round-field-backCourse,
  .mobile-round-screen .mobile-round-field-tee,
  .mobile-round-screen .mobile-round-field-green {
    grid-column: span 1;
  }

  .mobile-round-screen .mobile-round-field-courseName {
    grid-column: 1 / -1;
  }
}

/* ===== メモ（Keep-in-mind）===== */
.memo-panel {
  display: block;
}
.memo-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}
/* 詳細分析(ラウンド分析/クラブ分析/クラブHDCP)と同じくビューの先頭に置く。
   下の余白は .memo-list の margin-top が受け持つ。 */
.memo-subtabs {
  margin: 0;
}
/* 保存・クリアの結果表示。空のときは行を作らない。 */
.memo-status {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.memo-status:empty {
  display: none;
}
/* サブタブで選択中の1枚だけを表示する */
.memo-list .memo-card[hidden] {
  display: none;
}
.memo-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  /* overflow:hidden はスクロール領域を作ってしまい、見出し帯の position:sticky が効かなくなる。
     角丸は帯と本文それぞれに付ける。 */
  background: #fff;
}
.memo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  /* 帯の縦幅を /list ラウンド一覧の見出し帯(約30px)に合わせる(上下padding2px+ボタン26px) */
  padding: 2px 14px;
  /* 長文を下の方まで書いても装飾ボタンに手が届くよう、帯は画面上端に貼り付く。 */
  position: sticky;
  top: 0;
  z-index: 2;
  /* .memo-card の overflow:hidden を外したので、角丸は帯自身で付ける。 */
  border-radius: 9px 9px 0 0;
}
.memo-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}
.memo-count {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}
/* 装飾ボタンは紺帯の中、文字数カウントの左。編集中だけ出す。
   大きさは「編集」ボタンと同じ(.memo-card-head button の指定をそのまま使う)。 */
.memo-tools {
  display: none;
  align-items: center;
  gap: 6px;
  margin-right: 2px;
}
.memo-card.memo-editing .memo-tools { display: inline-flex; }
/* 読み上げボタン。アイコン1つなので幅は詰める(高さは他のボタンと同じ26px)。 */
.memo-card-head .memo-speak {
  min-width: 34px;
  padding: 0 8px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
}
.memo-card-head .memo-speak.on { background: #c0392b; color: #fff; }
.memo-card-head .memo-speak-stop {
  min-width: 34px;
  padding: 0 8px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
}
.memo-card-head .memo-speak-stop[hidden] { display: none; }
.memo-card-head .memo-fmt { background: #fff; color: var(--accent); }
.memo-card-head .memo-fmt-red { color: #c0392b; }
.memo-card-head .memo-fmt-blue { color: #1f5fbf; }
/* スマホは帯に4つ足すと横幅が足りないので、装飾ボタンだけ幅を詰める(高さは編集ボタンと同じ26pxのまま)。 */
@media (max-width: 640px) {
  /* 編集中は帯が2段になる。見出しは折り返さない。 */
  .memo-card-head h3 { white-space: nowrap; }
  .memo-head-actions { flex: 1; flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
  .memo-card-head .memo-fmt { min-width: 32px; padding: 0 6px; }
}
/* 閲覧は装飾を反映した表示、編集は textarea に切り替える */
.memo-view {
  display: block;
  min-height: 130px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fcfdff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.memo-view-empty { color: #9aa7b8; }
/* カード下端の角丸(overflow:hidden を外したぶんを補う) */
.memo-view, .memo-text { border-radius: 0 0 9px 9px; }
.memo-card .memo-text { display: none; }
.memo-card.memo-editing .memo-view { display: none; }
.memo-card.memo-editing .memo-text { display: block; }
.memo-c-red { color: #c0392b; }
.memo-c-blue { color: #1f5fbf; }
.memo-text {
  display: block;
  width: 100%;
  min-height: 130px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fcfdff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  padding: 12px 14px;
  /* 内容に合わせて高さ可変(JSがscrollHeightで伸長)。内部スクロールは出さない。 */
  resize: none;
  overflow-y: hidden;
}
.memo-text:focus {
  outline: none;
  background: #fff;
}
/* 操作ボタンは紺色の帯(memo-card-head)内の右側へ。文字数カウントの隣に置く。 */
.memo-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* 書体・横幅は /list の「クリア」に合わせる。縦幅だけ帯を30pxに収めるため26pxにする。 */
.memo-card-head button {
  min-width: 64px;
  height: 26px;
  min-height: 26px;
  padding: 0 10px;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}
.memo-card-head .memo-edit,
.memo-card-head .memo-save {
  background: #fff;
  color: var(--accent);
}
.memo-card-head .memo-cancel {
  background: transparent;
  color: #fff;
}
/* 通常時は「編集」のみ。編集中は「戻る/保存」を表示。 */
.memo-card-head .memo-cancel,
.memo-card-head .memo-save {
  display: none;
}
.memo-card.memo-editing .memo-card-head .memo-edit {
  display: none;
}
.memo-card.memo-editing .memo-card-head .memo-cancel,
.memo-card.memo-editing .memo-card-head .memo-save {
  display: inline-block;
}
/* 編集中のテキスト枠は白地で編集可能と分かるように。 */
.memo-card.memo-editing .memo-text {
  background: #fff;
}

/* ===== クラブHDCP(ホームクラブ) ===== */
/* フィルタは 年/ゴルフ場/イベント + 操作ボタン + 件数。/listのフィルタ書式に合わせる。 */
.homeclub-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 4px 8px;
}
.homeclub-filters .filter-year { width: 120px; }
/* ゴルフ場(検索)とイベントは /list の「検索」と同じ横幅に揃える。 */
.homeclub-filters .homeclub-course-search,
.homeclub-filters .filter-event { flex: 0 1 340px; min-width: 200px; }
.homeclub-filters .latest-round-meta { margin-left: auto; }
.homeclub-filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}
/* スマホ: イベントを狭め、セット/編集/クリアをその横(同じ行)に並べる。
   詳細度を上げて /list 由来の .filters .filter-search ルールに勝たせ、min-width:0 で横並びを確実にする。 */
@media (max-width: 640px) {
  /* /list と同じ 2列グリッドで明示配置(flexの折り返しに任せない)。
     1行目: 年(120px) + 検索 / 2行目: イベント(120px) + セット/編集/クリア */
  .homeclub-filters {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: end;
    gap: 2px 8px;
  }
  .homeclub-filters .filter-year { grid-area: 1 / 1; width: auto; }
  .homeclub-filters .homeclub-course-search { grid-area: 1 / 2; min-width: 0; }
  /* クラブHDCPの検索行は「クリア」が無いので、/list 用の74px枠を外して右端まで使う。 */
  .homeclub-course-search .search-filter-row { grid-template-columns: minmax(0, 1fr); }
  .homeclub-filters .filter-event { grid-area: 2 / 1; width: auto; min-width: 0; }
  .homeclub-filters .homeclub-filter-actions { grid-area: 2 / 2; min-width: 0; justify-content: flex-start; gap: 4px; }
  .homeclub-filters .latest-round-meta { grid-column: 1 / -1; }
  .homeclub-filters .homeclub-filter-actions button { flex: 1 1 0; min-width: 0; padding: 0 4px; }
}
/* ボタンの文字サイズ等を /list のクリア(.filters label内=12px)に合わせる。 */
.homeclub-filter-actions button {
  min-width: 56px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}
/* 計算対象チェックは日付セル内に小さく内包し、/list と行高を揃える。 */
.homeclub-row-check {
  width: 13px;
  height: 13px;
  min-height: 0;
  margin: 0 6px 0 0;
  vertical-align: middle;
}


.homeclub-row-excluded {
  opacity: 0.45;
}
/* クラブHDCP専用列(手入力)。幅はクラブHDCPの列構成に合わせて確定値。 */
.hc-event-col { width: 74px; min-width: 74px; max-width: 74px; overflow: hidden; }
.hc-num-col { width: 46px; min-width: 46px; max-width: 46px; }
.hc-rank-col { width: 84px; min-width: 84px; max-width: 84px; white-space: nowrap; }
.hc-meta-input {
  width: 100%;
  min-height: 22px;
  padding: 0 4px;
  font-size: 12px;
  box-sizing: border-box;
}
.hc-event-input { text-align: left; }
.hc-num-input { text-align: center; }
.hc-rank-input { width: 30px; text-align: center; display: inline-block; }
.hc-rank-sep { margin: 0 2px; color: var(--muted); }
.hc-net-col { width: 46px; min-width: 46px; max-width: 46px; font-weight: 700; }

/* クラブHDCP表は列順が /list と違うため、位置依存(nth-child)の幅を全列ここで決める。
   並び(25列): 1日付 2イベント 3コース 4ティー 5グリーン 6スコア 7ショット 8パット
   9HDCP当日 10NET 11順位 12FW 13パーオン 14ボギーオン 15スクランブル率
   16Putts per GIR 17SGA 18OB 19Yards 20CR 21SR 22調整 23調整スコア 24DIFF 25HDCP
   共通の列は /list と同じ幅に揃える。合計 1204px。 */
.homeclub-round-table th:nth-child(1),
.homeclub-round-table td:nth-child(1) { width: 70px; }

.homeclub-round-table th:nth-child(3),
.homeclub-round-table td:nth-child(3) { width: 100px; min-width: 100px; max-width: 100px; }

.homeclub-round-table th:nth-child(4),
.homeclub-round-table td:nth-child(4) { width: 72px; }

.homeclub-round-table th:nth-child(5),
.homeclub-round-table td:nth-child(5) { width: 56px; }

.homeclub-round-table th:nth-child(6),
.homeclub-round-table td:nth-child(6),
.homeclub-round-table th:nth-child(8),
.homeclub-round-table td:nth-child(8) { width: 44px; }

.homeclub-round-table th:nth-child(7),
.homeclub-round-table td:nth-child(7) { width: 50px; }

.homeclub-round-table th:nth-child(12),
.homeclub-round-table td:nth-child(12),
.homeclub-round-table th:nth-child(13),
.homeclub-round-table td:nth-child(13),
.homeclub-round-table th:nth-child(14),
.homeclub-round-table td:nth-child(14),
.homeclub-round-table th:nth-child(15),
.homeclub-round-table td:nth-child(15) { width: 50px; }

.homeclub-round-table th:nth-child(16),
.homeclub-round-table td:nth-child(16) { width: 54px; }

.homeclub-round-table th:nth-child(17),
.homeclub-round-table td:nth-child(17) { width: 40px; }

.homeclub-round-table th:nth-child(18),
.homeclub-round-table td:nth-child(18),
.homeclub-round-table th:nth-child(22),
.homeclub-round-table td:nth-child(22) { width: 30px; }

.homeclub-round-table th:nth-child(19),
.homeclub-round-table td:nth-child(19) { width: 52px; }

.homeclub-round-table th:nth-child(20),
.homeclub-round-table td:nth-child(20),
.homeclub-round-table th:nth-child(21),
.homeclub-round-table td:nth-child(21) { width: 38px; }

.homeclub-round-table th:nth-child(23),
.homeclub-round-table td:nth-child(23),
.homeclub-round-table th:nth-child(24),
.homeclub-round-table td:nth-child(24),
.homeclub-round-table th:nth-child(25),
.homeclub-round-table td:nth-child(25) { width: 44px; }

@media (max-width: 700px) {
  .memo-card-actions button {
    flex: 1 1 0;
    padding: 0 12px;
  }
}

/* ===== ラウンドサマリー画面（/detail）Phase1 ===== */
.round-summary-root {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 12px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rs-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rs-header h2 {
  margin: 0;
  font-size: 18px;
}
.rs-back {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.rs-hero {
  padding: 4px 2px;
}
.rs-hero .rs-date { color: var(--muted); font-size: 13px; font-weight: 700; }
.rs-hero .rs-course { font-size: 20px; font-weight: 800; margin-top: 2px; }
.rs-hero .rs-sub { color: var(--muted); font-size: 13px; font-weight: 700; margin-top: 2px; }
/* スコア/ショット/パットは .rs-counts と同一スタイル（バンカー等と縦幅・文字を揃える）*/
.rs-scorecard { display: flex; flex-direction: column; gap: 8px; overflow-x: auto; }
.rs-score-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.rs-score-table th, .rs-score-table td {
  border: 1px solid var(--line);
  text-align: center;
  padding: 4px 0;
  height: 30px;
}
.rs-score-table thead th { background: var(--accent); color: #fff; font-weight: 800; }
.rs-score-table tbody th, .rs-score-table tbody td { background: #fff; }
.rs-score-table .rs-row-label { color: var(--muted); font-weight: 800; width: 40px; }
.rs-score-table thead .rs-row-label { background: var(--accent); color: #fff; }
.rs-par-row td { color: var(--muted); font-weight: 700; }
.rs-total-col { font-weight: 800; }
.rs-hole-score { display: inline-flex; align-items: center; justify-content: center; }
.rs-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.rs-counts > div { text-align: center; }
.rs-counts span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.rs-counts strong { display: block; font-size: 17px; color: #1f3a5f; font-weight: 800; margin-top: 1px; line-height: 1.2; }
.rs-memo { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 12px; }
.rs-memo-label { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.rs-memo-body { font-size: 14px; min-height: 40px; white-space: normal; word-break: break-word; }
.rs-memo-empty { color: var(--muted); }
.rs-menu-label { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.rs-menu { display: flex; flex-direction: column; gap: 8px; }
.rs-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.rs-menu-item .rs-chevron { margin-left: auto; color: var(--muted); font-size: 18px; }
.rs-menu-item .rs-soon { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 700; }
.rs-menu-item--disabled { color: var(--muted); background: #f6f8fb; cursor: default; }
/* サマリーの出口。ラウンド情報の枠とは別にして、行き先が違うことを分かるようにする。
   受け口(data-rs-action="back")は前からあったが、押す場所が描かれていなかった。 */
.rs-back-bottom {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: #fff;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}
.rs-empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* スコアカード詳細を「閲覧専用」で開いたときは、前半/後半のテーブルだけ表示（Phase2）*/
body.scorecard-view-only .input-panel { display: none; }
body.scorecard-view-only .score-detail-panel-header { display: none; }
body.scorecard-view-only #scoreDetailView > .score-detail-section:first-of-type { display: none; }

/* ===== ハイパー入力（ホール内容詳細）Phase H1 ===== */
.mobile-hyper-toggle{ display:flex; gap:2px; background:#dfe7f2; border-radius:8px; padding:2px; margin:6px 0; }
.mobile-hyper-toggle button{ flex:1; font-size:13px; font-weight:800; padding:6px; border:0; border-radius:6px; background:transparent; color:var(--muted); }
.mobile-hyper-toggle button.on{ background:#fff; color:var(--accent); box-shadow:0 1px 2px rgba(0,0,0,.12); }
/* ハイパー入力(スマホ)は3層: 上=固定 / 中=明細だけスクロール / 下=カウンター帯を固定。
   ページ自体のロック(position:fixed/overflow:hidden/overscroll-behavior:none)は維持したまま、
   内側だけをスクロールさせる。overscroll-behavior:contain で親へ連鎖しない(暴走しない)。
   ラウンド基本情報(.mobile-round-basic-fields)で実績のある構造と同じ。 */
/* ハイパー時だけ3層flexにする(通常入力は従来のブロック配置のまま＝潰れない) */
.mobile-round-view-active .mobile-round-detail.is-hyper{
  display:flex; flex-direction:column; flex:1 1 auto; min-height:0; overflow:hidden;
}
.hyper-body{ display:flex; flex-direction:column; gap:8px; flex:1 1 auto; min-height:0; padding-bottom:0; }
.hyper-body .hy-counters{ flex:0 0 auto; }
.hy-scrollarea{
  flex:1 1 auto; min-height:0;
  overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
}
/* バンカー/OB/ペナルティ: 3つの大箱をやめて1行帯にし、最下部で常時表示 */
.hy-bar{
  flex:0 0 auto; display:flex; justify-content:center; align-items:center; gap:14px;
  background:#fff; border:1px solid var(--line); border-radius:10px; padding:8px 10px;
  font-size:12px; font-weight:700; color:var(--muted);
}
.hy-bar b{ color:var(--accent); font-size:15px; margin-left:4px; }
.hy-card{ background:#fff; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.hy-title{ font-size:12px; font-weight:800; color:var(--muted); padding:9px 12px; border-bottom:1px solid var(--line); }
.mobile-score-course{ text-align:center; }
.hy-done{ color:#fff; background:var(--accent); border-radius:6px; padding:1px 8px; font-size:11px; margin-left:6px; }
/* 見出しの右にピン位置・傾斜(ホールに1組)を並べる */
/* 通常は1行。3桁が並ぶ等で入りきらないときだけ4点が次の行へ回る(文字の途中で折れない)。 */
.hy-title-row{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px; padding-top:6px; padding-bottom:6px; }
.hy-title-row > span:first-child{ white-space:nowrap; }
.hy-adj{ display:flex; align-items:center; gap:5px; flex:0 0 auto; margin-left:auto; }
.hy-adj .hy-cell{ font-size:11px; padding:3px 6px; min-width:0; line-height:1.3; }
/* 数値欄は表の「残り」「実効飛距離」と同じ大きさ(font-size は .hy-table 相当の11px) */
.hy-adj .hy-num{ font-size:11px; }
.hy-adj .hy-num.active, .hy-adj .hy-cell.active{ background:var(--accent); color:#fff; }
.hy-adj .hy-num.active .u{ color:#dbe6f5; }
.hy-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
.hy-table{ width:100%; border-collapse:collapse; font-size:11px; }
.hy-table th{ background:#f1f5fb; color:var(--muted); font-weight:800; font-size:10px; padding:5px 2px; border-bottom:1px solid var(--line); white-space:nowrap; }
.hy-table td{ padding:4px 2px; text-align:center; border-bottom:1px solid #eef2f8; white-space:nowrap; }
.hy-no{ display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; background:var(--accent); color:#fff; font-weight:800; font-size:10px; }
.hy-cell{ min-width:34px; border:1px solid var(--line); border-radius:6px; padding:4px 6px; font-weight:800; color:var(--accent); background:#fff; }
.hy-cell.fixed{ display:inline-block; border-color:var(--accent); }
.hy-cell.putt{ display:inline-block; border-color:var(--accent); }
.hy-cell.dir{ font-size:14px; }
.hy-cell.dash{ display:inline-block; border-style:dashed; color:#b7c0cd; background:transparent; }
/* ハイパー入力(スマホ): ホール内容詳細の上に置く Score/Putts パレット */
.hy-counters.hy-totals{ margin-bottom:8px; }
.hy-num{ min-width:40px; border:1px dashed var(--accent); border-radius:6px; padding:4px 6px; font-weight:800; color:var(--accent); background:#fff; }
.hy-num.active{ background:var(--accent); color:#fff; }
.hy-num .u, .hy-carry .u{ font-size:9px; color:var(--muted); font-weight:600; margin-left:1px; }
.hy-num.active .u{ color:#dbe6f5; }
.hy-carry{ color:var(--accent); font-weight:800; }
.hy-del{ border:0; background:transparent; color:var(--muted); font-size:15px; font-weight:800; padding:0 4px; }
.hy-empty{ color:var(--muted); padding:14px 0; }
.hy-add{ width:100%; padding:11px; border:0; border-top:1px solid var(--line); background:#f6f9fe; color:var(--accent); font-size:13px; font-weight:800; }
/* ハイパー入力のピッカー: クラブと同じ固定オーバーレイ(下の内容を押し下げない・必要な高さのみ) */
.mobile-hyper-pick{ padding-top:76px; padding-bottom:18px; }
.mobile-hyper-pick h3{ margin: 4px 0 12px; font-size:18px; }
.mobile-hyper-pick .hy-opts{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.mobile-hyper-pick .hy-opts button,
.mobile-hyper-pick .hy-keys button{ min-height:48px; border:0; border-radius:6px; background:#fff; color:var(--accent); font-size:18px; font-weight:800; }
.mobile-hyper-pick .hy-opts button.active{ color:#fff; background:var(--mobile-primary); box-shadow:inset 0 0 0 2px rgba(255,255,255,0.62); }
.mobile-hyper-pick .hy-keys{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.mobile-hyper-pick .hy-keys button.ok{ color:#fff; background:var(--mobile-primary); }
.mobile-hyper-pick .hy-pick-value{ text-align:center; font-size:30px; font-weight:800; color:#fff; margin-bottom:12px; }
.mobile-hyper-pick .hy-pick-value .u{ font-size:14px; opacity:.85; margin-left:2px; }
/* シンプルなバンカー/OB/ペナルティ・パレット */
.hy-counters{ display:flex; gap:8px; margin-top:2px; }
.hy-count{ flex:1; background:#fff; border:1px solid var(--line); border-radius:10px; padding:8px; text-align:center; font-size:12px; color:var(--muted); font-weight:700; }
.hy-count b{ display:block; color:var(--accent); font-size:20px; margin-top:2px; }
/* 数字の下の補足(結果名・累計の対パー・累計)。通常入力と同じ内容。 */
.hy-count .hy-sub{ display:flex; justify-content:center; align-items:baseline; gap:6px; margin-top:3px; font-style:normal; font-size:11px; font-weight:700; }
.hy-count .hy-sub em{ font-style:normal; color:var(--muted); }
.hy-count .hy-sub s{ text-decoration:none; color:var(--accent); }
.hy-count .hy-sub u{ text-decoration:none; color:#9aa7b8; }
.hy-count .hy-sub :empty{ display:none; }

/* ===== 設定管理 > ヤード登録 ===== */
/* 見た目はラウンド情報の「ゴルフ場 / エリア」に揃える（枠の高さ30px・文字13px・見出し12px）。 */
.hole-yards-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.hole-yards-row label {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.hole-yards-row .field-course {
  flex: 0 1 320px;
  min-width: 200px;
}

.hole-yards-row input[type="text"],
.hole-yards-row input:not([type]) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.hole-yards-row .field-jga-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.hole-yards-row .field-jga-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}

.hole-yards-row .hole-yards-file {
  flex: 0 1 360px;
  min-width: 240px;
}

/* JGA取込の「JGA JSON」と同じ枠に揃える(白地・枠線・角丸)。高さだけ1行に収まるよう詰める。 */
.hole-yards-row .hole-yards-file input[type="file"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 13px;
}

/* エリア検索の一覧はラウンド入力と同じ見た目を使う（input-course-area-panel） */
#holeYardsAreaPanel {
  margin-top: 8px;
}

/* スマホのゴルフ場検索(全画面)。PCでは使わない。
   中身は round-basic と同じ .mobile-picker-* を使うが、あちらは
   高さいっぱいの親に置かれる前提なので、ここで全画面の器を用意する。 */
.schedule-course-btn {
  display: none;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
}

.schedule-course-btn .mcb-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-course-btn.has-value {
  color: var(--ink);
}

.schedule-course-picker {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: #f2f2f7;
}

.schedule-course-picker[hidden] {
  display: none;
}

body.schedule-picker-open {
  overflow: hidden;
}

/* PCは全画面ではなく、事前準備(ハイパー入力)と同じ中央の枠にする。
   選ぶ項目の数に対して画面全部を使うと落ち着かないため。
   スマホは全画面のまま（round-basic と揃える）。
   round-basic 側の検索は別物なので、この枠の中だけに効かせる。 */
@media (min-width: 641px) {
  .schedule-course-picker {
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 26, 45, 0.45);
  }

  .schedule-course-picker > .mobile-picker-overlay {
    box-sizing: border-box;
    flex: 0 1 auto;
    width: min(680px, 100%);
    height: auto;
    max-height: min(520px, 100%);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 26, 45, 0.3);
  }

  .schedule-course-picker .mobile-picker-header {
    border-radius: 12px 12px 0 0;
  }

  /* 高さが内容なりになるので flex-basis:0 のままだと一覧が潰れる */
  .schedule-course-picker .mobile-picker-list {
    flex: 0 1 auto;
  }
}

/* ===== 設定管理 > 予定登録 ===== */
/* ボタンは td の中の div に入れる。td 自体を display:flex にすると
   表のセルでなくなり、行の高さにボタンが収まらず潰れる。 */
.schedule-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
}

.schedule-actions button {
  /* button 共通の min-height:36px を打ち消さないと height が効かない */
  box-sizing: border-box;
  height: 14px;
  min-height: 14px;
  min-width: 36px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

/* ===== 予定登録: カレンダー ===== */
.schedule-calendar-panel {
  margin-top: 8px;
  /* 予定の吹き出しが枠で切れないようにする */
  overflow: visible;
}

.schedule-calendar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
}

.schedule-calendar-nav button {
  flex: 0 0 auto;
  height: 24px;
  min-height: 24px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.schedule-calendar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 10px 12px 12px;
}

.schedule-cal-title {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.schedule-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.schedule-cal-dow {
  padding: 2px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.schedule-cal-dow.is-sun,
.schedule-cal-day.is-sun .schedule-cal-num {
  color: #c0392b;
}

.schedule-cal-dow.is-sat,
.schedule-cal-day.is-sat .schedule-cal-num {
  color: #2563a8;
}

.schedule-cal-blank {
  min-height: 32px;
}

/* 1行目は 日付＋スタート。1行減らして枠を低くし、4か月分を出す。 */
.schedule-cal-head {
  display: flex;
  align-items: baseline;
  gap: 3px;
  min-width: 0;
}

.schedule-cal-day {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 2px 4px;
  border: 1px solid #eceff4;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
}

.schedule-cal-num {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.schedule-cal-course,
.schedule-cal-busy {
  display: block;
  color: var(--accent);
  font-size: 9.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-cal-start {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-cal-day.has-plan {
  border-color: #b9c6da;
  background: #e8eef7;
}

/* 予定がある日は枠の中の文字を太字にする */
.schedule-cal-day.has-plan .schedule-cal-num,
.schedule-cal-day.has-plan .schedule-cal-start,
.schedule-cal-day.has-plan .schedule-cal-course {
  font-weight: 800;
}

/* ゴルフの予定を入れられない日。カレンダーだけの表示で、文字は入れない。 */
.schedule-cal-day.is-busy {
  border-color: #c9ccd3;
  background: #e6e6ea;
}

.schedule-cal-day.is-busy .schedule-cal-num {
  color: #8a8d94;
}

.schedule-cal-busy {
  color: #8a8d94;
}

/* 行けそうな日（候補日）。淡い黄色。 */
.schedule-cal-day.is-candidate {
  border-color: #e4d5a4;
  background: #fdf6e0;
}

.schedule-cal-day.is-candidate .schedule-cal-num,
.schedule-cal-day.is-candidate .schedule-cal-busy {
  color: #8a6d1f;
}

.schedule-cal-day.is-today {
  border: 2px solid var(--accent);
}

.schedule-calendar-nav button.is-on {
  border-color: #fff;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
}

.schedule-busy-hint {
  margin: 0;
  padding: 6px 12px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.schedule-busy-hint[hidden] {
  display: none;
}

.schedule-calendar.is-busy-mode {
  background: #fcfaf6;
}

.schedule-cal-day.is-past {
  opacity: 0.62;
}

/* 予定の内容の吹き出し。マウスが使える端末だけ出す。 */
.schedule-cal-tip {
  display: none;
}

@media (hover: hover) {
  .schedule-cal-day:hover {
    border-color: var(--accent);
  }

  .schedule-cal-day.has-plan:hover {
    overflow: visible;
  }

  .schedule-cal-day.has-plan:hover .schedule-cal-tip {
    display: grid;
    gap: 2px;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    z-index: 30;
    box-sizing: border-box;
    min-width: 210px;
    max-width: 300px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #1b1f23;
    color: #fff;
    font-size: 11px;
    line-height: 1.35;
    white-space: normal;
    text-align: left;
    pointer-events: none;
  }
}

/* スマホは日付＋点だけにして、内容は押したときの吹き出しで見せる */
@media (max-width: 640px) {
  .schedule-calendar {
    grid-template-columns: 1fr;
  }

  .schedule-cal-day,
  .schedule-cal-blank {
    min-height: 30px;
  }

  .schedule-cal-day {
    padding: 2px 1px;
  }

  .schedule-cal-head {
    justify-content: center;
    gap: 2px;
  }

  /* 枠が狭いのでスタートは省き、ゴルフ場名だけを入るだけ出す */
  .schedule-cal-start {
    display: none;
  }

  .schedule-cal-course,
  .schedule-cal-busy {
    text-align: center;
  }

  /* スマホは縦に並ぶので2か月まで */
  .schedule-cal-month:nth-child(n + 3) {
    display: none;
  }

  .schedule-cal-course,
  .schedule-cal-busy {
    font-size: 9px;
  }

  /* 帯が狭いので、表示中の月の並びは出さない（各月の見出しに出ている） */
  #scheduleCalendarRange {
    display: none;
  }

  .schedule-calendar-nav {
    gap: 6px;
  }

  .schedule-calendar-nav button {
    padding: 0 7px;
  }
}

.schedule-day-popup {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schedule-day-popup[hidden] {
  display: none;
}

.schedule-day-popup-dim {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 45, 0.42);
}

.schedule-day-popup-card {
  position: relative;
  box-sizing: border-box;
  width: min(88vw, 340px);
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 26, 45, 0.24);
}

.schedule-day-popup-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.schedule-day-popup-course {
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.schedule-day-popup-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.schedule-day-popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.schedule-day-popup-actions button {
  flex: 1 1 0;
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.schedule-day-popup-actions button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ドラッグ中のマス */
.schedule-cal-day[draggable="true"] {
  cursor: grab;
}

/* 過ぎた予定は薄く出す */
.schedule-round-table tbody tr.schedule-past-row td {
  color: var(--muted);
}

/* スケジュール一覧は、画面の高さのところで切って中だけをスクロールさせる。
   .table-wrap は max-height:560px を持っているが、後から来る
   .table-panel .table-wrap が max-height:none で打ち消している。
   そのため一覧が件数ぶん縦に伸びきり、ホイールを回しても表の中が動かなかった。
   ここで戻す。overflow:auto と scrollbar-gutter は .table-wrap 側にある。

   実際の高さは app.js の updateScheduleListHeight() が画面の下端に合わせて
   入れ直す（/list や クラブHDCP と同じ作り）。この 60vh は、それが動く前の保険。 */
.schedule-list-panel .table-wrap {
  max-height: 60vh;
}

.schedule-empty {
  margin: 0;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* 日付〜クリアまでを1行に収める。
   ラウンド情報の28分割の格子だと欄の合計が28を超えて折り返すため、
   この画面だけ欄の数だけ列を用意する。狭い画面(900px以下)は元の折り返しのまま。 */
@media (min-width: 1140px) {
  #scheduleForm {
    grid-template-columns:
      118px                 /* 日付 */
      minmax(140px, 1.6fr)  /* ゴルフ場 */
      66px                  /* エリア */
      96px                  /* スタート(「半角数字4桁」が入る幅) */
      minmax(76px, 1fr)     /* 前半コース */
      minmax(76px, 1fr)     /* 後半コース */
      minmax(76px, 1fr)     /* ティー */
      60px                  /* 色 */
      minmax(76px, 1fr)     /* グリーン */
      210px;                /* 保存・クリア・削除 */
  }

  #scheduleForm > label,
  #scheduleForm > .field-jga-actions {
    grid-column: auto;
  }
}

/* スマホは3行に並べる。
   1行目 日付/ゴルフ場/エリア、2行目 スタート/前半/後半、3行目 ティー/色/グリーン。 */
@media (max-width: 900px) {
  #scheduleForm {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  #scheduleForm .field-date {
    grid-column: span 2;
    max-width: none;
  }

  /* iOS Safari の日付欄は中身の最小幅が優先され、width:100% を指定しても
     枠からはみ出して隣(ゴルフ場)の枠にくっつく。
     ネイティブの見た目指定を外し、文字を小さくし、それでもはみ出す分は枠で切る。 */
  #scheduleForm .field-date {
    overflow: hidden;
  }

  #scheduleForm .field-date input {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 12px;
    padding: 0 2px;
    text-align: center;
  }

  /* スマホはゴルフ場名の入力欄とエリアボタンを隠し、
     全画面の検索(round-basic と同じ形)を開くボタンに置き換える。 */
  #scheduleForm .field-course {
    grid-column: span 4;
  }

  #scheduleForm #holeYardsCourse,
  #scheduleForm .field-area-action {
    display: none;
  }

  #scheduleForm .schedule-course-btn {
    display: flex;
  }

  #scheduleForm .field-start-input,
  #scheduleForm .field-front-course,
  #scheduleForm .field-back-course,
  #scheduleForm .field-tee-input,
  #scheduleForm .field-color-input,
  #scheduleForm .field-green-input {
    grid-column: span 2;
  }

  #scheduleForm .field-schedule-save {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  #scheduleForm .field-schedule-save button {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* 一覧は /list のラウンド一覧と同じ見せ方にする。
   左の列に「日付＋スタート / ゴルフ場 / コース・ティー・グリーン」を3行で入れ、
   もとの ゴルフ場・スタート・コース・ティー・グリーン の列は隠す。
   .round-table のスマホ用 nth-child 指定はラウンド一覧(19列)向けなので、ずれる列を直す。 */
@media (max-width: 640px) {
  .schedule-round-table { min-width: 1138px; }

  .schedule-round-table .schedule-start-col { display: none; }

  .schedule-round-table th:nth-child(1),
  .schedule-round-table td:nth-child(1) { width: 154px; min-width: 154px; max-width: 154px; }

  .schedule-round-table th:nth-child(7),
  .schedule-round-table td:nth-child(7),
  .schedule-round-table th:nth-child(8),
  .schedule-round-table td:nth-child(8),
  .schedule-round-table th:nth-child(9),
  .schedule-round-table td:nth-child(9),
  .schedule-round-table th:nth-child(15),
  .schedule-round-table td:nth-child(15),
  .schedule-round-table th:nth-child(17),
  .schedule-round-table td:nth-child(17),
  .schedule-round-table th:nth-child(18),
  .schedule-round-table td:nth-child(18) {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
  }

  .schedule-round-table th:nth-child(10),
  .schedule-round-table td:nth-child(10),
  .schedule-round-table th:nth-child(11),
  .schedule-round-table td:nth-child(11),
  .schedule-round-table th:nth-child(12),
  .schedule-round-table td:nth-child(12),
  .schedule-round-table th:nth-child(13),
  .schedule-round-table td:nth-child(13),
  .schedule-round-table th:nth-child(14),
  .schedule-round-table td:nth-child(14),
  .schedule-round-table th:nth-child(16),
  .schedule-round-table td:nth-child(16) {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    white-space: normal;
  }

  .schedule-round-table th:nth-child(19),
  .schedule-round-table td:nth-child(19) {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
  }
}

/* 表は .round-table を流用する。列の並びは
   1日付 2ゴルフ場 3スタート 4コース 5ティー 6グリーン 7スコア 8ショット 9パット
   10FW 11パーオン 12ボギーオン 13スクランブル率 14Putts per GIR 15SGA
   16Yards 17CR 18SR 19Yards登録。
   .round-table の nth-child 指定は列の並びが違うので、全列をここで決める。 */
.schedule-round-table { min-width: 1140px; }

.schedule-round-table th:nth-child(1),
.schedule-round-table td:nth-child(1) { width: 70px; }

.schedule-round-table th:nth-child(2),
.schedule-round-table td:nth-child(2) { width: 150px; min-width: 150px; max-width: 150px; }

.schedule-round-table th:nth-child(3),
.schedule-round-table td:nth-child(3) { width: 56px; }

.schedule-round-table th:nth-child(4),
.schedule-round-table td:nth-child(4) { width: 100px; min-width: 100px; max-width: 100px; }

.schedule-round-table th:nth-child(5),
.schedule-round-table td:nth-child(5) { width: 72px; }

.schedule-round-table th:nth-child(6),
.schedule-round-table td:nth-child(6) { width: 56px; }

.schedule-round-table th:nth-child(7),
.schedule-round-table td:nth-child(7),
.schedule-round-table th:nth-child(9),
.schedule-round-table td:nth-child(9) { width: 44px; }

.schedule-round-table th:nth-child(8),
.schedule-round-table td:nth-child(8) { width: 50px; }

.schedule-round-table th:nth-child(10),
.schedule-round-table td:nth-child(10),
.schedule-round-table th:nth-child(11),
.schedule-round-table td:nth-child(11),
.schedule-round-table th:nth-child(12),
.schedule-round-table td:nth-child(12),
.schedule-round-table th:nth-child(13),
.schedule-round-table td:nth-child(13) { width: 50px; }

.schedule-round-table th:nth-child(14),
.schedule-round-table td:nth-child(14) { width: 54px; }

.schedule-round-table th:nth-child(15),
.schedule-round-table td:nth-child(15) { width: 40px; }

.schedule-round-table th:nth-child(16),
.schedule-round-table td:nth-child(16) { width: 52px; }

.schedule-round-table th:nth-child(17),
.schedule-round-table td:nth-child(17),
.schedule-round-table th:nth-child(18),
.schedule-round-table td:nth-child(18) { width: 38px; }

.schedule-round-table th:nth-child(19),
.schedule-round-table td:nth-child(19) { width: 76px; }

/* ボタンが行の高さに収まるよう、この列だけ上下に余白を足す */
.schedule-round-table td.schedule-action-col {
  height: 20px;
  padding-top: 1px;
  padding-bottom: 1px;
}

.schedule-round-table .schedule-start-col {
  white-space: nowrap;
}

/* 見出しを紺地・白文字にする（ラウンド入力の見出しと同じ作り） */
.panel-header-accent {
  border-bottom-color: var(--accent);
  background: var(--accent);
  color: #fff;
  /* パネル(角丸8px)からヘッダーの角がはみ出さないよう上端を丸める */
  border-radius: 8px 8px 0 0;
}

.panel-header-accent h2 {
  color: inherit;
}

.panel-header-accent p {
  color: rgba(255, 255, 255, 0.9);
}

/* ===== ラウンド一覧の列幅(22列) =====
   スクランブル率・Putts per GIR・SGA を足したぶん、他の列から少しずつ削って
   幅の合計は 1200px のまま（表全体は広がらない）。
   この表だけに効かせる。クラブHDCP(.homeclub-round-table)と
   スケジュール一覧(.schedule-round-table)は列の並びが違うので触らない。 */
.list-round-table th:nth-child(1),
.list-round-table td:nth-child(1) { width: 70px; }

.list-round-table th:nth-child(2),
.list-round-table td:nth-child(2) { width: 150px; min-width: 150px; max-width: 150px; }

.list-round-table th:nth-child(3),
.list-round-table td:nth-child(3) { width: 100px; min-width: 100px; max-width: 100px; }

.list-round-table th:nth-child(4),
.list-round-table td:nth-child(4) { width: 72px; }

.list-round-table th:nth-child(5),
.list-round-table td:nth-child(5) { width: 56px; }

.list-round-table th:nth-child(6),
.list-round-table td:nth-child(6),
.list-round-table th:nth-child(8),
.list-round-table td:nth-child(8) { width: 44px; }

.list-round-table th:nth-child(7),
.list-round-table td:nth-child(7) { width: 50px; }

.list-round-table th:nth-child(9),
.list-round-table td:nth-child(9),
.list-round-table th:nth-child(10),
.list-round-table td:nth-child(10),
.list-round-table th:nth-child(11),
.list-round-table td:nth-child(11),
.list-round-table th:nth-child(12),
.list-round-table td:nth-child(12) { width: 50px; }

.list-round-table th:nth-child(13),
.list-round-table td:nth-child(13) { width: 54px; }

.list-round-table th:nth-child(14),
.list-round-table td:nth-child(14) { width: 40px; }

.list-round-table th:nth-child(15),
.list-round-table td:nth-child(15),
.list-round-table th:nth-child(19),
.list-round-table td:nth-child(19) { width: 30px; }

.list-round-table th:nth-child(16),
.list-round-table td:nth-child(16) { width: 52px; }

.list-round-table th:nth-child(17),
.list-round-table td:nth-child(17),
.list-round-table th:nth-child(18),
.list-round-table td:nth-child(18) { width: 38px; }

.list-round-table th:nth-child(20),
.list-round-table td:nth-child(20),
.list-round-table th:nth-child(21),
.list-round-table td:nth-child(21),
.list-round-table th:nth-child(22),
.list-round-table td:nth-child(22) { width: 44px; }

/* スマホ。ゴルフ場・コース・ティー・グリーン(2〜5列)は隠し、左の列に3行でまとめる。 */
@media (max-width: 640px) {
  .list-round-table { min-width: 1378px; }

  .list-round-table th:nth-child(1),
  .list-round-table td:nth-child(1) { width: 154px; min-width: 154px; max-width: 154px; }

  .list-round-table th:nth-child(6),
  .list-round-table td:nth-child(6),
  .list-round-table th:nth-child(7),
  .list-round-table td:nth-child(7),
  .list-round-table th:nth-child(8),
  .list-round-table td:nth-child(8),
  .list-round-table th:nth-child(14),
  .list-round-table td:nth-child(14),
  .list-round-table th:nth-child(17),
  .list-round-table td:nth-child(17),
  .list-round-table th:nth-child(18),
  .list-round-table td:nth-child(18),
  .list-round-table th:nth-child(19),
  .list-round-table td:nth-child(19),
  .list-round-table th:nth-child(21),
  .list-round-table td:nth-child(21),
  .list-round-table th:nth-child(22),
  .list-round-table td:nth-child(22) { width: 64px; min-width: 64px; max-width: 64px; }

  .list-round-table th:nth-child(9),
  .list-round-table td:nth-child(9),
  .list-round-table th:nth-child(10),
  .list-round-table td:nth-child(10),
  .list-round-table th:nth-child(11),
  .list-round-table td:nth-child(11),
  .list-round-table th:nth-child(12),
  .list-round-table td:nth-child(12),
  .list-round-table th:nth-child(13),
  .list-round-table td:nth-child(13),
  .list-round-table th:nth-child(16),
  .list-round-table td:nth-child(16) { width: 88px; min-width: 88px; max-width: 88px; white-space: normal; }

  .list-round-table th:nth-child(15),
  .list-round-table td:nth-child(15) { width: 48px; min-width: 48px; max-width: 48px; }

  .list-round-table th:nth-child(20),
  .list-round-table td:nth-child(20) { width: 72px; min-width: 72px; max-width: 72px; }
}

/* ===== 事前準備（ホール別ヤードの登録）===== */
.prep-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 26, 45, 0.45);
}

.prep-overlay[hidden] { display: none; }

body.prep-open { overflow: hidden; }

.prep-card {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(1120px, 100%);
  max-height: 100%;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 26, 45, 0.3);
  overflow: hidden;
}

.prep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
}

.prep-title { font-size: 15px; font-weight: 800; }
.prep-sub { font-size: 12px; opacity: 0.88; }

.prep-close,
.prep-foot-actions button {
  height: 30px;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.prep-close { border-color: rgba(255, 255, 255, 0.55); background: transparent; color: #fff; }

.prep-primary {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #fff !important;
}

.prep-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.prep-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.prep-status b { color: var(--ink); font-weight: 800; }
.prep-status .is-ok, .prep-check.is-ok, .prep-csv-sum .is-ok, .prep-csv-checks .is-ok { color: #2c6a4d; }
.prep-status .is-diff, .prep-check.is-diff, .prep-csv-sum .is-diff, .prep-csv-checks .is-diff { color: #a8461c; }
.prep-check.is-wait { color: var(--muted); }
.prep-message { margin-left: auto; }
.prep-message.is-error { color: #a8461c; font-weight: 700; }

.prep-tabs {
  display: flex;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.prep-tab {
  min-height: 0;
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.prep-tab.is-on { border-bottom-color: var(--accent); color: var(--accent); font-weight: 800; }

.prep-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 14px;
  overflow-y: auto;
}

.prep-note { margin: 0 0 10px; color: var(--muted); font-size: 12px; }

.prep-steps { margin: 0; padding-left: 20px; font-size: 13px; }
.prep-steps li { margin-bottom: 12px; }
.prep-steps p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.prep-steps button { height: 30px; min-height: 30px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; }
.prep-file { margin-left: 8px; color: var(--muted); font-size: 12px; }

.prep-csv-result { margin-top: 8px; font-size: 12px; }
.prep-csv-sum { padding: 6px 0; }
.prep-csv-errors { margin: 4px 0; padding-left: 18px; color: #a8461c; }
.prep-csv-checks { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.prep-csv-checks li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); }

.prep-group { margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

.prep-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 7px 10px;
  border: 0;
  background: #f5f7f9;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.prep-group-caret { color: var(--muted); font-size: 11px; }
.prep-group-title { font-size: 13px; font-weight: 800; }
.prep-group-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.prep-group-checks { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; }

.prep-side { padding: 8px 10px; border-top: 1px solid var(--line); }
.prep-side-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.prep-side-name { font-size: 12.5px; font-weight: 800; }
.prep-source { color: var(--muted); font-size: 11px; }

.prep-badge { padding: 2px 8px; border-radius: 4px; font-size: 10.5px; font-weight: 700; }
.prep-badge.is-ok { background: #e2efe8; color: #2c6a4d; }
.prep-badge.is-empty { background: #eaedf1; color: #5f6874; }

.prep-cells {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr)) 88px;
  gap: 5px;
  align-items: end;
}

.prep-cell { display: grid; gap: 2px; color: var(--muted); font-size: 10.5px; text-align: center; }
.prep-cell input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}
.prep-cell-total { text-align: right; }
.prep-cell-total strong { font-size: 14px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }

.prep-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.prep-foot-note { color: var(--muted); font-size: 12px; }
.prep-foot-actions { display: flex; gap: 8px; }

@media (max-width: 640px) {
  .prep-overlay { padding: 0; }
  .prep-card { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .prep-cells { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .prep-cell-total { grid-column: 1 / -1; text-align: left; }
  .prep-group-checks { width: 100%; margin-left: 0; }
}

/* 一覧の「Yards登録」欄。準備が済んでいる行は「不要」と出す(押すと中身を見て直せる)。 */
.schedule-actions .prep-none {
  font-size: 11px;
  color: var(--muted);
}

.schedule-actions button.prep-partial {
  min-width: 0;
  padding: 0 8px;
  border-color: #e4d5a4;
  background: #fdf6e0;
  color: #8a6d1f;
  font-size: 11px;
}

/* 全部埋まっているが、JGAの18H合計と合わない。値が正しいとは限らない */
.schedule-actions button.prep-check {
  min-width: 0;
  padding: 0 8px;
  border-color: #e2aaa2;
  background: #fff0ee;
  color: #9b2c1f;
  font-size: 11px;
}

.schedule-actions button.prep-done {
  min-width: 0;
  padding: 0 6px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.schedule-actions button.prep-done:hover {
  color: var(--accent);
}

/* 基本設定 > データ同期（第1段）。差の一覧と、表ごとの件数。 */
.sync-card .sync-result { margin-top: 10px; }
.sync-ok { color: #1c6b45; font-weight: 700; margin: 0 0 8px; }
.sync-error { color: #a3261f; font-weight: 700; margin: 0 0 8px; line-height: 1.7; }
.sync-note { font-weight: 700; margin: 0 0 8px; }
.sync-list { list-style: none; margin: 0 0 12px; padding: 0; }
.sync-list li { display: grid; grid-template-columns: 20px 74px 1fr 42px; gap: 6px; align-items: baseline; padding: 3px 0; font-size: 13px; border-bottom: 1px solid #e6ecf5; }
.sync-list .sync-mark { font-weight: 800; }
.sync-list .is-add .sync-mark { color: #1c6b45; }
.sync-list .is-del .sync-mark { color: #a3261f; }
.sync-list .is-upd .sync-mark { color: #b26a00; }
.sync-list .sync-score { text-align: right; font-weight: 700; }
/* 長いゴルフ場名で枠を押し広げないよう、はみ出す分は「…」で切る。 */
.sync-list .sync-course { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 枠に収める。ra-tbl の既定（見出し168px・数値100px）だと はみ出す。 */
.sync-table { width: 100%; font-size: 12px; table-layout: fixed; }
.sync-table thead th:first-child { width: auto; min-width: 0; }
.sync-table thead th:not(:first-child) { width: 80px; }
.sync-table th, .sync-table td { padding: 4px 8px; }
.sync-table tbody th { text-align: left; font-weight: 700; color: #111820; background: inherit; }
.sync-table td.sync-judge { text-align: right; font-weight: 700; }
.sync-table tbody tr.is-diff { background: #fdeeee; }
.sync-subhead { margin: 18px 0 8px; font-size: 13px; font-weight: 800; color: #1f3a5f; }

/* カードに残す1行。中身は別画面で出す。 */
.sync-summary { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.sync-open-diff {
  border: 1px solid #d7e0ee; border-radius: 8px; background: #fff; color: #1f3a5f;
  font-size: 12px; font-weight: 700; padding: 5px 12px; cursor: pointer;
}
.sync-open-diff:hover { background: #f6f9fe; }
.sync-modal { width: min(680px, 94vw); }

/* クラブ分析の統計見出しの説明。左端の列なので、左寄せで折り返す。
   共通の .has-tooltip::after が min-width:max-content を持っており、
   それが max-width:300px より強いため、折り返さず1行のまま横へ伸びていた
   （実測 477px）。width:max-content と min-width:0 を入れて 300px で折り返す。
   .ra-k.has-tooltip::after は元から width:max-content を併記している。 */
.club-field-label.has-tooltip::after {
  left: 0;
  transform: none;
  width: max-content;
  min-width: 0;
  max-width: 300px;
  white-space: normal;
  line-height: 1.6;
  text-align: left;
  font-weight: 500;
}


/* いまのHDCPの算出に実際に使われている回（直近20件のDIFFのうち良い方から8件）。
   奇数行・偶数行の縞より後に書いて、こちらを優先させる。 */
.round-table tbody tr.hdcp-used-row,
.round-table tbody tr.hdcp-used-row:nth-child(odd),
.round-table tbody tr.hdcp-used-row:nth-child(even) {
  background: #e4f3e9;
}
.round-table tbody tr.hdcp-used-row td:first-child {
  box-shadow: inset 3px 0 0 #2f7a4d;
}
@media (max-width: 640px) {
  .round-table tbody tr.hdcp-used-row td:nth-child(1) { background: #e4f3e9; }
}

/* スマホの一覧に出す番号。/list は通算ラウンド数、クラブHDCP はそのゴルフ場への来場回数。
   .mobile-round-info はPCでは非表示なので、PCの列幅・見た目には影響しない。 */
.round-seq {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mobile-round-line {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

/* スコア分析（スマホ・1ラウンド分）。表の見た目は詳細分析(.ra-*)をそのまま使う。 */
.rsa { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.rsa .ra-sec { margin: 0; }
/* 失点ホールの合計行。ヘッダーと同じ紺で締める。 */
.rsa .rsa-total th.ra-rh,
.rsa .rsa-total td.ra-num { background: var(--accent); color: #fff; }

/* 説明を出している間だけ、その見出しセルを前に出す。
   .club-field-label は position:sticky + z-index:2 で、行ごとに重なり順を持つ。
   同じ z-index だと後ろの行が上に来るため、説明が次の行（帯など）に隠れていた。
   実測: カーソルを当てた位置にあるのは次の行の見出しセルだった。 */
.club-table .club-field-label.has-tooltip:hover {
  z-index: 5;
}

/* ===== 設定カードの中に出す保存結果 =====
   パネル見出しの #settingsStatus は設定画面の一番上にある。カードが下にあると
   スマホでは画面外になり、保存できたのか分からない。カードの中にも出す。 */
.settings-card-status {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-height: 1em;           /* 出たり消えたりでカードの高さが動かないように */
}

.settings-card-status.is-ok {
  color: #1c7c4a;
}

.settings-card-status.is-error {
  color: #b3261e;
}
