/*
 * 프리또 컴포넌트 — docs/디자인/디자인-시스템.md §4
 * 이름 규칙: .ft-{컴포넌트}__{부분} / .ft-{컴포넌트}--{변형} · 상태는 aria-* · data-* 속성으로
 * 독립성(§4.0): base.css(전역 리셋) 없이도 깨지지 않게 — 옛 화면(Tabler 위)에도 원자 컴포넌트를 넣을 수 있도록
 *   목록·버튼·제목 리셋을 컴포넌트 안에서 다시 선언한다. 색은 tokens.css 변수만 (hex 금지)
 */

/* ───────── 컴포넌트 공통 리셋 (base.css 없는 옛 화면 대비) ───────── */
[class^="ft-"], [class*=" ft-"], [class^="ft-"]::before, [class*=" ft-"]::before, [class^="ft-"]::after, [class*=" ft-"]::after { box-sizing: border-box; }
.ft-card, .ft-notice, .ft-empty, .ft-ad { font-family: var(--ft-font); color: var(--ft-text); word-break: keep-all; }
.ft-rows, .ft-prize, .ft-sets, .ft-kv, .ft-chips, .ft-pager, .ft-acc, .ft-card ul, .ft-card ol { margin: 0; padding: 0; list-style: none; }
.ft-card h2, .ft-card h3, .ft-card p, .ft-card dl, .ft-card dd, .ft-round__title, .ft-card__title, .ft-section-title,
.ft-empty__title, .ft-empty__desc, .ft-notice p { margin: 0; }
.ft-card a:not(.ft-btn), .ft-post, .ft-row, .ft-pager a, .ft-chip, .ft-card__more { text-decoration: none; color: inherit; }
.ft-btn, .ft-chip, .ft-seg__item, .ft-tabs__tab, .ft-picker__num, .ft-sheet__grip { font-family: inherit; cursor: pointer; text-decoration: none; }
.ft-card :focus-visible, .ft-btn:focus-visible, .ft-chip:focus-visible, .ft-seg__item:focus-visible, .ft-tabs__tab:focus-visible,
.ft-pager a:focus-visible, .ft-acc summary:focus-visible, .ft-picker__num:focus-visible {
  outline: 2px solid var(--ft-focus); outline-offset: 2px; box-shadow: none;
}

/* ───────── 카드 ───────── */
.ft-card {
  background: var(--ft-surface); border: 1px solid var(--ft-border);
  border-radius: var(--ft-radius-lg); box-shadow: var(--ft-shadow-1);
  min-width: 0;
}
.ft-card__head {
  display: flex; align-items: center; gap: var(--ft-space-2);
  padding: var(--ft-card-pad) var(--ft-card-pad) 0;
}
.ft-card__title { font-size: var(--ft-text-lg); line-height: var(--ft-lh-lg); font-weight: var(--ft-weight-bold); }
.ft-card__title small { font-size: var(--ft-text-sm); font-weight: var(--ft-weight-regular); color: var(--ft-text-2); margin-left: var(--ft-space-1); }
.ft-card__more {
  margin-left: auto; display: inline-flex; align-items: center; gap: 2px; min-height: var(--ft-touch);
  padding-left: var(--ft-space-2);
  font-size: var(--ft-text-sm); font-weight: var(--ft-weight-semibold); color: var(--ft-text-2);
}
.ft-card__more:hover { color: var(--ft-accent); }
.ft-card__body { padding: var(--ft-space-3) var(--ft-card-pad) var(--ft-card-pad); }
.ft-card__body--flush { padding: var(--ft-space-2) 0 var(--ft-space-1); }
.ft-card__foot {
  padding: var(--ft-space-3) var(--ft-card-pad); border-top: 1px solid var(--ft-border);
  font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2);
}
.ft-section-title { font-size: var(--ft-text-lg); line-height: var(--ft-lh-lg); font-weight: var(--ft-weight-bold); display: flex; align-items: center; gap: var(--ft-space-2); }

