/* =========================================================================
   G-LAND v3.0.0 — modal.css
   ---------------------------------------------------------------------------
   glModal 共通基盤 + 各モーダル固有スタイルを集約。
   iOS Safari PWA の位置ズレ根本解決:
     - `.gl-modal` は 100vh ではなく dvh を優先し、safe-area を padding で加算
     - align-items: center は "実表示エリア" 基準になる
     - JS 側の _injectStyles() は全廃したため優先度戦争は自然消滅
   ========================================================================= */

/* ==== glModal 基盤（全モーダル共通） ==================================== */
.gl-modal,
#modal-root .gl-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding:
    calc(var(--gl-safe-top) + 20px)
    calc(var(--gl-safe-right) + 20px)
    calc(var(--gl-safe-bottom) + 20px)
    calc(var(--gl-safe-left) + 20px);
  box-sizing: border-box;
  overscroll-behavior: contain;
}
.gl-modal.show,
#modal-root .gl-modal.show { display: flex; }

.gl-modal__backdrop,
#modal-root .gl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  z-index: 0;
}

.gl-modal__body,
#modal-root .gl-modal__body {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  flex-shrink: 0;
  min-width: 0;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}
.gl-modal__body--wide { width: min(100%, 720px); }

/* Name labels wrap; the adjacent action remains one horizontal label. */
[data-course-name-label] { overflow-wrap: anywhere; white-space: normal; }
[data-course-admin-edit] { white-space: nowrap; flex-shrink: 0; }

.gl-modal__title,
#modal-root .gl-modal__title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 800;
  color: #1a5f3f;
}

.gl-modal__close,
#modal-root .gl-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
  z-index: 10;
  padding: 0;
}
.gl-modal__close:hover,
.gl-modal__close:active,
#modal-root .gl-modal__close:hover,
#modal-root .gl-modal__close:active {
  background: rgba(0, 0, 0, 0.08);
  color: #1a5f3f;
}

/* モーダル内の見出し・段落 */
.gl-modal__body p,
#modal-root .gl-modal__body p {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  margin: 0 0 12px;
}
.gl-modal__body h3,
#modal-root .gl-modal__body h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1a5f3f;
  margin: 14px 0 8px;
}

/* モーダル内フォーム */
.gl-modal__body input[type="text"],
.gl-modal__body input[type="tel"],
.gl-modal__body input[type="number"],
.gl-modal__body input[type="email"],
.gl-modal__body select,
.gl-modal__body textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
  background: #fff;
}
.gl-modal__body input:focus,
.gl-modal__body select:focus,
.gl-modal__body textarea:focus {
  border-color: #1a5f3f;
  outline: none;
}

/* ★ v3.0.40.503: base.cssのinput,textarea{-webkit-appearance:none;}が type="time" にも一律にかかり、
   iOS Safariでネイティブ描画(数字表示・ホイールピナー)が消え、空欄の線に見える事故を修正。
   【受付・組分けボードのスタート時刻入力欄(gl-er-teetime)で令が入っているのに表示されない不具合の根本原因】
   type="text"等のブロッキに合流させない理由: width:100%が付くと固定幅指定(width:92px等)のレイアウトが崩れるため、
   appearanceの復元のみの専用ルールとして分離。 */
#modal-root .gl-modal__body input[type="time"],
.gl-standalone-overlay input[type="time"] {
  -webkit-appearance: auto;
  appearance: auto;
  background: #fff;
  color: #33463a;
}

/* モーダル内 primary ボタン */
.gl-modal .gl-btn-primary,
#modal-root .gl-modal .gl-btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  background: #1a5f3f;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(26, 95, 63, 0.25);
}
.gl-modal .gl-btn-primary:active,
#modal-root .gl-modal .gl-btn-primary:active { background: #14472f; }
.gl-modal .gl-btn-primary:disabled,
#modal-root .gl-modal .gl-btn-primary:disabled { background: #999; cursor: default; }

