/* 로또한장 */
:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --ink: #18213d;
  --ink-2: #4a5470;
  --ink-3: #7d869e;
  --line: #e1e5ee;
  --navy: #1f2e66;
  --navy-hover: #172452;
  --slip: #e2475f;
  --slip-tint: #fff3f5;
  --good: #1b7f4b;
  --good-tint: #e8f6ee;
  --b-yellow: #fbc400;
  --b-blue: #3fa9e8;
  --b-red: #f25a5a;
  --b-gray: #9aa0a8;
  --b-green: #8cc63f;
  --radius-l: 18px;
  --radius-m: 12px;
  --radius-s: 8px;
  --ball: clamp(34px, calc((100vw - 120px) / 6.6), 46px);
  --tabbar-h: 64px;
  color-scheme: light;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; background: var(--bg); }
h1, h2, h3, p, ol, ul, dl, dd, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #6f8cff; outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 800; letter-spacing: -.04em; text-decoration: none; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo-ball { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #fff9 0 12%, transparent 34%), var(--b-yellow); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), 9px 0 0 -4px var(--b-blue), 15px 0 0 -7px var(--b-red); margin-right: 8px; }
.tabs { display: flex; gap: 4px; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.tabs a:hover { background: var(--bg); color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--navy); background: #e9edfb; }
.tabs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab-count { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.tab-count:empty, .tab-count[data-zero] { display: none; }

/* Layout */
main { padding: 24px 0 48px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.side { position: sticky; top: 84px; display: grid; gap: 16px; }
.view { display: grid; gap: 18px; }
.view-title { font-size: clamp(26px, 4.2vw, 34px); font-weight: 800; letter-spacing: -.035em; line-height: 1.25; }
.view-lead { color: var(--ink-2); max-width: 36em; margin-top: -8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px; }
.alert { background: #fff4e5; border: 1px solid #f3c98b; color: #6b4100; border-radius: var(--radius-m); padding: 12px 16px; margin-bottom: 16px; }
.note { font-size: 14px; color: var(--ink-3); }

/* Round strip */
.round-strip { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; font-size: 15px; color: var(--ink-2); }
.round-strip strong { color: var(--slip); font-size: 17px; font-weight: 800; margin-right: 4px; }
.round-close { font-size: 13px; color: var(--ink-3); }

/* Balls */
.balls { display: flex; gap: clamp(4px, 1.2vw, 8px); flex-wrap: nowrap; }
.ball {
  --c: var(--b-gray);
  display: inline-grid; place-items: center; flex: none;
  width: var(--ball); height: var(--ball); border-radius: 50%;
  font-size: calc(var(--ball) * .42); font-weight: 800; font-style: normal; font-variant-numeric: tabular-nums; letter-spacing: -.03em;
  color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .28);
  background: radial-gradient(circle at 33% 28%, rgba(255, 255, 255, .7) 0 9%, rgba(255, 255, 255, 0) 38%), radial-gradient(circle at 50% 120%, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0) 60%), var(--c);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .14);
}
.ball-yellow { --c: var(--b-yellow); color: #4a3800; text-shadow: none; }
.ball-blue { --c: var(--b-blue); }
.ball-red { --c: var(--b-red); }
.ball-gray { --c: var(--b-gray); }
.ball-green { --c: var(--b-green); }
.ball.ghost { background: transparent; box-shadow: none; border: 2px dashed #cdd3df; }
.ball.dim { opacity: .28; filter: grayscale(.6); }
.ball.bonus-match { box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .14), 0 0 0 2px var(--surface), 0 0 0 4px var(--navy); }
.ball.match { box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .14), 0 0 0 2px var(--surface), 0 0 0 4px var(--good); }
.ball.pop { animation: pop .42s cubic-bezier(.3, 1.5, .55, 1) both; }
.ball.pop:nth-child(2) { animation-delay: 55ms; } .ball.pop:nth-child(3) { animation-delay: 110ms; } .ball.pop:nth-child(4) { animation-delay: 165ms; } .ball.pop:nth-child(5) { animation-delay: 220ms; } .ball.pop:nth-child(6) { animation-delay: 275ms; }
@keyframes pop { from { transform: translateY(-14px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ball.pop { animation: none; } }

/* Ticket (generated games) */
.ticket { background: var(--surface); border-radius: var(--radius-l); border: 1px solid var(--line); overflow: hidden; box-shadow: 0 1px 0 rgba(24, 33, 61, .04), 0 12px 32px -18px rgba(24, 33, 61, .25); }
.ticket-head { display: flex; justify-content: space-between; padding: 12px 20px; background: var(--slip); color: #fff; font-size: 14px; font-weight: 700; }
.ticket-body { padding: 8px 20px; }
.ticket-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.ticket-row:last-child { border-bottom: 0; }
.row-label { width: 18px; font-weight: 800; color: var(--slip); flex: none; }
.ticket-row .balls { flex: 1; }
.row-save { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-3); }
.row-save:hover { background: var(--bg); color: var(--navy); }
.row-save svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.row-save[aria-pressed="true"] { color: var(--navy); }
.row-save[aria-pressed="true"] svg { fill: currentColor; }
.ticket-foot { display: flex; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.ticket-foot .btn { flex: 1; }
.empty-msg { padding: 8px 0 4px; font-size: 14px; color: var(--ink-3); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: var(--radius-m); font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn-main { background: var(--navy); color: #fff; }
.btn-main:hover { background: var(--navy-hover); }
.btn-main:active { transform: translateY(1px); }
.btn-line { background: var(--surface); border: 1px solid #cfd5e2; color: var(--ink); }
.btn-line:hover { border-color: var(--ink-3); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.link-btn { font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px; }
.link-btn.danger { color: #b3261e; }
.ext { font-size: 14px; font-weight: 600; color: var(--navy); }
.ext::after { content: " ↗"; }

/* Segmented */
.seg { display: inline-flex; background: #e6e9f1; border-radius: var(--radius-m); padding: 4px; }
.seg button { min-height: 38px; padding: 0 16px; border-radius: 9px; font-weight: 700; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(24, 33, 61, .14); }
.seg-sm button { min-height: 34px; padding: 0 12px; font-size: 14px; }

.generate-bar { display: flex; gap: 10px; }
.generate-bar .btn-main { flex: 1; min-height: 54px; font-size: 18px; border-radius: 14px; }
.generate-bar .seg { flex: none; }
.generate-bar .seg button { min-height: 46px; }

/* OMR slip */
.slip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.slip summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; font-weight: 700; cursor: pointer; list-style: none; }
.slip summary::-webkit-details-marker { display: none; }
.slip summary::after { content: ""; width: 9px; height: 9px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(45deg); margin-left: 4px; flex: none; }
.slip[open] summary::after { transform: rotate(-135deg); }
.slip-state { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.slip-body { display: grid; gap: 14px; padding: 0 20px 20px; }
.slip-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.omr { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; padding: 14px 12px; background: var(--slip-tint); border: 1px solid #f6c3cc; border-radius: var(--radius-m); }
.omr button { position: relative; height: 40px; font-size: 14px; font-weight: 700; color: var(--slip); font-variant-numeric: tabular-nums; }
.omr button::before { content: ""; position: absolute; inset: 4px 22%; border: 1.5px solid #ef8a9b; border-radius: 3px; }
.omr button span { position: relative; }
.omr button.included { color: #fff; }
.omr button.included::before { background: var(--ink); border-color: var(--ink); }
.omr button.excluded { color: #c9a0a8; }
.omr button.excluded::after { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 2px; background: var(--slip); transform: rotate(-35deg); }
.slip-summary { font-size: 14px; color: var(--ink-2); }

/* Form bits */
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input, .win-inputs input { min-height: 46px; padding: 8px 12px; border: 1px solid #cfd5e2; border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 16px; min-width: 0; }
.field input[type="date"] { max-width: 220px; }
.field-full input { width: 100%; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.field-note { font-size: 14px; color: var(--ink-3); min-height: 1.6em; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.check small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-3); }
.check-inline { align-items: center; }
.check-inline input { margin: 0; }
.form-card { display: grid; gap: 18px; }
.form-row { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.form-row .field-note { padding-bottom: 12px; }
.form-row .field-note strong { color: var(--slip); font-size: 16px; }
.win-set legend { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.win-inputs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) 18px minmax(0, 1fr); gap: 6px; align-items: center; }
.win-inputs input { text-align: center; padding: 8px 2px; font-weight: 700; }
.win-inputs .plus { text-align: center; font-weight: 800; color: var(--ink-3); }
.bonus-input { border-color: var(--navy) !important; }
.toolbar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid #cfd5e2; background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chips button:hover { border-color: var(--navy); color: var(--navy); }

/* Info and tables */
.info { display: grid; gap: 10px; padding-top: 10px; }
.info h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.info > p { color: var(--ink-2); }
.odds { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.odds th, .odds td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 15px; }
.odds th { background: #f7f8fb; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.odds td:first-child { font-weight: 800; }
.odds td:last-child { text-align: right; }
.odds th:last-child { text-align: right; }
.odds tr:last-child td { border-bottom: 0; }
.plain-list { padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }

/* Records */
.record-groups { display: grid; gap: 16px; }
.record-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.record-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.record-head h2 { font-size: 16px; font-weight: 800; }
.record-head h2 strong { color: var(--slip); margin-right: 6px; }
.record-head span { font-size: 13px; color: var(--ink-3); }
.record { display: grid; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record-meta { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.record-meta .spacer { flex: 1; }
.buy { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.buy input { width: 18px; height: 18px; accent-color: var(--navy); margin: 0; }
.rank { font-weight: 800; color: var(--ink-2); }
.rank.win { color: var(--good); }
.empty { background: var(--surface); border: 1px dashed #cdd3df; border-radius: var(--radius-l); padding: 32px 20px; text-align: center; color: var(--ink-3); display: grid; gap: 12px; justify-items: center; }
.danger-zone { font-size: 14px; color: var(--ink-3); }
.danger-zone summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.danger-zone p { margin: 8px 0 10px; }

/* Check results */
.check-results { display: grid; gap: 12px; }
.check-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.check-head p { font-size: 15px; color: var(--ink-2); }
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px 18px; display: grid; gap: 10px; }
.result-card.win { border-color: #9fd8b8; background: var(--good-tint); }
.result-line { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }

/* Tax */
.tax-result { display: grid; gap: 12px; }
.tax-net { background: var(--navy); color: #fff; border-radius: var(--radius-l); padding: 22px 22px 20px; display: grid; gap: 2px; }
.tax-net span { font-size: 14px; opacity: .8; }
.tax-net strong { font-size: clamp(28px, 6vw, 40px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tax-net small { font-size: 15px; opacity: .85; }
.tax-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; font-variant-numeric: tabular-nums; }
.tax-table th, .tax-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.tax-table th { text-align: left; font-weight: 500; color: var(--ink-2); }
.tax-table td { text-align: right; font-weight: 700; white-space: nowrap; }
.tax-table tr:last-child th, .tax-table tr:last-child td { border-bottom: 0; }

/* Sidebar */
.mine { display: grid; gap: 12px; }
.mine h2, .guide h2 { font-size: 16px; font-weight: 800; }
.mine-date { font-size: 14px; color: var(--ink-3); margin-top: -8px; }
.mine-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mine-stats div { background: var(--bg); border-radius: var(--radius-m); padding: 10px 12px; }
.mine-stats dt { font-size: 13px; color: var(--ink-3); }
.mine-stats dd { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.guide ol { margin-top: 10px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }

/* Ad slots: empty and collapsed unless an ad is configured or local preview */
.ad-slot { display: none; }
.ad-slot.ad-on { display: block; }
.ad-slot.ad-preview { display: grid; place-items: center; border: 1.5px dashed #b9c1d3; border-radius: var(--radius-m); color: var(--ink-3); font-size: 13px; background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(185, 193, 211, .14) 10px 20px); }
.ad-slot.ad-preview::before { content: attr(data-label); }
.ad-wide.ad-preview { min-height: 100px; margin: 8px 0; }
.ad-box.ad-preview { min-height: 250px; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0 40px; font-size: 13px; color: var(--ink-3); }
.footer .wrap { display: grid; gap: 8px; }
.footer nav { display: flex; gap: 16px; margin-bottom: 4px; }
.footer nav a { color: var(--ink-2); font-weight: 600; font-size: 14px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 40; width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast.error { background: #b3261e; }

/* Document pages */
.doc { max-width: 720px; margin: 0 auto; padding: 36px 0 60px; display: grid; gap: 14px; }
.doc h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; letter-spacing: -.035em; line-height: 1.3; }
.doc h2 { font-size: 20px; font-weight: 800; margin-top: 18px; }
.doc p, .doc li { color: var(--ink-2); line-height: 1.75; }
.doc ul, .doc ol { padding-left: 20px; display: grid; gap: 4px; }
.doc table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.doc th, .doc td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.doc .updated { font-size: 14px; color: var(--ink-3); }
.doc a { color: var(--navy); font-weight: 600; }
.back { font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }

/* Mobile */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: 1fr; }
  .side .guide { display: none; }
}
@media (max-width: 720px) {
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .topbar { backdrop-filter: none; background: var(--surface); }
  .topbar-inner { height: 54px; justify-content: center; }
  .side .mine { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around; gap: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
  .tabs a { position: relative; flex: 1; flex-direction: column; justify-content: center; gap: 2px; border-radius: 0; font-size: 11px; padding: 6px 0; }
  .tabs a[aria-current="page"] { background: none; }
  .tabs svg { width: 24px; height: 24px; }
  .tab-count { position: absolute; top: 4px; left: calc(50% + 6px); }
  main { padding-top: 16px; }
  .card, .slip-body { padding-left: 16px; padding-right: 16px; }
  .ticket-body { padding: 4px 14px; }
  .ticket-head, .ticket-foot { padding-left: 14px; padding-right: 14px; }
  .ticket-row { gap: 8px; }
  .slip summary { padding: 14px 16px; }
  .omr { padding: 10px 6px; }
  .toast { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
  .win-inputs { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .win-inputs .plus { display: none; }
  .record, .record-head { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 440px) {
  .record-meta .saved-at { display: none; }
}
@media (max-width: 380px) {
  .generate-bar .seg button { padding: 0 10px; }
  .row-save { width: 32px; height: 32px; }
}
.check-head .balls { align-items: center; }
.check-head .plus { font-weight: 800; color: var(--ink-3); padding: 0 2px; }
@media (max-width: 720px) { .topbar-doc { justify-content: space-between; } }

/* Result pages and latest-draw card */
.results-main { display: grid; gap: 18px; min-width: 0; }
.draw-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px 20px; display: grid; gap: 8px; justify-items: start; box-shadow: 0 12px 32px -20px rgba(24, 33, 61, .25); }
.draw-title { font-size: clamp(22px, 4vw, 28px); font-weight: 800; letter-spacing: -.03em; line-height: 1.3; }
.draw-title a { text-decoration: none; }
.draw-title a:hover { text-decoration: underline; }
.draw-date { color: var(--ink-3); font-size: 14px; margin-top: -6px; }
.draw-balls { align-items: center; margin: 6px 0 2px; flex-wrap: wrap; row-gap: 8px; }
.balls .plus { font-weight: 800; color: var(--ink-3); padding: 0 2px; }
.draw-first { font-size: 15px; color: var(--ink-2); }
.draw-first strong { color: var(--ink); font-size: 17px; }
.draw-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.draw-actions .btn { flex: 1 1 200px; }
.results-h1 { margin-top: 12px; }
.prize-table td:nth-child(3), .prize-table th:nth-child(3) { text-align: right; }
.prize-table td:last-child { font-weight: 600; }
.my-check { display: grid; gap: 10px; }
.my-check h2 { font-size: 18px; font-weight: 800; }
.pager { display: flex; justify-content: space-between; gap: 8px; }
.round-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.round-list li + li { border-top: 1px solid var(--line); }
.round-list a { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding: 10px 14px; text-decoration: none; }
.round-list a:hover { background: #f7f8fb; }
.rl-round { font-weight: 800; color: var(--slip); min-width: 58px; }
.rl-date { font-size: 13px; color: var(--ink-3); min-width: 74px; font-variant-numeric: tabular-nums; }
.balls.mini { --ball: 28px; gap: 4px; align-items: center; }
.archive { display: flex; flex-wrap: wrap; gap: 8px; }
.archive a { padding: 6px 12px; border: 1px solid #cfd5e2; border-radius: 16px; background: var(--surface); font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.jump { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.jump input { width: 110px; min-height: 38px; padding: 6px 10px; border: 1px solid #cfd5e2; border-radius: 10px; font-size: 16px; }
.latest { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px 18px; text-decoration: none; }
.latest:hover { border-color: #b9c1d3; }
.latest-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--ink-2); }
.latest-top strong { color: var(--ink); }
.latest .balls { --ball: clamp(28px, calc((100vw - 120px) / 8), 36px); align-items: center; }
@media (max-width: 720px) { .round-list a { padding: 10px 12px; } .rl-round { min-width: 0; } }
.draw-balls { --ball: clamp(30px, calc((100vw - 104px) / 8.4), 48px); flex-wrap: nowrap; gap: clamp(3px, 1vw, 8px); }
@media (max-width: 480px) {
  .prize-table th:nth-child(2), .prize-table td:nth-child(2) { display: none; }
  .prize-table th, .prize-table td { padding: 10px; font-size: 14px; }
  .draw-card { padding: 18px 14px; }
}

/* Picking preferences */
.prefs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.switch { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); cursor: pointer; }
.switch:has(input:checked) { border-color: var(--navy); background: #f4f6fd; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 38px; height: 22px; margin: 1px 0 0; border-radius: 11px; background: #cfd5e2; position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked { background: var(--navy); }
.switch input:checked::after { transform: translateX(16px); }
.switch b { display: block; font-size: 15px; }
.switch small { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.presets-box { display: grid; gap: 8px; }
.presets-title { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.chips button[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.chips button:disabled { opacity: .45; }
.ways { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.ways div { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ways div:last-child { border-bottom: 0; }
.ways dt { font-weight: 800; font-size: 15px; }
.ways dd { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
@media (max-width: 520px) { .prefs { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .switch input, .switch input::after { transition: none; } }

/* Pick modes: 자동 / 반자동 / 수동 */
.pick-modes { display: grid; grid-template-columns: repeat(3, 1fr); background: #e6e9f1; border-radius: 14px; padding: 4px; gap: 4px; }
.pick-modes button { min-height: 46px; border-radius: 11px; font-size: 16px; font-weight: 800; color: var(--ink-2); }
.pick-modes button[aria-selected="true"] { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(24, 33, 61, .16); }
.pick-help { font-size: 14px; color: var(--ink-3); margin-top: -8px; }
.pick-panel { display: grid; gap: 14px; }
.prefs { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.slip-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 12px; }
.slip-head h2 { font-size: 16px; font-weight: 800; }
.slip > .slip-body { padding-top: 0; }
.round-pick { font-size: 13px; color: var(--ink-3); }
.round-pick summary { cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.round-pick summary::-webkit-details-marker { display: none; }
.round-pick[open] { flex-basis: 100%; }
.round-pick .field { margin-top: 8px; }
.manual .omr button.included::before { background: var(--navy); border-color: var(--navy); }
.sharing { padding: 12px 14px; border-radius: var(--radius-m); font-size: 14px; line-height: 1.6; background: #f4f6fd; color: var(--ink-2); }
.sharing strong { color: var(--ink); }
.sharing.high { background: #fff4e5; }
.sharing.low { background: var(--good-tint); }
.method-tag { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: #eef1f7; color: var(--ink-2); }
@media (max-width: 720px) { .slip-head { padding: 14px 16px 10px; } }

/* Round analysis facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 12px; }
.facts dt { font-size: 13px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.info > p + p { margin-top: 2px; }
.ad-slot.ad-on { position: relative; min-height: 120px; margin: 12px 0; padding-top: 18px; }
.ad-box.ad-on { min-height: 270px; }
.ad-label { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }
.footer nav { flex-wrap: wrap; gap: 6px 16px; }

/* 매주 한 장 기록 */
.ext-inline { color: var(--navy); font-weight: 700; }
.wk-entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px 16px; display: grid; gap: 8px; }
.wk-entry + .wk-entry { margin-top: 10px; }
.wk-head h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wk-head a { text-decoration: none; color: var(--slip); }
.wk-games { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wk-games li { display: grid; grid-template-columns: 9.5em auto 1fr; align-items: center; gap: 6px 10px; }
.wk-method { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.wk-games .rank { font-size: 13px; text-align: right; }
.wk-proof { font-size: 12px; color: var(--ink-3); }
.wk-proof code { font-size: 12px; }
.wk-table td:not(:first-child), .wk-table th:not(:first-child) { text-align: right; }
.wk-total td { font-weight: 800; }
.wk-expected td { color: var(--ink-3); font-style: normal; }
@media (max-width: 560px) {
  .wk-games li { grid-template-columns: 1fr auto; }
  .wk-games .balls { grid-column: 1 / -1; order: 3; }
  .wk-table th:nth-child(2), .wk-table td:nth-child(2) { display: none; }
}

/* Results layout v2 */
.side-card { display: grid; gap: 10px; }
.side-card h2 { font-size: 16px; font-weight: 800; }
.side-card p { font-size: 14px; color: var(--ink-2); }
.jump { display: grid; gap: 8px; }
.jump label { color: var(--ink); }
.jump-row { display: flex; gap: 8px; }
.jump-row input { flex: 1; width: auto; min-width: 0; }
.draw-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; width: 100%; margin-top: 4px; }
.draw-sum div { background: var(--bg); border-radius: var(--radius-m); padding: 10px 12px; }
.draw-sum dt { font-size: 13px; color: var(--ink-3); }
.draw-sum dd { margin: 2px 0 0; font-weight: 800; }
.draw-card .draw-actions { width: 100%; margin-top: 4px; }
.rl-prize { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 560px) { .rl-prize { margin-left: 0; } .round-list a { row-gap: 8px; } }
@media (max-width: 720px) { .tabs a { font-size: 10.5px; } }

/* Stats */
.subnav { display: inline-flex; gap: 4px; background: #e6e9f1; border-radius: 12px; padding: 4px; margin-top: -6px; justify-self: start; }
.subnav a { padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(24, 33, 61, .14); }
.callout { background: #f4f6fd; border-radius: var(--radius-m); padding: 12px 16px; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.freq { list-style: none; margin: 0; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.freq li { display: grid; grid-template-columns: 30px 1fr 52px; align-items: center; gap: 8px; }
.freq .ball { --ball: 28px; }
.bar { width: 100%; height: 12px; overflow: visible; }
.bar rect { fill: var(--navy); }
.bar line { stroke: var(--slip); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bar-val { font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.num-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.num-chips li { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 4px 12px 4px 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.num-chips .ball { --ball: 28px; }
.stat-table td:not(:first-child), .stat-table th:not(:first-child) { text-align: right; }

/* Guides */
.doc-body { display: grid; gap: 12px; }
.doc-body h2 { font-size: 20px; font-weight: 800; margin-top: 14px; letter-spacing: -.02em; }
.doc-body p, .doc-body li { color: var(--ink-2); line-height: 1.8; }
.doc-body ul, .doc-body ol { padding-left: 20px; display: grid; gap: 4px; }
.doc-body a:not(.btn) { color: var(--navy); font-weight: 600; }
.crumbs { font-size: 14px; }
.crumbs a { color: var(--ink-3); }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.guide-list a { display: grid; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); text-decoration: none; }
.guide-list a:hover { border-color: #b9c1d3; }
.guide-list strong { font-size: 17px; }
.guide-list span { font-size: 14px; color: var(--ink-2); }

.sources { font-size: 13px; }
.sources a { color: var(--ink-2); font-weight: 500; word-break: break-all; }
.text-table td, .text-table th { text-align: left !important; }
.byline { font-size: 13px; color: var(--ink-3); margin-top: -6px; }
.byline a { color: var(--ink-3); }

.btn-danger { color: #b3261e; border-color: #e8b4b0; }
.btn-danger:hover { border-color: #b3261e; }
.record-head-actions { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.record-head-actions .link-btn { font-size: 13px; padding: 2px 0; }
.record-head { flex-wrap: wrap; }

/* Share sheet */
.share-dialog { border: 0; padding: 0; border-radius: 22px; width: min(420px, calc(100% - 32px)); max-height: calc(100% - 32px); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); color: var(--ink); }
.share-dialog::backdrop { background: rgba(24, 33, 61, .5); }
.share-box { display: grid; gap: 12px; padding: 20px; margin: 0; }
.share-head { display: flex; justify-content: space-between; align-items: center; }
.share-head h2 { font-size: 19px; font-weight: 800; }
.share-close { width: 36px; height: 36px; border-radius: 50%; font-size: 16px; color: var(--ink-3); background: var(--bg); }
.share-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.share-card-head { display: flex; justify-content: space-between; padding: 9px 14px; background: var(--slip); color: #fff; font-size: 13px; font-weight: 700; }
.share-card-title { padding: 12px 14px 2px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.share-card-rows { display: grid; gap: 6px; padding: 8px 14px 14px; }
.share-row { display: flex; align-items: center; gap: 8px; }
.share-row .balls { --ball: clamp(26px, calc((min(420px, 100vw - 32px) - 100px) / 6.6), 38px); }
.share-seg { display: grid; grid-template-columns: 1fr 1fr; }
.share-primary { min-height: 52px; font-size: 16px; }
.share-hint { text-align: center; font-size: 13px; color: var(--ink-3); }
.share-fallback { width: 100%; padding: 10px 12px; border: 1px solid #cfd5e2; border-radius: 10px; font: 14px/1.6 inherit; resize: none; }
@media (max-width: 560px) {
  .share-dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .share-box { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
.ticket-foot .btn { flex: 1; }
.empty-msg { padding: 8px 0 4px; font-size: 14px; color: var(--ink-3); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: var(--radius-m); font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn-main { background: var(--navy); color: #fff; }
.btn-main:hover { background: var(--navy-hover); }
.btn-main:active { transform: translateY(1px); }
.btn-line { background: var(--surface); border: 1px solid #cfd5e2; color: var(--ink); }
.btn-line:hover { border-color: var(--ink-3); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.link-btn { font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px; }
.link-btn.danger { color: #b3261e; }
.ext { font-size: 14px; font-weight: 600; color: var(--navy); }
.ext::after { content: " ↗"; }

/* Segmented */
.seg { display: inline-flex; background: #e6e9f1; border-radius: var(--radius-m); padding: 4px; }
.seg button { min-height: 38px; padding: 0 16px; border-radius: 9px; font-weight: 700; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(24, 33, 61, .14); }
.seg-sm button { min-height: 34px; padding: 0 12px; font-size: 14px; }

.generate-bar { display: flex; gap: 10px; }
.generate-bar .btn-main { flex: 1; min-height: 54px; font-size: 18px; border-radius: 14px; }
.generate-bar .seg { flex: none; }
.generate-bar .seg button { min-height: 46px; }

/* OMR slip */
.slip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.slip summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; font-weight: 700; cursor: pointer; list-style: none; }
.slip summary::-webkit-details-marker { display: none; }
.slip summary::after { content: ""; width: 9px; height: 9px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(45deg); margin-left: 4px; flex: none; }
.slip[open] summary::after { transform: rotate(-135deg); }
.slip-state { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.slip-body { display: grid; gap: 14px; padding: 0 20px 20px; }
.slip-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.omr { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; padding: 14px 12px; background: var(--slip-tint); border: 1px solid #f6c3cc; border-radius: var(--radius-m); }
.omr button { position: relative; height: 40px; font-size: 14px; font-weight: 700; color: var(--slip); font-variant-numeric: tabular-nums; }
.omr button::before { content: ""; position: absolute; inset: 4px 22%; border: 1.5px solid #ef8a9b; border-radius: 3px; }
.omr button span { position: relative; }
.omr button.included { color: #fff; }
.omr button.included::before { background: var(--ink); border-color: var(--ink); }
.omr button.excluded { color: #c9a0a8; }
.omr button.excluded::after { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 2px; background: var(--slip); transform: rotate(-35deg); }
.slip-summary { font-size: 14px; color: var(--ink-2); }

/* Form bits */
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input, .win-inputs input { min-height: 46px; padding: 8px 12px; border: 1px solid #cfd5e2; border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 16px; min-width: 0; }
.field input[type="date"] { max-width: 220px; }
.field-full input { width: 100%; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.field-note { font-size: 14px; color: var(--ink-3); min-height: 1.6em; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.check small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-3); }
.check-inline { align-items: center; }
.check-inline input { margin: 0; }
.form-card { display: grid; gap: 18px; }
.form-row { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.form-row .field-note { padding-bottom: 12px; }
.form-row .field-note strong { color: var(--slip); font-size: 16px; }
.win-set legend { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.win-inputs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) 18px minmax(0, 1fr); gap: 6px; align-items: center; }
.win-inputs input { text-align: center; padding: 8px 2px; font-weight: 700; }
.win-inputs .plus { text-align: center; font-weight: 800; color: var(--ink-3); }
.bonus-input { border-color: var(--navy) !important; }
.toolbar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid #cfd5e2; background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chips button:hover { border-color: var(--navy); color: var(--navy); }

/* Info and tables */
.info { display: grid; gap: 10px; padding-top: 10px; }
.info h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.info > p { color: var(--ink-2); }
.odds { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.odds th, .odds td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 15px; }
.odds th { background: #f7f8fb; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.odds td:first-child { font-weight: 800; }
.odds td:last-child { text-align: right; }
.odds th:last-child { text-align: right; }
.odds tr:last-child td { border-bottom: 0; }
.plain-list { padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }

/* Records */
.record-groups { display: grid; gap: 16px; }
.record-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.record-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.record-head h2 { font-size: 16px; font-weight: 800; }
.record-head h2 strong { color: var(--slip); margin-right: 6px; }
.record-head span { font-size: 13px; color: var(--ink-3); }
.record { display: grid; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record-meta { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.record-meta .spacer { flex: 1; }
.buy { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.buy input { width: 18px; height: 18px; accent-color: var(--navy); margin: 0; }
.rank { font-weight: 800; color: var(--ink-2); }
.rank.win { color: var(--good); }
.empty { background: var(--surface); border: 1px dashed #cdd3df; border-radius: var(--radius-l); padding: 32px 20px; text-align: center; color: var(--ink-3); display: grid; gap: 12px; justify-items: center; }
.danger-zone { font-size: 14px; color: var(--ink-3); }
.danger-zone summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.danger-zone p { margin: 8px 0 10px; }

/* Check results */
.check-results { display: grid; gap: 12px; }
.check-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.check-head p { font-size: 15px; color: var(--ink-2); }
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px 18px; display: grid; gap: 10px; }
.result-card.win { border-color: #9fd8b8; background: var(--good-tint); }
.result-line { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }

/* Tax */
.tax-result { display: grid; gap: 12px; }
.tax-net { background: var(--navy); color: #fff; border-radius: var(--radius-l); padding: 22px 22px 20px; display: grid; gap: 2px; }
.tax-net span { font-size: 14px; opacity: .8; }
.tax-net strong { font-size: clamp(28px, 6vw, 40px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tax-net small { font-size: 15px; opacity: .85; }
.tax-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; font-variant-numeric: tabular-nums; }
.tax-table th, .tax-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.tax-table th { text-align: left; font-weight: 500; color: var(--ink-2); }
.tax-table td { text-align: right; font-weight: 700; white-space: nowrap; }
.tax-table tr:last-child th, .tax-table tr:last-child td { border-bottom: 0; }

/* Sidebar */
.mine { display: grid; gap: 12px; }
.mine h2, .guide h2 { font-size: 16px; font-weight: 800; }
.mine-date { font-size: 14px; color: var(--ink-3); margin-top: -8px; }
.mine-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mine-stats div { background: var(--bg); border-radius: var(--radius-m); padding: 10px 12px; }
.mine-stats dt { font-size: 13px; color: var(--ink-3); }
.mine-stats dd { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.guide ol { margin-top: 10px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }

/* Ad slots: empty and collapsed unless an ad is configured or local preview */
.ad-slot { display: none; }
.ad-slot.ad-on { display: block; }
.ad-slot.ad-preview { display: grid; place-items: center; border: 1.5px dashed #b9c1d3; border-radius: var(--radius-m); color: var(--ink-3); font-size: 13px; background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(185, 193, 211, .14) 10px 20px); }
.ad-slot.ad-preview::before { content: attr(data-label); }
.ad-wide.ad-preview { min-height: 100px; margin: 8px 0; }
.ad-box.ad-preview { min-height: 250px; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0 40px; font-size: 13px; color: var(--ink-3); }
.footer .wrap { display: grid; gap: 8px; }
.footer nav { display: flex; gap: 16px; margin-bottom: 4px; }
.footer nav a { color: var(--ink-2); font-weight: 600; font-size: 14px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 40; width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast.error { background: #b3261e; }

/* Document pages */
.doc { max-width: 720px; margin: 0 auto; padding: 36px 0 60px; display: grid; gap: 14px; }
.doc h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; letter-spacing: -.035em; line-height: 1.3; }
.doc h2 { font-size: 20px; font-weight: 800; margin-top: 18px; }
.doc p, .doc li { color: var(--ink-2); line-height: 1.75; }
.doc ul, .doc ol { padding-left: 20px; display: grid; gap: 4px; }
.doc table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.doc th, .doc td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.doc .updated { font-size: 14px; color: var(--ink-3); }
.doc a { color: var(--navy); font-weight: 600; }
.back { font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }

/* Mobile */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: 1fr; }
  .side .guide { display: none; }
}
@media (max-width: 720px) {
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .topbar { backdrop-filter: none; background: var(--surface); }
  .topbar-inner { height: 54px; justify-content: center; }
  .side .mine { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around; gap: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
  .tabs a { position: relative; flex: 1; flex-direction: column; justify-content: center; gap: 2px; border-radius: 0; font-size: 11px; padding: 6px 0; }
  .tabs a[aria-current="page"] { background: none; }
  .tabs svg { width: 24px; height: 24px; }
  .tab-count { position: absolute; top: 4px; left: calc(50% + 6px); }
  main { padding-top: 16px; }
  .card, .slip-body { padding-left: 16px; padding-right: 16px; }
  .ticket-body { padding: 4px 14px; }
  .ticket-head, .ticket-foot { padding-left: 14px; padding-right: 14px; }
  .ticket-row { gap: 8px; }
  .slip summary { padding: 14px 16px; }
  .omr { padding: 10px 6px; }
  .toast { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
  .win-inputs { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .win-inputs .plus { display: none; }
  .record, .record-head { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 440px) {
  .record-meta .saved-at { display: none; }
}
@media (max-width: 380px) {
  .generate-bar .seg button { padding: 0 10px; }
  .row-save { width: 32px; height: 32px; }
}
.check-head .balls { align-items: center; }
.check-head .plus { font-weight: 800; color: var(--ink-3); padding: 0 2px; }
@media (max-width: 720px) { .topbar-doc { justify-content: space-between; } }

/* Result pages and latest-draw card */
.results-main { display: grid; gap: 18px; min-width: 0; }
.draw-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px 20px; display: grid; gap: 8px; justify-items: start; box-shadow: 0 12px 32px -20px rgba(24, 33, 61, .25); }
.draw-title { font-size: clamp(22px, 4vw, 28px); font-weight: 800; letter-spacing: -.03em; line-height: 1.3; }
.draw-title a { text-decoration: none; }
.draw-title a:hover { text-decoration: underline; }
.draw-date { color: var(--ink-3); font-size: 14px; margin-top: -6px; }
.draw-balls { align-items: center; margin: 6px 0 2px; flex-wrap: wrap; row-gap: 8px; }
.balls .plus { font-weight: 800; color: var(--ink-3); padding: 0 2px; }
.draw-first { font-size: 15px; color: var(--ink-2); }
.draw-first strong { color: var(--ink); font-size: 17px; }
.draw-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.draw-actions .btn { flex: 1 1 200px; }
.results-h1 { margin-top: 12px; }
.prize-table td:nth-child(3), .prize-table th:nth-child(3) { text-align: right; }
.prize-table td:last-child { font-weight: 600; }
.my-check { display: grid; gap: 10px; }
.my-check h2 { font-size: 18px; font-weight: 800; }
.pager { display: flex; justify-content: space-between; gap: 8px; }
.round-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.round-list li + li { border-top: 1px solid var(--line); }
.round-list a { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding: 10px 14px; text-decoration: none; }
.round-list a:hover { background: #f7f8fb; }
.rl-round { font-weight: 800; color: var(--slip); min-width: 58px; }
.rl-date { font-size: 13px; color: var(--ink-3); min-width: 74px; font-variant-numeric: tabular-nums; }
.balls.mini { --ball: 28px; gap: 4px; align-items: center; }
.archive { display: flex; flex-wrap: wrap; gap: 8px; }
.archive a { padding: 6px 12px; border: 1px solid #cfd5e2; border-radius: 16px; background: var(--surface); font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.jump { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.jump input { width: 110px; min-height: 38px; padding: 6px 10px; border: 1px solid #cfd5e2; border-radius: 10px; font-size: 16px; }
.latest { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px 18px; text-decoration: none; }
.latest:hover { border-color: #b9c1d3; }
.latest-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--ink-2); }
.latest-top strong { color: var(--ink); }
.latest .balls { --ball: clamp(28px, calc((100vw - 120px) / 8), 36px); align-items: center; }
@media (max-width: 720px) { .round-list a { padding: 10px 12px; } .rl-round { min-width: 0; } }
.draw-balls { --ball: clamp(30px, calc((100vw - 104px) / 8.4), 48px); flex-wrap: nowrap; gap: clamp(3px, 1vw, 8px); }
@media (max-width: 480px) {
  .prize-table th:nth-child(2), .prize-table td:nth-child(2) { display: none; }
  .prize-table th, .prize-table td { padding: 10px; font-size: 14px; }
  .draw-card { padding: 18px 14px; }
}

/* Picking preferences */
.prefs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.switch { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); cursor: pointer; }
.switch:has(input:checked) { border-color: var(--navy); background: #f4f6fd; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 38px; height: 22px; margin: 1px 0 0; border-radius: 11px; background: #cfd5e2; position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked { background: var(--navy); }
.switch input:checked::after { transform: translateX(16px); }
.switch b { display: block; font-size: 15px; }
.switch small { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.presets-box { display: grid; gap: 8px; }
.presets-title { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.chips button[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.chips button:disabled { opacity: .45; }
.ways { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.ways div { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ways div:last-child { border-bottom: 0; }
.ways dt { font-weight: 800; font-size: 15px; }
.ways dd { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
@media (max-width: 520px) { .prefs { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .switch input, .switch input::after { transition: none; } }

/* Pick modes: 자동 / 반자동 / 수동 */
.pick-modes { display: grid; grid-template-columns: repeat(3, 1fr); background: #e6e9f1; border-radius: 14px; padding: 4px; gap: 4px; }
.pick-modes button { min-height: 46px; border-radius: 11px; font-size: 16px; font-weight: 800; color: var(--ink-2); }
.pick-modes button[aria-selected="true"] { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(24, 33, 61, .16); }
.pick-help { font-size: 14px; color: var(--ink-3); margin-top: -8px; }
.pick-panel { display: grid; gap: 14px; }
.prefs { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.slip-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 12px; }
.slip-head h2 { font-size: 16px; font-weight: 800; }
.slip > .slip-body { padding-top: 0; }
.round-pick { font-size: 13px; color: var(--ink-3); }
.round-pick summary { cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.round-pick summary::-webkit-details-marker { display: none; }
.round-pick[open] { flex-basis: 100%; }
.round-pick .field { margin-top: 8px; }
.manual .omr button.included::before { background: var(--navy); border-color: var(--navy); }
.sharing { padding: 12px 14px; border-radius: var(--radius-m); font-size: 14px; line-height: 1.6; background: #f4f6fd; color: var(--ink-2); }
.sharing strong { color: var(--ink); }
.sharing.high { background: #fff4e5; }
.sharing.low { background: var(--good-tint); }
.method-tag { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: #eef1f7; color: var(--ink-2); }
@media (max-width: 720px) { .slip-head { padding: 14px 16px 10px; } }

/* Round analysis facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 12px; }
.facts dt { font-size: 13px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.info > p + p { margin-top: 2px; }
.ad-slot.ad-on { position: relative; min-height: 120px; margin: 12px 0; padding-top: 18px; }
.ad-box.ad-on { min-height: 270px; }
.ad-label { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }
.footer nav { flex-wrap: wrap; gap: 6px 16px; }

/* 매주 한 장 기록 */
.ext-inline { color: var(--navy); font-weight: 700; }
.wk-entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px 16px; display: grid; gap: 8px; }
.wk-entry + .wk-entry { margin-top: 10px; }
.wk-head h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wk-head a { text-decoration: none; color: var(--slip); }
.wk-games { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wk-games li { display: grid; grid-template-columns: 9.5em auto 1fr; align-items: center; gap: 6px 10px; }
.wk-method { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.wk-games .rank { font-size: 13px; text-align: right; }
.wk-proof { font-size: 12px; color: var(--ink-3); }
.wk-proof code { font-size: 12px; }
.wk-table td:not(:first-child), .wk-table th:not(:first-child) { text-align: right; }
.wk-total td { font-weight: 800; }
.wk-expected td { color: var(--ink-3); font-style: normal; }
@media (max-width: 560px) {
  .wk-games li { grid-template-columns: 1fr auto; }
  .wk-games .balls { grid-column: 1 / -1; order: 3; }
  .wk-table th:nth-child(2), .wk-table td:nth-child(2) { display: none; }
}

/* Results layout v2 */
.side-card { display: grid; gap: 10px; }
.side-card h2 { font-size: 16px; font-weight: 800; }
.side-card p { font-size: 14px; color: var(--ink-2); }
.jump { display: grid; gap: 8px; }
.jump label { color: var(--ink); }
.jump-row { display: flex; gap: 8px; }
.jump-row input { flex: 1; width: auto; min-width: 0; }
.draw-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; width: 100%; margin-top: 4px; }
.draw-sum div { background: var(--bg); border-radius: var(--radius-m); padding: 10px 12px; }
.draw-sum dt { font-size: 13px; color: var(--ink-3); }
.draw-sum dd { margin: 2px 0 0; font-weight: 800; }
.draw-card .draw-actions { width: 100%; margin-top: 4px; }
.rl-prize { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 560px) { .rl-prize { margin-left: 0; } .round-list a { row-gap: 8px; } }
@media (max-width: 720px) { .tabs a { font-size: 10.5px; } }

/* Stats */
.subnav { display: inline-flex; gap: 4px; background: #e6e9f1; border-radius: 12px; padding: 4px; margin-top: -6px; justify-self: start; }
.subnav a { padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(24, 33, 61, .14); }
.callout { background: #f4f6fd; border-radius: var(--radius-m); padding: 12px 16px; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.freq { list-style: none; margin: 0; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.freq li { display: grid; grid-template-columns: 30px 1fr 52px; align-items: center; gap: 8px; }
.freq .ball { --ball: 28px; }
.bar { width: 100%; height: 12px; overflow: visible; }
.bar rect { fill: var(--navy); }
.bar line { stroke: var(--slip); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bar-val { font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.num-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.num-chips li { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 4px 12px 4px 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.num-chips .ball { --ball: 28px; }
.stat-table td:not(:first-child), .stat-table th:not(:first-child) { text-align: right; }

/* Guides */
.doc-body { display: grid; gap: 12px; }
.doc-body h2 { font-size: 20px; font-weight: 800; margin-top: 14px; letter-spacing: -.02em; }
.doc-body p, .doc-body li { color: var(--ink-2); line-height: 1.8; }
.doc-body ul, .doc-body ol { padding-left: 20px; display: grid; gap: 4px; }
.doc-body a:not(.btn) { color: var(--navy); font-weight: 600; }
.crumbs { font-size: 14px; }
.crumbs a { color: var(--ink-3); }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.guide-list a { display: grid; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); text-decoration: none; }
.guide-list a:hover { border-color: #b9c1d3; }
.guide-list strong { font-size: 17px; }
.guide-list span { font-size: 14px; color: var(--ink-2); }

.sources { font-size: 13px; }
.sources a { color: var(--ink-2); font-weight: 500; word-break: break-all; }
.text-table td, .text-table th { text-align: left !important; }
.byline { font-size: 13px; color: var(--ink-3); margin-top: -6px; }
.byline a { color: var(--ink-3); }

.btn-danger { color: #b3261e; border-color: #e8b4b0; }
.btn-danger:hover { border-color: #b3261e; }
.record-head-actions { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.record-head-actions .link-btn { font-size: 13px; padding: 2px 0; }
.record-head { flex-wrap: wrap; }

/* Share sheet */
.share-dialog { border: 0; padding: 0; border-radius: var(--radius-l); width: min(440px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.share-dialog::backdrop { background: rgba(24, 33, 61, .45); }
.share-box { display: grid; gap: 14px; padding: 20px; margin: 0; }
.share-head { display: flex; justify-content: space-between; align-items: center; }
.share-head h2 { font-size: 18px; font-weight: 800; }
.share-preview { margin: 0; padding: 12px 14px; background: var(--bg); border-radius: var(--radius-m); font: 14px/1.6 "Pretendard Variable", Pretendard, sans-serif; white-space: pre-wrap; word-break: break-all; color: var(--ink-2); max-height: 220px; overflow: auto; }
.share-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.ticket-foot .btn { flex: 1; }
.wk-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Admin */
.adm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.adm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px 18px; display: grid; gap: 6px; }
.adm-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.adm-card h2 { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.adm-value { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.adm-detail { font-size: 13px; color: var(--ink-3); }
.st { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st-ok { background: var(--good-tint); color: var(--good); }
.st-warn { background: #fff4e5; color: #8a5300; }
.st-bad { background: #fde8e7; color: #b3261e; }
.st-info { background: #eef1f7; color: var(--ink-2); }
.adm-steps, .adm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; }
.adm-steps li, .adm-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.adm-time { font-weight: 700; min-width: 64px; font-variant-numeric: tabular-nums; }
.adm-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.adm-links a { padding: 8px 12px; border: 1px solid #cfd5e2; border-radius: 10px; background: var(--surface); font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink); }
.adm-check { padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); font-size: 14px; }
.layout-full { grid-template-columns: 1fr; }