/* ───────── 로또 공 ───────── */
.ft-balls { display: flex; align-items: center; flex-wrap: nowrap; gap: var(--ft-ball-gap, 6px); }
.ft-balls--lg { --ft-ball-gap: 5px; }
.ft-balls--sm { --ft-ball-gap: 3px; }
.ft-ball {
  --size: var(--ft-ball-md);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--size); height: var(--size); border-radius: var(--ft-radius-full);
  background: var(--ft-ball-empty); color: var(--ft-ball-text);
  box-shadow: inset 0 0 0 1px var(--ft-ball-edge);
  font-size: calc(var(--size) * 0.44); font-weight: var(--ft-weight-bold);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1;
}
.ft-ball--sm { --size: var(--ft-ball-sm); font-size: 12px; font-weight: var(--ft-weight-semibold); }
.ft-ball--md { --size: var(--ft-ball-md); font-size: 14px; }
.ft-ball--lg { --size: var(--ft-ball-lg); font-size: calc(var(--ft-ball-lg) * 0.42); }
.ft-ball[data-r="1"] { background: var(--ft-ball-1); }
.ft-ball[data-r="2"] { background: var(--ft-ball-2); }
.ft-ball[data-r="3"] { background: var(--ft-ball-3); }
.ft-ball[data-r="4"] { background: var(--ft-ball-4); }
.ft-ball[data-r="5"] { background: var(--ft-ball-5); }
/* 발행 번호에서 당첨번호와 다른 수: 흐리게(opacity) 대신 회색 바탕 + 보조 글자색 */
.ft-ball--miss { background: var(--ft-surface-2) !important; color: var(--ft-text-3); box-shadow: inset 0 0 0 1px var(--ft-border); font-weight: var(--ft-weight-semibold); }
.ft-balls__plus { flex: none; width: 14px; text-align: center; font-weight: var(--ft-weight-bold); color: var(--ft-text-3); font-size: var(--ft-text-md); }
.ft-balls--sm .ft-balls__plus { width: 10px; font-size: var(--ft-text-sm); }
.ft-ball-cap { position: relative; display: inline-flex; flex: none; }
.ft-ball-cap__label { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); white-space: nowrap; font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-3); font-weight: var(--ft-weight-semibold); }
.ft-balls:has(.ft-ball-cap) { padding-bottom: 18px; }

/* ───────── 신선도 배지 ───────── */
.ft-fresh {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 24px; padding: 2px var(--ft-space-2); border-radius: var(--ft-radius-full);
  font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); font-weight: var(--ft-weight-semibold);
  background: var(--ft-surface-2); color: var(--ft-text-2); border: 1px solid var(--ft-border);
  white-space: nowrap;
}
.ft-fresh::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ft-fresh--ok { color: var(--ft-success); background: var(--ft-success-weak); border-color: transparent; }
.ft-fresh--pending { color: var(--ft-accent); background: var(--ft-accent-weak); border-color: transparent; }
.ft-fresh--stale { color: var(--ft-warning); background: var(--ft-warning-weak); border-color: transparent; }

