/* 로또랩 하위 페이지와 공통 구성 요소 (styles.css 다음에 불러온다) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 50; padding: 12px 16px;
  background: var(--navy); color: var(--white); font-weight: 700; border-radius: 8px;
}
.skip-link:focus { top: 12px; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 10px; text-decoration-color: var(--gold); }
.tabbar a[aria-current="page"] { background: var(--bg); }
.hello { font-weight: 700; color: var(--navy); padding: 0 6px; }
.ph { background: #FFF4D6; color: #6B4A00; border-radius: 4px; padding: 0 4px; }
.footer .ph { background: rgba(226, 169, 59, 0.2); color: #FFE7B0; }
.plan-paid .ph { background: rgba(226, 169, 59, 0.2); color: var(--gold); }
.save-btn { margin-top: 12px; }
.empty { padding: 28px 4px; color: var(--muted); }
.empty a { color: var(--navy); font-weight: 700; text-decoration: underline; }
.ball-sm { width: 2.25rem; height: 2.25rem; font-size: 0.9375rem; }
.ball-dim { opacity: 0.28; }

.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 60; transform: translate(-50%, 20px);
  max-width: calc(100% - 32px); padding: 14px 22px; border-radius: 12px;
  background: var(--navy); color: var(--white); font-size: 1rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(20, 40, 75, 0.25); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.page-head { background: var(--bg); padding: 40px 0 32px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 2.25rem; font-weight: 900; letter-spacing: -0.02em; color: var(--navy); }
.page-head p { margin-top: 10px; line-height: 1.7; color: var(--muted); max-width: 760px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 8px; font-weight: 700; color: var(--navy); }
.back-link svg { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.stack { display: flex; flex-direction: column; gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.card h3 { font-size: 1.25rem; font-weight: 900; color: var(--navy); }
.card-sub { margin-top: 8px; line-height: 1.6; color: var(--muted); font-size: 1rem; }
.notice-box {
  padding: 16px 20px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  font-size: 1rem; line-height: 1.7; color: var(--text);
}
.notice-box.warn { background: var(--notice); border-color: #EBD9A6; }

/* 통계 타일 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { padding: 20px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.stat .label { font-size: 0.9375rem; color: var(--muted); font-weight: 700; }
.stat .value { display: block; margin-top: 6px; font-size: 1.75rem; font-weight: 900; color: var(--navy); }
.stat .sub { display: block; margin-top: 4px; font-size: 0.875rem; color: var(--muted); }

/* 가로 막대 그래프 */
.bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 32px; margin-top: 20px; }
.bar-row { display: grid; grid-template-columns: 2.25rem 1fr 3rem; align-items: center; gap: 10px; }
.bar-row .ball { width: 2.25rem; height: 2.25rem; font-size: 0.9375rem; }
.bar-track { height: 14px; border-radius: 7px; background: #E9EDF4; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; background: var(--navy); }
.bar-fill.hot { background: var(--gold-dark); }
.bar-val { font-size: 0.9375rem; font-weight: 700; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 0.9375rem; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; background: var(--navy); }
.legend i.hot { background: var(--gold-dark); }

/* 세로 분포 그래프 */
.dist { display: flex; align-items: flex-end; gap: 10px; height: 180px; margin-top: 20px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.dist-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.dist-bar { width: 100%; max-width: 56px; border-radius: 8px 8px 0 0; background: var(--navy); }
.dist-val { font-size: 0.875rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.dist-labels { display: flex; gap: 10px; margin-top: 8px; }
.dist-labels span { flex: 1; text-align: center; font-size: 0.875rem; color: var(--muted); font-weight: 700; min-width: 0; }

/* 표 */
.table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { background: var(--bg); color: var(--navy); font-weight: 700; font-size: 0.9375rem; }
.table tr:last-child td { border-bottom: 0; }
.table .balls { flex-wrap: nowrap; gap: 6px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }

/* 등수 */
.rank { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.875rem; font-weight: 700; background: var(--chip); color: var(--navy); white-space: nowrap; }
.rank-1, .rank-2, .rank-3 { background: var(--gold); color: var(--navy); }
.rank-4, .rank-5 { background: var(--navy); color: var(--white); }
.rank-none { background: #EEF0F4; color: var(--muted); }

/* 폼 */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field .label { font-size: 1rem; font-weight: 700; color: var(--text); }
.field .hint { font-size: 0.875rem; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; min-height: 52px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--white); color: var(--text); font-family: inherit; font-size: 1.0625rem;
}
.textarea { min-height: 200px; line-height: 1.7; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(47, 111, 214, 0.25); }
.btn-row > .field-error { flex: 1 0 100%; }
.field-error { overflow-wrap: anywhere; }
/* 회차 범위 입력 */
.range-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 16px; }
.range-form .field { flex: 0 1 150px; min-width: 110px; }
.range-form .range-sep { margin-top: 36px; font-weight: 700; color: var(--muted); }
.range-form .btn { margin-top: 32px; }
@media (max-width: 480px) {
  .range-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .range-form .field { min-width: 0; }
  .range-form .range-sep { display: none; }
  .range-form .btn { grid-column: 1 / -1; margin-top: 0; width: 100%; }
}
/* 끌어서 고르는 회차 막대 (손잡이 둘, 사이 구간이 선택된 기간) */
.range-form .dual-wrap { flex: 1 0 100%; }
.dual-range { position: relative; height: 44px; margin-top: 6px; }
.dual-track { position: absolute; left: 16px; right: 16px; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: #E1E6EF; }
.dual-fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--navy); }
.dual-range input[type="range"] {
  position: absolute; left: 0; top: 0; width: 100%; height: 44px; margin: 0; padding: 0;
  background: transparent; -webkit-appearance: none; appearance: none; pointer-events: none; touch-action: pan-y;
}
.dual-range input[type="range"]::-webkit-slider-runnable-track { height: 44px; background: transparent; border: 0; }
.dual-range input[type="range"]::-moz-range-track { height: 44px; background: transparent; border: 0; }
.dual-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: grab; width: 32px; height: 32px; margin-top: 6px;
  border-radius: 50%; background: #FFFFFF; border: 5px solid var(--navy); box-shadow: 0 2px 6px rgba(20, 40, 75, 0.3);
}
.dual-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto; cursor: grab; box-sizing: border-box; width: 32px; height: 32px;
  border-radius: 50%; background: #FFFFFF; border: 5px solid var(--navy); box-shadow: 0 2px 6px rgba(20, 40, 75, 0.3);
}
.dual-range input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
.dual-range input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--ball-blue); outline-offset: 2px; }
.dual-range input[type="range"]:focus-visible::-moz-range-thumb { outline: 3px solid var(--ball-blue); outline-offset: 2px; }
.dual-labels { display: flex; justify-content: space-between; gap: 12px; margin-top: 2px; font-size: 0.9375rem; font-weight: 700; color: var(--navy); }
.dual-labels small { display: block; font-weight: 500; font-size: 0.8125rem; color: var(--muted); }
.dual-labels span:last-child { text-align: right; }
@media (max-width: 480px) { .range-form .dual-wrap { grid-column: 1 / -1; } }
/* 옆으로 밀어서 보는 영역: 더 볼 쪽 가장자리를 흐리게, 점과 "2 / 4", 처음 한 번 안내 */
[data-cue="r"] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
[data-cue="l"] { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
[data-cue="lr"] { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.swipe-hint { margin: 12px 0 0; text-align: center; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.scroll-dots { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 10px; }
.scroll-dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #C7CEDB; }
.scroll-dots i.on { width: 22px; border-radius: 4px; background: var(--navy); transition: width 0.2s; }
.scroll-count { margin-left: 8px; font-size: 0.875rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .scroll-dots i.on { transition: none; } }
.market-grid { scroll-padding-left: 16px; }
/* 패턴 마켓 전체 목록은 휴대폰에서 가로 줄 대신 세로로 쌓는다 (홈의 미리보기만 가로 카드) */
@media (max-width: 720px) {
  .market-grid.market-all { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; overflow: visible; padding: 8px 0 0; scroll-snap-type: none; }
  .market-all .pattern { flex: none; width: auto; }
}

/* 틀린 입력: 색만으로 알리지 않도록 테두리·바탕·이름표·'!' 이유를 함께 쓴다 */
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] {
  border-color: #C62828; background: #FFF4F3; box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.18);
}
.input[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus, .select[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.35); }
.invalid > label, .invalid > legend, .invalid > .label { color: #B3261E; }
.check-row.invalid { color: #B3261E; }
.check-row.invalid input { outline: 3px solid #C62828; outline-offset: 1px; }
.field-error { display: flex; align-items: flex-start; gap: 8px; font-size: 0.9375rem; font-weight: 700; line-height: 1.5; color: #B3261E; }
.field-error::before {
  content: '!'; flex: none; display: grid; place-items: center; width: 1.3em; height: 1.3em; margin-top: 0.1em;
  border-radius: 50%; background: #B3261E; color: #FFFFFF; font-size: 0.8125rem; font-weight: 900;
}
.form-error { color: #B3261E; font-size: 0.9375rem; font-weight: 700; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 1rem; line-height: 1.6; }
.check-row input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--navy); }
.check-row a { text-decoration: underline; font-weight: 700; color: var(--navy); }
.auth-card { max-width: 480px; margin: 0 auto; padding: 36px 32px; border-radius: 20px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(20, 40, 75, 0.06); }
.auth-card h1 { font-size: 1.75rem; font-weight: 900; color: var(--navy); }
.auth-card .card-sub { margin-bottom: 24px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 1rem; color: var(--muted); }
.auth-foot a { font-weight: 700; color: var(--navy); text-decoration: underline; }

/* 번호 고르기 판 */
.picker { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.pick {
  aspect-ratio: 1; min-height: 40px; border: 2px solid var(--line); border-radius: 50%;
  background: var(--white); color: var(--text); font-size: 1rem; font-weight: 700; padding: 0;
}
.pick[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 1rem; }
.btn-navy { background: var(--navy); color: var(--white); }

/* 목록 */
.game-list { display: flex; flex-direction: column; margin-top: 16px; border-top: 2px solid var(--navy); }
.game-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.game-meta { font-size: 0.875rem; color: var(--muted); margin-top: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 12px; background: var(--white); padding: 0; }
.icon-btn svg { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 커뮤니티 */
.board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.post-body { margin-top: 24px; font-size: 1.0625rem; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.post-info { margin-top: 10px; font-size: 0.9375rem; color: var(--muted); }
.comment { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment strong { color: var(--navy); }
.comment p { margin-top: 6px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* 법적 문서·공지 */
.prose { max-width: 820px; line-height: 1.85; font-size: 1.0625rem; }
.prose h2 { margin-top: 36px; font-size: 1.375rem; font-weight: 900; color: var(--navy); }
.prose h3 { margin-top: 24px; font-size: 1.125rem; font-weight: 700; color: var(--navy); }
.prose p, .prose ul, .prose ol { margin-top: 12px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 6px; }
.prose .meta { color: var(--muted); font-size: 0.9375rem; }
.prose a { color: var(--navy); font-weight: 700; text-decoration: underline; }
.prose .table { margin-top: 12px; }
.prose .table th, .prose .table td { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.notice-article { padding: 28px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.notice-article h2 { font-size: 1.375rem; font-weight: 900; color: var(--navy); }
.notice-article time { display: block; margin-top: 6px; color: var(--muted); font-size: 0.9375rem; }
.notice-article p { margin-top: 12px; line-height: 1.8; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { min-height: 56px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--navy); padding: 12px 4px; }
.faq details p { padding: 0 4px 18px; line-height: 1.8; color: var(--text); }

/* 패턴 */
.pattern-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 20px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.loading { color: var(--muted); padding: 16px 0; }

@media (max-width: 720px) {
  .page-head { padding: 28px 0 24px; }
  .page-head h1 { font-size: 1.75rem; }
  .auth-card { padding: 28px 20px; border-radius: 16px; }
  .bars { grid-template-columns: 1fr; }
  .dist { gap: 6px; height: 150px; }
  .dist-labels { gap: 6px; }
  .picker { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 16px; }
  .stat .value { font-size: 1.5rem; }
  .table th, .table td { padding: 10px; }
  .toast { bottom: calc(var(--tabbar-h) + 16px); }
  .grid-2 { grid-template-columns: 1fr; }
}

.grid-2 > *, .stack > * { min-width: 0; }
.brand-name { white-space: nowrap; }

@media (max-width: 720px) {
  .header-actions .hello, .header-actions [data-logout] { display: none; }
}

@media (max-width: 420px) {
  .dist, .dist-labels { gap: 3px; }
  .dist-val, .dist-labels span { font-size: 0.6875rem; letter-spacing: -0.02em; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat .value { font-size: 1.25rem; }
  .picker { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* 확인 창 */
.dialog { width: min(480px, calc(100vw - 32px)); padding: 28px; border: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(20, 40, 75, 0.3); color: var(--text); }
.dialog::backdrop { background: rgba(20, 40, 75, 0.55); }
.dialog h2 { font-size: 1.375rem; font-weight: 900; color: var(--navy); }
.dialog p { line-height: 1.7; }
.btn-danger { background: #B3261E; color: var(--white); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
a.hello { text-decoration: none; }
a.hello:hover { text-decoration: underline; }
.is-paid .ad { display: none; }
.is-paid .hb-ad, .is-paid .ad-wrap, .is-paid .ad-label { display: none; }
.ad-inline:not(.ad-live) { display: none; }
.ad-wrap { margin: 24px auto; }
.ad-wrap:has(.ad-inline:not(.ad-live)) { display: none; }
.ad-label { margin: 0 0 4px; font-size: 0.75rem; color: var(--muted, #6b7280); text-align: center; }
.ad-live { border: 0 !important; background: transparent !important; min-height: 0 !important; height: auto !important; padding: 0 !important; display: block !important; }
.link-btn { border: 0; background: none; padding: 0; color: var(--navy); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* 패턴 만들기 */
.studio { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.studio-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 24px; }
.pair { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 칸 두 개가 한 줄에 붙는 곳(바로 아래 자식)만 가로 폭을 정한다. .field 안의 칸에까지 적용하면 세로로 쌓인 칸의 높이가 132px로 커진다. */
.pair > .select, .pair > .input { width: auto; flex: 0 1 132px; min-width: 96px; }
.pair > .field { min-width: 0; }
.pair > .field .select, .pair > .field .input { width: 100%; min-width: 0; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { font-size: 1rem; font-weight: 700; padding: 0; margin-bottom: 8px; }
.rule-list { margin-top: 12px; padding-left: 1.2em; line-height: 1.8; }
.meter { height: 12px; margin-top: 10px; border-radius: 6px; background: var(--chip); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--navy); }
.meter.low i { background: #B3261E; }
.price { font-size: 1.5rem; font-weight: 900; color: var(--navy); }
.status-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 14px; font-size: 0.875rem; font-weight: 700; background: var(--chip); color: var(--text); white-space: nowrap; }
.status-chip.on { background: #DDF1E4; color: #0F5B2E; }
.status-chip.off { background: #F7DCDA; color: #8C1D18; }
.form h3 { font-size: 1.125rem; font-weight: 900; color: var(--navy); padding-top: 12px; border-top: 1px solid var(--line); }

/* 결제 */
.order { border-top: 2px solid var(--navy); margin-top: 16px; }
.order-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.order-row.total { font-weight: 900; font-size: 1.25rem; color: var(--navy); }
.test-banner { background: var(--notice); border: 2px dashed var(--gold-dark); border-radius: 12px; padding: 14px 16px; font-weight: 700; line-height: 1.6; }

@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .studio-side { position: static; }
}

/* 소셜 로그인 */
.social-buttons { display: flex; flex-direction: column; gap: 12px; }
.btn-kakao { background: #FEE500; color: #191919; }
.btn-naver { background: #03C75A; color: #FFFFFF; }
.btn-google { background: var(--white); color: #1F1F1F; border: 2px solid var(--line); }
.admin-login { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.admin-login summary { cursor: pointer; color: var(--muted); font-size: 0.9375rem; min-height: 44px; display: flex; align-items: center; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 28px 0 16px; color: var(--muted); font-size: 0.9375rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.remember-row { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.hint-text { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }

/* 기법 실험실 */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tech { padding: 14px 0; border-top: 1px solid var(--line); }
.tech:first-child { border-top: 0; padding-top: 4px; }
.tech-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tech-head label { font-weight: 700; color: var(--text); }
.tech-head output { font-size: 0.9375rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tech.on .tech-head output { color: var(--navy); }
.slider { width: 100%; height: 40px; margin: 4px 0 0; accent-color: var(--navy); }
.tech-hint { display: flex; justify-content: space-between; gap: 12px; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.tech-hint span { flex: 1; min-width: 0; }
.tech-hint span:last-child { text-align: right; }
/* 번호판: 번호를 누르면 고정수(파란 테두리)·제외수(빨간 테두리, 줄 그음)로 고른다. 아래 숫자는 한 게임에 들어갈 확률 */
.wmap { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px 6px; margin-top: 12px; }
.wcell { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 3px 0; border: 0; background: none; font: inherit; cursor: pointer; }
.wcell .ball { width: 100%; max-width: 2.25rem; height: auto; aspect-ratio: 1; font-size: 0.75rem; }
.wbar { width: 100%; height: 6px; border-radius: 3px; background: #E9EDF4; overflow: hidden; }
.wbar i { display: block; height: 100%; background: var(--navy); }
.wpct { font-size: 0.6875rem; font-weight: 700; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.wcell.fix .wpct { color: #1A56C9; }
.wcell.exc .wpct { color: #B3261E; }
.wcell.exc .wbar i, .wcell.fix .wbar i { width: 0 !important; }
@media (max-width: 420px) { .tech-hint { flex-direction: column; gap: 2px; } .tech-hint span:last-child { text-align: left; } }

/* 생년월일 입력 */
.birth-row { display: flex; gap: 8px; }
.birth-row .input { min-width: 0; text-align: center; }
.birth-row .input:nth-child(1) { flex: 2 1 0; }
.birth-row .input:nth-child(2), .birth-row .input:nth-child(3) { flex: 1 1 0; }

/* 번호로 확인: 게임마다 번호 칸 6개 */
.num-games { display: flex; flex-direction: column; gap: 12px; }
.num-game { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.num-game > .field-error { flex: 1 0 100%; }
.num-game-name { flex: 0 0 22px; font-weight: 900; color: var(--navy); text-align: center; }
.num-cells { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.num-cell { padding: 10px 0; width: 100%; min-width: 0; min-height: 48px; text-align: center; font-weight: 900; font-size: 1.375rem; }
.num-game-remove { flex: 0 0 auto; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.num-game-remove:hover { color: #B3261E; }
.num-add { flex: 0 0 22px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--navy); color: #fff; font-size: 1.125rem; font-weight: 700; line-height: 1; cursor: pointer; }
.num-game.ghost .num-cells { opacity: 0.4; }
.num-game-remove.off { visibility: hidden; }
.num-game.ghost .num-game-remove { visibility: hidden; }

/* 번호 인쇄 */
#printSheet { display: none; }
@media print {
  body > *:not(#printSheet):not(#ticketPrint) { display: none !important; }
  #printSheet { display: block; color: #000; background: #fff; font-family: inherit; padding: 8mm 4mm; }
  .ps-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 4px; }
  .ps-head strong { font-size: 20pt; }
  .ps-head span, .ps-source { font-size: 11pt; }
  .ps-source { margin: 4px 0 10px; }
  .ps-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed #999; break-inside: avoid; }
  .ps-name { width: 28px; font-weight: 900; font-size: 16pt; }
  .ps-ball { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 2px solid #000; border-radius: 50%; font-size: 17pt; font-weight: 900; }
  .ps-foot { margin-top: 14px; font-size: 9pt; color: #333; line-height: 1.5; }
}

/* 로또 용지에 인쇄 */
#ticketPrint { display: none; }
.ticket-preview-wrap { margin-top: 16px; display: flex; justify-content: center; background: var(--bg, #F4F6FA); border-radius: 12px; padding: 12px; }
/* 용지 그림 옆에 화살표와 확대 칸을 붙여 두고, 스크롤해도 따라오게 한다 */
.ticket-stage { display: grid; grid-template-columns: minmax(0, 420px) minmax(200px, 300px); gap: 16px; justify-content: center; align-items: start; margin-top: 16px; }
.ticket-stage .ticket-preview-wrap { margin-top: 0; }
.ticket-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; padding-bottom: 4px; }
.ticket-side .ticket-nudge { margin-top: 0; }
@media (max-width: 640px) {
  .ticket-stage { grid-template-columns: minmax(0, 1fr) 132px; gap: 10px; justify-content: stretch; }
  .ticket-side { top: 64px; max-height: calc(100vh - 64px - var(--tabbar-h, 64px) - 12px); }
  .ticket-side .nudge-pad { grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(3, 40px); }
  .ticket-side .nudge-btn { font-size: 1rem; }
  .ticket-side .nudge-side p { display: none; }
  .ticket-side .nudge-side .opt { padding: 6px 8px; font-size: 0.875rem; }
  .ticket-side .ticket-zoom { grid-template-columns: 1fr; gap: 8px; }
  .ticket-side #moveNote { font-size: 0.8125rem; }
}
.ticket-fit > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-weight: 700; }
.ticket-fit > summary::-webkit-details-marker { display: none; }
.ticket-fit > summary::before { content: '▶'; font-size: 0.875rem; color: var(--navy); margin-right: 2px; }
.ticket-fit[open] > summary::before { content: '▼'; }
.ticket-fit-title { font-size: 1.375rem; color: var(--navy); }
.ticket-fit-now { font-size: 0.9375rem; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.ticket-fit-hint { flex: 1 0 100%; font-size: 0.875rem; font-weight: 500; color: var(--muted); line-height: 1.6; }
.ticket-fit-help { margin: 10px 0 0; padding: 12px 14px; background: var(--bg, #F4F6FA); border-radius: 10px; font-size: 0.9375rem; line-height: 1.7; }
.ticket-fit-help p { margin: 0 0 6px; }
.ticket-fit-help ul { margin: 0 0 6px; padding-left: 20px; }
.ticket-fit-body { margin-top: 14px; }
.ticket-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 16px; }
.nudge-pad { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); gap: 4px; flex: 0 0 auto; }
.nudge-btn { border: 2px solid var(--navy); background: #fff; color: var(--navy); border-radius: 10px; font-size: 1.25rem; font-weight: 700; cursor: pointer; }
.nudge-btn:hover { background: var(--navy); color: #fff; }
.nudge-btn:focus-visible { outline: 3px solid var(--gold, #C9A227); outline-offset: 2px; }
.nudge-up { grid-column: 2; grid-row: 1; }
.nudge-left { grid-column: 1; grid-row: 2; }
.nudge-mid { grid-column: 2; grid-row: 2; display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; line-height: 1.25; text-align: center; color: var(--muted); }
.nudge-right { grid-column: 3; grid-row: 2; }
.nudge-down { grid-column: 2; grid-row: 3; }
.nudge-side { flex: 1 1 220px; min-width: 0; }
.ticket-zoom-wrap { margin-top: 12px; }
.ticket-zoom-wrap summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 6px 0; }
.ticket-zoom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.ticket-zoom figure { margin: 0; }
.ticket-zoom-svg { display: block; width: 100%; height: auto; background: #F6F4EE; border: 1px solid var(--line, #D9DEE8); border-radius: 8px; }
.ticket-zoom figcaption { margin-top: 4px; font-size: 0.875rem; color: var(--muted); text-align: center; }
.ticket-preview { width: 100%; max-width: 360px; height: auto; background: #fff; border-radius: 6px; }
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ticket-off { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 10px 16px; align-items: center; }
.ticket-off-row { display: grid; grid-template-columns: 2.5em minmax(0, 1fr) minmax(64px, 84px) 2em; gap: 8px; align-items: center; }
.ticket-off-name { font-weight: 700; }
.ticket-off .select { width: 100%; min-width: 0; }
.ticket-off .input { width: 100%; text-align: center; }
.ticket-off > .btn-row { grid-column: 1 / -1; }
.ticket-off > .field-error { grid-column: 1 / -1; }
.ticket-page { word-break: keep-all; overflow-wrap: anywhere; }
.ticket-page .btn-row { align-items: center; }
.ticket-grid { align-items: end; }
.ticket-grid .field { min-width: 0; }
.ticket-hint { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }
#feedOptions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
#feedOptions .opt { width: 100%; text-align: center; }
#offField > .field-error { flex: 1 0 100%; }
.ticket-advanced { margin-top: 4px; }
.ticket-advanced summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 8px 0; }
.ticket-steps { margin: 16px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; line-height: 1.7; }
@media print {
  /* 용지 인쇄: 본문의 여백·최소 높이가 남으면 빈 둘째 쪽이 생기므로 모두 없앤다 */
  html.ticket-printing, html.ticket-printing body { margin: 0 !important; padding: 0 !important; min-height: 0 !important; height: auto !important; background: #fff !important; display: block !important; }
  #ticketPrint { display: block; margin: 0; padding: 0; line-height: 0; font-size: 0; }
  #ticketPrint svg { display: block; margin: 0; break-after: page; break-inside: avoid; }
  #ticketPrint svg:last-child { break-after: auto; }
}
.quota-line { flex: 1 0 100%; margin: 0 0 12px; padding: 10px 14px; background: var(--bg, #F4F6FA); border-radius: 10px; font-size: 0.9375rem; line-height: 1.6; }
.quota-line strong { color: var(--navy); font-size: 1.0625rem; }

/* ---- 인쇄 단추 묶음: 쓰는 기기에 맞는 묶음을 앞에 열어 둔다 ---- */
.print-groups { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.print-groups.phone-first #printPhone { order: -1; }
.print-group { border: 1px solid var(--line, #D9DEE8); border-radius: 12px; padding: 12px 14px; background: #fff; }
.print-group > summary { cursor: pointer; font-weight: 700; color: var(--navy); list-style: none; display: flex; align-items: center; gap: 6px; }
.print-group > summary::-webkit-details-marker { display: none; }
.print-group > summary::before { content: '▶'; font-size: 0.75rem; }
.print-group[open] > summary::before { content: '▼'; }
.print-group[open] > summary { margin-bottom: 10px; }
.btn-print { min-height: 56px; font-size: 1.125rem; padding: 0 28px; }
.btn[data-locked] { border-style: dashed; }
@media (max-width: 640px) {
  /* 폰에서는 인쇄 단추가 화면 아래에 붙어 따라온다 (하단 메뉴 바로 위) */
  .print-group[open] .print-main { position: sticky; bottom: calc(var(--tabbar-h, 4.5rem) + 8px); z-index: 5; background: #fff; padding: 8px; margin: 0 -8px; border-radius: 12px; box-shadow: 0 -6px 16px rgba(20, 40, 75, 0.12); }
  .btn-print { flex: 1 1 100%; }
}

/* ---- 인쇄할 번호: 한 줄에 한 게임, 숫자 영역을 넓게 (장 단위로 색을 번갈아) ---- */
.game-list.scrolls { max-height: min(460px, 60vh); overflow-y: auto; overscroll-behavior: contain; border-bottom: 1px solid var(--line); }
.tg-row { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tg-row.alt { background: var(--bg, #F4F6FA); }
.tg-row.sheet-start { border-top: 2px solid var(--navy); }
.tg-id { font-size: 0.9375rem; font-weight: 900; color: var(--navy); }
.tg-nums { display: flex; justify-content: space-between; gap: 6px; width: 100%; max-width: 36rem; justify-self: center; font-size: 1.1875rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.tg-nums span { min-width: 1.75rem; text-align: center; }
.tg-rm { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 0.875rem; cursor: pointer; }
.tg-rm:hover { background: #FCEBEB; border-color: #E24B4A; color: #A32D2D; }
.tg-rm:focus-visible { outline: 3px solid var(--gold, #C9A227); outline-offset: 2px; }
.tg-range { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: 0.9375rem; font-weight: 700; }
.tg-range-in { width: 4.5rem; text-align: center; }
.tg-range .small { font-weight: 400; color: var(--muted); }
.tg-nav { display: inline-flex; align-items: center; gap: 6px; }
.tg-nav .opt { min-width: 44px; }
@media (max-width: 640px) {
  .tg-row { grid-template-columns: 2.75rem minmax(0, 1fr) auto; column-gap: 8px; padding: 5px 4px; }
  .tg-nums { font-size: 1.0625rem; gap: 2px; }
  .tg-nums span { min-width: 1.5rem; }
  .tg-rm { min-width: 40px; padding: 0 8px; }
}

/* ---- 내 기록 > 저장한 번호: 한 줄에 한 게임으로 촘촘하게, 많으면 상자 안에서 스크롤 ---- */
#myGames.scrolls { max-height: min(560px, 70vh); overflow-y: auto; overscroll-behavior: contain; border-bottom: 1px solid var(--line); }
.sg-row { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.sg-no { font-size: 0.875rem; font-weight: 700; color: var(--muted); text-align: right; }
.sg-main .balls { gap: 8px; flex-wrap: nowrap; }
.sg-main .ball { width: 2.125rem; height: 2.125rem; font-size: 0.9375rem; }
.sg-meta { margin: 3px 0 0; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-act { display: flex; align-items: center; gap: 10px; }
.sg-bt-m { display: none; }
.sg-bt { font-size: 0.875rem; font-weight: 700; color: var(--navy); text-decoration: underline; white-space: nowrap; }
@media (max-width: 640px) {
  .sg-row { grid-template-columns: 1.5rem minmax(0, 1fr) auto; column-gap: 6px; padding: 8px 2px; }
  .sg-main .balls { gap: 3px; }
  .sg-main .ball { width: 1.75rem; height: 1.75rem; font-size: 0.8125rem; }
  .sg-act { gap: 4px; }
  .sg-act .sg-bt { display: none; }
  .sg-bt-m { display: inline; margin-left: 8px; font-size: 0.8125rem; }
  .sg-main { min-width: 0; }
  .sg-meta { display: inline-block; max-width: calc(100% - 4.5rem); vertical-align: bottom; }
  .sg-del { width: 32px; height: 32px; min-width: 0; padding: 0; }
  .sg-del svg { width: 16px; height: 16px; }
}

/* QR 확인: 사진 올리기 */
.photo-drop { margin-top: 16px; padding: 20px; border: 2px dashed var(--line); border-radius: 16px; text-align: center; background: var(--bg, #F4F6FA); }
.photo-drop.over { border-color: var(--navy); background: #EEF3FB; }
.photo-drop .small { margin-top: 10px; color: var(--muted); }
.photo-drop .btn.disabled { opacity: 0.5; pointer-events: none; }
.photo-progress { margin-top: 12px; color: var(--text); font-weight: 700; }
.draw-section { margin-top: 24px; }
.draw-title { font-size: 1.125rem; font-weight: 900; color: var(--navy); }
.summary-line { font-size: 1.125rem; font-weight: 900; color: var(--navy); }
.failed-list { margin: 8px 0 0; padding-left: 20px; font-size: 0.9375rem; line-height: 1.6; }

/* 시험 인쇄 확인 창: 주 버튼은 같은 크기로 왼쪽부터, 취소는 오른쪽 아래. 일반 회원은 한도와 남은 횟수를 보여 준다 */
.ticket-dlg-limit { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg, #F4F6FA); }
.ticket-dlg-limit p { margin: 0; font-size: 0.9375rem; line-height: 1.6; }
.ticket-dlg-left { margin-top: 4px !important; color: var(--navy); }
.ticket-dlg-left strong { font-size: 1.0625rem; }
.ticket-dlg-left span { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
.ticket-dlg-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; justify-items: stretch; }
.ticket-dlg-actions .btn { width: 100%; min-height: 52px; padding-inline: 10px; line-height: 1.25; text-align: center; }
.ticket-dlg-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.ticket-dlg-foot .btn { min-width: 120px; }
@media (max-width: 420px) { .ticket-dlg-actions { grid-template-columns: minmax(0, 1fr); } }

/* 인쇄 페이지: 인쇄 종류에 따라 보이는 카드가 달라진다 */
.print-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.print-mode .field-label { margin: 0; font-weight: 700; }
html[data-pmode="plain"] .ticket-only { display: none !important; }
html:not([data-pmode="plain"]) .plain-only { display: none; }

/* 패턴 마켓: 검색·정렬 줄, 카드, 후기 */
.pm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.pm-toolbar .field { margin: 0; }
.pm-search { flex: 1 1 260px; }
.pm-sort { flex: 0 0 150px; }
.pm-toolbar .btn { min-height: 44px; }
.pm-cart-btn b { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--navy); color: var(--white); font-size: 0.8125rem; text-align: center; }
.pm-like-filter[aria-pressed="true"] { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pm-card { gap: 10px; }
.pm-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pm-like { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--navy); font: inherit; font-size: 0.9375rem; font-weight: 700; cursor: pointer; }
.pm-like[aria-pressed="true"] { border-color: #E0407A; color: #C2185B; background: #FFF0F5; }
.pm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-tags span { padding: 2px 10px; border-radius: 999px; background: #EEF1F7; color: var(--navy); font-size: 0.8125rem; font-weight: 700; }
.pm-verify { display: flex; flex-direction: column; gap: 5px; }
.pm-verify-text { font-size: 0.9375rem; color: var(--navy); }
.pm-verify-text b { font-weight: 900; }
.pm-verify small { font-size: 0.8125rem; color: var(--muted); }
.pm-bar { position: relative; display: block; height: 10px; border-radius: 999px; background: #E6EAF2; overflow: visible; }
.pm-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--navy); }
.pm-bar u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #E0407A; text-decoration: none; }
.pm-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.875rem; color: var(--muted); }
.pm-meta b { color: var(--navy); font-weight: 900; }
.pm-star { color: #B8860B; font-weight: 700; }
.pm-actions { display: flex; gap: 8px; margin-top: auto; }
.pm-actions .btn { flex: 1 1 0; margin-top: 0; }
.pm-owned { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }
.pm-cart-dlg { max-width: 460px; width: calc(100% - 32px); }
.pm-cart-list { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pm-cart-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pm-cart-name { flex: 1 1 140px; font-weight: 700; color: var(--navy); }
.pm-cart-total { text-align: right; font-size: 1.125rem; }
.review-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.review { padding: 12px 0; border-top: 1px solid var(--line); }
.review-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; }
.review-head b { color: #B8860B; letter-spacing: 1px; }
.review-head b span { color: #D9DEE8; }
.review p { margin-top: 6px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.pm-like[id="likeBtn"] { background: rgba(255, 255, 255, 0.9); }
@media (min-width: 721px) { .market-grid.market-all { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.pm-top-r { display: inline-flex; align-items: center; gap: 6px; }
.pm-cart-icon { padding: 0 10px; }
.pm-cart-icon[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: var(--white); }
.pm-own { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; background: #EEF1F7; color: var(--navy); font-size: 0.875rem; font-weight: 700; }
.pm-cart-own { color: var(--muted); }

/* 관심·장바구니: 알약 테두리 없이 아이콘과 숫자만 */
.pm-like { border: 0; background: transparent; padding: 0 6px; min-height: 36px; border-radius: 8px; color: var(--muted); }
.pm-like:hover { background: #EEF1F7; }
.pm-like[aria-pressed="true"] { border: 0; background: transparent; color: #C2185B; }
.pm-cart-icon { padding: 0 6px; }
.pm-cart-icon[aria-pressed="true"] { border: 0; background: transparent; color: #C2185B; }
.pm-cart-own { opacity: 0.45; }
.pm-top-r { gap: 2px; }
.pm-like svg { display: block; }
.pm-stat { cursor: default; }   /* 담은 수·관심 수를 보여 주는 아이콘+숫자: 누르는 단추가 아니라 표시 */
.pm-stat:hover { background: transparent; }
.pm-stat.on { color: #C2185B; }
.pm-add-pre { margin-right: 0.3em; }   /* '장바구니' + '담기' 사이 띄움(칸 안에서는 공백이 사라진다) */

/* 장바구니 창: 한 줄에 이름·가격 / 주 버튼 / 빼기(✕) */
.pm-cart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pm-cart-head h2 span { margin-left: 4px; font-size: 1rem; color: #C2185B; }
.pm-cart-clear { border: 0; background: none; padding: 4px 0; color: var(--muted); font: inherit; font-size: 0.875rem; text-decoration: underline; cursor: pointer; }
.pm-cart-list li { display: grid; grid-template-columns: minmax(0, 1fr) 124px 32px; align-items: center; gap: 10px; padding: 12px 0; }
.pm-cart-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pm-cart-info small { color: var(--muted); font-size: 0.875rem; font-weight: 700; }
.pm-cart-name { flex: none; overflow-wrap: anywhere; }
.pm-cart-list .btn { min-height: 40px; padding: 0 16px; white-space: nowrap; }
.pm-cart-x { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer; }
.pm-cart-x:hover { background: #EEF1F7; color: var(--navy); }
.pm-cart-list .btn { width: 100%; padding: 0 8px; justify-content: center; text-align: center; }

/* 장바구니 창 v3: 체크박스 · 이름(괄호 안내) · 버튼 · ✕ */
.pm-cart-list li { grid-template-columns: 22px minmax(0, 1fr) 124px 32px; }
.pm-cart-ck { width: 20px; height: 20px; accent-color: var(--navy); }
.pm-cart-tools { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pm-cart-all { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9375rem; color: var(--navy); }
.pm-cart-all input { width: 20px; height: 20px; accent-color: var(--navy); }
.pm-cart-clear[disabled] { opacity: 0.4; cursor: default; text-decoration: none; }
.pm-cart-info { display: block; }
.pm-cart-info small { display: inline; margin-left: 2px; font-size: 0.75rem; font-weight: 400; color: var(--muted); opacity: 0.7; white-space: nowrap; }
.pm-cart-list { margin-top: 0; }
.pm-cart-list li { grid-template-columns: 22px minmax(0, 1fr) 32px; }
.pm-cart-dlg .btn-row .btn { min-height: 44px; }
.pm-count { font-size: 1rem; color: #C2185B; font-weight: 700; }

/* 내가 만든 패턴: 체크박스·삭제(✕) */
.mp-tools { margin: 12px 0 0; }
.mp-tools-btns { display: inline-flex; gap: 14px; }
.mp-danger { color: #B3261E; }
.mp-pattern { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.mp-pattern-main { min-width: 0; }
.mp-pattern .btn-row { flex-wrap: nowrap; }
@media (max-width: 560px) { .mp-pattern { grid-template-columns: 22px minmax(0, 1fr); } .mp-pattern .btn-row { grid-column: 2; flex-wrap: wrap; } }

/* 로그인 화면 다듬기: 비밀번호 보기, 찾기 안내 */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 72px; width: 100%; }
.pw-eye { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--navy); font: inherit; font-size: 0.875rem; font-weight: 700; cursor: pointer; }
.pw-eye:hover { background: #EEF1F7; }
.find-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.find-block h2 { font-size: 1.125rem; margin-bottom: 8px; }
.find-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.find-list li { display: flex; flex-direction: column; gap: 4px; line-height: 1.6; }
.find-list strong { color: var(--navy); }
.find-list span { color: var(--muted); }
.lm-list { list-style: none; margin: 12px 0 0; padding: 0; }
.lm-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lm-name { flex: 1 1 auto; font-weight: 700; color: var(--navy); }
.lm-list .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
/* 해제·연결·비밀번호 설정 단추는 옆의 상태 표시와 같은 높이로 작게 */
.lm-list .btn { min-height: 28px; height: 28px; padding: 0 12px; border-width: 1px; border-radius: 14px; font-size: 0.8125rem; }
.lm-mail { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.lm-sub { margin: 0 0 6px; font-size: 1rem; color: var(--navy); }
.lm-mailrow { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.lm-mailrow .lm-name { word-break: break-all; }
.lm-mail .btn-row { margin-top: 10px; }


/* ---- 고정수 · 제외수 (기법 실험실에서 고르고, 홈의 번호 생성에도 반영된다. 화면 칸은 picks.js가 만든다) ---- */
/* 기법 실험실: 왼쪽(기법·조건) / 가운데(대시보드) / 오른쪽(고정수·제외수) 3칸. 화면이 좁으면 2칸, 휴대폰은 1칸 */
body[data-page="lab"] main .container { max-width: 1560px; }
body[data-page="lab"] .studio { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.85fr); }
/* 대시보드·고정수 칸: 윗선을 화면 위에 고정하고(페이지를 내려도 올라가지 않는다), 칸이 화면보다 길면 그 칸에 마우스를 올리고 굴릴 때 칸 안에서 스크롤된다. 스크롤바는 보이지 않는다 */
body[data-page="lab"] .studio-side, .studio-picks { min-width: 0; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; overscroll-behavior: contain; padding: 16px 0; scrollbar-width: none; -ms-overflow-style: none; }
body[data-page="lab"] .studio-side::-webkit-scrollbar, .studio-picks::-webkit-scrollbar { display: none; }
@media (max-width: 1250px) {
  body[data-page="lab"] .studio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body[data-page="lab"] .studio > .stack { grid-column: 1 / -1; }
  body[data-page="lab"] .studio-side, .studio-picks { position: static; max-height: none; overflow: visible; padding: 0; }
}
@media (max-width: 900px) {
  body[data-page="lab"] .studio { grid-template-columns: minmax(0, 1fr); }
  body[data-page="lab"] .studio > .stack { grid-column: auto; }
}

/* 번호판 표시: 고정수는 파란 테두리, 제외수는 빨간 테두리에 공 색을 흐리게 하고 번호에 줄을 긋는다 */
.wcell.fix .ball { box-shadow: 0 0 0 2px var(--white), 0 0 0 5px #1A6DFF; }
.wcell.exc .ball { box-shadow: 0 0 0 2px var(--white), 0 0 0 5px #E5271C; color: #4F5B70; text-decoration: line-through; }
.wcell.exc .ball.r1, .pk-home-exc .ball.r1 { background: color-mix(in srgb, var(--ball-yellow) 28%, #FFFFFF); }
.wcell.exc .ball.r2, .pk-home-exc .ball.r2 { background: color-mix(in srgb, var(--ball-blue) 28%, #FFFFFF); }
.wcell.exc .ball.r3, .pk-home-exc .ball.r3 { background: color-mix(in srgb, var(--ball-red) 28%, #FFFFFF); }
.wcell.exc .ball.r4, .pk-home-exc .ball.r4 { background: color-mix(in srgb, var(--ball-gray) 28%, #FFFFFF); }
.wcell.exc .ball.r5, .pk-home-exc .ball.r5 { background: color-mix(in srgb, var(--ball-green) 28%, #FFFFFF); }
.wcell:focus-visible, .pk-pick:focus-visible, .pk-chip:focus-visible, .pk-home:focus-visible { outline: 3px solid #2F6FD6; outline-offset: 2px; border-radius: 10px; }
.pk-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; }
.pk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pk-dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid #1A6DFF; box-sizing: border-box; }
.pk-dot.exc { border-color: #E5271C; }
.balls .ball.pk-fixed { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px #1A6DFF; }
/* 휴대폰: 번호판을 로또 용지처럼 7칸으로 줄여 번호를 누르기 쉽게 한다 */
@media (max-width: 480px) { .wmap { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

/* 고정수·제외수 칸 */
.pk-field { margin-top: 12px; padding: 8px 14px 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--white); }
.pk-field.on { background: var(--bg); }
.pk-field.pk-fix.on { border-color: #1A6DFF; }
.pk-field.pk-exc.on { border-color: #E5271C; }
.pk-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: 1rem; font-weight: 700; color: var(--navy); text-align: left; cursor: pointer; }
.pk-pick em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.pk-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 44px; font-size: 0.875rem; color: var(--muted); }
.ball.pk-chip { width: 44px; height: 44px; padding: 0; border: 0; font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; }
.pk-field.pk-fix .pk-chip { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px #1A6DFF; }
.pk-field.pk-exc .pk-chip { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px #E5271C; }
.pk-chip:hover { filter: brightness(0.9); }
.pk-tools { margin-top: 12px; }
.pk-warn { margin-top: 8px; min-height: 1.5em; font-size: 0.9375rem; font-weight: 700; line-height: 1.5; color: #B3261E; }
.card h3.pk-h { margin-top: 16px; }
.pk-explain { margin-top: 10px; padding-left: 1.2em; font-size: 0.9375rem; line-height: 1.65; color: var(--muted); }
.pk-explain li + li { margin-top: 4px; }
.pk-explain b { color: var(--navy); }
.pk-halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.pk-half { min-width: 0; padding: 12px; border-radius: 12px; background: var(--bg); border-top: 4px solid var(--line); }
.pk-half.pk-fix { border-top-color: #1A6DFF; }
.pk-half.pk-exc { border-top-color: #E5271C; }
.pk-cap { display: block; font-size: 0.8125rem; font-weight: 700; color: var(--navy); }
.pk-big { margin: 4px 0; font-size: 1.5rem; font-weight: 900; letter-spacing: -0.02em; color: var(--navy); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pk-sm { font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }
.pk-score { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 0.8125rem; font-weight: 700; color: var(--text); }
.pk-score b { margin: 0 2px; font-size: 1.0625rem; font-weight: 900; color: var(--navy); }
.pk-fit { display: block; margin-top: 2px; }
.pk-half.pk-fix .pk-fit { color: #1A56C9; }
.pk-half.pk-exc .pk-fit { color: #B3261E; }
.pk-prob-note { margin-top: 8px; }
.pk-prob-note:empty { display: none; }
.pk-actions { margin-top: 14px; }
.pk-actions > .btn { width: 100%; }
.pk-toast { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #E8F5EC; color: #14532D; font-size: 0.9375rem; font-weight: 700; line-height: 1.5; }
.pk-toast[hidden] { display: none; }
.pk-toast-btns { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.pk-toast-btns .btn { flex: 1 1 0; min-width: 7rem; }
.pk-toast-btns [hidden] { display: none; }
.pk-ai { margin-top: 14px; font-size: 0.875rem; line-height: 1.6; color: var(--muted); }
.pk-ai summary { padding: 10px 0; font-weight: 700; color: var(--navy); cursor: pointer; }
.pk-ai p { margin-top: 2px; }

/* 홈 첫 화면의 '고정수 · 제외수' 버튼.
   고른 번호가 없으면 보통 버튼이고 누르면 기법 실험실로 간다.
   기법 실험실에서 적용하면 버튼이 늘어나면서 고른 번호를 보여 주고, 누르면 취소된다. */
.pk-home { flex: 0 0 auto; width: 100%; }
.pk-home.pk-home-on {
  flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 6px; padding: 12px 16px; text-align: left; cursor: default;
}
.pk-home button.ball { border: 0; padding: 0; margin: 0; font-family: inherit; font-weight: 700; cursor: pointer; }
.pk-home button.ball:active { transform: scale(0.92); }
.pk-home-set { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 0.9375rem; font-weight: 700; line-height: 1.2; color: var(--text); }
.pk-home-cap { margin-right: 2px; color: var(--muted); }
.pk-home .ball { width: 1.75rem; height: 1.75rem; font-size: 0.875rem; }
.pk-home-fix .ball { box-shadow: 0 0 0 2px #1A6DFF; }
.pk-home-exc .ball { box-shadow: 0 0 0 2px #E5271C; color: #4F5B70; text-decoration: line-through; }
.pk-home-more { color: var(--muted); }
.pk-home-msg { font-size: 1rem; font-weight: 700; color: var(--navy); }
.pk-home-go { font-size: 0.9375rem; font-weight: 700; color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }

/* 기법 실험실: 순서를 알기 쉽게 카드 왼쪽 위에 번호를 붙인다 (1 시작하기 → 2 기법 섞기 → 3 이 기법의 모습 → 4 고정수·제외수) */
.lab-step { position: relative; }
.lab-step::before { content: attr(data-step); position: absolute; top: -14px; left: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 1rem; font-weight: 900; line-height: 30px; text-align: center; box-shadow: 0 0 0 3px var(--bg, #F5F7FB); }

/* 구독이 끝난 뒤 구매한 패턴: 2개월까지는 남은 날을 보여 주고, 그 뒤에는 회백색으로 '이용 종료'를 표시한다(지우지 않는다) */
.pu-note { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #FFF7E3; border: 1px solid #F0DCA8; line-height: 1.6; }
.game-item.pu-ended { background: #F2F1ED; opacity: 0.8; }
.game-item.pu-ended a:not(.btn), .game-item.pu-ended strong { color: #8A8982; }
.game-item.pu-ended .game-meta { color: #86857F; }

/* 패턴 마켓 휴대폰: 검색은 한 줄 전체, 그 아래 정렬·장바구니·관심만을 같은 높이로 나란히 맞춘다 */
@media (max-width: 640px) {
  .pm-toolbar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
  .pm-search { grid-column: 1 / -1; flex: none; }
  .pm-sort { flex: none; min-width: 0; }
  .pm-toolbar .select { width: 100%; min-height: 44px; }
  .pm-toolbar .btn { width: 100%; min-width: 0; padding: 0 8px; justify-content: center; white-space: nowrap; font-size: 0.9375rem; }
}

/* 구매한 패턴의 남은 이용 기간 */
.pm-keep { color: #8A5A00; font-weight: 700; }
.pm-keep-end { color: #86857F; }

/* QR 당첨 확인: 카메라 버튼은 좌우 끝까지, 카메라 화면 아래 두 버튼은 반씩 나란히 */
#cameraBtn { width: 100%; min-height: 52px; justify-content: center; }
#cameraBox video { display: block; width: 100%; max-width: none; }
.cam-actions { display: flex; gap: 8px; }
.cam-actions .btn { flex: 1 1 0; min-height: 44px; justify-content: center; }

/* 카메라 화면 위: 읽은 로또 장 수 + 한 장 읽을 때마다 크게 뜨는 'N장째!' */
.cam-wrap { position: relative; width: 100%; }
.cam-count { position: absolute; top: 10px; left: 10px; padding: 6px 12px; border-radius: 999px; background: rgba(20, 40, 75, 0.88); color: #fff; font-size: 1rem; font-weight: 900; letter-spacing: -0.01em; pointer-events: none; }
.cam-count.bump { animation: camBump 0.5s ease-out; }
.cam-pop { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.6); padding: 12px 22px; border-radius: 18px; background: rgba(23, 125, 70, 0.92); color: #fff; font-size: 1.75rem; font-weight: 900; white-space: nowrap; opacity: 0; pointer-events: none; }
.cam-pop.show { animation: camPop 1.1s ease-out; }
@keyframes camBump { 0% { transform: scale(1); } 40% { transform: scale(1.25); background: #177D46; } 100% { transform: scale(1); } }
@keyframes camPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }
@media (prefers-reduced-motion: reduce) { .cam-count.bump, .cam-pop.show { animation: none; } .cam-pop.show { opacity: 1; } }
.cam-pop.dup { background: rgba(179, 112, 0, 0.94); font-size: 1.375rem; }

/* 커뮤니티 글쓰기: 말머리·양식, 첨부(번호·사진), 임시 저장, 미리보기 */
.write-cat { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.write-cat .select { flex: 1 1 200px; min-width: 0; }
.attach-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.attach-games-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.attach-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.attach-chip b, .attach-game b { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--navy); color: #fff; font-size: 0.8125rem; }
.attach-chip .balls { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; }
.attach-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 10px; }
.attach-thumbs:empty { display: none; }
.attach-thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #F3F5FA; }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-thumb button { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(20, 40, 75, 0.88); color: #fff; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.draft-note { margin: 0 0 10px; font-size: 0.875rem; color: var(--muted); min-height: 1.2em; }
.write-preview { max-width: 820px; margin-top: 20px; padding: 14px; border: 2px dashed var(--line); border-radius: 16px; background: #FBFCFE; }
.pv-title { margin: 10px 0 0; font-size: 1.5rem; font-weight: 900; color: var(--navy); }
.post-attach { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.post-attach:empty { display: none; }
.attach-games { padding: 12px 14px; border-radius: 14px; background: #F4F6FA; }
.attach-game { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.attach-game .balls { flex-wrap: wrap; gap: 6px; }
.attach-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.attach-photos img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: #F3F5FA; display: block; }
.pick-list { max-height: 50vh; overflow-y: auto; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.pick-game { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; flex-wrap: wrap; }
.pick-game .balls { flex-wrap: nowrap; }

/* 링크·영상 첨부 */
.link-add { display: flex; gap: 8px; margin-top: 10px; }
.link-add .input { flex: 1 1 auto; min-width: 0; }
.attach-links-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.attach-links-edit:empty { display: none; }
.link-url { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; }
.attach-links { display: flex; flex-direction: column; gap: 14px; }
.link-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.link-card .embed { width: 100%; max-width: 560px; margin: 0 auto; background: #0B1220; }
.link-card .embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.link-src { margin: 0; padding: 10px 14px; font-size: 0.9375rem; color: var(--muted); }
.link-src a { font-weight: 700; color: var(--navy); }
.link-note { margin: 0; color: var(--muted); }

.link-add[hidden] { display: none; }

/* 첨부 버튼: 휴대폰은 두 칸씩, 넓은 화면은 한 줄에 네 칸, 크기 동일 */
.attach-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 641px) { .attach-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 640px; } }
.attach-bar .btn { width: 100%; min-height: 48px; white-space: nowrap; justify-content: center; }
.attach-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0B1220; }
.attach-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.attach-videos video { width: 100%; max-height: 520px; border-radius: 14px; background: #0B1220; display: block; }

/* 커뮤니티 목록: 게시판 느낌(글쓰기 버튼·말머리 탭·행 목록·인기글) */
.cm-wrap { padding-top: 20px; }
.cm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cm-title { margin: 0; font-size: 1.625rem; font-weight: 900; color: var(--navy); }
.cm-title small { margin-left: 8px; font-size: 0.9375rem; font-weight: 600; color: var(--muted); }
.cm-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1000px) { .cm-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.cm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cm-search { display: flex; gap: 8px; margin-bottom: 10px; }
.cm-search .input { flex: 1 1 auto; min-width: 0; }
.cm-caption { margin: 0 0 8px; font-size: 0.9375rem; color: var(--muted); }
.cm-board { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 0 0 12px 12px; overflow: hidden; }
.cm-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 120px 72px 64px; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid #EEF0F5; color: var(--text); text-decoration: none; }
.cm-row:last-child { border-bottom: 0; }
a.cm-row:hover { background: #F5F8FF; }
a.cm-row:visited .c-title strong { color: #6B7690; }
.cm-head { background: #F3F5FA; font-size: 0.8125rem; font-weight: 800; color: var(--muted); padding-top: 9px; padding-bottom: 9px; }
.cm-head .c-title { text-align: center; }
.c-cat { text-align: center; }
.c-cat .tag { white-space: nowrap; }
.c-title { min-width: 0; display: flex; align-items: center; gap: 4px; }
.c-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 700; color: var(--navy); }
.c-title .cnt { flex: none; font-style: normal; font-weight: 800; color: #B3261E; }
.c-title .ic { flex: none; font-style: normal; font-size: 0.75rem; color: #5C6B8C; }
.c-title .new, .c-title .hot { flex: none; padding: 1px 5px; border-radius: 4px; font-size: 0.6875rem; font-weight: 900; color: #fff; }
.c-title .new { background: #1F7A4C; }
.c-title .hot { background: #B3261E; }
.c-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; text-align: center; }
.c-date, .c-view { font-size: 0.875rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.c-date.is-new { color: #B3261E; font-weight: 800; }
.v-label { display: none; }
@media (max-width: 760px) {
  .cm-head { display: none; }
  .cm-row { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: 'title title title title' 'cat nick date view'; gap: 6px 10px; padding: 12px 14px; }
  .c-title { grid-area: title; }
  .c-cat { grid-area: cat; text-align: left; }
  .c-nick { grid-area: nick; text-align: left; font-size: 0.8125rem; color: var(--muted); }
  .c-date { grid-area: date; font-size: 0.8125rem; }
  .c-view { grid-area: view; font-size: 0.8125rem; }
  .v-label { display: inline; }
  .cm-title small { display: none; }
}
.cm-hot { background: #fff; border: 1px solid var(--line); border-top: 3px solid #B3261E; border-radius: 0 0 12px 12px; padding: 12px 14px; }
.cm-hot h2 { margin: 0 0 8px; font-size: 1.0625rem; font-weight: 900; color: var(--navy); }
.cm-hot h2 small { margin-left: 6px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.cm-hot ol { list-style: none; margin: 0; padding: 0; }
.cm-hot li a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid #EEF0F5; color: var(--text); text-decoration: none; }
.cm-hot li:last-child a { border-bottom: 0; }
.cm-hot li a b { color: #B3261E; font-weight: 900; text-align: center; }
.cm-hot li a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--navy); }
.cm-hot li a em { font-style: normal; color: #B3261E; font-weight: 800; }
.cm-hot li a small { color: var(--muted); font-variant-numeric: tabular-nums; }
.cm-hot-empty { padding: 14px 0; color: var(--muted); }

.cm-search .btn { white-space: nowrap; flex: none; }

/* 글 보기 아래 '같은 말머리의 글' */
#sameCard h2 small { margin-left: 8px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.cm-row.is-cur { background: #FFF7E0; box-shadow: inset 4px 0 0 var(--gold, #E0A526); }
.cm-same .cm-row { grid-template-columns: 96px minmax(0, 1fr) 110px 72px 56px; }
@media (max-width: 760px) { .cm-same .cm-row { grid-template-columns: auto minmax(0, 1fr) auto auto; } }

/* 글 보기: 오른쪽 중분류 버튼 + 아래로 긴 글 목록 */
.pv-container { max-width: 1180px; }
.pv-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.pv-main { min-width: 0; }
@media (min-width: 1000px) {
  .pv-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}
.pv-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-cats h2 { flex: 0 0 100%; margin: 0 0 4px; font-size: 1.0625rem; font-weight: 900; color: var(--navy); }
.pv-cats .btn { flex: 0 0 100%; margin-top: 6px; }
@media (min-width: 1000px) {
  .pv-cats { flex-direction: column; flex-wrap: nowrap; padding: 12px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 0 0 12px 12px; }
  .pv-cats .opt { width: 100%; justify-content: flex-start; text-align: left; min-height: 46px; }
}
.pv-cats-m { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }

/* 오른쪽 압축 목록 4칸 */
.pv-container { max-width: 1280px; }
.pw-pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.pw-pane[hidden] { display: none; }
@media (min-width: 640px) and (max-width: 999px), (min-width: 1500px) { .pw-pane { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pw-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pw-search { flex: 1 1 auto; min-width: 0; display: flex; gap: 8px; }
.pw-search .input { flex: 1 1 auto; min-width: 0; min-height: 40px; }
.pw-search .btn { flex: none; white-space: nowrap; min-height: 40px; font-size: 0.9375rem; }
.post-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.post-topleft { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.post-topright { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.post-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.pw-bar .btn { min-width: 44px; min-height: 40px; font-size: 1.25rem; line-height: 1; }
.pw-bar .btn[disabled] { opacity: 0.4; cursor: default; }
.pw { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pw h2 { margin: 0; padding: 10px 14px; font-size: 1rem; font-weight: 900; color: #fff; display: flex; justify-content: space-between; align-items: baseline; }
.pw h2 small { font-size: 0.75rem; font-weight: 600; opacity: 0.85; }
.pw-new h2 { background: #14284B; } .pw-hot h2 { background: #B3261E; } .pw-week h2 { background: #1F4E9E; } .pw-month h2 { background: #7A4A00; }
.pw-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; padding: 6px 14px; background: #F3F5FA; font-size: 0.75rem; color: var(--muted); }
.pw-head span:first-child { text-align: center; } .pw-head span:last-child { text-align: right; }
.pw ol { list-style: none; margin: 0; padding: 0; }
.pw li a { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 14px; border-top: 1px solid #EEF0F5; color: var(--text); text-decoration: none; }
.pw li a:hover { background: #FFF7E0; }
.pw-v { text-align: center; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pw-t { min-width: 0; display: flex; flex-direction: column; }
.pw-t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; color: var(--navy); }
.pw-t strong b { color: #B3261E; margin-right: 2px; }
.pw-t strong .cnt { font-style: normal; color: #B3261E; font-weight: 800; }
.pw-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; color: var(--muted); }
.pw-d { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.pw-d.is-new { color: #B3261E; font-weight: 800; }
.pw-empty { padding: 14px; color: var(--muted); font-size: 0.875rem; }

/* 글 보기: 글쓰기는 위쪽으로, 중분류 버튼은 한 줄, 글 목록은 8개씩 두 줄 + 넘기기 */
.pv-toprow { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pv-cats-m { flex-wrap: nowrap; gap: 8px; }
.pv-cats-m .opt { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; white-space: nowrap; padding-left: 6px; padding-right: 6px; }
@media (max-width: 640px) { .pv-cats-m { flex-wrap: wrap; } .pv-cats-m .opt { flex: 1 1 calc(33% - 8px); } }
.pv-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }
.pv-pager[hidden] { display: none; }
.pv-pager span { min-width: 64px; text-align: center; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.pv-pager .btn[disabled] { opacity: 0.4; cursor: default; }
@media (min-width: 1000px) {
  .cm-same .cm-head { display: none; }
  #sameRows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(8, auto); grid-auto-flow: column; column-gap: 0; }
  #sameRows > p { grid-column: 1 / -1; grid-row: auto; }
  .cm-same .cm-row { grid-template-columns: minmax(0, 1fr) 84px 52px 44px; padding: 10px 12px; gap: 8px; }
  .cm-same .cm-row .c-cat { display: none; }
  #sameRows > a.cm-row:nth-child(n+9) { border-left: 1px solid #EEF0F5; }
}

/* 글 보기: 화면을 넓게 써서 글은 왼쪽, 오른쪽에 압축 목록 */
@media (min-width: 1000px) { .pv-container { max-width: 1840px; } }
@media (min-width: 1500px) { .pv-layout { grid-template-columns: minmax(0, 1fr) 720px; } }

/* 휴대폰·좁은 화면: 글 아래 버튼 줄 */
.post-bottom { margin-top: 24px; }
.post-bottom:not(:has(> :not([hidden]))) { display: none; }
@media (min-width: 1000px) { .post-bottom { display: none; } }

/* 커뮤니티 메인: 오른쪽 6칸(인기글·주간·월간·유머·정보·일상생활) */
@media (min-width: 1000px) { .cm-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (min-width: 1300px) { .cm-layout { grid-template-columns: minmax(0, 1fr) 580px; } }
@media (min-width: 1300px) { .cm-wrap .container { max-width: 1500px; } }
.hb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 640px) and (max-width: 999px), (min-width: 1300px) { .hb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hb-grid .cm-hot h2 { display: flex; align-items: baseline; gap: 6px; }
.hb-more { margin-left: auto; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.hb-more:hover { color: var(--navy); text-decoration: underline; }
.hb-week { border-top-color: #1F4E9E; } .hb-month { border-top-color: #7A4A00; }
.hb-sports { border-top-color: #C62828; } .hb-humor { border-top-color: #2E7D32; } .hb-info { border-top-color: #00796B; } .hb-life { border-top-color: #6A1B9A; } .hb-num { border-top-color: #E0A100; }

/* 내 기록: 내가 쓴 글 관리 */
.mpp-board { margin-top: 16px; border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 0 0 12px 12px; background: #fff; overflow: hidden; }
.mpp-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 64px 64px 96px 132px; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #EEF0F5; }
.mpp-row:last-child { border-bottom: 0; }
.mpp-head { background: #F3F5FA; font-size: 0.8125rem; font-weight: 800; color: var(--muted); padding-top: 9px; padding-bottom: 9px; }
.mpp-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--navy); text-decoration: none; }
.mpp-title:hover { text-decoration: underline; }
.mpp-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.mpp-date { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.mpp-act { display: flex; gap: 6px; justify-content: flex-end; }
.mpp-hid { margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: #EEE; color: #666; font-size: 0.75rem; }
.mpp-board[hidden] { display: none; }
@media (max-width: 760px) {
  .mpp-head { display: none; }
  .mpp-row { grid-template-columns: auto auto auto minmax(0, 1fr); grid-template-areas: 'title title title title' 'cat views cmts date' 'act act act act'; gap: 6px 12px; padding: 12px 14px; }
  .mpp-title { grid-area: title; white-space: normal; }
  .mpp-cat { grid-area: cat; }
  .mpp-row .mpp-n:nth-child(3) { grid-area: views; text-align: left; }
  .mpp-row .mpp-n:nth-child(4) { grid-area: cmts; text-align: left; }
  .mpp-n::before { content: attr(data-l); }
  .mpp-date { grid-area: date; text-align: right; }
  .mpp-act { grid-area: act; justify-content: flex-start; }
}
.hb-ad { border-top-color: #9AA3B5; }
.hb-ad-box { min-height: 196px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; border: 2px dashed #D3D8E3; border-radius: 10px; background: #F8F9FC; color: var(--muted); padding: 12px; }
.hb-ad-box strong { color: var(--navy); font-size: 1.0625rem; }
.hb-ad-box span { font-size: 0.875rem; }

/* 댓글·글 안의 작은 글자 버튼도 손가락으로 누르기 쉽게 */
.comment .text-toggle, .link-card .text-toggle { min-height: 40px; padding: 8px 10px; }

/* 고정수·제외수: 비회원은 칸을 보여 주되 누를 수 없다 */
.pk-locked { position: relative; }
.pk-locked > :not(.pk-lock-note) { pointer-events: none; opacity: 0.45; }
.pk-lock-note { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); color: var(--navy); font-weight: 700; line-height: 1.6; }
.pk-lock-note a { color: var(--gold-deep, #8A6A00); text-decoration: underline; }

/* ---- 닥터 랩(안내원): 오른쪽 아래 떠 있는 단추와 말풍선 칸 ---- */
.lb-fab { position: fixed; right: 14px; bottom: 14px; z-index: 40; display: block; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer; line-height: 0; -webkit-tap-highlight-color: transparent; }
.lb-fab img { display: block; width: 112px; height: auto; filter: drop-shadow(0 6px 8px rgba(20, 40, 75, 0.28)); transition: transform 0.15s ease; animation: lb-float 3.2s ease-in-out infinite; }
@keyframes lb-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .lb-fab img { animation: none; } }
.lb-fab:hover img { transform: scale(1.06); }
.lb-fab:focus-visible { outline: 3px solid #2F6FD6; outline-offset: 2px; }
/* 휴대폰에서 1.5초 동안 쓰지 않으면 흐려진다(눌러서 바로 쓸 수 있고, 화면을 3초 이상 눌러도 또렷해진다) */
.lb-fab { transition: opacity 0.45s ease; }
.lb-fab.lb-away { opacity: 0.18; }
@media (prefers-reduced-motion: reduce) { .lb-fab { transition: none; } }
.lb-badge { position: absolute; top: 4px; right: 10px; width: 16px; height: 16px; border-radius: 50%; background: #D9453A; border: 2px solid var(--white); }
.lb-panel { position: fixed; right: 16px; bottom: 120px; z-index: 41; width: min(380px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 40px rgba(20, 40, 75, 0.22); overflow: hidden; }
/* 대화창 높이 손잡이(맨 위 줄)와 끌어서 옮기는 머리 칸 */
.lb-grip { flex: 0 0 auto; height: 18px; display: flex; align-items: center; justify-content: center; background: var(--navy); cursor: ns-resize; touch-action: none; }
.lb-grip span { width: 48px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.45); transition: background 0.15s; }
.lb-grip:hover span, .lb-grip:focus-visible span, .lb-dragging .lb-grip span { background: var(--gold); }
.lb-grip:focus-visible { outline: 3px solid #2F6FD6; outline-offset: -3px; }
.lb-panel.lb-dragging { user-select: none; }
.lb-op { display: flex; align-items: center; gap: 4px; margin-left: auto; color: var(--on-navy); cursor: default; }
.lb-op input { width: 64px; accent-color: var(--gold); cursor: pointer; }
.lb-op + .lb-close { margin-left: 6px; }
.lb-head { display: flex; align-items: center; gap: 10px; padding: 2px 14px 12px; background: var(--navy); color: #fff; }
@media (min-width: 900px) { .lb-head { cursor: move; touch-action: none; user-select: none; } }
.lb-head img { width: 34px; height: 42px; object-fit: contain; }   /* 얼굴 누끼 그림 그대로(동그란 틀 없음) */
.lb-head strong { display: block; font-size: 1.05rem; }
.lb-sub { font-size: 0.8rem; color: var(--on-navy); }
.lb-close { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.12); color: #fff; font-size: 1rem; cursor: pointer; }
.lb-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.lb-tab { min-height: 42px; border: 0; background: var(--bg); font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.lb-tab[aria-selected="true"] { background: var(--white); color: var(--navy); box-shadow: inset 0 -3px 0 var(--gold); }
.lb-body { padding: 14px; overflow-y: auto; flex: 1 1 auto; min-height: 160px; line-height: 1.6; }
.lb-bubble { position: relative; margin: 0 0 10px; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--notice); color: var(--text); font-weight: 500; white-space: pre-line; }
.lb-bubble.lb-faq { background: var(--bg); }
.lb-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 6px 10px; margin-bottom: 10px; }
.lb-hero img { flex: 0 0 132px; width: 132px; height: auto; filter: drop-shadow(0 4px 6px rgba(20, 40, 75, 0.22)); }
.lb-hero .lb-bubble { flex: 1 1 150px; margin: 0 0 6px; font-weight: 700; color: var(--navy); }
.lb-hello::before { content: ''; position: absolute; left: -8px; bottom: 10px; border: 8px solid transparent; border-right-color: var(--notice); border-left: 0; }
@media (max-width: 340px) { .lb-hello::before { display: none; } }
.lb-me { margin: 0 0 10px 40px; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--navy); color: #fff; text-align: right; }
/* 대화 칸: 메신저처럼 닥터 랩은 왼쪽(얼굴·이름), 내 말은 오른쪽. 시간은 말풍선 옆에 작게 */
.lb-body.lb-chatmode { background: #EEF2F8; }
.lb-chatmode .lb-bubble { background: var(--white); border: 1px solid #DCE3EE; }
.lb-row { display: flex; gap: 8px; margin: 0 0 4px; }
.lb-row.lb-first { margin-top: 12px; }
.lb-row.lb-first:first-child { margin-top: 0; }
.lb-bot { justify-content: flex-start; }
.lb-user { justify-content: flex-end; }
.lb-av { flex: 0 0 34px; width: 34px; height: 42px; object-fit: contain; }
.lb-msg { min-width: 0; max-width: calc(100% - 42px); }
.lb-who-name { display: block; margin: 0 0 3px 2px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.lb-line { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; }
.lb-user .lb-line { max-width: 88%; }
.lb-line time { flex: 0 0 auto; font-size: 0.7rem; color: var(--muted); line-height: 1.2; padding-bottom: 2px; white-space: nowrap; }
.lb-line .lb-bubble, .lb-line .lb-me { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.lb-line .lb-bubble { border-radius: 16px; }
.lb-bot.lb-first .lb-line .lb-bubble { border-radius: 4px 16px 16px 16px; }
.lb-line .lb-me { border-radius: 16px; text-align: left; }
.lb-user.lb-first .lb-line .lb-me { border-radius: 16px 4px 16px 16px; }
.lb-new { animation: lb-rise 0.28s ease-out; }
@keyframes lb-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lb-new { animation: none; } }
.lb-typing i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--muted); animation: lb-blink 1s infinite; }
.lb-typing i:nth-child(2) { animation-delay: 0.2s; } .lb-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes lb-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.lb-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lb-suggest .opt { font-size: 0.85rem; min-height: 34px; padding: 4px 10px; }
.lb-ask { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bg); }
.lb-ask .input { flex: 1 1 auto; min-height: 42px; font-size: 16px; }
.lb-ask .btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 68px; min-height: 42px; padding: 0 16px; white-space: nowrap; text-align: center; line-height: 1; }   /* 글자가 두 줄로 꺾이지 않고 버튼 가운데에 놓인다 */   /* 16px 아래면 아이폰이 입력 때 화면을 확대한다 */
/* 키보드가 올라온 휴대폰: 탭 줄·손잡이를 접어 글 칸을 최대한 넓힌다 */
.lb-panel.lb-kb .lb-tabs, .lb-panel.lb-kb .lb-grip, .lb-panel.lb-kb .lb-sub { display: none; }
.lb-panel.lb-kb .lb-head { padding-top: 8px; padding-bottom: 8px; }
.lb-panel.lb-kb .lb-body { min-height: 0; }
.lb-stats { display: flex; gap: 8px; margin: 4px 0 10px; }
.lb-stats span { flex: 1; padding: 8px 6px; border-radius: 10px; background: var(--bg); text-align: center; font-size: 0.85rem; color: var(--muted); }
.lb-stats b { display: block; font-size: 1.25rem; color: var(--navy); }
.lb-month { margin: 0 0 6px; font-weight: 900; color: var(--navy); }
.lb-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.lb-dow { text-align: center; font-size: 0.75rem; color: var(--muted); padding-bottom: 2px; }
.lb-day { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg); font-size: 0.9rem; color: var(--muted); }
.lb-day.today { box-shadow: inset 0 0 0 2px var(--navy); color: var(--navy); font-weight: 900; }
.lb-day.on { background: var(--gold); color: var(--navy); font-weight: 900; }
.lb-day.on i { font-style: normal; font-size: 1.1rem; }
.lb-day.on em { position: absolute; right: 3px; bottom: 1px; font-style: normal; font-size: 0.6rem; }
.lb-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lb-steps li { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.lb-steps li.on { background: #EEF7F0; border-color: #BFE3C8; }
.lb-steps li p { margin: 2px 0 8px; font-size: 0.9rem; color: var(--muted); }
.lb-steps li.on p { margin-bottom: 0; }
.lb-step-n { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.lb-steps li.on .lb-step-n { background: #1B7F42; }
@media (max-width: 900px) {
  .lb-fab { bottom: calc(var(--tabbar-h) + 8px); right: 8px; }
  .lb-fab img { width: 88px; }
  html.lb-open .lb-fab { display: none; }   /* 휴대폰: 대화창이 열려 있는 동안은 그림을 숨긴다(✕ 로 닫으면 다시 나온다) */
  .lb-panel { right: 8px; left: 8px; width: auto; bottom: calc(var(--tabbar-h) + 96px); max-height: min(560px, calc(100vh - var(--tabbar-h) - 112px)); }   /* 휴대폰: 화면을 다 덮지 않는다(키보드가 올라오면 아래 .lb-kb 가 거의 전체를 쓴다) */
}
@media print { .lb-fab, .lb-panel { display: none !important; } }

/* ---- 레벨 칩 · 경험치 막대 · 랭킹 ---- */
.lv { display: inline-block; padding: 1px 7px; margin-right: 2px; border-radius: 10px; font-size: 0.75rem; font-weight: 900; line-height: 1.5; vertical-align: 1px; color: #fff; background: #6B7385; white-space: nowrap; }
.lv-b1 { background: #1B7F42; } .lv-b2 { background: #2F6FD6; } .lv-b3 { background: #7A44C2; } .lv-b4 { background: #D9731A; } .lv-b5 { background: #B07D12; } .lv-b6 { background: linear-gradient(90deg, #B07D12, #E2A93B); color: #14284B; }
.rk-bar { height: 10px; margin: 8px 0 4px; border-radius: 5px; background: var(--chip); overflow: hidden; }
.rk-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-dark)); border-radius: 5px; }
.rk-lv { font-size: 1.25rem; }
.rk-lv .lv { font-size: 1rem; padding: 2px 10px; }
.rk-table td, .rk-table th { padding: 10px 8px; }
.rk-me-row { background: var(--notice); }
.rk-top { display: inline-block; min-width: 26px; text-align: center; border-radius: 13px; color: #fff; background: #6B7385; padding: 0 6px; }
.rk-1 { background: #E2A93B; color: #14284B; } .rk-2 { background: #9AA3B5; } .rk-3 { background: #B8773B; }
.rule-list { margin: 8px 0 0; padding-left: 1.2em; line-height: 1.9; }
.rk-stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.rk-stamp { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 2px dashed var(--gold-dark); border-radius: 14px; background: var(--notice); }
.rk-stamp-ico { font-size: 1.6rem; color: var(--gold-dark); line-height: 1; }
.rk-stamp small { color: var(--muted); }
.lb-lv { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.lb-lv small { color: var(--muted); }

/* ---- 닥터 랩 인사 말풍선: 그림 위쪽에 잠깐 떠서 말을 건다. 누르면 대화창 ---- */
.lb-greet { position: fixed; right: 18px; bottom: 124px; z-index: 40; max-width: min(290px, calc(100vw - 36px)); border: 2px solid var(--gold); border-radius: 18px 18px 4px 18px; background: var(--white); box-shadow: 0 8px 22px rgba(20, 40, 75, 0.2); animation: lb-pop 0.3s ease-out; transition: opacity 0.3s, transform 0.3s; }
.lb-greet.out { opacity: 0; transform: translateY(6px); }
.lb-greet::after { content: ''; position: absolute; right: 26px; bottom: -11px; width: 16px; height: 16px; background: var(--white); border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); }
.lb-greet-text { display: block; width: 100%; padding: 12px 34px 12px 14px; border: 0; background: none; font: inherit; font-weight: 700; line-height: 1.5; color: var(--navy); text-align: left; cursor: pointer; border-radius: 16px; }
.lb-greet-text:hover { background: var(--notice); }
.lb-greet-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 0.85rem; cursor: pointer; }
.lb-greet-x:hover { background: var(--chip); }
.lb-greet button:focus-visible { outline: 3px solid #2F6FD6; outline-offset: 2px; }
@keyframes lb-pop { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .lb-greet { right: 10px; bottom: calc(var(--tabbar-h) + 96px); } }
@media (prefers-reduced-motion: reduce) { .lb-greet { animation: none; transition: none; } }
@media print { .lb-greet { display: none !important; } }

/* 시험용 가짜 휴대폰 키보드(주소 끝에 ?kbsim=1 일 때만 만들어진다) */
.lb-fakekb { position: fixed; left: 0; right: 0; bottom: 0; height: 280px; z-index: 60; padding: 8px 4px; background: #D2D5DB; display: flex; flex-direction: column; gap: 8px; }
.lb-fakekb[hidden] { display: none; }
.lb-kr { display: flex; justify-content: center; gap: 5px; flex: 1 1 0; }
.lb-kr .k { flex: 1 1 0; max-width: 40px; border: 0; border-radius: 6px; background: #fff; font: inherit; font-size: 1.15rem; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.lb-kr .k-w { flex: 0 0 56px; max-width: none; background: #AEB3BD; font-size: 0.95rem; }
.lb-kr .k-sp { flex: 1 1 auto; max-width: none; font-size: 0.95rem; }
@media print { .lb-fakekb { display: none !important; } }

/* ---- 닥터 랩 대화 전용 화면(doctor.html): 휴대폰에서 대화창을 덮어 쓰지 않고 새 화면으로 연다 ---- */
body[data-page="doctor"] { padding-bottom: 0; background: var(--white); }
body[data-page="doctor"] .lb-fab, body[data-page="doctor"] .lb-greet { display: none !important; }
body[data-page="doctor"] .lb-panel { position: fixed; left: 0; right: 0; top: 0; bottom: auto; width: auto; max-width: none; height: 100vh; height: 100dvh; max-height: none !important; border: 0; border-radius: 0; box-shadow: none; z-index: 10; }
body[data-page="doctor"] .lb-grip, body[data-page="doctor"] .lb-op { display: none; }
body[data-page="doctor"] .lb-head { cursor: default; touch-action: auto; padding-top: max(10px, env(safe-area-inset-top)); }
body[data-page="doctor"] .lb-close { order: -1; width: auto; margin: 0 4px 0 0; padding: 0 14px; border-radius: 18px; font-weight: 700; font-size: 0.95rem; }
body[data-page="doctor"] .lb-body { padding: 16px; }
/* 대화 전용 화면 머리 칸: 얼굴·이름은 없애고 ← 돌아가기(왼쪽)와 ☰ 메뉴(오른쪽)만 둔다. ☰ 를 누르면 탭 줄이 머리 칸 바로 아래에 그대로 펼쳐진다 */
body[data-page="doctor"] .lb-head > div { display: none; }
body[data-page="doctor"] .lb-head { justify-content: space-between; }
body[data-page="doctor"] .lb-close { margin: 0; }
.lb-burger { display: none; width: 44px; height: 40px; border: 0; border-radius: 18px; background: rgba(255, 255, 255, 0.12); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 0; }
.lb-burger span { display: block; width: 20px; height: 2.5px; border-radius: 2px; background: #fff; }
body[data-page="doctor"] .lb-burger { display: flex; }
body[data-page="doctor"] .lb-burger:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
body[data-page="doctor"] .lb-tabs { display: none; position: absolute; left: 0; right: 0; z-index: 5; background: var(--white); box-shadow: 0 10px 18px rgba(20, 40, 75, 0.2); }
body[data-page="doctor"] .lb-panel.lb-menu-open .lb-tabs { display: grid; }

/* 고정수·제외수 선택 버튼: 번호 생성 칸 안, 수동입력·자동생성 버튼 바로 위에 둔다 */
.set-criteria .pk-home { margin-top: 16px; }
.set-criteria .pk-home + .gen-actions { margin-top: 10px; }
@media (min-width: 900px) {
  .hero .set-criteria .pk-home { margin-top: auto; }
  .hero .set-criteria .pk-home + .gen-actions { margin-top: 0; padding-top: 10px; }
}

/* 제목 설명: 제목(data-help)을 누르면 닥터 랩이 대화창을 열어 짧게 설명한다. 긴 안내 문단은 감춘다 */
[data-help] { cursor: pointer; }
[data-help]::after { content: '?'; display: inline-flex; align-items: center; justify-content: center; width: 1.2em; height: 1.2em; margin-left: 8px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 0.7em; font-weight: 900; vertical-align: middle; line-height: 1; }
[data-help]:hover::after { background: var(--gold-dark); }
[data-help]:focus-visible { outline: 3px solid #2F6FD6; outline-offset: 3px; border-radius: 6px; }
.count-hint, .tier-hint { display: none !important; }
.page-head [data-help]::after { background: var(--gold); color: var(--navy); }
.page-head [data-help]:hover::after { background: #fff; }

/* 설명 말풍선 안의 "더 자세한 설명이 필요하신가요?" 알약 버튼 */
.lb-greet-more { display: none; margin: -4px 12px 12px 14px; padding: 6px 14px; border: 2px solid var(--gold-dark); border-radius: 999px; background: #FFF7E3; font: inherit; font-size: 0.875rem; font-weight: 700; color: var(--navy); cursor: pointer; }
.lb-greet[data-mode="help"] .lb-greet-more { display: inline-block; }
.lb-greet-more:hover { background: var(--gold); }
/* 고정수·제외수 칸은 카드 어디를 눌러도 선택된다(번호를 지우는 동작은 번호 자체를 누른다) */
.pk-field { cursor: pointer; }

/* 휴대폰: 번호판 맨 끝(45번 옆 빈 칸)에 놓이는 '고정수·제외수 칸으로 돌아가기' 버튼 */
.pk-back { position: absolute; z-index: 3; box-sizing: border-box; padding: 4px 10px; border: 2px solid var(--navy); border-radius: 14px; background: var(--navy); color: #fff; font: inherit; font-size: 0.875rem; font-weight: 700; line-height: 1.25; text-align: center; white-space: pre-line; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pk-back[hidden] { display: none; }
@media (min-width: 900px) { .pk-back { display: none !important; } }
@media print { .pk-back { display: none !important; } }

/* 시험 결과 카드(.stat): ? 를 카드 오른쪽 위에 둔다 */
.stat[data-help] { position: relative; }
.stat[data-help]::after { position: absolute; top: 10px; right: 10px; margin: 0; }
.notice-box[data-help]::after { margin-left: 10px; }

/* 홈 분석 기법 설명 흐름 */
.lb-greet-tech { display: none; margin: -2px 12px 12px 14px; padding: 6px 14px; border: 2px solid var(--navy); border-radius: 999px; background: #EEF2FA; font: inherit; font-size: 0.875rem; font-weight: 700; color: var(--navy); cursor: pointer; }
.lb-greet.lb-has-tech[data-mode="help"] .lb-greet-tech { display: block; width: fit-content; }
.lb-greet.lb-has-tech[data-mode="help"] .lb-greet-more { display: block; width: fit-content; margin-bottom: 8px; }
.lb-greet[data-key^="tech-"][data-mode="help"] .lb-greet-more, .lb-greet[data-key^="lab-"][data-mode="help"] .lb-greet-more { display: block; width: fit-content; }
/* 실험실: "기법의 설명이 필요하신가요?"를 누르면 기법 이름 옆 ? 가 잠깐 반짝인다 */
.tech-pulse-el::after { animation: tech-pulse 0.8s ease-in-out 3; }
@keyframes tech-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.45); background: var(--gold-dark); } }
@media (prefers-reduced-motion: reduce) { .tech-pulse-el::after { animation: none; background: var(--gold-dark); } }
.lb-greet-tech:hover { background: var(--chip); }
/* 설명 흐름이 켜지면 기법 칩 오른쪽 위에 ? 가 나온다 */
#criteriaOptions.tech-help-on .opt { position: relative; overflow: visible; }
.tech-q { position: absolute; top: -9px; right: -5px; z-index: 3; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; box-shadow: 0 0 0 2px #fff; font-size: 0.8rem; font-weight: 900; line-height: 22px; text-align: center; cursor: pointer; animation: lb-pop 0.25s ease-out; }
.tech-q::before { content: ''; position: absolute; inset: -9px; }   /* 누를 수 있는 자리를 넓힌다 */
.tech-q:hover { background: var(--gold-dark); }
/* 대화 아래 이어 가는 버튼 두 개 */
.lb-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 8px 0 4px; }
.lb-acts .opt { font-size: 0.875rem; min-height: 38px; padding: 6px 14px; text-align: left; }

/* ---- 대화창 맨 위 공지 줄(왼쪽으로 돌아가는 글) ---- */
.lb-notice { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #FFF7E3; border-bottom: 1px solid #F0DCA8; }
.lb-notice-tag { flex: 0 0 auto; padding: 1px 8px; border-radius: 999px; background: var(--gold-dark); color: #fff; font-size: 0.75rem; font-weight: 900; }
.lb-notice-view { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.lb-notice-track { display: inline-block; white-space: nowrap; font-size: 0.8125rem; font-weight: 700; color: var(--navy); animation: lb-roll 30s linear infinite; will-change: transform; }
.lb-notice:hover .lb-notice-track, .lb-notice:active .lb-notice-track { animation-play-state: paused; }   /* 올리거나 누르고 있으면 멈춰서 읽을 수 있다 */
.lb-n-set { display: inline-block; }
.lb-n-set i { margin: 0 14px; font-style: normal; color: var(--gold-dark); }
@keyframes lb-roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .lb-notice-track { animation: none; white-space: normal; display: block; }
  .lb-n-dup { display: none; }
}
/* ---- 입력칸 위 추천 질문 줄(한 줄, 옆으로 밀어 보기) ---- */
.lb-suggest-bar { flex: 0 0 auto; display: flex; flex-wrap: nowrap; gap: 6px; padding: 8px 12px 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; background: var(--bg); border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch; cursor: grab; }
.lb-suggest-bar::-webkit-scrollbar { display: none; }
.lb-suggest-bar[hidden] { display: none; }
.lb-suggest-bar .opt { flex: 0 0 auto; font-size: 0.85rem; min-height: 34px; padding: 4px 12px; white-space: nowrap; }
.lb-suggest-bar:active { cursor: grabbing; }
.lb-panel.lb-kb .lb-suggest-bar { display: none; }

/* 운영자 화면: 닥터 랩 대화창 공지 목록 */
.dn-row { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.dn-top { display: flex; align-items: center; gap: 10px; }
.lb-suggest-bar + .lb-ask { border-top: 0; padding-top: 2px; }
/* 대화창은 위아래로 쌓인 칸이라, 공지 줄·추천 질문 줄·입력칸은 줄어들지 않고 가운데 대화 칸만 줄어든다(겹쳐 보이지 않게) */
.lb-notice, .lb-ask { flex: 0 0 auto; }
.lb-suggest-bar .opt { min-height: 36px; }

/* 설정에서 '설명 물음표(?) 보기'를 끈 기기: 모든 제목 옆 ? 를 숨기고 제목은 보통 글자처럼 보인다 */
html.no-help-q [data-help]::after { display: none !important; }
html.no-help-q [data-help] { cursor: inherit; }


/* 체크 칸을 알약 스위치로 쓴 줄: 가운데 맞춤, 숨긴 체크 칸이 자리를 차지하지 않게 */
.check-row.switch-row { align-items: center; }
.check-row .sw-input { width: 1px; height: 1px; margin: 0; }

/* 접는 칸 제목(summary) 안에 넣은 ? (빈 칸에 ? 만 보인다) */
.hq { display: inline-block; vertical-align: middle; }
.hq::after { margin-left: 6px; }
.lb-acts a.opt { text-decoration: none; display: inline-flex; align-items: center; }
.lb-acts a.lb-cta { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 800; }
/* 막힌 기능 안내 말풍선의 버튼 */
.lb-greet-cta { display: block; width: fit-content; margin: 2px 12px 12px 14px; padding: 8px 16px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 0.9375rem; font-weight: 800; text-decoration: none; }
.lb-greet-cta[hidden] { display: none; }
/* 구독·가입·충전 버튼: 손가락으로 누르기 편하게 높이 44px, 글자는 가운데 */
.lb-acts a.lb-cta { min-height: 44px; padding: 8px 18px; justify-content: center; text-align: center; }
.lb-greet-cta { min-height: 44px; display: flex; align-items: center; justify-content: center; }
.lb-greet-cta[hidden] { display: none; }
/* 오늘 남은 무료 질문 안내줄 */
.lb-who { position: relative; flex: 0 0 auto; width: 44px; height: 52px; padding: 0; border: 0; background: transparent; cursor: pointer; }   /* 머리 칸의 얼굴 그림(누끼, 틀 없음) 자체가 대화 상대 바꾸는 버튼 */
.lb-who img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lb-who:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 10px; }
.lb-who-sw { position: absolute; right: -2px; bottom: 0; width: 20px; height: 20px; line-height: 17px; text-align: center; font-style: normal; font-size: 0.75rem; font-weight: 800; color: var(--navy); background: #fff; border-radius: 50%; border: 2px solid var(--navy); }
.lb-who-menu { position: absolute; left: 0; right: 0; z-index: 6; display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 12px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 10px 18px rgba(10, 20, 50, 0.28); }   /* 대화창 위에 덮어서 보인다 */
.lb-who-menu[hidden] { display: none; }
.lb-who-opt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font: inherit; color: inherit; }
.lb-who-opt[aria-pressed="true"] { border-color: var(--navy); background: #F2F6FF; }
.lb-who-opt img { width: 32px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.lb-who-opt span { display: flex; flex-direction: column; }
.lb-who-opt small { font-size: 0.8125rem; color: #5b6475; }
.lb-who-opt .lb-who-cost { font-weight: 700; color: #6B4E00; }
.lb-pill { display: inline-block; margin-left: 4px; padding: 1px 9px; border-radius: 999px; font-style: normal; font-size: 0.75rem; font-weight: 800; vertical-align: middle; }
.lb-pill-free { background: #E3F5E8; color: #1B6B35; }
.lb-pill-paid { background: #FFF0CC; color: #8A5A00; }
.lb-quota { flex: 0 0 auto; margin: 0; padding: 6px 14px; background: #FFF6E0; border-top: 1px solid var(--line); font-size: 0.8125rem; font-weight: 700; color: #6B4E00; line-height: 1.4; }
.lb-quota[hidden] { display: none; }

/* 복 게임터 */
.gm-nums { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin: 14px 0; }
.gm-n { min-height: 44px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); font: inherit; font-size: 1rem; font-weight: 800; cursor: pointer; }
.gm-n.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.gm-n:disabled { opacity: 0.5; cursor: not-allowed; }
.gm-ticket { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.gm-ball { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; }
.gm-ball.bonus { background: var(--gold); color: var(--navy); }
.gm-plus { font-weight: 900; color: var(--navy); }
.gm-prize { margin-top: 16px; }
.gm-pat { padding: 14px 0; border-top: 1px solid var(--line); }
.gm-pat:first-child { border-top: 0; }
.gm-opt { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; }
.gm-opt small { font-size: 0.8125rem; font-weight: 800; color: var(--gold-dark); }
.gm-opt[aria-pressed="true"] small { color: #fff; }
@media (max-width: 480px) { .gm-nums { grid-template-columns: repeat(7, 1fr); } }

/* 명예의 전당 줄(복 게임터) */
.hall-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #FFF6E0; border-bottom: 1px solid var(--line); color: #5A4200; font-size: 0.875rem; text-decoration: none; overflow: hidden; }
.hall-tag { flex: 0 0 auto; padding: 3px 10px; border-radius: 999px; background: var(--gold); color: var(--navy); font-weight: 900; }
.hall-run { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
.hall-track { display: inline-block; padding-left: 100%; animation: hall-run 40s linear infinite; }
.hall-item { margin-right: 36px; }
.hall-item em { font-style: normal; font-weight: 900; color: #B3541E; }
.hall-bar:hover .hall-track, .hall-bar:focus .hall-track { animation-play-state: paused; }
@keyframes hall-run { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .hall-track { animation: none; padding-left: 0; } }
.gm-hall li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
.gm-hall li:first-child { border-top: 0; }
.gm-hall .gm-prize-amt { margin-left: auto; font-weight: 900; color: #B3541E; }


/* 튜토리얼: 어두운 투명 덮개 + 눌러야 할 곳만 밝게 + 하얀 화살표 */
.tour { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; }
.tour-shade { position: fixed; inset: 0; background: rgba(8, 14, 32, 0.72); pointer-events: auto; }
.tour-rings { position: fixed; inset: 0; pointer-events: none; }
.tour-ring { position: fixed; border-radius: 12px; box-shadow: 0 0 0 3px #fff, 0 0 18px 4px rgba(255, 255, 255, 0.7); pointer-events: none; animation: tour-pulse 1.4s ease-in-out infinite; }
@keyframes tour-pulse { 50% { box-shadow: 0 0 0 5px #fff, 0 0 26px 8px rgba(255, 255, 255, 0.9); } }
.tour-arrow { position: fixed; pointer-events: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); animation: tour-bob 0.9s ease-in-out infinite alternate; }
@keyframes tour-bob { to { margin-top: 6px; } }
.tour-card { position: fixed; box-sizing: border-box; pointer-events: auto; padding: 14px 16px 12px; background: #fff; color: var(--text, #1b2230); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.tour-count { margin: 0 0 4px; font-size: 0.8125rem; font-weight: 800; color: #6B4E00; }
.tour-title { margin: 0 0 6px; font-size: 1.125rem; font-weight: 900; color: var(--navy); }
.tour-text { margin: 0 0 12px; font-size: 1rem; line-height: 1.6; }
.tour-btns { display: flex; gap: 8px; justify-content: flex-end; }
.tour-btns .btn { min-height: 44px; padding: 0 18px; }
@media (prefers-reduced-motion: reduce) { .tour-ring, .tour-arrow { animation: none; } }

.tour-need { margin: -4px 0 12px; padding: 8px 10px; border-radius: 8px; background: #FFF6E0; color: #6B4E00; font-size: 0.9375rem; font-weight: 700; line-height: 1.5; }
.tour-need.ok { background: #E3F5E8; color: #1B6B35; }
.tour-need.nag { background: #FDE7E5; color: #A4261D; }
.tour-btns .btn.is-wait { opacity: 0.5; }
.tour-card.shake { animation: tour-shake 0.4s; }
@keyframes tour-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .tour-card.shake { animation: none; } }

/* 튜토리얼 완료 축하 창: 큰 3D 동전 + 폭죽 */
.cel { position: fixed; inset: 0; z-index: 2147483100; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at 50% 40%, rgba(40, 30, 90, 0.88), rgba(6, 10, 28, 0.94)); }
.cel-fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.cel-card { position: relative; width: min(440px, 100%); box-sizing: border-box; padding: 20px 22px 22px; text-align: center; background: linear-gradient(180deg, #fffdf5, #fff4d6); border-radius: 22px; box-shadow: 0 0 0 3px #ffd24a, 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 80px rgba(255, 210, 74, 0.45); animation: cel-pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes cel-pop { from { transform: scale(0.5) translateY(40px); opacity: 0; } }
.cel-stage { height: 190px; perspective: 700px; display: flex; align-items: center; justify-content: center; margin-top: -6px; }
.cel-coin { position: relative; width: 150px; height: 150px; transform-style: preserve-3d; animation: cel-spin 3.4s linear infinite; filter: drop-shadow(0 14px 14px rgba(120, 70, 0, 0.45)); }
.cel-coin.calm { animation: none; transform: rotateY(-20deg); }
@keyframes cel-spin { to { transform: rotateY(360deg); } }
.cel-edge, .cel-face { position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; }
.cel-edge { background: #b8860b; border: 4px solid #8a6208; box-sizing: border-box; backface-visibility: visible; }
.cel-face { font-style: normal; font-size: 78px; font-weight: 900; color: #8a5a00; text-shadow: 0 2px 0 #fff3b0, 0 -2px 0 #b8860b; background: radial-gradient(circle at 35% 30%, #fff6b8 0%, #ffd24a 38%, #e9a40c 78%, #b8860b 100%); border: 7px solid #f3b824; box-sizing: border-box; box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.35), inset 0 0 22px rgba(138, 90, 0, 0.45); }
.cel-face.front { transform: translateZ(8px); }
.cel-face.back { transform: rotateY(180deg) translateZ(8px); }
.cel-kicker { margin: 4px 0 2px; font-size: 0.875rem; font-weight: 800; letter-spacing: 0.06em; color: #a06a00; }
.cel-card h2 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 900; color: var(--navy); line-height: 1.3; }
.cel-pts { margin: 2px 0 6px; font-weight: 900; color: #c25a00; line-height: 1; text-shadow: 0 3px 0 #ffe29a, 0 6px 12px rgba(194, 90, 0, 0.35); }
.cel-pts span { font-size: 4.25rem; }
.cel-pts small { font-size: 1.75rem; margin-left: 4px; }
.cel-sub { margin: 0 0 16px; font-size: 1rem; line-height: 1.6; color: #4a4030; }
.cel-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cel-btns .btn { min-height: 48px; padding: 0 20px; }
@media (prefers-reduced-motion: reduce) { .cel-card { animation: none; } }

.cel-bag { transform-style: preserve-3d; animation: cel-sway 2.6s ease-in-out infinite; filter: drop-shadow(0 14px 12px rgba(120, 20, 20, 0.4)); }
.cel-bag.calm { animation: none; }
@keyframes cel-sway { 0%, 100% { transform: rotateY(-24deg) translateY(0); } 50% { transform: rotateY(24deg) translateY(-12px); } }

.lb-tab.has-dot { position: relative; }
.lb-tab.has-dot::after { content: ""; position: absolute; top: 6px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: #D9453A; box-shadow: 0 0 0 2px var(--white, #fff); }

.cm-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; }
.cm-pager[hidden] { display: none; }
.pg-btn { min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line, #d3d8e3); border-radius: 10px; background: #fff; color: var(--navy); font: inherit; font-weight: 800; cursor: pointer; }
.pg-btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pg-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.pg-gap { padding: 0 2px; color: var(--muted, #6b7280); }

.stat.flash { animation: stat-flash 0.7s ease-in-out 3; }
@keyframes stat-flash { 50% { background: #FFF0CC; box-shadow: 0 0 0 3px #ffd24a; } }
@media (prefers-reduced-motion: reduce) { .stat.flash { animation: none; box-shadow: 0 0 0 3px #ffd24a; } }

/* 휴대폰: 손가락으로 누르기 작은 버튼을 44px 이상으로 */
@media (max-width: 767px) {
  #textToggle, #nickBtn, #bigTextBtn, #helpQBtn, .btn.btn-sm { min-height: 44px; }
  #textToggle { padding-left: 14px; padding-right: 14px; }
  .icon-btn, .num-game-remove, .num-add { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

/* 휴대전화 번호 칸과 [인증번호 받기]·[확인] 버튼은 위아래로 따로 놓아 번호가 잘리지 않게 */
.phone-stack { display: flex; flex-direction: column; gap: 8px; }
.phone-stack .input { width: 100%; min-width: 0; font-size: 1.125rem; letter-spacing: 0.02em; }
.phone-stack .btn { width: 100%; min-height: 48px; }

/* 시험 기간 인증번호: 문자 대신 노란 칸에 크게 */
.devcode { margin: 10px 0; padding: 14px 16px; border-radius: 12px; border: 2px solid #E2A93B; background: #FFF3C4; text-align: center; color: #5a3b00; }
.devcode p { margin: 0 0 6px; font-size: 0.9375rem; font-weight: 700; line-height: 1.5; }
.devcode-num { display: block; margin: 4px 0 10px; font-size: 2.5rem; font-weight: 900; letter-spacing: 0.18em; color: #7a4a00; font-variant-numeric: tabular-nums; }
.devcode .btn { width: 100%; min-height: 48px; }

/* 작은 화면 글씨: 화면 폭에 맞춰 기본 글자 크기를 줄이고(전체가 같이 비례), 낱말 중간에서 끊기지 않게 하고, 제목 줄은 줄바꿈한다 */
@media (max-width: 420px) {
  html { font-size: clamp(14px, 4.4vw, 16px); }
  html.big-text { font-size: clamp(16px, 5.2vw, 19px); }
}
@media (max-width: 767px) {
  body, h1, h2, h3, h4, p, li, label, .btn, .opt, .hint, .small { word-break: keep-all; overflow-wrap: break-word; }
  h1, h2, h3 { text-wrap: balance; }
  .cm-top, .section-head, .board-head, .dn-top { flex-wrap: wrap; row-gap: 10px; }
  .cm-top .btn-row, .section-head .btn-row { flex: 1 1 100%; }
  .cm-title { flex: 1 1 100%; font-size: clamp(1.5rem, 7vw, 2rem); }
  .tabbar a { font-size: clamp(0.6875rem, 3.3vw, 0.875rem); white-space: nowrap; letter-spacing: -0.03em; padding: 0 2px; }
  .tabbar a span { white-space: nowrap; }
  .btn { white-space: normal; text-align: center; line-height: 1.25; }
  .btn-sm { padding-left: 12px; padding-right: 12px; }
  .cm-search { gap: 8px; }
  .cm-search .input { min-width: 0; padding-left: 12px; padding-right: 12px; }
  .cm-search .input::placeholder { font-size: 0.875rem; }
  .cm-search .btn { padding-left: 14px; padding-right: 14px; flex: none; }
  .table th, .table td { word-break: keep-all; }
}

/* 글 목록 옆 칸: 제목이 길면 두 줄까지 보여 줘서 [댓글 수]가 잘려 나가지 않게 */
@media (max-width: 767px) {
  .pw-t strong { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
}

/* 운영 현황 */
.db-card .stats { margin-top: 12px; }
.db-big { background: #FFF6E0; border-color: #E2A93B; }
.db-big .value { font-size: 2.25rem; color: #7a4a00; }
.db-alert { background: #FDE7E5; border-color: #E4857E; }
.db-alert .value { color: #A4261D; }
.db-chart { margin-top: 18px; }
.db-bars { display: flex; align-items: flex-end; gap: 4px; height: 128px; }
.db-bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.db-bar i { display: block; width: 100%; max-width: 28px; background: var(--navy); border-radius: 5px 5px 0 0; min-height: 3px; }
.db-bar b { font-size: 0.625rem; font-weight: 800; color: var(--navy); white-space: nowrap; line-height: 1.4; min-height: 14px; }
.db-bar small { font-size: 0.625rem; color: var(--muted); margin-top: 3px; }
.db-chart-note { margin-top: 6px; text-align: right; }

/* 문의 */
.inq-row { padding: 12px 0; border-top: 1px solid var(--line); }
.inq-row:first-child { border-top: 0; }
.inq-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inq-top b { flex: 1 1 100%; font-size: 1rem; color: var(--navy); }
.inq-answer { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: #E3F5E8; color: #14532D; }
.inq-answer p { margin: 4px 0 0; line-height: 1.6; }
.inq-body { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.inq-meta { font-size: 0.8125rem; color: var(--muted); }
.inq-admin textarea { width: 100%; min-height: 80px; margin-top: 6px; }

.mb-row summary b { font-size: 1.0625rem; color: var(--navy); }
.mb-stats { margin-top: 10px; }
.mb-luck { margin-top: 12px; }
.mb-row .phone-stack .input { font-size: 1rem; }

.mb-live { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; background: #E3F5E8; color: #14532D; font-size: 0.75rem; font-weight: 800; vertical-align: middle; }
.mb-live i { width: 8px; height: 8px; border-radius: 50%; background: #1FA356; box-shadow: 0 0 0 0 rgba(31, 163, 86, 0.6); animation: mb-pulse 1.6s infinite; }
@keyframes mb-pulse { 70% { box-shadow: 0 0 0 7px rgba(31, 163, 86, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 163, 86, 0); } }
@media (prefers-reduced-motion: reduce) { .mb-live i { animation: none; } }

.mb-off { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; background: #EEF0F4; color: #6b7280; font-size: 0.75rem; font-weight: 700; vertical-align: middle; }
.mb-off i { width: 8px; height: 8px; border-radius: 50%; background: #B7BDC9; }

.mb-info { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); overflow-y: auto; }
.mb-info .table th { width: 34%; white-space: nowrap; }
.mb-info .table td { word-break: break-word; }
.mb-info-table { margin: 8px 0; }
.mb-info-table .table { width: 100%; min-width: 0; table-layout: fixed; }
.mb-info-table .table th { width: 36%; font-size: 0.875rem; white-space: normal; }
.mb-info-table .table td { font-size: 0.9375rem; overflow-wrap: anywhere; }

/* 근처 판매점: 지도 고르기 */
.map-pick { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; background: #fff; border: 2px solid var(--line, #D8DEE9); border-radius: 16px; font: inherit; font-weight: 800; font-size: 1.125rem; color: var(--navy); cursor: pointer; text-align: left; box-shadow: 0 2px 0 rgba(20, 40, 75, .08); }
.map-pick:hover, .map-pick:focus-visible { border-color: var(--navy); background: #F4F7FC; }
.map-pick:active { transform: translateY(1px); box-shadow: none; }
.map-ico { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; }
.map-ico svg { display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); }
.map-name { flex: 1 1 auto; }
.map-go { flex: 0 0 auto; font-size: 1.75rem; line-height: 1; color: var(--muted); }

/* 기법 실험실: 8% 맞추기 도움 */
.assist-box { margin-top: 14px; padding: 14px; background: #FFF6E0; border: 2px solid #E2A93B; border-radius: 14px; }
.assist-box .btn { width: 100%; margin-top: 10px; }
.assist-list { margin: 10px 0; padding-left: 20px; line-height: 1.7; font-weight: 700; color: var(--navy); }

/* 닥터 랩 제안창: 웹에서는 제안창 바로 오른쪽에 닥터 랩이 붙어서 나온다(폰에서는 그림을 숨긴다) */
.assist-dlg { overflow: visible; --docw: calc(72vh * 0.5425); }
.assist-dlg .form { max-height: 80vh; overflow: auto; }
.assist-dlg::backdrop { background: rgba(8, 18, 40, .82); }
.assist-doc { display: none; pointer-events: none; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .5)); }
@media (min-width: 900px) {
  .assist-dlg { translate: calc(var(--docw) / -2) 0; }
  .assist-doc { display: block; position: absolute; left: calc(100% - 14px); top: 50%; height: 72vh; width: auto; transform: translateY(-50%); animation: assistInR .45s ease-out both; }
}
@keyframes assistInR { from { opacity: 0; transform: translate(24px, -50%); } to { opacity: 1; transform: translate(0, -50%); } }
@media (prefers-reduced-motion: reduce) { .assist-doc { animation: none; } }

.assist-think { margin: 18px 0 24px; font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.assist-think .dots i { font-style: normal; animation: dotBlink 1s infinite both; }
.assist-think .dots i:nth-child(2) { animation-delay: .25s; }
.assist-think .dots i:nth-child(3) { animation-delay: .5s; }
@keyframes dotBlink { 0%, 20% { opacity: .15; } 50% { opacity: 1; } 100% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .assist-think .dots i { animation: none; } }
.assist-dlg { width: min(480px, calc(100vw - 32px)); }

/* 대화창: 1등 판매점 표 */
.lb-table { max-width: 100%; }
.shop-wrap { overflow-x: auto; margin-top: 8px; -webkit-overflow-scrolling: touch; }
.shop-table { width: 100%; border-collapse: collapse; font-size: .9375rem; background: #fff; color: var(--navy); }
.shop-table th, .shop-table td { padding: 8px 6px; border-bottom: 1px solid var(--line, #D8DEE9); text-align: left; vertical-align: top; }
.shop-table th { font-weight: 800; background: #F4F7FC; white-space: nowrap; }
.shop-table td.num { width: 2.5em; text-align: center; color: var(--muted); }
.shop-table a { color: var(--navy); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* 백테스트: 홈에서 넘어온 '지금 고른 패턴' 시험 칸 (backtest-pattern.js) */
.pt-card .pt-h { margin-top: 24px; font-size: 1.125rem; }
.pt-sum { margin: 14px 0 0; display: grid; gap: 8px; }
.pt-sum > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; }
.pt-sum dt { margin: 0; padding: 4px 0; text-align: center; font-size: 0.875rem; font-weight: 900; border-radius: 8px; border: 1px solid var(--line); color: var(--navy); background: #F4F6FB; }
.pt-sum dd { margin: 0; min-width: 0; font-weight: 700; line-height: 1.6; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.pt-sum dd small { font-weight: 700; color: var(--muted); }
.pt-sum .pt-way { display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 0.875rem; white-space: nowrap; }
.pt-sum .pt-way em { font-style: normal; font-size: 0.75rem; font-weight: 900; padding: 3px 8px; border-radius: 999px; background: #E7ECF6; color: var(--navy); }
.pt-sum .pt-way em.lv2 { background: #F3D58A; color: #2E1A02; }
.pt-sum .pt-way em.lv3 { background: #F0894B; color: #2A0E00; }
.pt-sum .pt-way em.lv0 { background: #7ED9B0; color: #06281B; }
.pt-wait { margin: 16px 0 0; font-weight: 700; }
.pt-card #ptStats, .pt-card #ptRanks, .pt-card #ptPickStats { margin-top: 12px; }
.pt-verdict { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; font-weight: 700; line-height: 1.6; background: #F4F6FB; border: 1px solid var(--line); color: var(--navy); }
.pt-verdict.above { background: #EEF8F0; border-color: #9CD3A8; }
.pt-verdict.below { background: #FFF4EE; border-color: #F0C2A6; }
.pt-desc { margin: 10px 0 0; padding-left: 20px; line-height: 1.7; }
.pt-desc li + li { margin-top: 2px; }

/* 아이디·비밀번호 찾기(휴대폰 문자 인증) */
.find-card .options { margin: 16px 0 4px; }
.fa-sec { margin-top: 14px; }
.fa-sec[hidden] { display: none; }
.fa-result { margin-top: 16px; padding: 18px 16px; border-radius: 14px; border: 1px solid var(--line); background: #F4F6FB; text-align: center; }
.fa-result:focus { outline: none; }
.fa-res-h { margin: 0 0 6px; font-weight: 800; color: var(--navy); }
.fa-res-big { display: block; margin: 6px 0 10px; font-size: 1.75rem; font-weight: 900; letter-spacing: .06em; color: var(--navy); word-break: break-all; }
.fa-result .btn-row { justify-content: center; margin-top: 12px; }

/* 로또봇 고객센터 카드(대화창·고객센터·아이디 찾기 화면 공용: support-cards.js) */
.sc-bot { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0 12px; }
.sc-bot img { flex: 0 0 40px; width: 40px; height: 48px; object-fit: contain; }
.sc-bot p { margin: 0; padding: 10px 14px; border-radius: 4px 16px 16px 16px; background: var(--notice); color: var(--navy); font-weight: 700; line-height: 1.55; }
.sc-card { margin: 8px 0 4px; padding: 12px; border-radius: 14px; border: 1px solid #DCE3EE; background: var(--white); }
.sc-card .form { gap: 10px; }
.sc-card .btn { min-height: 44px; font-size: 0.95rem; }
.sc-card .btn-block { width: 100%; }
.sc-card .field label { font-size: 0.875rem; }
.sc-card .input, .sc-card .textarea { font-size: 16px; }
.sc-card .textarea { min-height: 110px; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-chips .opt { min-height: 38px; padding: 4px 12px; font-size: 0.875rem; }
.sc-link { align-self: flex-start; padding: 6px 0; border: 0; background: none; font: inherit; font-size: 0.85rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.sc-result { padding: 4px 2px; text-align: center; }
.sc-result:focus { outline: none; }
.sc-result .btn-row { justify-content: center; margin-top: 10px; }
.lb-card-slot { margin-top: 6px; }
.lb-msg .sc-card { max-width: 100%; }
.sc-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.sc-quick .opt { min-height: 42px; padding: 6px 14px; }
.sc-askform { display: flex; gap: 8px; margin: 0 0 8px; }
.sc-askform .input { flex: 1 1 auto; min-width: 0; font-size: 16px; }
.sc-askform .btn { flex: 0 0 auto; }

/* ---- 홈: 로또랩 번호 당첨 소식 판 (win-board.js) ---- */
.wb-sec[hidden] { display: none; }
.wb-sec { margin: 14px 0 0; }
.wb-sec.section { margin: 0; padding: 14px 0 6px; }
.wb { padding: 12px 14px 10px; border-radius: 16px; border: 1.5px solid #C99A45; background: linear-gradient(180deg, #22345C, #0E1A36); box-shadow: inset 0 0 0 1px rgba(255, 233, 170, 0.22), 0 6px 14px rgba(0, 0, 0, 0.3); color: #EAF2FF; }
.wb-top { display: flex; align-items: center; gap: 10px; }
.wb-cup { flex: none; width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
.wb-head b { display: block; font-size: 1.06rem; font-weight: 900; letter-spacing: -0.02em; color: #FFE9A6; }
.wb-head span { display: block; margin-top: 2px; font-size: 0.86rem; font-weight: 700; line-height: 1.4; color: #D3DEF2; }
.wb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wb-chips:empty { display: none; }
.wb-chip { padding: 3px 10px; border-radius: 999px; font-size: 0.86rem; font-weight: 900; color: #FFE9A6; background: rgba(255, 233, 166, 0.14); border: 1px solid rgba(255, 233, 166, 0.45); }
.wb-chip b { margin-right: 3px; color: #fff; }
.wb-chip.all { color: #C9D6EE; background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.25); font-weight: 800; }
.wb-tick { position: relative; height: 34px; margin-top: 8px; overflow: hidden; border-radius: 10px; background: rgba(0, 0, 0, 0.3); }
.wb-tick[hidden] { display: none; }
.wb-tick > div { position: absolute; left: 0; right: 0; top: 0; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 0.9rem; font-weight: 800; color: #EAF2FF; white-space: nowrap; opacity: 0; transform: translateY(8px); transition: opacity 0.4s ease, transform 0.4s ease; }
.wb-tick > div.on { opacity: 1; transform: none; }
.wb-tick img { flex: none; width: 22px; height: 22px; }
.wb-tick b { color: #FFE9A6; font-weight: 900; }
.wb-tick span { overflow: hidden; text-overflow: ellipsis; }
.wb-note { margin: 8px 0 0; font-size: 0.76rem; line-height: 1.5; color: #9FB0CC; }
.wb-note a { color: #FFE9A6; font-weight: 800; white-space: nowrap; text-decoration: none; }
@media (min-width: 900px) {
  .wb { display: grid; grid-template-columns: minmax(280px, 1.3fr) auto minmax(260px, 1fr); align-items: center; gap: 10px 22px; padding: 16px 22px 12px; }
  .wb-cup { width: 56px; height: 56px; }
  .wb-head b { font-size: 1.2rem; }
  .wb-head span { font-size: 0.95rem; }
  .wb-chips { margin-top: 0; }
  .wb-tick { margin-top: 0; }
  .wb-note { grid-column: 1 / -1; margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) { .wb-tick > div { transition: none; } }

/* ---- 내 기록: 저장한 번호의 자동 당첨 확인 ---- */
.sg-sum { margin: 10px 0 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #F2F4F8; color: var(--text); font-size: 0.9375rem; font-weight: 800; line-height: 1.5; }
.sg-sum.win { border-color: #D9A93C; background: linear-gradient(180deg, #FFF6D8, #FFE9AC); color: #3A2400; }
.sg-res { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 900; line-height: 1.55; vertical-align: baseline; white-space: nowrap; }
.sg-res.miss { background: #E7EAF0; color: #5B6578; }
.sg-res.wait { background: #E1ECFF; color: #1F4E9C; }
.sg-res.win { background: linear-gradient(180deg, #FFE08A, #E0A93A); color: #3A2400; box-shadow: 0 0 0 1px rgba(150, 100, 10, 0.35); }
.sg-res.win.r1, .sg-res.win.r2 { background: linear-gradient(180deg, #FFB0A0, #E5483A); color: #fff; box-shadow: 0 0 0 1px rgba(120, 20, 10, 0.4); }
.sg-row.won { background: linear-gradient(90deg, rgba(255, 214, 120, 0.22), rgba(255, 214, 120, 0)); border-radius: 10px; }
@media (max-width: 640px) {   /* 폰: 결과 딱지는 따로 한 줄에 두어 저장 날짜가 잘리지 않게 */
  .sg-meta .sg-res { display: block; width: fit-content; margin: 0 0 3px; }
  .sg-meta:has(.sg-res) { white-space: normal; }
}

/* ---- PC 홈: 추천 조합 카드(쉬운 고르기) ---- */
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.preset { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 9px 12px 9px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); text-align: left; cursor: pointer; position: relative; font: inherit; }
.preset b { font-size: 0.9375rem; font-weight: 900; line-height: 1.3; padding-right: 22px; }
.preset span { font-size: 0.75rem; font-weight: 600; line-height: 1.4; color: var(--muted); }
.preset::after { content: ''; position: absolute; right: 9px; top: 9px; width: 18px; height: 18px; border-radius: 50%; background: #EEF1F6; box-shadow: inset 0 0 0 1.5px #C9D0DC; }
.preset:hover { border-color: #C9A227; }
.preset[aria-pressed="true"] { border-color: #C9A227; background: #FFF8E1; box-shadow: 0 0 0 1px #C9A227; }
.preset[aria-pressed="true"]::after { background: #C9A227 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.6 9.4l2.7 2.7 6-6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; box-shadow: none; }
.preset.locked { opacity: 0.72; }
.preset:focus-visible { outline: 3px solid #2F6FD6; outline-offset: 2px; }

/* ---- PC 홈 정리 ---- */
/* 바로가기: 5칸을 한 줄로, 아이콘 옆에 이름과 한 줄 설명(번호 생성은 바로 위에 있어 뺐다) */
.shortcuts-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.shortcuts-5 .shortcut { min-height: 78px; padding: 14px 16px; flex-direction: row; justify-content: flex-start; gap: 12px; text-align: left; border-radius: 14px; background: #fff; }
.shortcuts-5 .shortcut svg { flex: none; width: 34px; height: 34px; }
.shortcuts-5 .shortcut span { min-width: 0; }
.shortcuts-5 .shortcut b { display: block; font-size: 0.9375rem; font-weight: 900; line-height: 1.3; }
.shortcuts-5 .shortcut small { display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 600; line-height: 1.35; color: var(--muted); }
.shortcuts-5 .shortcut:hover { box-shadow: 0 3px 10px rgba(20, 40, 75, 0.1); }
@media (max-width: 1179px) { .shortcuts-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .shortcuts-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .shortcuts-5 .shortcut:last-child { grid-column: 1 / -1; } .shortcuts-5 .shortcut { min-height: 72px; padding: 12px; } }
/* 번호 생성 칸: 게임 수는 휠(왼쪽)과 입력칸(오른쪽)을 나란히 두고, 세기 안내는 낮게 해서 세로를 줄인다 */
@media (min-width: 900px) {
  .hero .set-games .count-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 12px; }
  .hero .count-input .input { padding-inline: 2.4rem; }
  .hero .sense-now { margin-top: 8px; padding: 6px 10px; font-size: 0.8125rem; }
  .hero .sense-now b { display: inline; margin-right: 6px; }
}

/* ---- 주간 요약 리포트(weekly.html) ---- */
.wk-head .balls { margin-top: 10px; }
.wk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wk-head + .wk-grid { margin-top: 16px; }
.wk-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; min-width: 0; }
.wk-card h3 { margin: 0; font-size: 1.0625rem; font-weight: 900; color: var(--navy); }
.wk-sub { margin: 2px 0 4px; font-size: 0.8125rem; color: var(--muted); }
.wk-label { margin: 12px 0 6px; font-size: 0.8125rem; font-weight: 800; color: var(--muted); }
.wk-balls { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.wk-ball { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wk-ball i { font-style: normal; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.wk-meta { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--muted); }
.wk-old { border-top: 1px solid var(--line); padding: 4px 0; }
.wk-old:first-child { border-top: 0; }
.wk-old summary { display: flex; align-items: baseline; gap: 10px; padding: 12px 2px; cursor: pointer; list-style: none; font-size: 1rem; }
.wk-old summary::-webkit-details-marker { display: none; }
.wk-old summary::before { content: '▸'; color: var(--muted); font-size: 0.875rem; }
.wk-old[open] summary::before { content: '▾'; }
.wk-old summary span { font-size: 0.8125rem; color: var(--muted); }
.wk-old > .balls { margin: 0 0 12px 22px; }
.wk-old > .wk-grid { margin: 0 0 12px; }
.wk-note { margin: 0; }
@media (max-width: 899px) { .wk-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- 분석 리포트: 많이 나온 번호 · 적게 나온 번호 Top 10 ---- */
.tp-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.tp-row { display: grid; grid-template-columns: 1.5rem auto minmax(0, 1fr); align-items: center; column-gap: 10px; padding: 8px 10px; border-radius: 12px; background: #F6F8FB; }
.tp-rank { font-size: 0.9375rem; font-weight: 900; color: var(--muted); text-align: center; }
.tp-main { min-width: 0; }
.tp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; font-size: 0.875rem; }
.tp-top b { font-weight: 800; color: var(--text); }
.tp-top span { font-size: 0.8125rem; font-weight: 800; color: var(--muted); }
.tp-track { height: 9px; border-radius: 999px; background: #E3E8F0; overflow: hidden; }
.tp-fill { height: 100%; border-radius: 999px; }
.tp-fill.hot { background: linear-gradient(90deg, #FF8A7E, #D9453A); }
.tp-fill.cold { background: linear-gradient(90deg, #7FB0F5, #2F6FD6); }
.tp-grid .card-sub { min-height: 3.2em; }

/* ---- 공유하기 버튼 ---- */
.wb-share { margin-left: 6px; padding: 3px 12px; border-radius: 999px; border: 1.5px solid #C99A45; background: rgba(255, 233, 170, 0.12); color: #FFE9A6; font: inherit; font-size: 0.8125rem; font-weight: 900; cursor: pointer; white-space: nowrap; }
.wb-share:hover { background: rgba(255, 233, 170, 0.22); }
.wb-share:focus-visible { outline: 3px solid #FFE08A; outline-offset: 2px; }
.ez-actions .ez-share { grid-column: 1 / -1; }
.wk-share { margin-top: 14px; }
