/* HSK One responsive shell + touch-stable flashcards, 2026-11-09. */
:root {--hsk-shell-max:2960px;--hsk-shell-gutter:clamp(14px,2.7vw,84px)}
/* One fluid viewport from 320px phones through 21:9 ultrawide monitors. */
body.hsk3-unified #hskWelcome,
body.hsk3-unified #hskLevelHub,
body.hsk3-unified .container {width:min(calc(100% - 2 * var(--hsk-shell-gutter)),var(--hsk-shell-max))!important;max-width:var(--hsk-shell-max)!important;margin-inline:auto!important;min-width:0;}
body.hsk3-unified #hskWelcome{padding-top:clamp(20px,2.4vw,46px)}
body.hsk3-unified .topbar{padding-inline:max(var(--hsk-shell-gutter),calc((100vw - var(--hsk-shell-max))/2));}
@media (min-width:1900px){
 body.hsk3-unified #hskWelcome .hx-hero{min-height:clamp(400px,22vw,590px)}
 body.hsk3-unified #hskWelcome .hx-hero h1{font-size:clamp(61px,4.25vw,96px)}
 body.hsk3-unified #hskWelcome .hx-hero-copy{padding:clamp(42px,3.2vw,95px)}
 body.hsk3-unified #hskWelcome .hx-level-grid{grid-template-columns:repeat(7,minmax(0,1fr));gap:clamp(12px,.8vw,20px)}
 body.hsk3-unified #hskWelcome .hx-level-card{min-height:210px;padding:clamp(17px,1.2vw,27px)}
 body.hsk3-unified #hskWelcome .hx-how{grid-template-columns:.62fr 1.4fr}
}
@media (min-width:2800px){
 body.hsk3-unified #hskWelcome .hx-hero{min-height:555px}
 body.hsk3-unified #hskWelcome .hx-hero p{font-size:19px;max-width:820px}
 body.hsk3-unified #hskWelcome .hx-level-card strong{font-size:29px}
}
/* Let the native selector show the complete option label, including its descenders. */
body.hsk3-unified .hsk3-shell .flash-side-controls select,
body.hsk3-unified #hskLevelHub .lh-studio-parity .flash-head select {
 box-sizing:border-box!important;display:block!important;width:100%!important;min-width:0!important;
 height:50px!important;min-height:50px!important;max-height:none!important;
 padding:0 38px 0 13px!important;line-height:normal!important;
 font-size:15px!important;font-weight:700!important;letter-spacing:normal!important;
 appearance:none;-webkit-appearance:none;-moz-appearance:none;
 white-space:nowrap;text-overflow:ellipsis;overflow:hidden;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2387aaa6' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;
 background-repeat:no-repeat!important;background-position:right 12px center!important;background-size:17px!important;
}
/* Avoid 2 narrow dropdowns on a 320-600px screen. */
@media (max-width:700px){
 :root{--hsk-shell-gutter:14px}
 body.hsk3-unified .hsk3-shell .flash-side-controls .controls:first-child,
 body.hsk3-unified #hskLevelHub .lh-studio-parity .flash-side-controls .controls:first-child{
  grid-template-columns:minmax(0,1fr)!important;gap:12px!important;
 }
 body.hsk3-unified .hsk3-shell .flash-side-controls label.smalllabel{width:100%!important;min-width:0!important;display:block!important}
 body.hsk3-unified .hsk3-shell .flash-full .flash-head{height:auto!important;min-height:0!important}
 /* The example grows with its content. Scroll the *page*, never the flashcard interior. */
 body.hsk3-unified #app .flash-full,
 body.hsk3-unified #hskLevelHub .lh-studio-parity{min-height:0!important;height:auto!important;align-items:start!important}
 body.hsk3-unified #app .flash-full .flash-shell,
 body.hsk3-unified #hskLevelHub .lh-studio-parity .flash-shell{min-height:0!important;height:auto!important;overflow:visible!important;}
 body.hsk3-unified #app .flash-full .flash-stage,
 body.hsk3-unified #hskLevelHub .lh-studio-parity .flash-stage{flex:0 0 auto!important;min-height:0!important;height:auto!important;overflow:visible!important;}
 body.hsk3-unified #app .flash-full .study-card,
 body.hsk3-unified #hskLevelHub .lh-studio-parity .study-card{
  height:auto!important;min-height:295px!important;max-height:none!important;overflow:visible!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;
  justify-content:center!important;position:relative;touch-action:pan-y;overscroll-behavior:auto;
  padding:68px 14px 24px!important;transform:none!important;transition:none!important;
 }
 body.hsk3-unified #app .flash-full .hsk3-flash-content,
 body.hsk3-unified #hskLevelHub .lh-studio-parity .hsk3-flash-content{
  height:auto!important;max-height:none!important;overflow:visible!important;
  width:100%!important;padding:14px 0!important;min-width:0!important;flex:0 0 auto!important;
 }
 body.hsk3-unified #app .flash-full .study-card:active,
 body.hsk3-unified #hskLevelHub .lh-studio-parity .study-card:active{transform:none!important}
 body.hsk3-unified .hsk3-shell .hsk3-word-example,
 body.hsk3-unified #hskLevelHub .lh-shared-example{
  width:100%!important;max-width:100%!important;overflow:visible!important;
  margin:14px auto 4px!important;padding:14px 11px!important;min-width:0!important;
 }
 body.hsk3-unified .hsk3-shell .hsk3-word-example *{overflow-wrap:anywhere}
 body.hsk3-unified .hsk3-shell .hsk3-word-example .example-pinyin,
 body.hsk3-unified .hsk3-shell .hsk3-word-example .example-english{max-width:100%;overflow-wrap:anywhere}
 body.hsk3-unified #hskLevelHub .lh-studio-parity .flash-deck-note{max-height:none!important;overflow:visible!important}
 body.hsk3-unified .hsk3-shell .flash-card-toolbar{left:12px!important;right:12px!important;top:12px!important;max-width:calc(100% - 24px)!important}
 body.hsk3-unified #hskLevelHub .lh-studio-parity .flash-btns,
 body.hsk3-unified #app .flash-full .flash-btns{margin-top:12px}
 body.hsk3-unified .hsk3-shell .flash-full .front-main,
 body.hsk3-unified .hsk3-shell .flash-full .back-main{overflow-wrap:anywhere;max-width:100%}
}
@media (max-width:390px){
 body.hsk3-unified #hskLevelHub .lh-studio-parity .flash-head,
 body.hsk3-unified #app .flash-full .flash-head{padding:14px!important}
 body.hsk3-unified #hskLevelHub .lh-studio-parity .flash-shell,
 body.hsk3-unified #app .flash-full .flash-shell{padding:11px!important}
 body.hsk3-unified #hskLevelHub .lh-studio-parity .study-card,
 body.hsk3-unified #app .flash-full .study-card{padding:68px 10px 22px!important}
}
@media(prefers-reduced-motion:reduce){body.hsk3-unified .hsk3-shell .study-card,body.hsk3-unified .hsk3-shell .hsk3-flash-content{transition:none!important;animation:none!important}}
/* The original HSK 4 flash deck is a fixed fullscreen overlay on desktop.
   A fixed/overflow-hidden overlay on mobile traps the revealed example and
   blocks document scrolling. Let the phone layout participate in normal flow. */
@media (max-width:700px){
 body.hsk3-unified #app .flash-full{
  position:relative!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;
  inset:auto!important;width:100%!important;max-width:100%!important;max-height:none!important;
  height:auto!important;min-height:0!important;overflow:visible!important;
  padding:0!important;margin:0!important;z-index:auto!important;transform:none!important;
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;
 }
 body.hsk3-unified #app:has(>.flash-full),body.hsk3-unified #app:has(.flash-full){min-height:100dvh!important;overflow:visible!important}
 body.hsk3-unified #app .flash-full .flash-stage .stage-glow{pointer-events:none}
}
@media(max-width:700px){
 /* Classic's old `.controls {display:flex}` ignored grid-template-columns and
    squeezed the labels to half width. Explicit grid fixes the native truncation. */
 body.hsk3-unified #app .flash-full .flash-side-controls .controls:first-child,
 body.hsk3-unified #hskLevelHub .lh-studio-parity .flash-side-controls .controls:first-child{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:stretch!important;
 }
}