/* ───────── 회차 카드 ───────── */
.ft-round { padding: var(--ft-card-pad); display: grid; gap: var(--ft-space-4); }
.ft-round__head { display: flex; align-items: flex-start; gap: var(--ft-space-2); }
.ft-round__title { font-size: var(--ft-text-xl); line-height: var(--ft-lh-xl); font-weight: var(--ft-weight-bold); letter-spacing: -0.01em; }
.ft-round__title .ft-round__no { color: var(--ft-accent); }
.ft-round__date { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); }
.ft-round__head .ft-fresh { margin-left: auto; margin-top: 3px; }
.ft-round__first {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--ft-space-1) var(--ft-space-3);
  padding: var(--ft-space-3) var(--ft-space-4); border-radius: var(--ft-radius-md); background: var(--ft-surface-2);
}
.ft-round__first dt { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); font-weight: var(--ft-weight-semibold); }
.ft-round__first dd { font-variant-numeric: tabular-nums; }
.ft-round__amount { grid-column: 1; font-size: var(--ft-text-xl); line-height: var(--ft-lh-xl); font-weight: var(--ft-weight-bold); letter-spacing: -0.01em; }
.ft-round__full { grid-column: 1; font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-3); }
.ft-round__winners { grid-column: 2; grid-row: 1 / span 3; align-self: center; text-align: right; font-size: var(--ft-text-lg); font-weight: var(--ft-weight-bold); }
.ft-round__winners small { display: block; font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-2); font-weight: var(--ft-weight-semibold); }
.ft-round__sub { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); }
.ft-round__nav { display: flex; align-items: center; gap: var(--ft-space-2); border-top: 1px solid var(--ft-border); padding-top: var(--ft-space-2); margin: 0 calc(var(--ft-card-pad) * -1) calc(var(--ft-card-pad) * -1 + 4px); padding-left: var(--ft-space-2); padding-right: var(--ft-space-2); }
.ft-round__nav a, .ft-round__nav span {
  display: inline-flex; align-items: center; gap: 2px; min-height: var(--ft-touch); padding: 0 var(--ft-space-2);
  font-size: var(--ft-text-sm); font-weight: var(--ft-weight-semibold); color: var(--ft-text-2); border-radius: var(--ft-radius-md);
}
.ft-round__nav a:hover { color: var(--ft-accent); background: var(--ft-surface-2); }
.ft-round__nav .is-center { margin: 0 auto; color: var(--ft-text); }
.ft-round__nav [aria-disabled="true"] { color: var(--ft-text-3); font-weight: var(--ft-weight-regular); }
.ft-dday {
  display: flex; align-items: center; gap: var(--ft-space-2);
  font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2);
}
.ft-dday b { color: var(--ft-text); }
.ft-dday__count {
  margin-left: auto; padding: 2px var(--ft-space-2); border-radius: var(--ft-radius-sm);
  background: var(--ft-accent); color: var(--ft-on-accent); font-weight: var(--ft-weight-bold); font-size: var(--ft-text-sm);
}

/* ───────── 당첨금: 모바일 등수 카드 / 데스크톱 표 ───────── */
.ft-prize { display: grid; }
.ft-prize__item {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 2px var(--ft-space-3);
  padding: var(--ft-space-3) var(--ft-card-pad); border-top: 1px solid var(--ft-border);
}
.ft-prize__item:first-child { border-top: 0; }
.ft-prize__rank {
  grid-row: 1 / span 2; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 28px; border-radius: var(--ft-radius-sm);
  background: var(--ft-surface-2); font-size: var(--ft-text-sm); font-weight: var(--ft-weight-bold); color: var(--ft-text);
}
.ft-prize__item--top .ft-prize__rank { background: var(--ft-accent); color: var(--ft-on-accent); }
.ft-prize__amount { font-size: var(--ft-text-lg); line-height: var(--ft-lh-lg); font-weight: var(--ft-weight-bold); font-variant-numeric: tabular-nums; }
.ft-prize__item--top .ft-prize__amount { font-size: var(--ft-text-xl); line-height: var(--ft-lh-xl); }
.ft-prize__people { text-align: right; font-size: var(--ft-text-md); font-weight: var(--ft-weight-semibold); font-variant-numeric: tabular-nums; }
.ft-prize__meta { grid-column: 2 / span 2; font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); font-variant-numeric: tabular-nums; }

.ft-table-wrap { overflow-x: auto; }
.ft-table { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); font-variant-numeric: tabular-nums; }
.ft-table caption { text-align: left; padding: 0 var(--ft-card-pad) var(--ft-space-2); color: var(--ft-text-2); }
.ft-table th, .ft-table td { padding: var(--ft-space-3) var(--ft-space-4); border-top: 1px solid var(--ft-border); text-align: left; vertical-align: middle; }
.ft-table thead th { background: var(--ft-surface-2); font-size: 13px; font-weight: var(--ft-weight-semibold); color: var(--ft-text-2); border-top: 0; white-space: nowrap; }
.ft-table tbody th { font-weight: var(--ft-weight-bold); white-space: nowrap; }
.ft-table .is-num { text-align: right; white-space: nowrap; }
.ft-table .is-strong { font-weight: var(--ft-weight-bold); font-size: var(--ft-text-md); }
.ft-table tbody tr:first-child .is-strong { color: var(--ft-accent); }
.ft-only-mobile { display: block; }
.ft-only-desktop { display: none; }
@media (min-width: 768px) {
  .ft-only-mobile { display: none; }
  .ft-only-desktop { display: block; }
}

/* 축약 금액의 원값: title(마우스) + 화면에 한 번은 원값을 함께 보인다 (회차 카드·등수 카드 메타) */
data[title] { cursor: help; }

