/*
 * 発信元: claude（Phase3）／発信先: codex、モコ（企画部）、オーナー
 * 当日運営（画面契約_v1 H5a〜H5d・H6 の集計）。値は tokens_v1.css（.crtto-modern の中で有効）。
 */
.host-ops { display: grid; gap: var(--sp-4); min-width: 0; color: var(--text); font-family: var(--font); }
.host-ops h1, .host-ops h2 { margin: 0; color: var(--text); }
.host-ops-heading { display: grid; gap: var(--sp-1); }
.host-ops-meta { margin: 0; color: var(--text-muted); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.host-ops-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.host-ops-title h1 { font-size: 1.75rem; line-height: 1.25; overflow-wrap: anywhere; }
.host-ops-links { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.host-link { min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; white-space: nowrap; }
.host-link.host-danger { color: var(--error); }
.host-muted { color: var(--text-muted); font-size: var(--fs-small); }

/* ステップ（スマホは文字のタブ、現在地にコーラルの下線、済みに緑の ✓） */
.host-steps { display: flex; justify-content: space-between; gap: var(--sp-3); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.host-steps button { flex: 0 0 auto; min-height: 48px; padding: 0 2px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--text-muted); font: inherit; font-size: var(--fs-small); font-weight: 700; white-space: nowrap; cursor: pointer; }
.host-steps button[aria-current="step"] { border-bottom-color: var(--coral); color: var(--text); }
.host-steps button.is-done { color: var(--text); }
.host-step-done { margin-right: 2px; color: var(--ok); }

.host-ops-panel { display: grid; gap: var(--sp-4); min-width: 0; }
.host-card { min-width: 0; padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.host-empty-state { display: grid; justify-items: start; gap: var(--sp-3); }
.host-empty-state p { margin: 0; }

/* 集計 */
.host-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.host-summary-label { margin: 0; color: var(--text-muted); font-size: var(--fs-small); }
.host-summary-value { margin: 0; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.host-summary-value strong { font-size: var(--fs-num); }
.host-summary-plain { display: grid; gap: var(--sp-1); }
.host-summary-plain h2 { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.host-summary-plain p { margin: 0; }
.host-progress { width: min(100%, 280px); height: 8px; margin-top: var(--sp-2); border-radius: var(--r-pill); background: var(--navy-tint); overflow: hidden; }
.host-summary-plain .host-progress { width: 100%; }
.host-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--coral); }

/* 状態バッジ（文言付き。色だけで伝えない） */
.host-badge { display: inline-block; padding: 2px 8px; border-radius: var(--r-s); font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.host-badge.is-ok { background: var(--ok-bg); color: var(--ok); }
.host-badge.is-wait { background: var(--wait-bg); color: var(--wait); }
.host-badge.is-neutral { background: var(--navy-tint); color: var(--text); }
.host-badge.is-muted { background: var(--navy-tint); color: var(--text-muted); }

/* 検索・並び替え（§1-4）を当日運営の見た目にそろえる */
.host-ops .host-finder { margin-top: 0; }
.host-ops .host-chips { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: var(--r-m); background: var(--navy-tint); flex: 1 1 auto; min-width: min(100%, 18rem); }
.host-ops .host-chip { min-height: 48px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: var(--fs-small); }
.host-ops .host-chip[aria-pressed="true"] { background: var(--navy); color: #fff; }
.host-finder-count { margin: 0 0 var(--sp-2); color: var(--text-muted); font-size: var(--fs-small); }
.host-ops .host-finder-search input { border: 1px solid var(--line-strong); border-radius: var(--r-m); }
.host-ops .host-list { margin-top: 0; }
.host-row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: 2px; color: var(--text-muted); font-size: var(--fs-small); }
.host-ops .host-roster-actions .btn { min-height: var(--h-onsite); }
.host-danger { color: var(--error); border-color: var(--error); }

/* 試合表 */
.host-make { display: grid; gap: var(--sp-2); }
.host-wide { width: 100%; min-height: var(--h-btn); border: 2px solid var(--navy); background: var(--surface); color: var(--text); font-weight: 700; }
.host-wide:disabled { border-color: transparent; background: var(--disabled-bg); color: var(--disabled-text); }
.host-reason { margin: 0; color: var(--text-muted); font-size: var(--fs-small); text-align: center; }
.host-ok-box { padding: var(--sp-3); border: 2px solid var(--ok); border-radius: var(--r-m); background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.host-ops .host-round { display: grid; gap: var(--sp-3); margin: 0; }
.host-round h2 { font-size: 1.25rem; }
.host-court-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 44px; margin-bottom: var(--sp-1); }
.host-versus { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--sp-2); }
.host-versus > .pn-pair:first-child { text-align: left; }
.host-versus > .pn-pair:last-child { text-align: right; }
.host-versus .pn-pair-name .pn-names { justify-content: inherit; }
.host-vs { color: var(--text-muted); font-size: var(--fs-small); }
.host-rest { margin: 0; color: var(--text-muted); font-size: var(--fs-small); }
.host-practice .section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.host-practice h2 { font-size: 1.1rem; }

/* 入れ替え */
.host-swap-out, .host-swap-in { display: grid; gap: var(--sp-2); margin: 0; padding: 0; border: 0; }
.host-swap-out legend, .host-swap-in legend { margin-bottom: var(--sp-2); font-weight: 700; }
.host-pick-list { display: grid; gap: var(--sp-2); max-height: 50dvh; overflow-y: auto; }
.host-pick-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); min-height: 56px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); cursor: pointer; }
.host-pick-row input { width: 1.2rem; height: 1.2rem; accent-color: var(--navy); }

