/* 네이버 증권의 색상, 여백, 패널 스타일을 참고한 도구 UI */
:root {
    --bg-1: #fff; --bg-2: #fff; --card: #fff; --surface: #f5f7f9;
    --raised: #fff; --text: #101214; --muted: #808891; --line: #e3e6ea;
    --accent-1: #03b75a; --accent-2: #03b75a; --fixed: #03b75a;
    --excluded: #9ca3af; --shadow: transparent; --check-1: #fff; --check-2: #edf0ee;
    --soft-green: #effaf4; color-scheme: light;
}
:root[data-theme="dark"] {
    --bg-1: #191d1b; --bg-2: #191d1b; --card: #202622; --surface: #28312b;
    --raised: #303a33; --text: #eff3f0; --muted: #a1afa5; --line: #354038;
    --accent-1: #03b75a; --accent-2: #03b75a; --fixed: #03b75a;
    --soft-green: #243c2e; --check-1: #273129; --check-2: #354038; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-1: #191d1b; --bg-2: #191d1b; --card: #202622; --surface: #28312b;
        --raised: #303a33; --text: #eff3f0; --muted: #a1afa5; --line: #354038;
        --accent-1: #03b75a; --accent-2: #03b75a; --fixed: #03b75a;
        --soft-green: #243c2e; --check-1: #273129; --check-2: #354038; color-scheme: dark;
    }
}
html { background: var(--bg-1); scroll-behavior: smooth; scroll-padding-top: 24px; }
body, .layout-pc body { padding: 0; min-width: 0; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #03b75a; outline-offset: 4px; }
[hidden] { display: none !important; }
.site-header { background: var(--card); color: var(--text); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1320px; min-height: 68px; margin: auto; display: flex; align-items: center; gap: 30px; padding: 0 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; letter-spacing: -.8px; white-space: nowrap; }
.header-inner > .settings, .header-inner > .segmented { margin-left: auto; }
.settings { gap: 15px; }
.setting { gap: 6px; }
.setting-label { color: var(--muted); font-size: 11px; }
.header-inner .segmented { padding: 3px; background: var(--surface); border-radius: 8px; }
.header-inner .segmented button { color: var(--muted); padding: 6px 10px; font-size: 11px; border-radius: 2px; }
.header-inner .segmented button.active { color: var(--text); background: var(--card); box-shadow: 0 1px 3px #0000000d; }
.navigation-bar { display: flex; justify-content: space-between; align-items: center; max-width: 1320px; margin: auto; height: 56px; border-bottom: 1px solid var(--line); }
.nav { gap: 32px; height: 100%; flex-wrap: nowrap; align-items: stretch; }
.nav a { display: flex; align-items: center; padding: 0 2px; font-size: 16px; border-radius: 0; border-bottom: 3px solid transparent; }
.nav a.current { color: var(--text); background: transparent; box-shadow: none; border-bottom-color: var(--text); }
.nav a:hover { background: transparent; color: var(--text); }
.nav-caption { font-size: 12px; color: var(--muted); }
.panel, .layout-pc .draw-panel, .layout-mobile .panel { padding: 28px; border-radius: 16px; box-shadow: none; backdrop-filter: none; }
.draw-panel { text-align: left; }
.draw-panel h1, .layout-pc .draw-panel h1 { font-size: 28px; font-weight: 700; }
.subtitle { font-size: 13px; line-height: 1.8; }
.games { justify-content: flex-start; margin-top: 22px; }
.segmented { background: var(--surface); border-radius: 8px; }
.segmented button, .segmented button.active { border-radius: 6px; box-shadow: none; }
.segmented button.active { color: var(--text); }
.results, .layout-pc .results { min-height: 220px; margin: 24px 0; border-radius: 12px; padding: 28px 14px; }
.placeholder { font-size: 13px; text-align: center; }
button { font-size: 14px; padding: 13px 18px; border-radius: 8px; }
button.primary { background: #03b75a; box-shadow: none; }
button.primary:hover, button.primary:hover:not(:disabled) { background: #029e4d; box-shadow: none; }
#drawButton { display: flex; justify-content: center; gap: 15px; }
.stats { gap: 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.stats div { padding: 0 10px; border: 0; border-radius: 0; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: 11px; }
.stats dd { font-size: 24px; letter-spacing: -.6px; }
.hint { font-size: 11px; text-align: center; }
.panel-head h2 { font-size: 17px; }
button.link { font-size: 12px; text-decoration: none; }
.panel-desc, .panel-foot { font-size: 12px; line-height: 1.9; }
.tag { font-size: 10px; border-radius: 3px; padding: 1px 5px; }
.number-grid { gap: 6px; grid-template-columns: repeat(9,minmax(0,1fr)); }
.cell { border-radius: 7px; border-width: 1px; min-width: 0; }
.cell::before { width: 3px; height: 3px; top: 3px; left: 3px; }
.cell-num { font-size: 14px; }
.cell-freq { min-height: 12px; font-size: 10px; }
.history-list li { padding: 6px 0; gap: 3px; background: transparent; border-bottom: 1px solid var(--line); border-radius: 0; }
.history-list li.empty { font-size: 13px; padding: 30px 0; border-bottom: 0; }
.history-list li::before { width: 12px; font-size: 9px; }
.ball { box-shadow: none; text-shadow: none; }
.hero { margin: 32px auto 24px; max-width: 1320px; }
.hero h1 { font-size: 28px; font-weight: 700; }
.hero p { font-size: 13px; line-height: 1.9; max-width: 760px; }
.tool { max-width: 1320px; gap: 24px; margin-bottom: 48px; }
.dropzone { border-width: 1px; border-radius: 12px; background: var(--surface); padding: 30px 15px; }
.dropzone strong { font-size: 14px; }
.dropzone span { font-size: 11px; line-height: 1.8; }
.field-label { font-size: 13px; }
.field-help { font-size: 11px; }
.canvas-box, .progress-card, .receipt-thumb, select, .settings-note { border-radius: 12px; }
.progress div { background: #03b75a; }
.preview figcaption { font-size: 13px; }
.progress-top strong { font-size: 14px; }

.app, .layout-pc .app { max-width: 1320px; margin: 32px auto 48px; gap: 24px; }
.layout-pc .app { grid-template-columns: minmax(0, 1fr) 380px; }
.app > .panel { min-width: 0; }
.layout-mobile .app { max-width: 600px; }
@media (min-width: 900px) { .tool { grid-template-columns: 340px minmax(0, 1fr); } }
.cell { min-height: 42px; }
.panel { background: var(--card); }
@media (max-width: 1380px) {
    .header-inner, .navigation-bar, .hero, .tool, .app, .layout-pc .app { margin-left: 28px; margin-right: 28px; }
    .layout-mobile .app { margin-left: auto; margin-right: auto; }
}
@media (max-width: 900px) {
    .header-inner { min-height: 68px; flex-wrap: wrap; gap: 12px; padding: 15px 0; }
    .brand { font-size: 21px; }
    .header-inner .settings { gap: 7px; }
    .setting-label { display: none; }
    .header-inner .segmented button { font-size: 10px; padding: 4px 6px; }
    .app, .layout-pc .app, .layout-mobile .app { display: grid; grid-template-columns: minmax(0,1fr); grid-template-areas: 'draw' 'picker' 'history'; max-width: none; margin: 24px 28px 40px; }
    .tool { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 520px) {
    .header-inner, .navigation-bar, .hero, .tool, .app, .layout-pc .app, .layout-mobile .app { margin-left: 16px; margin-right: 16px; }
    .header-inner { align-items: center; }
    .header-inner .settings { flex-direction: column; align-items: flex-end; }
    .brand { font-size: 19px; }
    .nav { gap: 24px; }
    .nav a { font-size: 12px; }
    .navigation-bar { height: 53px; }
    .panel, .layout-pc .draw-panel, .layout-mobile .panel { padding: 22px 16px; }
    .draw-panel h1, .layout-pc .draw-panel h1, .hero h1 { font-size: 24px; }
    .layout-pc .ball, .layout-mobile .ball { width: 30px; height: 30px; font-size: 13px; }
    .layout-pc .balls, .layout-mobile .balls { gap: 3px; }
    .game-row { gap: 4px; }
    .results, .layout-pc .results { padding: 20px 6px; }
    .cell { min-height: 34px; }
    .number-grid { gap: 6px; }
    .cell-num { font-size: 12px; }
    .cell-freq { font-size: 9px; min-height: 10px; }
    .history-list { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.ball.c1 { background: #e9aa1b; }
.ball.c2 { background: #3685f5; }
.ball.c3 { background: #f15b64; }
.ball.c4 { background: #87909c; }
.ball.c5 { background: #04b66c; }
.primary:focus-visible { outline-color: #111; }