/* ───────── 키-값 요약 ───────── */
.ft-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--ft-border); border-radius: var(--ft-radius-md); overflow: hidden; }
.ft-kv > div { background: var(--ft-surface); padding: var(--ft-space-3); display: grid; gap: 2px; }
.ft-kv dt { font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-2); font-weight: var(--ft-weight-semibold); }
.ft-kv dd { font-size: var(--ft-text-lg); line-height: var(--ft-lh-lg); font-weight: var(--ft-weight-bold); font-variant-numeric: tabular-nums; }
.ft-kv dd small { font-size: var(--ft-text-xs); font-weight: var(--ft-weight-regular); color: var(--ft-text-2); margin-left: 2px; }
@media (min-width: 768px) { .ft-kv { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ───────── 버튼 ───────── */
.ft-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ft-space-2);
  min-height: var(--ft-touch); padding: 0 var(--ft-space-4);
  border: 1px solid transparent; border-radius: var(--ft-radius-md);
  font-size: var(--ft-text-md); font-weight: var(--ft-weight-semibold); line-height: 1; white-space: nowrap;
  transition: background-color var(--ft-dur) var(--ft-ease), border-color var(--ft-dur) var(--ft-ease);
}
.ft-btn--lg { min-height: 52px; padding: 0 var(--ft-space-6); font-size: var(--ft-text-lg); }
.ft-btn--sm { min-height: 36px; padding: 0 var(--ft-space-3); font-size: var(--ft-text-sm); position: relative; }
.ft-btn--sm::after { content: ""; position: absolute; inset: -4px 0; }
.ft-btn--block { width: 100%; }
.ft-btn--primary { background: var(--ft-accent); color: var(--ft-on-accent); }
.ft-btn--primary:hover { background: var(--ft-accent-strong); }
.ft-btn--secondary { background: var(--ft-surface); color: var(--ft-text); border-color: var(--ft-border-strong); }
.ft-btn--secondary:hover { background: var(--ft-surface-2); }
.ft-btn--tonal { background: var(--ft-accent-weak); color: var(--ft-accent); }
.ft-btn--ghost { background: none; color: var(--ft-text-2); }
.ft-btn--ghost:hover { background: var(--ft-surface-2); color: var(--ft-text); }
.ft-btn--danger { background: var(--ft-danger); color: var(--ft-on-danger); }
.ft-btn--danger:hover { background: var(--ft-danger); color: var(--ft-on-danger); filter: brightness(.92); }
.ft-btn[disabled], .ft-btn[aria-disabled="true"] { background: var(--ft-surface-2); color: var(--ft-text-3); border-color: var(--ft-border); cursor: not-allowed; }
.ft-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ft-space-2); }
.ft-actions--3 { grid-template-columns: repeat(3, 1fr); }

/* ───────── 탭 · 세그먼트 · 칩 ───────── */
.ft-tabs { display: flex; gap: var(--ft-space-1); border-bottom: 1px solid var(--ft-border); overflow-x: auto; scrollbar-width: none; }
.ft-tabs__tab {
  flex: none; min-height: var(--ft-touch); padding: 0 var(--ft-space-3); border: 0; background: none;
  font-size: var(--ft-text-sm); font-weight: var(--ft-weight-semibold); color: var(--ft-text-2);
  box-shadow: inset 0 -2px 0 transparent;
}
.ft-tabs__tab[aria-selected="true"] { color: var(--ft-text); box-shadow: inset 0 -2px 0 var(--ft-accent); }

.ft-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 2px; background: var(--ft-surface-2); border: 1px solid var(--ft-border); border-radius: var(--ft-radius-md); }
.ft-seg__item {
  min-height: 38px; padding: 0 var(--ft-space-3); border: 0; border-radius: 8px; background: none;
  font-size: var(--ft-text-sm); font-weight: var(--ft-weight-semibold); color: var(--ft-text-2); position: relative;
}
.ft-seg__item::after { content: ""; position: absolute; inset: -3px 0; }
.ft-seg__item[aria-pressed="true"], .ft-seg__item[aria-current="page"] { background: var(--ft-surface); color: var(--ft-text); box-shadow: var(--ft-shadow-1); }

