:root {
  /* ========================================================
   * POINT RD 공식 브랜드 컬러 토큰 (SSOT)
   * 
   * 브랜드 체계: KEID -> RSP / RealData -> POINT RD (Product Brand)
   * 공식 로고 등 브랜드 자체 요소 정의
   * ======================================================== */

  /* [Primary] 대표색: POINT RD 로고 전용 브랜드 토큰 */
  --point-rd-primary: #0068B7;

  /* [Deep] 깊은 블루/네이비: 브랜드 전용 서브 토큰 */
  --point-rd-deep: #1E2C5B;

  /* [Accent] 밝은 블루: 브랜드 강조 토큰 */
  --point-rd-accent: #0083CB;

  /* [Light] 소프트 블루: 브랜드 보조 토큰 */
  --point-rd-light: #A8CCEC;

  /* [Digital Accent] 디지털 액센트 */
  --point-rd-digital-accent: #0013D7;

  /* ===== 테니스 코트 친화 테마 색상 (기능 화면 및 모바일 외곽 UI 환원) ===== */
  --green: #145c43;
  --green-2: #1d7a58;
  --lime: #d9ef59;
  --tennis-dark: #17322a;
  --tennis-court: #eef3e8;
  --tennis-paper: #fffdf7;
  --tennis-active-bg: #e6f0e7;

  /* 테니스 앱 기능 UI 매핑 (기존 테니스 친화 계열로 환원) */
  --brand-primary: var(--green);
  --brand-deep: var(--tennis-dark);
  --brand-accent: var(--green-2);
  --brand-light: var(--tennis-active-bg);

  /* ===== 중립색 및 기본 레이아웃 ===== */
  --ink: #17322a;
  --muted: #65766f;
  --court: #eef3e8;
  --paper: #fffdf7;
  --line: #d8e0d8;
  --shadow: 0 10px 30px rgba(23, 50, 42, .1);

  /* ===== 기능 상태색 (브랜드 토큰과 엄격히 분리 유지) ===== */
  /* 승패/성공/경고/오류 등의 기능적 의미는 독립 유지됨 */
  --functional-win: #15803d;     /* 승리 (녹색) */
  --functional-loss: #b63838;    /* 패배 (적색) */
  --functional-draw: #64748b;    /* 무승부 (슬레이트 그레이) */
  --functional-success: #15803d; /* 성공 (녹색) */
  --functional-warning: #d97706; /* 경고 (앰버) */
  --functional-error: #b63838;   /* 오류/위험 (적색) */
  --danger: var(--functional-error);

  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--court);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; overflow-x: hidden; background: linear-gradient(150deg, #f7f5e9 0%, #e7f0e3 100%); }
button, input, select { font: inherit; }
button, select, input, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(20,92,67,.3); outline-offset: 2px; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 60px;
  height: calc(60px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: 0;
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  background: rgba(255,253,247,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { display: flex; gap: 9px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: -.03em; }
.brand-mark { width: auto; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-mark img, img.brand-mark, .brand-logo { height: 20px; width: auto; max-width: 100px; object-fit: contain; display: block; }
.offline-badge { font-size: 12px; font-weight: 700; color: var(--green); background: #e0f0e7; padding: 6px 9px; border-radius: 99px; }
main { width: min(760px, 100%); margin: 0 auto; padding: 22px 16px 112px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 4px; color: var(--green-2); font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(26px, 7.5vw, 40px); letter-spacing: -.055em; line-height: 1.08; word-break: keep-all; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.subtitle { color: var(--muted); margin: 6px 0 0; line-height: 1.5; font-size: 14px; word-break: keep-all; }
.btn { border: 0; border-radius: 14px; min-height: 48px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; cursor: pointer; font-weight: 800; color: var(--ink); background: #e7ebe5; transition: transform .1s ease, background-color .15s ease; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--green); color: white; box-shadow: 0 7px 16px rgba(20,92,67,.2); }
.btn.primary:hover { background: var(--green-2); }
.btn.accent { background: var(--green-2); color: white; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger-ghost { background: transparent; border: 1.5px solid rgba(182, 56, 56, .5); color: var(--danger); }
.btn.danger-ghost:active { background: #fbe8e5; }
.btn.full { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 13px; font-size: 13px; border-radius: 11px; font-weight: 750; }
.detail-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.card { padding: 18px 16px; background: rgba(255,253,247,.96); border: 1px solid rgba(20,92,67,.12); border-radius: 20px; box-shadow: var(--shadow); word-break: break-word; overflow-wrap: break-word; }
.stack { display: grid; gap: 12px; }
.empty { text-align: center; padding: 40px 18px; }
.empty-icon { width: 60px; height: 60px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: #e0f0e7; color: var(--green); font-size: 24px; }
.match-card { display: block; color: inherit; text-decoration: none; padding: 16px; transition: transform .15s ease; }
.match-card:active { transform: scale(.985); }
.match-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.type-pill { padding: 4px 8px; border-radius: 99px; color: var(--green); background: #e0f0e7; font-size: 12px; font-weight: 750; }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 16px 0; }
.team { font-weight: 800; line-height: 1.4; word-break: keep-all; overflow-wrap: break-word; font-size: 14.5px; }
.team:last-child { text-align: right; }
.score { min-width: 72px; padding: 10px 6px; text-align: center; border-radius: 14px; background: var(--ink); color: white; font-size: 20px; font-weight: 900; letter-spacing: .04em; }
.result { margin: 0; color: var(--green-2); font-weight: 850; font-size: 14px; }
.section { margin-bottom: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; flex-wrap: wrap; }
.section-title-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sort-badge { font-size: 11px; font-weight: 700; color: var(--muted); background: #f0f3ed; border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; white-space: normal; display: inline-block; }
.btn-toggle-expand { margin-top: 10px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field-label { font-size: 13px; font-weight: 800; color: #42584f; }
.field input, .field select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 13px; padding: 0 13px; color: var(--ink); background: white; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented button { min-height: 50px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: white; cursor: pointer; font-weight: 850; font-size: 14px; }
.segmented button.active { border-color: var(--green); background: var(--green); color: white; }
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.team-box { padding: 14px; border-radius: 16px; background: #f4f5ef; }
.team-box h3 { margin: 0 0 10px; font-size: 14px; color: var(--green-2); letter-spacing: .04em; }
.scoreboard { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 10px; align-items: center; }
.score-side { text-align: center; }
.score-side strong { display: block; margin-bottom: 6px; font-size: 13px; }
.score-control { display: grid; grid-template-columns: 50px 1fr 50px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.score-control button { min-height: 56px; border: 0; color: var(--green); background: #edf5ef; cursor: pointer; font-size: 26px; font-weight: 900; user-select: none; }
.score-control button:active { background: #dbeef0; }
.score-control input { width: 100%; min-width: 0; border: 0; text-align: center; color: var(--ink); background: white; font-size: 24px; font-weight: 900; }
.score-colon { font-size: 26px; font-weight: 900; text-align: center; }
.live-result { margin-top: 14px; padding: 12px; border-radius: 13px; text-align: center; background: #e0f0e7; color: var(--green); font-weight: 900; font-size: 14px; }
.error { display: none; margin: 12px 0 0; padding: 11px 13px; border-radius: 12px; color: var(--danger); background: #fbe8e5; font-size: 13px; font-weight: 700; }
.error.show { display: block; }
.storage-banner { margin-bottom: 16px; padding: 12px 14px; border-radius: 14px; color: var(--danger); background: #fbe8e5; border: 1px solid rgba(182, 56, 56, .25); font-size: 13px; font-weight: 700; line-height: 1.5; display: flex; align-items: center; gap: 10px; }
.storage-banner-icon { font-size: 18px; flex-shrink: 0; }
.empty-icon.error-icon { background: #fbe8e5; color: var(--danger); }
.error-subtitle { color: var(--danger); font-weight: 700; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.detail-hero { text-align: center; padding: 24px 16px; }
.detail-score { margin: 16px 0 8px; font-size: clamp(36px, 10vw, 50px); font-weight: 950; letter-spacing: .08em; }
.detail-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.detail-team { padding: 16px; border-radius: 16px; background: #f0f3ed; }
.detail-team strong { display: block; margin-bottom: 6px; color: var(--green-2); font-size: 12px; letter-spacing: .08em; }
.member-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.member-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.member-stats-badge { font-size: 12px; line-height: 1.35; color: var(--muted); font-weight: 700; word-break: break-word; }
.member-stats-badge .winrate { color: var(--green-2); font-weight: 850; }
.member-stats-badge.empty-stats { color: #8fa099; font-weight: 600; }
.member-display-name { font-weight: 850; font-size: 15px; color: var(--ink); word-break: keep-all; overflow-wrap: break-word; }
.member-name { font-weight: 850; font-size: 15px; color: var(--ink); word-break: keep-all; overflow-wrap: break-word; }
.member-realname { color: var(--muted); font-size: 13px; font-weight: 600; word-break: keep-all; overflow-wrap: break-word; }
.inactive-pill { background: #e8ece5; color: #76837c; font-size: 11px; padding: 2px 7px; }
.guest-pill { background: #d3e3f5; color: #163d63; font-size: 11.5px; padding: 2.5px 8px; font-weight: 800; border: 1px solid rgba(22, 61, 99, .18); line-height: 1.2; }
.member-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.filter-card { margin-bottom: 16px; padding: 16px; }
.filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0; gap: 8px; flex-wrap: wrap; }
.filter-head-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-head-title h2 { font-size: 16px; margin: 0; }
.filter-head-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-count-badge { font-size: 12px; font-weight: 750; color: var(--green); background: #e0f0e7; padding: 3px 8px; border-radius: 99px; cursor: pointer; user-select: none; }
.filter-body { margin-top: 12px; }
.filter-body.is-collapsed { display: none; }
.filter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.filter-grid select, .filter-grid input { min-height: 44px; font-size: 13px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--line); background: white; width: 100%; color: var(--ink); }
.filter-date-group { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; grid-column: 1 / -1; }
.filter-date-sep { color: var(--muted); font-size: 12px; font-weight: 700; }
.add-member-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.add-member-grid .field { margin-bottom: 0; }
.req { color: var(--danger); font-weight: 800; }
.opt { color: var(--muted); font-size: 11px; font-weight: normal; }
.member-edit-form { width: 100%; display: grid; gap: 10px; padding: 6px 0; grid-column: 1 / -1; }
.member-edit-form .field { margin-bottom: 0; }
.edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.inline-error { margin: 6px 0 0; padding: 8px 10px; }
.notice-msg { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fdf3d8; color: #7a5c10; font-size: 13px; font-weight: 700; border: 1px solid rgba(122,92,16,.2); }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.inline-form input { min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 13px; padding: 0 13px; }
.success-panel { text-align: center; padding: 32px 18px; }
.success-panel .check { width: 60px; height: 60px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: #e0f0e7; color: var(--green); font-size: 26px; }
.success-actions { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: 88px; z-index: 50; transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 99px; color: white; background: var(--tennis-dark); opacity: 0; pointer-events: none; transition: .2s ease; font-weight: 700; font-size: 13px; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,253,247,.97); backdrop-filter: blur(12px); }
.bottom-nav a { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 750; }
.bottom-nav a span { font-size: 20px; line-height: 1; }
.bottom-nav a.active { color: var(--green); background: #e6f0e7; }
.bottom-nav.is-viewer { grid-template-columns: repeat(3, 1fr); }

/* Analytics Styles */
.period-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.period-tabs button { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: white; cursor: pointer; font-weight: 800; font-size: 13px; }
.period-tabs button.active { border-color: var(--green); background: var(--green); color: white; }
.custom-date-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; margin-top: 8px; }
.custom-date-row input { min-height: 44px; font-size: 13px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--line); background: white; width: 100%; color: var(--ink); }
.analytics-option-row { display: flex; align-items: center; justify-content: flex-start; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.analytics-checkbox-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; color: var(--ink); cursor: pointer; user-select: none; }
.analytics-checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; margin: 0; }

.stat-hero-card { text-align: center; padding: 20px 16px; margin-bottom: 16px; }
.stat-hero-rate { font-size: clamp(34px, 9vw, 46px); font-weight: 950; color: var(--green); letter-spacing: -.03em; margin: 4px 0 10px; }
.stat-hero-record { font-size: 15px; font-weight: 850; color: var(--ink); }
.stat-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.stat-pill-btn { border: 1px solid var(--line); background: white; border-radius: 99px; min-height: 40px; padding: 0 14px; font-size: 13px; font-weight: 800; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: transform .1s ease, background-color .15s ease; }
.stat-pill-btn:active { transform: scale(.97); background: #eef4ef; }

.sub-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.sub-stat-card { padding: 14px; border-radius: 16px; background: #f4f5ef; border: 1px solid rgba(20,92,67,.08); text-align: left; cursor: pointer; transition: transform .1s ease; }
.sub-stat-card:active { transform: scale(.98); }
.sub-stat-title { font-size: 13px; font-weight: 850; color: var(--green-2); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.sub-stat-rate { font-size: 22px; font-weight: 900; color: var(--ink); }
.sub-stat-rate.sub-stat-empty { font-size: 15px; font-weight: 800; color: var(--muted); padding: 4px 0 2px; }
.sub-stat-card:not([data-drill]) { cursor: default; }
.sub-stat-card:not([data-drill]):active { transform: none; }
.sub-stat-desc { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 2px; }

.analytics-card-list { display: grid; gap: 8px; }
.analytics-item-btn { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer; text-align: left; transition: transform .1s ease, background-color .15s ease; font: inherit; }
.analytics-item-btn.norank { grid-template-columns: 1fr auto; gap: 6px; }
.analytics-item-btn:active { transform: scale(.985); background: #f4f7f2; }
.analytics-rank { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 900; background: #e8f2eb; color: var(--green); flex-shrink: 0; }
.analytics-rank.rank-1 { background: #fef08a; color: #854d0e; }
.analytics-rank.rank-2 { background: #e2e8f0; color: #334155; }
.analytics-rank.rank-3 { background: #fed7aa; color: #9a3412; }
.analytics-rank.ref-rank { background: #edf0ec; color: #76837c; font-size: 11px; font-weight: 750; border-radius: 8px; width: auto; padding: 0 6px; height: 26px; }
.analytics-item-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.analytics-item-name { font-size: 14px; font-weight: 850; color: var(--ink); word-break: keep-all; overflow-wrap: break-word; }
.analytics-item-sub { font-size: 12px; color: var(--muted); font-weight: 700; word-break: keep-all; overflow-wrap: break-word; }
.analytics-item-rate { text-align: right; flex-shrink: 0; }
.analytics-item-rate .rate-num { font-size: 16px; font-weight: 900; color: var(--green-2); }
.analytics-item-rate .rate-arrow { font-size: 13px; color: var(--muted); margin-left: 2px; }
.analytics-item-rate .rate-diff { display: block; font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 1px; }

/* Inline Data Freshness / Sync Status (Section 4) */
.data-sync-inline { display: inline-flex; align-items: center; gap: 6px; }
.sync-tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; line-height: 1.2; }
.sync-tag.fresh { background: #e0f0e7; color: var(--green); }
.sync-tag.stale { background: #fef3c7; color: #b45309; }
.btn-refresh-icon { background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; padding: 3px 6px; font-size: 12px; line-height: 1; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.btn-refresh-icon:hover { background: rgba(20, 92, 67, 0.06); }
.btn-refresh-icon:active { transform: scale(0.95); }

.team-combo-box { display: grid; gap: 10px; }
.combo-select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.combo-result-card { margin-top: 10px; padding: 14px; border-radius: 14px; background: #eef4ef; border: 1px solid rgba(20,92,67,.15); text-align: center; }
.combo-result-title { font-size: 13px; font-weight: 800; color: var(--green-2); margin-bottom: 4px; }
.combo-result-rate { font-size: 24px; font-weight: 950; color: var(--ink); }
.combo-result-rate.combo-empty { font-size: 16px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.combo-result-desc { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 2px; }

.drilldown-head-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }

/* Update Banner */
.update-banner { position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 45; width: calc(100% - 24px); max-width: 540px; background: var(--tennis-dark, #17322a); color: #fff; border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 25px rgba(0,0,0,.25); animation: updateSlideUp .25s ease-out; }
.update-content { display: flex; align-items: center; gap: 10px; min-width: 0; }
.update-icon { font-size: 20px; flex-shrink: 0; }
.update-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.update-text strong { font-size: 13px; font-weight: 850; color: #fff; }
.update-text span { font-size: 11px; color: #b5cebc; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.update-actions .btn { min-height: 36px; padding: 0 12px; font-size: 12px; font-weight: 800; border-radius: 10px; }
.btn-update-apply { background: var(--lime); color: #103829; border: none; cursor: pointer; }
.btn-update-apply:active { background: #b5e640; }
.btn-update-dismiss { background: rgba(255,255,255,.15); color: #fff; border: none; cursor: pointer; }
.btn-update-dismiss:active { background: rgba(255,255,255,.25); }
@keyframes updateSlideUp { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 600px) {
  .update-banner { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (max-width: 560px) {
  main { padding: 16px 12px 112px; }
  .page-head { align-items: flex-start; gap: 10px; }
  .page-head .btn { min-width: 44px; padding: 0 12px; }
  .page-head .btn .wide-label { display: none; }
  .card { padding: 16px 14px; border-radius: 18px; }
  .add-member-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .detail-teams { grid-template-columns: 1fr; }
  .scoreboard { grid-template-columns: 1fr; gap: 12px; }
  .score-colon { display: none; }
  .actions, .form-actions, .success-actions { grid-template-columns: 1fr; gap: 8px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid select[name=memberId] { grid-column: 1 / -1; }
  .member-row { grid-template-columns: 1fr; gap: 8px; }
  .member-actions { justify-content: flex-end; width: 100%; }
  .member-edit-form .edit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .period-tabs { grid-template-columns: 1fr 1fr; }
  .sub-stat-grid { grid-template-columns: 1fr; }
  .combo-select-grid { grid-template-columns: 1fr; }
  .app-header {
    height: calc(52px + env(safe-area-inset-top, 0px));
    min-height: calc(52px + env(safe-area-inset-top, 0px));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  .brand-club-wrap { gap: 4px; }
  .club-title-btn {
    padding: 2px 4px;
    font-size: 14px;
    gap: 2px;
  }
  .brand-mark img, img.brand-mark, .brand-logo { height: 18px; max-width: 82px; }
}
@media (max-width: 360px) {
  .app-header {
    height: calc(50px + env(safe-area-inset-top, 0px));
    min-height: calc(50px + env(safe-area-inset-top, 0px));
    padding-left: max(6px, env(safe-area-inset-left));
    padding-right: max(6px, env(safe-area-inset-right));
  }
  .brand-club-wrap { gap: 3px; }
  .club-title-btn {
    padding: 2px 3px;
    font-size: 13px;
    gap: 2px;
  }
  .brand { gap: 4px; font-size: 14px; }
  .brand-mark img, img.brand-mark, .brand-logo { height: 17px; max-width: 76px; }
  .offline-badge { font-size: 11px; padding: 4px 7px; }
  .filter-grid { grid-template-columns: 1fr; }
  .segmented { grid-template-columns: 1fr; }
  .versus { gap: 4px; }
  .score { min-width: 62px; padding: 8px 4px; font-size: 18px; }
  .period-tabs { grid-template-columns: 1fr; }
}
@media (min-width: 820px) { .bottom-nav { width: 560px; left: 50%; right: auto; bottom: 14px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ===== Club Edition 전용 추가 스타일 (WU-01) ===== */
/* Club Share 탭 — Placeholder */
.club-share-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.club-share-placeholder .placeholder-icon {
  font-size: 48px;
  line-height: 1;
  opacity: 0.5;
}
.club-share-placeholder h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.club-share-placeholder p {
  font-size: 14px;
  margin: 0;
  max-width: 280px;
}
/* Club Edition 헤더 구분 배지 */
.club-edition-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--green);
  color: var(--lime);
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 6px;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

/* Match Card Status Badges (Recorder Match List UX) */
.match-status-badge {
  font-size: 11px;
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 6px;
  display: inline-block;
  line-height: 1.2;
}
.match-status-badge.uncommitted {
  background: #fbe8e5;
  color: #c92a2a;
  border: 1px solid rgba(201, 42, 42, 0.3);
}
.match-status-badge.own {
  background: #e6f0e7;
  color: #2b7a4b;
  border: 1px solid rgba(43, 122, 75, 0.25);
}
.uncommitted-summary-bar {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff5f5;
  border: 1px solid rgba(201, 42, 42, 0.2);
  color: #c92a2a;
  font-size: 12.5px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.uncommitted-summary-bar a {
  color: #c92a2a;
  text-decoration: underline;
  font-size: 11.5px;
}

/* Duplicate Warning Modal (RC14) */
.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 34, 27, .65);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn .15s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirm-modal-card {
  max-width: 440px;
  width: 100%;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .28);
  border: 1px solid rgba(20, 92, 67, .2);
  padding: 22px 20px;
  background: #fffdf9;
}
.confirm-modal-title {
  margin: 0 0 10px 0;
  font-size: 1.15rem;
  font-weight: 850;
  color: #193426;
}
.confirm-modal-desc {
  margin: 0 0 14px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #33443c;
}
.confirm-modal-match-box {
  background: #f4f5ef;
  border-radius: 14px;
  border: 1px solid rgba(20, 92, 67, .1);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.confirm-modal-match-label {
  font-size: 12px;
  font-weight: 700;
  color: #5d6f65;
  margin-bottom: 4px;
}
.confirm-modal-match-date {
  font-size: 12px;
  color: #6d7f76;
  margin-bottom: 4px;
}
.confirm-modal-match-content {
  font-size: 14px;
  font-weight: 750;
  color: #193426;
  word-break: keep-all;
}
.confirm-score {
  color: var(--green);
  font-weight: 850;
}
.confirm-modal-prompt {
  margin: 0 0 18px 0;
  font-size: 14px;
  font-weight: 700;
  color: #193426;
}
.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== WU-08 Today & Daily Share Styles ===== */
.daily-share-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(20, 92, 67, 0.08);
  border: 1px solid rgba(20, 92, 67, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
  margin-bottom: 14px;
}
.daily-share-info-title {
  font-weight: 750;
  font-size: 13px;
  color: var(--ink);
}
.daily-share-info-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.period-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 6px;
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  .period-tabs {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
@media (max-width: 360px) {
  .period-tabs {
    grid-template-columns: 1fr 1fr !important;
  }
}
.filter-date-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* AB02-01 & AB02-02: Filter pills with active selection */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-pill {
  border: 1px solid var(--line);
  background: white;
  border-radius: 99px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}
.filter-pill.active {
  background: var(--green, #145c43) !important;
  color: #fff !important;
  border-color: var(--green, #145c43) !important;
  font-weight: 850 !important;
  box-shadow: 0 2px 8px rgba(20, 92, 67, 0.25);
}

/* AB02-05: Header Simplification */
.brand-club-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}
.club-title-btn {
  background: none;
  border: none;
  min-height: 44px;
  padding: 3px 5px;
  font-size: 15px;
  font-weight: 850;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 8px;
  transition: background-color .15s ease;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
}
.club-title-btn:hover {
  background: rgba(20, 92, 67, 0.06);
}
.club-title-btn #headerClubName {
  display: inline-block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.club-title-btn .dropdown-arrow {
  font-size: 10px;
  opacity: 0.7;
  flex-shrink: 0;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-settings {
  text-decoration: none;
  font-size: 18px;
  padding: 6px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-settings:hover {
  background: rgba(20, 92, 67, 0.06);
}


/* App Modal Styling (AB02) */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 105;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.app-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 34, 27, .65);
  backdrop-filter: blur(2px);
}
.app-modal .modal-content {
  position: relative;
  z-index: 1;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .28);
  border: 1px solid rgba(20, 92, 67, .2);
  border-radius: 12px;
  padding: 20px;
  background: #fffdf9;
  max-height: 90vh;
  overflow-y: auto;
}
.app-modal .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line, #e2e8f0);
}
.modal-head-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.modal-brand-logo {
  height: 15px;
  width: auto;
  max-width: 78px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.app-modal .modal-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-dark, #145c43);
  line-height: 1.25;
  white-space: nowrap;
}
.app-modal .btn-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted, #64748b);
  padding: 4px 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.app-modal .modal-desc {
  font-size: 13px;
  color: var(--text-muted, #64748b);
  margin-bottom: 12px;
  line-height: 1.5;
}
.filter-summary-bar {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  font-weight: 600;
  margin-top: 6px;
}


/* ==========================================================================
   1인당 1줄 중심의 순위 및 분석 목록 리스트 (가독성 최적화)
   ========================================================================== */
.ranking-table-card {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.ranking-table-header {
  display: grid;
  grid-template-columns: 26px 1fr 92px 48px 30px;
  align-items: center;
  gap: 4px;
  padding: 8px 8px;
  background: #f8faf7;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
  user-select: none;
}

.ranking-table-header .col-center {
  text-align: center;
}
.ranking-table-header .col-right {
  text-align: right;
}

.ranking-row-btn {
  display: grid;
  grid-template-columns: 26px 1fr 92px 48px 30px;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 9px 8px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  transition: background-color .12s ease;
}

.ranking-row-btn:last-child {
  border-bottom: none;
}

.ranking-row-btn:hover {
  background: #f9fbf9;
}

.ranking-row-btn:active {
  background: #edf5ef;
}

.ranking-badge-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  background: #edf2ee;
  color: #4b5563;
  margin: 0 auto;
}

.ranking-badge-sm.rank-1 {
  background: #fef08a;
  color: #854d0e;
}
.ranking-badge-sm.rank-2 {
  background: #e2e8f0;
  color: #334155;
}
.ranking-badge-sm.rank-3 {
  background: #fed7aa;
  color: #9a3412;
}

.ranking-col-name {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-col-record {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.ranking-col-rate {
  font-size: 13px;
  font-weight: 850;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}
.ranking-col-rate.high {
  color: var(--functional-win, #15803d);
}

.ranking-col-diff {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

/* 개인분석 1인 1줄 리스트 */
.personal-list-card {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
}

.personal-row-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  transition: background-color .12s ease;
}

.personal-row-btn:last-child {
  border-bottom: none;
}

.personal-row-btn:hover {
  background: #f9fbf9;
}

.personal-row-btn:active {
  background: #edf5ef;
}

.personal-col-name {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-col-record {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.personal-col-rate {
  font-size: 13px;
  font-weight: 850;
  color: var(--ink);
  text-align: right;
  min-width: 48px;
  white-space: nowrap;
}
.personal-col-rate.high {
  color: var(--functional-win, #15803d);
}

.personal-col-arrow {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  margin-left: 2px;
}

/* Match List Pagination, Count Summary, Preparing State & Scroll-to-Top */
.match-list-count-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  padding: 9px 14px;
  border-radius: 13px;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid rgba(20, 92, 67, 0.14);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.match-list-count-bar strong {
  color: var(--green, #145c43);
  font-weight: 900;
}
.match-list-page-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--green, #145c43);
  background: #e0f0e7;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.match-list-footer {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid rgba(20, 92, 67, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.match-list-footer-count {
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
}
.match-list-footer-count strong {
  color: var(--ink);
  font-weight: 900;
}
.match-list-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-floating-top {
  position: fixed;
  right: max(14px, env(safe-area-inset-right, 14px));
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  z-index: 28;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--green, #145c43);
  color: #fff;
  font-size: 12.5px;
  font-weight: 850;
  box-shadow: 0 6px 18px rgba(20, 92, 67, 0.28);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.12s ease, background-color 0.15s ease;
}
.btn-floating-top:hover {
  background: var(--green-2, #1d7a58);
}
.btn-floating-top:active {
  transform: scale(0.95);
}
.match-list-preparing-card {
  border: 1.5px solid rgba(20, 92, 67, 0.22);
  background: rgba(255, 253, 247, 0.98);
}

/* Club picker */
.club-picker-section + .club-picker-section {
  margin-top: 20px;
}
.club-picker-heading,
.club-picker-add-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.club-picker-heading {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.club-picker-heading h3 {
  margin: 0;
  font-size: 14px;
}
.club-picker-add-actions {
  flex-direction: column;
  margin-top: 10px;
}
.club-picker-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.club-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.club-select-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line, #d8e0d8);
  box-sizing: border-box;
  width: 100%;
}
.club-select-card.is-active {
  background: rgba(20, 92, 67, 0.08);
  border-color: #145c43;
}
.club-select-card--personal,
.club-select-card--shared {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.club-card-name {
  display: block;
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink, #17322a);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.club-select-card.is-active .club-card-name {
  font-weight: 750;
}
.club-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 8px;
  width: 100%;
}
.club-active-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 4px;
  font-size: 12px;
  color: #145c43;
  font-weight: 800;
  white-space: nowrap;
}
.club-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.club-modal-btn {
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.app-info-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.app-info-summary-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.settings-collapsible-summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  padding: 4px 0;
  outline: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  list-style: none;
}
.settings-collapsible-summary::-webkit-details-marker {
  display: none;
}
.settings-collapsible-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.settings-collapsible[open] .dropdown-arrow {
  transform: rotate(180deg);
}
.settings-collapsible-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.settings-disconnect-section {
  margin-top: 16px;
}
.viewer-member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.viewer-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-subtle, #f8fafc);
}
.viewer-member-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
