/* 4.21: role-based type, comfortable Korean line height and scalable labels.
   References and measured before/after values: docs/ui-4.21-verification.json. */
:root{--type-caption:.875rem;--type-body-small:.9375rem;--type-body:1rem;--type-subtitle:1.125rem;--type-title:1.25rem;--type-page:1.5rem;--text-secondary:#4d607a}
body{font-size:var(--type-body);line-height:1.6}
.shell :is(p,li,dd,label,summary){word-break:keep-all;overflow-wrap:anywhere}
.shell h2{font-size:var(--type-page);line-height:1.4;letter-spacing:-.025em}
.shell h3{font-size:var(--type-title);line-height:1.45;letter-spacing:-.02em}
.shell :is(.help,.match-legend,.menu-description,.selection-status,.game-support){font-size:var(--type-caption);line-height:1.65;color:var(--text-secondary)}
.shell :is(.info-note,.empty-message,.game-record-note){font-size:var(--type-body-small);line-height:1.7}
.shell label{font-size:var(--type-caption);line-height:1.5;font-weight:600}
.shell :is(input,select,textarea){font-size:var(--type-body);line-height:1.5}
.shell :is(input:not([type=checkbox]):not([type=radio]),select,textarea){max-width:100%;min-width:0}
.shell :is(.text-button,.primary,.file-label,.store-route,.download-list>a){font-size:var(--type-body-small);line-height:1.5}
.shell :is(summary,.pill,.eyebrow){font-size:var(--type-caption);line-height:1.5}
.shell summary{min-height:44px;padding-block:10px;cursor:pointer}
.shell .eyebrow{letter-spacing:.02em}
.shell :is(.help,.info-note) a{text-decoration:underline;text-underline-offset:3px}
#install-top{font-size:var(--type-caption)}
/* Keep shortcuts compact and fully visible while increasing their labels. */
.shell .shortcuts-heading h2{font-size:var(--type-body);line-height:1.5;color:#344a69}
.shell .shortcuts-list .shortcut-link{font-size:var(--type-body-small);line-height:1.5}
.shell .shortcuts-edit{font-size:var(--type-caption)}
.shell .draw-game-switch label{font-size:var(--type-caption);line-height:1.5;margin-bottom:6px}
.shell .draw-game-switch select{font-size:var(--type-body);min-height:46px}
/* A draw number, its date and its prize each have one readable line. */
.shell .result-title h2,.shell .result-title h3{font-size:var(--type-title);line-height:1.4;letter-spacing:-.025em}
#panel-results>.results-section-heading{gap:8px}
#official-latest{display:flex;flex-direction:column;gap:2px;min-width:0}
#official-latest .official-round{font-size:var(--type-title);line-height:1.4;font-weight:750}
#official-latest .official-date{font-size:var(--type-caption);line-height:1.5;font-weight:400;color:var(--text-secondary);letter-spacing:0}
#refresh-official{font-size:var(--type-caption);min-width:80px;padding:10px 12px;align-self:center}
#official-detail{margin:0 0 6px;line-height:1.5;font-variant-numeric:tabular-nums}
#official-detail .official-prize{display:block;font-size:var(--type-title);font-weight:750;overflow-wrap:anywhere}
#official-detail .official-winners{display:block;font-size:var(--type-caption);font-weight:400;color:var(--text-secondary);margin-top:2px}
#official-checked,#sync-status,#official-link{font-size:var(--type-caption);line-height:1.65}
#official-balls{margin:18px 0 14px;gap:6px;flex-wrap:wrap}
#official-balls .ball{flex:0 1 calc((100% - 3.5rem)/7);min-width:1.7em;min-height:1.7em;max-width:2.625rem;height:auto;aspect-ratio:1;font-size:var(--type-subtitle)}
#official-balls .ball:last-child{margin-left:0}
#official-balls .bonus-separator{flex:none;margin:0 1px}
.shell :is(.history-balls,.history-bonus) .ball{font-size:var(--type-body);font-variant-numeric:tabular-nums}
.shell :is(.history-row small,.history-date,.history-pagination>span){font-size:var(--type-caption);line-height:1.5}
.shell .history-row strong{font-size:var(--type-body)}
.shell .history-numbers{min-width:0}
.shell .history-actions{flex-wrap:wrap}
/* Body copy and large financial values can grow without clipping their cards. */
.shell .summary-metrics{gap:10px}
.shell .summary-metrics span{font-size:var(--type-caption);line-height:1.5}
.shell .summary-metrics strong{font-size:var(--type-title);line-height:1.4;min-width:0;overflow-wrap:anywhere}
#panel-tickets .audit-grid .help,#mode-help,.shell .game-card p{font-size:var(--type-body-small);line-height:1.65}
#panel-tickets .audit-grid .form-actions{margin-top:14px;flex-wrap:wrap}
.shell .ticket-result b{font-size:var(--type-body-small);line-height:1.6;overflow-wrap:anywhere}
.shell .ticket-number{font-size:var(--type-body);font-variant-numeric:tabular-nums}
.shell .purchase-actions>button{min-width:0;overflow-wrap:anywhere}
.shell .qr-guidance{border-top:1px solid var(--line);padding-top:4px}
.shell .more-grid .menu-copy strong{font-size:var(--type-subtitle);line-height:1.45}
.shell .more-grid .menu-copy .menu-description{font-size:var(--type-caption);line-height:1.6;font-weight:400}
.shell :is(.game-facts,.games-table,.analysis-table){font-size:var(--type-body-small);line-height:1.65}
.shell :is(.games-segments button,.draw-tabs button,.advanced-links button){font-size:var(--type-caption);line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.shortcuts-dialog :is(.help,.shortcut-selected-label,.shortcut-choice,.shortcut-order button){font-size:var(--type-caption);line-height:1.55}
.shell :is(.table-scroll,.history-list){overscroll-behavior:contain}
/* Reading/community/shop share the same body scale; article prose stays larger. */
.l-main :is(.help,.kicker,.post-meta,.entry-meta,.shop-note){font-size:var(--type-caption);line-height:1.6}
.l-main .l-hero p:not(.eyebrow),.l-main .read-card p,.l-main .shop-card p{font-size:var(--type-body-small);line-height:1.7}
.l-main .article-body section p{font-size:var(--type-body);line-height:1.8;max-width:68ch}
.l-main :is(input,textarea,select){font-size:var(--type-body)}
.l-main :is(button,.button,.read-more),.l-header .app-link{font-size:var(--type-body-small)}
@media(max-width:760px){
 .shell .primary-nav .tab{font-size:.75rem;line-height:1.4;min-height:64px;white-space:normal;padding-inline:2px}
 .shell .primary-nav .tab>span{white-space:normal;word-break:keep-all;overflow-wrap:anywhere}
 .shell .primary-nav .tab svg{width:22px;height:22px}
 .shell .primary-nav{align-items:stretch}
 .shell{padding-bottom:calc(104px + env(safe-area-inset-bottom))}
 html{scroll-padding-bottom:112px}
 .shell .shortcuts-list .shortcut-link{padding:10px 8px;gap:6px}
 .shell .shortcuts-list{grid-template-columns:repeat(2,minmax(0,1fr))}
 .shell .form-actions{flex-wrap:wrap}
 .shell .quick-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .shell .quick-actions>button{min-width:0;min-height:50px;padding:12px 10px;white-space:normal}
 .shell .ticket{gap:8px;flex-wrap:wrap}
 .shell .summary-metrics>div{flex-wrap:wrap}
 .shell .summary-metrics strong{margin-left:auto}
 .shell .purchase-filters{align-items:stretch}
}
@media(max-width:360px){
 .shell .shortcuts-list .shortcut-link{grid-template-columns:20px minmax(0,1fr);gap:5px}
 .shell .shortcuts-list .shortcut-icon{font-size:18px}
 .shell .result-title{gap:8px}
 #panel-results .result-game-logo{width:56px}
 #official-balls{gap:4px}
 #official-balls .ball{font-size:var(--type-body);flex-basis:calc((100% - 3rem)/7)}
 .shell .official-card .section-heading h3{min-width:0;flex-basis:140px}
 .shell .history-balls{gap:5px;flex-wrap:wrap}
 .shell .history-balls .ball,.shell .history-bonus .ball{width:30px;height:30px;font-size:var(--type-body-small)}
}
.shell #sync-status{font-size:var(--type-caption);line-height:1.65}
.shell .strategy-choice strong{font-size:var(--type-body);line-height:1.5}
.shell .strategy-choice span{font-size:var(--type-caption);line-height:1.6}
.shell .ticket-number-list{grid-template-columns:repeat(auto-fit,minmax(1.8rem,1fr))}
.shell .ticket-number{max-width:2.375rem}
.shell .ticket .balls{flex-wrap:wrap;min-width:0}
.shell .ticket .ball{font-size:var(--type-body);min-width:2em;min-height:2em;flex:none}
@media(max-width:760px){.shell{padding-bottom:calc(7rem + env(safe-area-inset-bottom))}html{scroll-padding-bottom:8rem}}
.shell .official-card .section-heading #official-latest{flex:1 1 10rem;min-width:min(100%,10rem)}
#official-latest .official-round{word-break:keep-all;overflow-wrap:anywhere}
.shell .history-balls,.shell .history-bonus{flex-wrap:wrap;min-width:0}
.shell .history-balls .ball,.shell .history-bonus .ball{min-width:2em;min-height:2em;flex:none}
.l-main h2{font-size:var(--type-title);line-height:1.45}
.l-main .article-body h1{font-size:clamp(1.9375rem,4vw,2.6875rem);line-height:1.4}
.l-main .article-body section h2{font-size:var(--type-page);line-height:1.45}

.shortcuts-dialog :is(button,.shortcut-selected-label){font-size:var(--type-caption);overflow-wrap:anywhere;min-width:0}
.shortcuts-dialog h2{font-size:var(--type-title);line-height:1.4}
/* 4.21.1: keep numbers and first prize together on mobile without smaller type. */
@media(max-width:760px){
 #panel-results>.official-card{padding-block:12px}
 #panel-results #official-balls{margin-block:10px 6px}
 #panel-results #official-detail{margin-block:0 4px}
 #panel-results #latest-detail{margin-block:8px 4px;padding-block:10px;min-height:44px}
 #panel-results #official-checked{margin-top:6px}
 #panel-results #sync-status{margin-block:8px;padding-block:8px}
 #panel-results .official-card>details{margin-block:8px}
}