.ft-chips { display: flex; gap: var(--ft-space-2); overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.ft-chips::-webkit-scrollbar { display: none; }
.ft-chip {
  flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 var(--ft-space-3);
  border: 1px solid var(--ft-border-strong); border-radius: var(--ft-radius-full); background: var(--ft-surface);
  font-size: var(--ft-text-sm); font-weight: var(--ft-weight-semibold); color: var(--ft-text-2); position: relative; white-space: nowrap;
}
.ft-chip::after { content: ""; position: absolute; inset: -4px 0; }
.ft-chip[aria-pressed="true"], .ft-chip[aria-current="page"] { background: var(--ft-text); border-color: var(--ft-text); color: var(--ft-surface); }
.ft-chip__count { font-weight: var(--ft-weight-regular); }

/* 말머리 태그 */
.ft-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 6px; flex: none;
  border-radius: var(--ft-radius-sm); font-size: var(--ft-text-xs); font-weight: var(--ft-weight-semibold);
  background: var(--ft-surface-2); color: var(--ft-text-2); border: 1px solid var(--ft-border);
}
.ft-tag--accent { background: var(--ft-accent-weak); color: var(--ft-accent); border-color: transparent; }
.ft-tag--notice { background: var(--ft-text); color: var(--ft-surface); border-color: transparent; }
.ft-tag--win { background: var(--ft-success-weak); color: var(--ft-success); border-color: transparent; }

/* ───────── 목록 행 (링크) ───────── */
.ft-rows > li + li { border-top: 1px solid var(--ft-border); }
.ft-row {
  display: flex; align-items: center; gap: var(--ft-space-3);
  min-height: 52px; padding: var(--ft-space-3) var(--ft-card-pad);
}
a.ft-row:hover { background: var(--ft-surface-2); }
.ft-row__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ft-row__title { font-size: var(--ft-text-md); line-height: var(--ft-lh-md); font-weight: var(--ft-weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-row__meta { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); display: flex; flex-wrap: wrap; gap: 0 var(--ft-space-2); font-variant-numeric: tabular-nums; }
.ft-row__end { flex: none; text-align: right; font-size: var(--ft-text-sm); color: var(--ft-text-2); font-variant-numeric: tabular-nums; }
.ft-row__chev { flex: none; color: var(--ft-text-3); }

/* ───────── 게시판 목록 행 ───────── */
.ft-post { display: block; padding: var(--ft-space-3) var(--ft-card-pad); min-height: 64px; }
.ft-post:hover { background: var(--ft-surface-2); }
.ft-post__line { display: flex; align-items: center; gap: var(--ft-space-2); min-width: 0; }
.ft-post__title { flex: 1; min-width: 0; font-size: var(--ft-text-md); line-height: var(--ft-lh-md); font-weight: var(--ft-weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-post__cmt { flex: none; min-width: 24px; height: 22px; padding: 0 6px; border-radius: var(--ft-radius-full); background: var(--ft-accent-weak); color: var(--ft-accent); font-size: var(--ft-text-xs); font-weight: var(--ft-weight-bold); display: inline-flex; align-items: center; justify-content: center; }
.ft-post__meta { margin-top: 2px; display: flex; flex-wrap: wrap; gap: 0 var(--ft-space-2); font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); font-variant-numeric: tabular-nums; }
.ft-post__meta > * + *::before { content: "·"; margin-right: var(--ft-space-2); color: var(--ft-text-3); }
.ft-post--notice { background: var(--ft-surface-2); min-height: 52px; display: flex; align-items: center; }
.ft-post--notice .ft-post__line { flex: 1; }
.ft-card > .ft-rows:first-child > li:first-child > * { border-radius: calc(var(--ft-radius-lg) - 1px) calc(var(--ft-radius-lg) - 1px) 0 0; }

/* ───────── 빈 상태 ───────── */
.ft-empty { display: grid; justify-items: center; gap: var(--ft-space-2); padding: var(--ft-space-6) var(--ft-card-pad); text-align: center; }
.ft-empty__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ft-surface-2); color: var(--ft-text-2); }
.ft-empty__title { font-size: var(--ft-text-md); font-weight: var(--ft-weight-semibold); }
.ft-empty__desc { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); max-width: 32em; }
.ft-empty .ft-btn { margin-top: var(--ft-space-2); }
.ft-empty--pending .ft-empty__icon { background: var(--ft-accent-weak); color: var(--ft-accent); }
.ft-empty--stale .ft-empty__icon { background: var(--ft-warning-weak); color: var(--ft-warning); }