/* スコア確定 */
.host-score-head { display: grid; gap: var(--sp-1); }
.host-score-head h2 { font-size: 1.5rem; }
.host-score-head p { margin: 0; }
.host-score-list { display: grid; gap: var(--sp-3); }
.host-score-text { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.host-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-top: var(--sp-3); }
.host-card-actions .btn, .host-score-card > .host-wide { min-height: var(--h-onsite); border: 2px solid var(--navy); background: var(--surface); color: var(--text); }
.host-score-card .host-link { margin-top: var(--sp-2); }
.host-score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.host-score-grid > div { display: grid; justify-items: center; gap: var(--sp-2); text-align: center; }
.host-counter { display: flex; align-items: center; gap: var(--sp-2); }
.host-step-btn { width: var(--h-onsite); height: var(--h-onsite); border: 2px solid var(--navy); border-radius: var(--r-m); background: var(--surface); color: var(--navy); font-size: 1.5rem; font-weight: 700; cursor: pointer; }
.host-step-btn.is-plus { background: var(--navy); color: #fff; }
.host-step-btn:disabled { border-color: var(--disabled-bg); background: var(--disabled-bg); color: var(--disabled-text); cursor: not-allowed; }
.host-score-num { min-width: 2ch; font-size: var(--fs-score); font-weight: 700; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.host-score-editor > .host-muted { margin: var(--sp-2) 0 0; text-align: center; }

/* 会計 */
.host-ops .host-receipt-row { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 64px; border-radius: var(--r-m); background: var(--surface); }
.host-ops .host-receipt-row input { width: 24px; height: 24px; accent-color: var(--navy); }
.host-check-space { width: 24px; }
.host-receipt-person { display: grid; gap: 2px; min-width: 0; }
.host-received summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }

/* 終了（集計） */
.host-finish { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.host-stat { display: grid; gap: var(--sp-1); }
.host-stat span { color: var(--text-muted); font-size: var(--fs-small); }
.host-stat strong { font-size: var(--fs-num); font-variant-numeric: tabular-nums; }

/* 主ボタン（1画面に1つ）。スマホは画面下の固定バー */
.host-primary-bar { position: sticky; bottom: 0; z-index: 15; display: grid; gap: var(--sp-2); padding: var(--sp-3) 0 max(var(--sp-3), env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); box-shadow: 0 -12px 0 -11px var(--line); }
.host-ops .host-primary { width: 100%; min-height: var(--h-onsite); border: 0; border-radius: var(--r-m); background: var(--cta); color: var(--on-cta); font-size: 1rem; font-weight: 700; }
.host-ops .host-primary:hover { background: var(--cta-hover); }
.host-ops .host-primary:disabled { background: var(--disabled-bg); color: var(--disabled-text); }
.host-primary-reason, .host-primary-note { margin: 0; color: var(--text-muted); font-size: var(--fs-small); text-align: center; }
.host-primary-summary { display: flex; justify-content: space-between; margin: 0; }
.host-primary-summary strong { font-variant-numeric: tabular-nums; }

/* トースト「〇〇しました ［元に戻す］」 */
.host-toast { position: fixed; z-index: 40; left: 50%; bottom: calc(var(--h-onsite) + 48px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: var(--sp-4); width: min(calc(100% - 2 * var(--gutter)), 480px); padding: var(--sp-3) var(--sp-4); transform: translateX(-50%); border-radius: var(--r-m); background: var(--navy); box-shadow: var(--shadow-pop); color: #fff; }
.host-toast[hidden] { display: none; }
.host-toast > span { flex: 1; }
.host-toast-undo { min-height: 44px; padding: 0 var(--sp-2); border: 0; background: none; color: #fff; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; white-space: nowrap; }

.host-ops :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (min-width: 600px) {
  .host-finish { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .host-primary-bar { position: static; margin: 0; padding: 0; border: 0; background: none; justify-items: end; }
  .host-ops .host-primary { width: auto; min-width: 320px; }
  .host-primary-summary { gap: var(--sp-4); }
  .host-toast { bottom: var(--sp-6); }
}
@media (max-width: 559px) {
  .host-score-grid { grid-template-columns: minmax(0, 1fr); }
  .host-score-grid > div { grid-template-columns: minmax(0, 1fr) auto; justify-items: start; text-align: left; }
}
@media (max-width: 380px) {
  .host-steps { gap: var(--sp-2); }
  .host-step-btn { width: 48px; height: 48px; }
  .host-score-grid > div { grid-template-columns: minmax(0, 1fr); }
  .host-steps button { font-size: 12px; }
  .host-ops-title h1 { font-size: 1.4rem; }
  .host-card-actions { grid-template-columns: 1fr; }
}

/* 当日運営から開くシート（入れ替え・確認）。ダイアログは .host-ops の外に出るため、同じ基礎値の範囲を付ける */
.host-dialog.crtto-modern { color: var(--text); background: var(--paper); border-radius: var(--r-l); }
.host-dialog.crtto-modern .btn.primary { min-height: var(--h-btn); border: 0; border-radius: var(--r-m); background: var(--cta); color: var(--on-cta); font-weight: 700; }
.host-dialog.crtto-modern .btn.primary:disabled { background: var(--disabled-bg); color: var(--disabled-text); }
.host-dialog.crtto-modern .btn.secondary { border: 2px solid var(--navy); background: var(--surface); color: var(--text); }
.host-dialog.crtto-modern .host-finder-search input, .host-dialog.crtto-modern select { border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--surface); }
.host-confirm-danger { min-height: var(--h-btn); border: 2px solid var(--error); border-radius: var(--r-m); background: var(--surface); color: var(--error); font-weight: 700; }
.host-dialog .host-confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
.host-badge.is-error { background: var(--error-bg); color: var(--error); }
.host-conflict { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-top: var(--sp-3); }
.host-conflict-pick { display: grid; gap: var(--sp-1); min-height: 72px; padding: var(--sp-2); border: 2px solid var(--navy); border-radius: var(--r-m); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.host-conflict-pick span { color: var(--text-muted); font-size: var(--fs-small); overflow-wrap: anywhere; }
.host-conflict-pick strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.host-center { text-align: center; }
.host-score-card:has(.host-conflict) { border: 2px solid var(--error); }

/* 主催者のホーム側（画面契約_v1 H1〜H4・H6・H7）。最大 720px の1列 */
.host-home { display: grid; gap: var(--sp-4); width: min(100%, 720px); margin-inline: auto; padding-bottom: calc(72px + env(safe-area-inset-bottom)); color: var(--text); font-family: var(--font); }
.host-home h1, .host-home h2, .host-home p { margin: 0; }
.host-home h1 { font-size: 1.5rem; }
.host-home h2 { font-size: 1.15rem; }
.host-home-org { color: var(--text-muted); font-size: var(--fs-small); text-align: right; }
.host-today { display: grid; gap: var(--sp-1); border: 2px solid var(--navy); }
.host-today .host-primary, .host-home .host-primary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.host-event-when { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.host-list-group { display: grid; gap: var(--sp-2); }
.host-event-list { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.host-event-row { display: grid; gap: var(--sp-1); width: 100%; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.host-home .host-wide { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border-radius: var(--r-m); }
.host-setup, .host-compose, .host-invite { display: grid; gap: var(--sp-3); }
.host-setup-form { display: grid; gap: var(--sp-3); }
.host-home .field { display: grid; gap: var(--sp-1); font-weight: 700; }
.host-home .field input, .host-home .field select, .host-home .field textarea, .host-inline-fields input, .host-inline-fields select { min-height: 48px; padding: 0 var(--sp-3); border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--surface); font: inherit; font-size: 16px; }
.host-home .field textarea { padding-block: var(--sp-2); }
.host-home [aria-invalid="true"] { border: 2px solid var(--error) !important; }
.host-inline-fields { display: flex; flex-wrap: wrap; align-items: end; gap: var(--sp-2); margin: 0; padding: 0; border: 0; }
.host-inline-fields > .field { flex: 1 1 8rem; }
.host-inline-fields legend { margin-bottom: var(--sp-1); font-weight: 700; }
.host-field-error { display: grid; gap: var(--sp-1); color: var(--error); font-size: var(--fs-small); }
.host-field-error > span, p.host-field-error { display: flex; gap: var(--sp-1); }
.host-summary-rows { display: grid; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.host-summary-row + .host-summary-row { border-top: 1px solid var(--line); }
.host-summary-row > summary, .host-summary-row.is-static { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); min-height: 52px; padding: 0 var(--sp-4); cursor: pointer; list-style: none; }
.host-summary-row.is-static { grid-template-columns: auto minmax(0, 1fr); cursor: default; }
.host-summary-row > summary::-webkit-details-marker { display: none; }
.host-summary-row strong { text-align: right; overflow-wrap: anywhere; }
.host-summary-body { display: grid; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-4); }
.host-qr { display: grid; justify-items: center; gap: var(--sp-2); margin: 0; }
.host-qr-code svg { width: min(220px, 60vw); height: auto; }
.host-qr figcaption { color: var(--text-muted); font-size: var(--fs-small); }
.host-settings { display: grid; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.host-setting-row + .host-setting-row { border-top: 1px solid var(--line); }
.host-setting-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: 0 var(--sp-4); border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.host-setting-head strong { text-align: right; overflow-wrap: anywhere; }
.host-setting-body { padding: 0 var(--sp-4) var(--sp-4); }
.host-home .host-display-option { border-color: var(--line); }
.host-home-tabs { position: fixed; z-index: 20; inset: auto 0 0; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 0 env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--surface); }
.host-home-tabs button { min-height: 56px; border: 0; border-top: 3px solid transparent; background: none; color: var(--text-muted); font: inherit; font-size: var(--fs-small); font-weight: 700; cursor: pointer; }
.host-home-tabs button[aria-current="page"] { border-top-color: var(--coral); color: var(--navy); }
.host-home .host-primary-bar { bottom: calc(56px + env(safe-area-inset-bottom)); }
.host-compose .host-primary-bar, .host-setup .host-primary-bar, .host-invite .host-primary-bar { bottom: 0; }
.host-finish-head h2 { font-size: 1.5rem; }
.host-pending-note { display: grid; gap: var(--sp-2); justify-items: start; border: 2px solid var(--wait); }
.host-home :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (min-width: 1024px) {
  .host-home { padding-bottom: 0; }
  .host-home-tabs { position: static; border: 1px solid var(--line); border-radius: var(--r-l); }
  .host-home .host-primary-bar { position: static; justify-items: stretch; }
  .host-home .host-primary { width: 100%; }
}
/* H5a「20人以上（検索と件数を上部に固定）」 */
.host-finder-wrap.is-sticky { position: sticky; top: 0; z-index: 12; padding-block: var(--sp-2); background: var(--paper); box-shadow: 0 1px 0 var(--line); }
.host-field-error[hidden] { display: none; }