/* glModal 共通アクション行 */
.gl-modal__actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.gl-modal__btn {
  flex: 1;
  min-width: 120px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.gl-modal__btn--primary { background: #1a5f3f; color: #fff; }
.gl-modal__btn--primary:active { background: #14472f; }
.gl-modal__btn--primary:disabled { background: #999; cursor: default; }
.gl-modal__btn--secondary { background: #f5f5f5; color: #666; }
.gl-modal__btn--secondary:active { background: #e8e8e8; }
.gl-modal__btn--danger { background: #f44336; color: #fff; }
.gl-modal__btn--danger:active { background: #c62828; }

/* サブ見出し */
.gl-modal__sub {
  font-size: 14px;
  color: #666;
  margin: 0 0 18px;
}

/* ==== オンボーディング（プロフィール登録）：既存互換 ==================== */
/* onboarding.js の gl-modal__sub, gl-form__* は components.css / base で吸収 */

/* ==== 配布 QR モーダル（home.js） ======================================
   従来は独自 overlay。glModal.open({modalType:'distqr'}) に置換。 */
.gl-modal--distqr .gl-modal__body {
  max-width: 340px;
  text-align: center;
  padding: 24px;
}
.gl-distqr-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a5f3f;
  margin-bottom: 8px;
}
.gl-distqr-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}
.gl-distqr-code {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  display: inline-block;
  margin: 8px 0 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.gl-distqr-code img,
.gl-distqr-code canvas { display: block; margin: 0 auto; }
.gl-distqr-url {
  font-size: 12px;
  color: #666;
  word-break: break-all;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 12px;
  font-family: monospace;
}
.gl-distqr-close {
  width: 100%;
  padding: 12px;
  background: #1a5f3f;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* ★ v3.0.15.38: 「アプリを配る」モーダルのLINEボタン・閉じるボタンを「つながり」モーダルと統一。
   現行の glModal（modalType='distqr'）では css/screens.css 側の古い定義が
   メディアクエリ内で上書きされ、ボタンが白っぽく見える不具合があったため、
   ここ（modal.css）で確実に適用されるよう詳細度を上げて定義する。 */
.gl-modal--distqr .gl-distqr-btn--line {
  background: #06C755 !important;
  color: #fff !important;
  border: none;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(6, 199, 85, 0.3);
}
.gl-modal--distqr .gl-distqr-btn--primary {
  background: #1a5f3f !important;
  color: #fff !important;
  width: 100%;
  border-radius: 10px;
}

/* ==== 招待モーダル（round.js） =========================================
   v3.0.0.4 fix: QRコード左寄りバグを解消。
   .gl-invite-box をフレックス縦積み・中央揃えにし、__qr は display:block +
   auto マージンで確実にセンタリング。 canvas/img/svg も block 化して
   inline-block 由来のベースライン隙間・左寄せを排除。 */
.gl-invite-box {
  background: linear-gradient(135deg, #1a5f3f, #2d7a56);
  color: #fff;
  padding: 20px;
  border-radius: 14px;
  text-align: center;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gl-invite-box__code {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 6px;
  margin: 10px 0;
  font-family: monospace;
  text-align: center;
  width: 100%;
}
.gl-invite-box__qr {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  display: block;
  margin: 12px auto;
  min-width: 200px;
  min-height: 200px;
  width: max-content;
  max-width: 100%;
  text-align: center;
  box-sizing: border-box;
}
.gl-invite-box__qr canvas,
.gl-invite-box__qr img,
.gl-invite-box__qr svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
.gl-invite-box__hint {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 8px;
  text-align: center;
  width: 100%;
}
.gl-input-code {
  width: 100%;
  padding: 16px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 8px;
  text-transform: uppercase;
  border: 2px solid #1a5f3f;
  border-radius: 12px;
  font-family: monospace;
  box-sizing: border-box;
}

/* ==== 履歴：BEST 演出（history.js） ==================================== */
.glh-best-modal .gl-modal__body { max-width: 380px; text-align: center; }
.glh-best-modal__icon {
  font-size: 64px;
  animation: glh-best-pop 0.5s ease-out;
}
.glh-best-modal__title {
  font-size: 22px;
  font-weight: 800;
  color: #f9a825;
  margin: 8px 0;
}
.glh-best-modal__sub { font-size: 14px; color: #666; margin-bottom: 14px; }
.glh-best-modal__score {
  font-size: 48px;
  font-weight: 800;
  color: #1a5f3f;
  margin: 12px 0;
}
.glh-best-modal__diff { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.glh-best-modal__close {
  width: 100%;
  padding: 14px;
  background: #1a5f3f;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}
@keyframes glh-best-pop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ==== Classic テーマ内モーダル（classic.js） =========================== */
/* 従来は .gl-cls-modal という独自クラス。glModal.open() に統合しつつ、
   既存の見た目を維持するため .gl-modal--cls として同等スタイルを提供。 */
.gl-modal--cls .gl-modal__body {
  max-width: 420px;
  padding: 20px;
}
.gl-modal--cls .gl-modal__title {
  font-size: 18px;
  color: #1a5f3f;
  margin: 0 0 12px;
}
.gl-modal--cls .gl-modal__body input[type="tel"],
.gl-modal--cls .gl-modal__body input[type="text"],
.gl-modal--cls .gl-modal__body input[type="number"] {
  width: 100%;
  padding: 14px;
  font-size: 20px;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
  margin: 8px 0 12px;
}
.gl-cls-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.gl-cls-modal__actions button { padding: 14px; border-radius: 8px; border: none; font-size: 14px; font-weight: 700; cursor: pointer; }
.gl-cls-modal__btn-cancel { background: #f5f5f5; color: #666; }
.gl-cls-modal__btn-ok { background: #1a5f3f; color: #fff; }
.gl-cls-modal__btn-clear { background: #fff4f4; color: #c62828; border: 1px solid #ffcdd2; }

/* Classic 内: ふりがな表示 / 代理編集 / LINE 共有共通 */
.gl-cls-modal__section {
  background: #fafafa;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}
.gl-cls-modal__section h3 {
  font-size: 13px;
  color: #5a4a30;
  margin: 0 0 6px;
  font-weight: 700;
}
.gl-cls-modal__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.gl-cls-modal__row:last-child { border: none; }

/* Wheel picker（Afternoon start） */
.gl-wheel-wrap {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 12px 0;
  height: 200px;
  position: relative;
}
.gl-wheel-scroller {
  height: 200px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  /* v3.0.3.10: 幅を親コンテナいっぱいにして数字を真ん中に寄せる（旧め width: 80px を廃止） */
  width: 100%;
  scrollbar-width: none;
}
.gl-wheel-scroller::-webkit-scrollbar { display: none; }
.gl-wheel-item {
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 22px;
  color: #999;
  scroll-snap-align: center;
  transition: color 0.15s, transform 0.15s;
}
.gl-wheel-item--active { color: #1a5f3f; font-weight: 800; transform: scale(1.15); }
.gl-wheel-colon {
  align-self: center;
  font-size: 24px;
  font-weight: 800;
  color: #1a5f3f;
}
.gl-wheel-highlight {
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  height: 40px;
  background: rgba(26,95,63,0.06);
  border-top: 2px solid #1a5f3f;
  border-bottom: 2px solid #1a5f3f;
  pointer-events: none;
}

/* LINE 共有ボタン */
.gl-cls-line-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: #06c755;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  margin: 8px 0;
}
.gl-cls-line-btn--outline {
  background: #fff;
  color: #06c755;
  border: 2px solid #06c755;
}
.gl-cls-line-preview {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #333;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 8px 0;
  max-height: 200px;
  overflow-y: auto;
}

/* ==== 保存前確認モーダル (finish-confirm) =============================== */
.gl-modal[data-modal-type="finish-confirm"] .gl-modal__body {
  max-width: 480px;
}
.gl-finish-summary {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}
.gl-finish-summary__row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}
.gl-finish-summary__label { color: #666; }
.gl-finish-summary__value { font-weight: 700; color: #333; }

/* ==== 代理管理モーダル（proxy-manager） ================================ */
.gl-modal[data-modal-type="proxy-manager"] .gl-modal__body { max-width: 440px; }
.gl-proxy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
}
.gl-proxy-row__info { flex: 1; }
.gl-proxy-row__name { font-weight: 700; color: #333; font-size: 15px; }
.gl-proxy-row__kana { font-size: 12px; color: #888; }
.gl-proxy-row__del {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

/* ==== コース選択 / 検索モーダル（course.js） =========================== */
.gl-course-list {
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px 0;
}
.gl-course-item {
  padding: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.gl-course-item:active { background: #f5f5f5; }
.gl-course-item__name { font-size: 15px; font-weight: 700; color: #333; }
.gl-course-item__pref { font-size: 12px; color: #888; margin-top: 2px; }

/* ==== glScorePanel（bottom-sheet, 対象外だが CSS 移管必要） ============ */
#gl-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.35);
  display: none;
}
/* v3.0.0 fix: _panel.js が付与する実クラスは .gl-panel-open。.show も互換で維持 */
#gl-panel-overlay.gl-panel-open,
#gl-panel-overlay.show { display: block; }

#gl-panel-root {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: #fff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.22);
  box-sizing: border-box;
  padding: 0;
  /* ★ v3.0.15.28: パネルを「中身スクロール＋ボタン固定」の2分割構造にし、
     さらに上部マージンを潰して画面最上部まで拡大（CEO最終仕様）。
     理由: Androidでパット行ボタンが下端に切れる問題の根本解決。
     背後のスコアカードが完全に隠れてもOK（右上の「×」で閉じられるため）。
     構造: パネル本体はflex縦並び。中身は .gl-panel-scroll（スクロール可）、
     ボタン行（.gl-cls-panel-actions）は直下に置いて固定表示。 */
  max-height: calc(100dvh - var(--gl-safe-top) - 4px);
  max-height: calc(100vh - var(--gl-safe-top) - 4px); /* dvh非対応端末のフォールバック */
  display: none;
  flex-direction: column;
  overflow: hidden;   /* スクロールは .gl-panel-scroll が担当（本体はスクロールしない） */
}
#gl-panel-root.gl-panel-open,
#gl-panel-root.show { display: flex; }

/* ★ v3.0.15.27: パネル内のスクロール領域（中身だけが動く） */
#gl-panel-root .gl-panel-scroll {
  flex: 1 1 auto;
  min-height: 0;             /* flex子が正しく縮むために必須 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 0;
}
/* ボタン行はスクロール領域の外（直下）で固定 */
#gl-panel-root .gl-cls-panel-actions {
  flex: 0 0 auto;
  padding: 10px 16px calc(var(--gl-safe-bottom) + 12px);
  background: #fff;
  border-top: 1px solid #f0e8d0;
}

/* =========================================================================
   元 index.html <style> 内モーダル内フォーム/ボタン詳細ルール
   （<style> を完全撤去するため、ここへ漏れなく移管）
   ========================================================================= */

/* モーダル内の見出し h3/h4 は緑色でマージン統一 */
#modal-root .gl-modal__body h3,
#modal-root .gl-modal__body h4 {
  margin: 12px 0 8px;
  color: #1a5f3f;
}

/* モーダル内 input/textarea 詳細ルール（元 index.html） */
/* ★ v3.0.40.498: checkbox/radio を除外（根治）。
   従来は input 全般に display:block; width:100%; padding:12px 14px; が
   一律で当たっており、チェックボックス/ラジオボタンが引き伸ばされて
   当たり判定と見た目が崩れ、「チェックが入らない」現象の原因になっていた。
   モーダルを使う全画面に影響する共通バグだったため、ここ1箇所の修正で全体を根治する。 */
#modal-root .gl-modal__body input:not([type="checkbox"]):not([type="radio"]),
#modal-root .gl-modal__body textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
}

/* ★ v3.0.40.500〜501【根治修Part2、3】: 498ではサイズ(引き伸ばし)の問題だけを止め、
   base.css の input,textarea { -webkit-appearance:none; } がチェッキボックス/ラジオボタンの
   枚線・チレオクス描画を消してしまう問題に手を入れていなかった。
   結果、「正しいサイズの透明な四角」（押しても何も見えない）になっていた。
   483で.gl-eri-check等の専用クラスに限定して行っていた自前描画対策を、クラス付け忘れでも
   二度と同じ事故が起きないよう、モーダル内のcheckbox/radio全体に拡張して根治する。
   ★ v501: 「月例競技会を作る」等の画面は実は#modal-rootではなく、js/ui/score/_classic-leaderboard.jsが
   document.bodyに直接作る独自オービーレイ(.gl-standalone-overlay)だったため500の修正が全く値いていなかった。
   セレキタに.gl-standalone-overlayも追加して共通化。 */
#modal-root .gl-modal__body input[type="checkbox"],
#modal-root .gl-modal__body input[type="radio"],
.gl-standalone-overlay input[type="checkbox"],
.gl-standalone-overlay input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  cursor: pointer;
  border: 2px solid #8fae9a;
  background: #fff;
  position: relative;
  box-sizing: border-box;
}
#modal-root .gl-modal__body input[type="checkbox"],
.gl-standalone-overlay input[type="checkbox"] {
  border-radius: 6px;
}
#modal-root .gl-modal__body input[type="radio"],
.gl-standalone-overlay input[type="radio"] {
  border-radius: 50%;
}
#modal-root .gl-modal__body input[type="checkbox"]:checked,
#modal-root .gl-modal__body input[type="radio"]:checked,
.gl-standalone-overlay input[type="checkbox"]:checked,
.gl-standalone-overlay input[type="radio"]:checked {
  background: #1a8f4c;
  border-color: #1a8f4c;
}
#modal-root .gl-modal__body input[type="checkbox"]:checked::after,
.gl-standalone-overlay input[type="checkbox"]:checked::after {
  content: "";
  position: absolute; left: 5px; top: 1px;
  width: 6px; height: 11px;
  border: solid #fff; border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
#modal-root .gl-modal__body input[type="radio"]:checked::after,
.gl-standalone-overlay input[type="radio"]:checked::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
/* ★ v501: .gl-standalone-overlay 内のinput全体にも、modal.cssの#modal-rootと同構造の
   サイズトラブル対策(display:block;width:100%など)を適用し、checkbox/radioは除外。 */
.gl-standalone-overlay input:not([type="checkbox"]):not([type="radio"]),
.gl-standalone-overlay textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
}

/* モーダル内 button デフォルト（グレー背景・緑文字） */
#modal-root .gl-modal__body button {
  display: inline-block;
  min-height: 44px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: #f2f4f3;
  color: #1a5f3f;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(26, 95, 63, 0.15);
  touch-action: manipulation;
}
#modal-root .gl-modal__body button:active {
  transform: scale(0.98);
}

/* 追加系ボタン（緑グラデ）：data-add or .gl-btn-primary */
#modal-root .gl-modal__body button[data-add],
#modal-root .gl-modal__body .gl-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #1a5f3f, #2d7a56);
  color: #fff;
  margin-top: 6px;
}

/* 危険系ボタン（削除・赤）：data-del or .gl-btn-danger */
#modal-root .gl-modal__body button[data-del],
#modal-root .gl-modal__body .gl-btn-danger {
  background: #d64545;
  color: #fff;
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
}

/* 終了・確定系ボタン（緑）：data-confirm or .gl-btn-confirm */
#modal-root .gl-modal__body button[data-confirm],
#modal-root .gl-modal__body .gl-btn-confirm {
  width: 100%;
  background: #1a5f3f;
  color: #fff;
  margin-top: 8px;
}

/* 閉じるフッターボタン：data-close or .gl-btn-close */
#modal-root .gl-modal__body button[data-close],
#modal-root .gl-modal__body .gl-btn-close {
  display: block;
  width: 100%;
  margin-top: 14px;
  background: #f2f4f3;
  color: #444;
  font-weight: 600;
}

/* モーダル内 label（既定・小さいグレー） */
#modal-root .gl-modal__body label {
  display: block;
  font-size: 13px;
  color: #666;
  margin: 8px 0 4px;
}

/* リストの各アイテム（代理入力の名前カード：faf7ec 背景） */
#modal-root .gl-modal__body .gl-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #faf7ec;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

/* ★ v3.0.7.4: β版ウェルカムモーダル（初回起動時のみ） */
.gl-beta-welcome {
  text-align: center;
  padding: 8px 4px;
}
.gl-beta-welcome__hero {
  font-size: 52px;
  line-height: 1.2;
  margin-bottom: 8px;
}
.gl-beta-welcome__title {
  font-size: 20px;
  font-weight: 800;
  color: #1a5f3f;
  margin-bottom: 10px;
}
.gl-beta-welcome__lead {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #e8a4b8;
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 14px;
}
.gl-beta-welcome__text {
  font-size: 14px;
  color: #444;
  line-height: 1.9;
  margin-bottom: 18px;
}
.gl-beta-welcome__note {
  font-size: 12px;
  color: #6b5a1e;
  background: #fff8e6;
  border-radius: 8px;
  padding: 8px 10px;
  display: inline-block;
}
.gl-beta-welcome__btn {
  width: 100%;
  max-width: 280px;
  padding: 14px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2e8b57 0%, #1a5f3f 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
.gl-beta-welcome__btn:active {
  opacity: 0.85;
}

/* ★ v3.0.7.4: 絵文字アイコン選択（プロフィール編集モーダル） */
.gl-icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.gl-icon-picker__btn {
  font-size: 26px;
  line-height: 1;
  padding: 8px 0;
  background: #f8f7f2;
  border: 2px solid #e5e2d8;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}
.gl-icon-picker__btn:active {
  transform: scale(1.12);
}
.gl-icon-picker__btn--selected {
  border-color: #2e8b57;
  background: #eaf6ee;
  box-shadow: 0 0 0 2px rgba(46, 139, 87, 0.15);
}

/* ★ v3.0.7.4: ご意見箱モーダル */
.gl-feedback__lead {
  font-size: 14px;
  font-weight: 700;
  color: #1a5f3f;
  margin-bottom: 14px;
  text-align: center;
}
.gl-feedback__types {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.gl-feedback__type {
  flex: 1;
  min-width: 100px;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 4px;
  background: #f8f7f2;
  border: 2px solid #e5e2d8;
  border-radius: 10px;
  cursor: pointer;
  color: #555;
}
.gl-feedback__type--selected {
  border-color: #2e8b57;
  background: #eaf6ee;
  color: #1a5f3f;
}
.gl-feedback__text {
  min-height: 110px;
  resize: vertical;
}
.gl-feedback__note {
  font-size: 12px;
  color: #8a7a3a;
  background: #fff8e6;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* ★ v3.0.7.4: Par入力タップボタン（コース新規登録の高速化） */
.cc-par-btn {
  width: 44px;
  height: 40px;
  font-size: 17px;
  font-weight: 700;
  color: #333;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.08s, background 0.12s, border-color 0.12s;
}
.cc-par-btn:active {
  transform: scale(1.12);
}
.cc-par-btn--3 {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}
.cc-par-btn--4 {
  border-color: #ddd;
  background: #fff;
  color: #333;
}
.cc-par-btn--5 {
  border-color: #c9a959;
  background: #fdf6e3;
  color: #8a6d1e;
}

/* ★ v3.0.8.0: スコアカードOCR UI */
.gl-ocr__entry-btn {
  width: 100%;
  font-size: 15px;
  font-weight: 700;
  border: none;
  color: #fff;
}
.gl-ocr__notice {
  font-size: 11px;
  line-height: 1.7;
  color: #6b5a1e;
  background: #fff8e6;
  border: 1px solid #e8d9a8;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  text-align: left;
}
.gl-ocr__hero {
  font-size: 56px;
  text-align: center;
  line-height: 1.2;
  margin: 8px 0;
}
.gl-ocr__lead {
  font-size: 15px;
  font-weight: 700;
  color: #1a5f3f;
  text-align: center;
  margin-bottom: 12px;
}
.gl-ocr__tips {
  font-size: 13px;
  line-height: 1.9;
  color: #555;
  background: #f0f8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.gl-ocr__status {
  margin-top: 14px;
  font-size: 14px;
  color: #1a5f3f;
  text-align: center;
  line-height: 1.6;
}
/* 確認プレビュー */
.gl-ocr__layout {
  margin-bottom: 14px;
}
.gl-ocr__layout-name {
  font-size: 13px;
  font-weight: 700;
  color: #5a4a30;
  margin-bottom: 6px;
}
.gl-ocr__grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
}
.gl-ocr__cell {
  text-align: center;
}
.gl-ocr__cell-label {
  display: block;
  font-size: 10px;
  color: #9a8c5a;
  margin-bottom: 2px;
}
.gl-ocr__par-btn {
  width: 100%;
  height: 38px;
  font-size: 16px;
  font-weight: 700;
  color: #333;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.08s;
}
.gl-ocr__par-btn:active {
  transform: scale(1.1);
}
.gl-ocr__par-btn--unread {
  border-color: #d32f2f;
  background: #fff0f0;
  color: #d32f2f;
  animation: gl-ocr-unread-blink 1.2s ease-in-out infinite;
}
@keyframes gl-ocr-unread-blink {
  0%, 100% { background: #fff0f0; }
  50% { background: #ffd9d9; }
}
.gl-ocr__warning {
  font-size: 12px;
  font-weight: 700;
  color: #b71c1c;
  background: #fff0f0;
  border: 1px solid #f0b8b8;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  line-height: 1.6;
}
.gl-ocr__info {
  font-size: 12px;
  color: #6b5a1e;
  background: #fff8e6;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.gl-ocr__hint {
  font-size: 11px;
  color: #9a8c5a;
  text-align: center;
  margin: 8px 0 12px;
}

/* ★ v3.0.40.834.6.3: 読み取り確認だけ、狭い画面は1〜5／6〜9。
   520px時の内幅444pxなら9列が各45px以上。519px以下は5列にする。
   共通buttonの左右18pxに詳細度で勝ち、内在幅によるはみ出しも防ぐ。 */
#modal-root [data-modal-type="ocr-preview"] .gl-ocr__grid {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}
#modal-root [data-modal-type="ocr-preview"] .gl-ocr__cell {
  min-width: 0;
}
@media (max-width: 519px) {
  #modal-root [data-modal-type="ocr-preview"] .gl-ocr__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  #modal-root [data-modal-type="ocr-preview"] .gl-modal__body .gl-ocr__par-btn {
    min-width: 0;
    min-height: 44px;
    height: 44px;
    padding: 12px 4px;
    box-sizing: border-box;
  }
}

/* ★ v3.0.8.1: OCR撮影スロット（表紙＋スコア面の複数枚対応） */
.gl-ocr__slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fdfaf3;
  border: 1px solid #ece5d0;
  border-radius: 10px;
}
.gl-ocr__slot-info {
  flex: 1;
  min-width: 0;
}
.gl-ocr__slot-label {
  font-size: 14px;
  font-weight: 700;
  color: #1a5f3f;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gl-ocr__slot-req {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #d32f2f;
  border-radius: 4px;
  padding: 1px 6px;
}
.gl-ocr__slot-sub {
  font-size: 11px;
  color: #8a7a55;
  margin-top: 2px;
  line-height: 1.4;
}
.gl-ocr__slot-preview {
  flex: 0 0 auto;
}
.gl-ocr__slot-btn {
  font-size: 13px;
  font-weight: 700;
  color: #1a5f3f;
  background: #fff;
  border: 2px dashed #a5d6a7;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  min-width: 76px;
  min-height: 44px;
}
.gl-ocr__slot-btn:active {
  background: #f1f8e9;
}
.gl-ocr__thumb {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #2e8b57;
  display: block;
  cursor: pointer;
}
.gl-ocr__thumb-retake {
  font-size: 9px;
  color: #8a7a55;
  text-align: center;
  margin-top: 2px;
}

/* ★ v3.0.9.1: 画像アイコンアップロードUI（プロフィール編集モーダル） */
.gl-icon-upload { display: flex; align-items: center; gap: 12px; }
.gl-icon-upload__preview {
  flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%;
  background: #f3f4f6; border: 2px dashed #d1d5db; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.gl-icon-upload__preview img { width: 100%; height: 100%; object-fit: cover; }
.gl-icon-upload__placeholder { font-size: 28px; }
.gl-icon-upload__actions { display: flex; flex-direction: column; gap: 6px; }
.gl-icon-upload__btn {
  display: inline-block; font-size: 13px; font-weight: 700; color: #065f46;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; text-align: center;
}
.gl-icon-upload__btn:active { background: #dcfce7; }
.gl-icon-upload__clear {
  font-size: 12px; color: #9ca3af; background: none;
  border: 1px solid #e5e7eb; border-radius: 999px; padding: 5px 12px; cursor: pointer;
}

/* ★ v3.0.40.483: 友達招集モーダルのチェックボックスが選択できないように見える不具合を修正
   【真犯人1】css/base.css: input, textarea { -webkit-appearance: none; } が全input に効き、
     枠線・チェックマークが消えて「選択できているか分からない」透明な四角になっていた。
   【真犯人2】css/modal.css #modal-root .gl-modal__body input { width:100%; padding:12px 14px; ... }
     の詳細度 (1,1,1) がタグ名指定より優先され、18px四方のはずのチェックボックスが
     横幅いっぱいに引き伸ばされ潰れていた（v3.0.40.186 のラジオボタン不具合と同一パターン）。
   【対策】#modal-root を付けて詳細度 (1,2,0) に引き上げて確実に勝たせ、
     appearance:none の自前描画で iOS 実機でも確実にチェック状態を可視化する。 */
#modal-root .gl-modal__body input.gl-eri-check,
#modal-root .gl-modal__body input.gl-faf-check {
  appearance: none; -webkit-appearance: none;
  display: inline-block !important;
  width: 22px !important; height: 22px !important;
  padding: 0 !important; margin: 0 !important;
  border: 2px solid #8fae9a !important; border-radius: 6px; background: #fff;
  flex: 0 0 auto; cursor: pointer;
  position: relative;
}
#modal-root .gl-modal__body input.gl-eri-check:checked,
#modal-root .gl-modal__body input.gl-faf-check:checked {
  background: #1a8f4c !important; border-color: #1a8f4c !important;
}
#modal-root .gl-modal__body input.gl-eri-check:checked::after,
#modal-root .gl-modal__body input.gl-faf-check:checked::after {
  content: "";
  position: absolute; left: 6px; top: 2px;
  width: 6px; height: 11px;
  border: solid #fff; border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
/* ★ v3.0.40.489: フォルダ管理モーダル(色パレット選択の丸ボタン)にも同一の透明化バグが
   起きるため、gl-faf-check と合わせてここで先回りして対応済み（該当クラスが追加されれば自動適用）。 */

/* ★ v3.0.40.647: ⏰ 時計の設定（スタート時間／午後のスタート時間） */
.gl-time-now { font-size: 13px; color: #4b5563; background: #f5f8f5; border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px; }
.gl-time-now b { color: #1a5f3f; }
.gl-time-row { display: flex; align-items: center; gap: 8px; padding: 10px 2px; border-bottom: 1px solid #eee; }
.gl-time-row__text { flex: 1 1 auto; min-width: 0; }
.gl-time-row__label { font-size: 15px; font-weight: 700; color: #333; }
.gl-time-row__sub { font-size: 11px; color: #888; line-height: 1.4; margin-top: 2px; }
.gl-time-row__val { flex: 0 0 auto; min-width: 76px; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid #1a5f3f; background: #fff; color: #1a5f3f; font-size: 16px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.gl-time-row__val--empty { border-style: dashed; color: #888; border-color: #bbb; font-size: 13px; font-weight: 700; }
.gl-time-row__clear { flex: 0 0 auto; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid #ffcdd2; background: #fff4f4; color: #c62828; font-size: 13px; font-weight: 700; cursor: pointer; }
.gl-time-day { display: flex; gap: 8px; margin: 2px 0 8px; }
.gl-time-day button { flex: 1; min-height: 44px; border-radius: 10px; border: 1.5px solid #d4c8a8; background: #fff; color: #5a4a30; font-size: 15px; font-weight: 700; cursor: pointer; }
.gl-time-day button.on { background: #1a5f3f; border-color: #1a5f3f; color: #fff; }

/* ★ v3.0.40.661【社長の実機指摘】押す所（打数・パット・保存）はパネルの下に固定。見る所だけがスクロール。 */
#gl-panel-root .gl-cls-panel-dock {
  flex: 0 0 auto;
  background: #fff;
  border-top: 1px solid #f0e8d0;
  padding: 4px 16px 0;
  box-shadow: 0 -6px 12px -8px rgba(0,0,0,.18);
}
#gl-panel-root .gl-cls-panel-dock .gl-cls-panel-actions {
  margin: 0 -16px;
  border-top: none;
}

/* ★ v3.0.40.828【社長 10/16】コース選択の「✏️ コースの間違いを知らせる」
   ほかの3つと同じ大きさ（横いっぱい・押せる所 48px 以上・文字 16px）。色は控えめ（白地に緑のふち・緑の文字）＝「困った時の道」。 */
#modal-root .gl-modal__body button.gl-fix828__btn {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  background: #fff;
  color: #1a5f3f;
  border: 2px solid #1a5f3f;
  border-radius: 12px;
}
#modal-root .gl-modal__body button.gl-fix828__btn:active { background: #eef6f1; }
#modal-root .gl-modal__body select.gl-fix828__pick { background: #fff; color: #222; min-height: 48px; }
html[data-score-dark="1"] #modal-root .gl-modal__body button.gl-fix828__btn { background: transparent !important; color: #6fdca6 !important; border-color: #2f7a55 !important; }