/* ───────── 알림 띠 ───────── */
.ft-notice { display: flex; gap: var(--ft-space-2); align-items: flex-start; padding: var(--ft-space-3) var(--ft-space-4); border-radius: var(--ft-radius-md); font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); background: var(--ft-surface-2); color: var(--ft-text-2); }
.ft-notice .ft-icon { margin-top: 1px; }
.ft-notice--warning { background: var(--ft-warning-weak); color: var(--ft-warning); }
.ft-notice--warning b { color: inherit; }

/* ───────── 폼 ───────── */
.ft-field { display: grid; gap: 6px; }
.ft-label { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); font-weight: var(--ft-weight-semibold); color: var(--ft-text); }
.ft-label small { color: var(--ft-text-2); font-weight: var(--ft-weight-regular); margin-left: 4px; }
.ft-input, .ft-select {
  width: 100%; min-height: var(--ft-touch); padding: 0 var(--ft-space-3);
  border: 1px solid var(--ft-border-strong); border-radius: var(--ft-radius-md); background: var(--ft-surface);
  font-size: var(--ft-text-md); /* 16px 미만이면 iOS가 확대한다 */
}
.ft-select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ft-text-2) 50%), linear-gradient(135deg, var(--ft-text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.ft-input:focus-visible, .ft-select:focus-visible { outline: 2px solid var(--ft-accent); outline-offset: 0; border-color: var(--ft-accent); }
.ft-input[aria-invalid="true"] { border-color: var(--ft-danger); }
.ft-help { font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-2); }
.ft-error { font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-danger); font-weight: var(--ft-weight-semibold); }
.ft-search { display: flex; gap: var(--ft-space-2); }
.ft-search .ft-input { flex: 1; }

/* ───────── 페이지네이션 ───────── */
.ft-pager { display: flex; align-items: center; justify-content: center; gap: var(--ft-space-1); padding: var(--ft-space-3) 0; }
.ft-pager a, .ft-pager span {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--ft-touch); height: var(--ft-touch);
  border-radius: var(--ft-radius-md); font-size: var(--ft-text-sm); font-weight: var(--ft-weight-semibold); color: var(--ft-text-2); font-variant-numeric: tabular-nums;
}
.ft-pager a:hover { background: var(--ft-surface-2); color: var(--ft-text); }
.ft-pager [aria-current="page"] { background: var(--ft-text); color: var(--ft-surface); }
.ft-pager [aria-disabled="true"] { color: var(--ft-text-3); opacity: 1; }
.ft-pager__status { min-width: auto !important; padding: 0 var(--ft-space-3); color: var(--ft-text) !important; }
.ft-pager .ft-pager__num { display: none; }
@media (min-width: 768px) { .ft-pager .ft-pager__num { display: inline-flex; } .ft-pager .ft-pager__status { display: none; } }

/* ───────── 광고 자리 (높이 예약 → CLS 0) ───────── */
.ft-ad { display: grid; gap: 4px; justify-items: center; }
.ft-ad__label { font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-3); justify-self: start; }
.ft-ad__slot {
  width: 100%; min-height: var(--ft-ad-h, 100px); border-radius: var(--ft-radius-md); overflow: hidden;
  background: repeating-linear-gradient(-45deg, var(--ft-surface-2) 0 10px, var(--ft-bg) 10px 20px);
  border: 1px solid var(--ft-border);
}
.ft-ad__slot > ins { display: block; width: 100%; min-height: var(--ft-ad-h, 100px); }  /* 광고가 늦게·안 와도 자리는 그대로 (접으면 그때 CLS) */
.ft-ad--banner { --ft-ad-h: 100px; }   /* 모바일 320×100 */
.ft-ad--rect { --ft-ad-h: 250px; }     /* 300×250 */
.ft-ad--leader { --ft-ad-h: 90px; }    /* 데스크톱 728×90 */

/* ───────── 가로 스크롤 카드 ───────── */
.ft-scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 78%); gap: var(--ft-space-3);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 calc(var(--ft-gutter) * -1); padding: 2px var(--ft-gutter) var(--ft-space-1);
}
.ft-scroller::-webkit-scrollbar { display: none; }
.ft-scroller > * { scroll-snap-align: start; }
@media (min-width: 768px) {
  .ft-scroller { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-columns: auto; margin: 0; padding: 0; overflow: visible; }
}

/* 통계 카드 */
.ft-stat { padding: var(--ft-card-pad); display: grid; gap: var(--ft-space-3); align-content: start; }
.ft-stat__label { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); font-weight: var(--ft-weight-semibold); }
.ft-stat__value { font-size: var(--ft-text-xl); line-height: var(--ft-lh-xl); font-weight: var(--ft-weight-bold); }
.ft-stat__value small { font-size: var(--ft-text-sm); font-weight: var(--ft-weight-regular); color: var(--ft-text-2); margin-left: 2px; }
.ft-stat__note { font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-3); }
.ft-stat .ft-balls { flex-wrap: wrap; row-gap: 6px; }

/* ───────── 접기 (details/summary) ───────── */
.ft-acc > details + details { border-top: 1px solid var(--ft-border); }
.ft-acc summary {
  list-style: none; display: flex; align-items: center; gap: var(--ft-space-2); min-height: 52px; padding: var(--ft-space-2) var(--ft-card-pad);
  font-size: var(--ft-text-md); font-weight: var(--ft-weight-semibold); cursor: pointer;
}
.ft-acc summary::-webkit-details-marker { display: none; }
.ft-acc summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ft-text-2); border-bottom: 2px solid var(--ft-text-2); transform: rotate(45deg) translateY(-3px); transition: transform var(--ft-dur); flex: none; }
.ft-acc details[open] > summary::after { transform: rotate(225deg) translateY(-1px); }
.ft-acc summary small { font-weight: var(--ft-weight-regular); color: var(--ft-text-2); font-size: var(--ft-text-sm); }
.ft-acc__body { padding: 0 var(--ft-card-pad) var(--ft-card-pad); font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); }

/* ───────── 발행 번호 세트 ───────── */
.ft-sets { display: grid; }
.ft-set { display: flex; align-items: center; gap: var(--ft-space-3); padding: var(--ft-space-2) 0; }
.ft-set + .ft-set { border-top: 1px dashed var(--ft-border); }
.ft-set__label { flex: none; width: 20px; font-size: var(--ft-text-sm); font-weight: var(--ft-weight-bold); color: var(--ft-text-2); }
.ft-set__result { margin-left: auto; font-size: var(--ft-text-xs); font-weight: var(--ft-weight-semibold); color: var(--ft-text-3); white-space: nowrap; }

/* ───────── 번호 고르기 (45칸) ───────── */
.ft-picker { display: grid; grid-template-columns: repeat(7, var(--ft-touch)); gap: 6px; justify-content: space-between; }
.ft-picker__num {
  width: var(--ft-touch); height: var(--ft-touch); border-radius: 50%;
  border: 1px solid var(--ft-border-strong); background: var(--ft-surface);
  font-size: var(--ft-text-md); font-weight: var(--ft-weight-semibold); font-variant-numeric: tabular-nums; color: var(--ft-text);
}
.ft-picker__num[aria-pressed="true"][data-mode="fix"] { background: var(--ft-accent); border-color: var(--ft-accent); color: var(--ft-on-accent); }
.ft-picker__num[aria-pressed="true"][data-mode="ex"] { background: var(--ft-surface-2); border-style: dashed; color: var(--ft-text-3); text-decoration: line-through; }
@media (min-width: 768px) { .ft-picker { grid-template-columns: repeat(9, var(--ft-touch)); justify-content: start; } }

/* ───────── 판매점 ───────── */
.ft-store { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--ft-space-3); padding: var(--ft-space-3) var(--ft-card-pad); }
.ft-store__wins { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.ft-win { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--ft-radius-full); font-size: var(--ft-text-xs); font-weight: var(--ft-weight-bold); font-variant-numeric: tabular-nums; }
.ft-win--1 { background: var(--ft-ball-1); color: var(--ft-ball-text); }
.ft-win--2 { background: var(--ft-accent-weak); color: var(--ft-accent); }
.ft-store__name { font-size: var(--ft-text-md); line-height: var(--ft-lh-md); font-weight: var(--ft-weight-bold); }
.ft-store__dist { align-self: start; font-size: var(--ft-text-sm); font-weight: var(--ft-weight-bold); color: var(--ft-text); font-variant-numeric: tabular-nums; padding-top: 2px; }
.ft-store__addr { grid-column: 1 / -1; font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); }
.ft-store__money { grid-column: 1 / -1; font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-3); font-variant-numeric: tabular-nums; }
.ft-store__acts { grid-column: 1 / -1; display: flex; gap: var(--ft-space-2); margin-top: 4px; }

/* 하단 시트 (지도 위 목록) */
.ft-sheet {
  background: var(--ft-surface); border-radius: 16px 16px 0 0; box-shadow: var(--ft-shadow-3);
  display: grid; grid-template-rows: auto auto 1fr; min-height: 0;
}
.ft-sheet__grip { display: grid; place-items: center; height: var(--ft-touch); border: 0; background: none; width: 100%; }
.ft-sheet__grip::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--ft-border-strong); }
.ft-sheet__head { padding: 0 var(--ft-card-pad) var(--ft-space-3); display: grid; gap: var(--ft-space-3); border-bottom: 1px solid var(--ft-border); }
.ft-sheet__body { overflow-y: auto; min-height: 0; }
@media (min-width: 768px) { .ft-chips--wrap { flex-wrap: wrap; overflow: visible; } }

/* ───────── 회차 카드 부품 보강 (D2 — components/round_card.php) ───────── */
.ft-round__heading { flex: 1; min-width: 0; }
.ft-round__date .ft-fresh { margin: 0 0 0 6px; vertical-align: 1px; }
.ft-round__head > .ft-copy { flex: none; margin: -8px -10px 0 auto; }
/* 복사 버튼 (ft.js data-ft-copy) — 복사하면 data-copied="true" 2초: 아이콘이 체크로, 스크린리더는 #ft-live가 알린다 */
.ft-copy .ft-icon + .ft-icon { display: none; }
.ft-copy[data-copied="true"] { color: var(--ft-success); }
.ft-copy[data-copied="true"] .ft-icon:first-child { display: none; }
.ft-copy[data-copied="true"] .ft-icon + .ft-icon { display: inline-block; }
.ft-round__pending {
  display: flex; gap: var(--ft-space-2); align-items: flex-start; padding: var(--ft-space-3) var(--ft-space-4);
  border-radius: var(--ft-radius-md); background: var(--ft-accent-weak); color: var(--ft-accent);
  font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); font-weight: var(--ft-weight-semibold);
}
.ft-round__pending .ft-icon { margin-top: 2px; }
.ft-round__sub b { color: var(--ft-text); font-variant-numeric: tabular-nums; }
.ft-round__ranks { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ft-space-2) var(--ft-space-4); font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); }
@media (min-width: 480px) { .ft-round__ranks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ft-round__ranks div { display: flex; justify-content: space-between; gap: var(--ft-space-2); font-variant-numeric: tabular-nums; }
.ft-round__ranks dt { color: var(--ft-text-2); font-weight: var(--ft-weight-semibold); white-space: nowrap; }
.ft-round__ranks dd { font-weight: var(--ft-weight-semibold); text-align: right; }
.ft-card.ft-round__nav { margin: 0; padding: var(--ft-space-1) var(--ft-space-2); border-top: 1px solid var(--ft-border); }

/* 표 안 축약 금액 아래 원값 (§4.1 — 화면에 원값을 한 번은 보인다) */
.ft-table__full { display: block; font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); font-weight: var(--ft-weight-regular); color: var(--ft-text-3); }
.ft-set__result.is-win { color: var(--ft-success); font-weight: var(--ft-weight-bold); }
/* 카드 안 페이지네이션 — .ft-card a(색 상속)보다 강하게: 지금 쪽은 진한 바탕 + 표면색 글자 (다크 포함 대비 4.5:1 이상) */
.ft-card .ft-pager a[aria-current="page"] { background: var(--ft-text); color: var(--ft-surface); }
