/* KS-MOBILE-INTERNAL-SURFACES: preserve the existing desktop and Home layouts. */
@layer ksMobileInternalSurfaces {
 @media (max-width:780px) {
  .app[data-ks-mobile-route]:is([data-ks-mobile-route="references"],[data-ks-mobile-route="ranking"],[data-ks-mobile-route="my-dictionary"]):not([data-page="home"]) {
   --ks-mobile-page-inset:16px;
  }
  .app[data-ks-mobile-route]:is([data-ks-mobile-route="references"],[data-ks-mobile-route="ranking"],[data-ks-mobile-route="my-dictionary"]):not([data-page="home"])>.main {
   display:block!important;
   box-sizing:border-box!important;width:auto!important;min-width:0!important;max-width:none!important;
   margin:var(--ks-mobile-page-inset)!important;padding:0!important;
   background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;
   min-height:0!important;height:auto!important;overflow:visible!important;
  }
  .app[data-ks-mobile-route]:is([data-ks-mobile-route="references"],[data-ks-mobile-route="ranking"],[data-ks-mobile-route="my-dictionary"]):not([data-page="home"]) :is(#main-content,#view) {
   background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;
   width:100%!important;max-width:none!important;min-width:0!important;min-height:0!important;
   margin:0!important;padding:0!important;height:auto!important;overflow:visible!important;
  }
  .app[data-ks-mobile-route]:is([data-ks-mobile-route="references"],[data-ks-mobile-route="ranking"],[data-ks-mobile-route="my-dictionary"]):not([data-page="home"]) #studio-topbar:not([hidden]) {
   display:flex!important;flex-flow:row nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;
   width:100%!important;min-width:0!important;max-width:none!important;min-height:48px!important;height:auto!important;
   margin:0 0 12px!important;padding:0 4px!important;box-sizing:border-box!important;
   background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;
   color:#e5f4ff!important;
  }
  .app[data-ks-mobile-route]:is([data-ks-mobile-route="references"],[data-ks-mobile-route="ranking"],[data-ks-mobile-route="my-dictionary"]) #studio-topbar>.ks-area-title {display:none!important}
  .app[data-ks-mobile-route]:is([data-ks-mobile-route="references"],[data-ks-mobile-route="ranking"],[data-ks-mobile-route="my-dictionary"]) #studio-topbar .mobile-menu {
   flex:0 0 44px!important;width:44px!important;height:44px!important;min-width:44px!important;
   margin:0!important;align-self:center!important;
  }
  .app[data-ks-mobile-route]:is([data-ks-mobile-route="references"],[data-ks-mobile-route="ranking"],[data-ks-mobile-route="my-dictionary"]) #studio-topbar :is(.breadcrumb,#studio-breadcrumb) {
   flex:1 1 auto!important;display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:5px!important;
   min-width:0!important;max-width:none!important;margin:0!important;padding:0!important;
   background:transparent!important;border:0!important;color:#e5f4ff!important;
   font-size:clamp(12px,3.4vw,14px)!important;line-height:1.4!important;
  }
  .app[data-ks-mobile-route]:is([data-ks-mobile-route="references"],[data-ks-mobile-route="ranking"],[data-ks-mobile-route="my-dictionary"]) #studio-topbar :is(.breadcrumb,#studio-breadcrumb) :is(a,span,strong,b) {
   color:inherit!important;opacity:1!important;white-space:normal!important;overflow-wrap:anywhere!important;
  }
  .app[data-ks-mobile-route]:is([data-ks-mobile-route="references"],[data-ks-mobile-route="ranking"],[data-ks-mobile-route="my-dictionary"]) #studio-topbar .ks-notification-trigger {
   margin:0 0 0 auto!important;flex:none!important;color:#e5f4ff!important;
  }
  .app[data-ks-mobile-route] #studio-topbar .ks-notification-trigger[hidden]{display:none!important}
  /* One actual page surface, rather than a white panel inside a bordered shell. */
  .app[data-ks-mobile-route]:is([data-ks-mobile-route="references"],[data-ks-mobile-route="ranking"],[data-ks-mobile-route="my-dictionary"]):not([data-page="home"]) #view>.korean-panel {
   display:block!important;box-sizing:border-box!important;width:100%!important;max-width:none!important;min-width:0!important;
   margin:0!important;padding:18px!important;min-height:0!important;height:auto!important;
   border:0!important;border-radius:20px!important;box-shadow:none!important;
   background:var(--ks-t-paper,var(--kv-surface,#fff))!important;
   color:var(--ks-t-text,var(--kv-text,#172c41))!important;overflow:visible!important;
  }
  .app[data-ks-mobile-route="references"] #view>.korean-panel>h1 {
   margin:0 0 20px!important;padding:0!important;font-size:24px!important;line-height:1.25!important;
  }
  .app[data-ks-mobile-route="references"] #view .ks-reference-grid{
   display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;
   width:100%!important;margin:0!important;padding:0!important;min-width:0!important;
  }
  .app[data-ks-mobile-route="references"] #view .ks-reference-grid>a{
   display:block!important;box-sizing:border-box!important;min-height:0!important;height:auto!important;
   width:100%!important;min-width:0!important;margin:0!important;padding:16px!important;border-radius:16px!important;
  }
  .app[data-ks-mobile-route="references"] #view .ks-reference-grid>a>h2{
   font-size:18px!important;line-height:1.35!important;margin:0 0 10px!important;
  }
  .app[data-ks-mobile-route="references"] #view .ks-reference-grid>a>p{
   font-size:14px!important;line-height:1.55!important;margin:0!important;overflow-wrap:anywhere!important;
  }
  /* Dictionary is a service page, not an exercise with nested paper/card gutters. */
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-edition,
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-services,
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-service-card{
   display:block!important;box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:none!important;
   margin:0!important;padding:0!important;height:auto!important;min-height:0!important;
   background:transparent!important;box-shadow:none!important;border:0!important;border-radius:0!important;
  }
  .app[data-ks-mobile-route="my-dictionary"] #view .sample-index-heading{
   margin:0 0 16px!important;padding:0!important;
  }
  .app[data-ks-mobile-route="my-dictionary"] #view .sample-index-heading h1{
   font-size:24px!important;line-height:1.25!important;margin:0!important;
  }
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-service-card>h2{
   font-size:20px!important;line-height:1.35!important;margin:0 0 14px!important;
  }
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-invite{
   display:grid!important;grid-template-columns:64px minmax(0,1fr)!important;gap:10px 12px!important;align-items:center!important;
   box-sizing:border-box!important;margin:0!important;padding:14px!important;width:100%!important;min-width:0!important;
   border-radius:16px!important;min-height:0!important;
  }
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-invite>div{display:contents!important}
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-invite>picture{grid-area:1/1;width:64px!important;min-width:0!important}
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-invite img{width:64px!important;height:64px!important;border-radius:12px!important;object-fit:cover!important}
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-invite h2{grid-area:1/2;font-size:19px!important;line-height:1.25!important;margin:0!important}
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-invite p{grid-column:1/-1;font-size:14px!important;line-height:1.55!important;margin:0!important;max-width:none!important}
  .app[data-ks-mobile-route="my-dictionary"] #view .ks-invite .ks-guest-action{grid-column:1/-1;min-width:0!important;width:100%!important;min-height:44px!important;font-size:14px!important;line-height:1.35!important;margin:2px 0 0!important;padding:10px!important;text-align:center!important}
  html[data-ks-dark] .app[data-ks-mobile-route="my-dictionary"] #view .ks-invite{background:var(--ks-t-paper,#19344c)!important;color:var(--ks-t-text,#e5f4ff)!important}
 }
 @media (max-width:1130px) {
  /* Rules are plain readable content after the rating list. No nested scroll or false accordion affordance. */
  #view>.ks-ranking-shell>.ks-ranking-rules {
   display:block!important;margin:20px 0 0!important;padding:20px 0 0!important;
   border:0!important;border-top:1px solid var(--ks-t-edge,var(--kv-rim,#bdcfdc))!important;
   border-radius:0!important;box-shadow:none!important;background:transparent!important;
   width:100%!important;max-height:none!important;overflow:visible!important;
  }
  #view>.ks-ranking-shell>.ks-ranking-rules .ks-ranking-rules-title{display:block!important;cursor:default!important;margin:0 0 12px!important}
  #view>.ks-ranking-shell>.ks-ranking-rules .ks-ranking-rules-title::after{content:none!important;display:none!important}
  #view>.ks-ranking-shell>.ks-ranking-rules .ks-ranking-rules-body{display:block!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important}
 }
}

/* KS-DICTIONARY-MOBILE-20261205: independent content cards, one outer scroll. */
@layer ksMobileInternalSurfaces {
 @media(max-width:780px){
  html .app[data-ks-mobile-route="my-dictionary"]:not([data-page="home"]) #view>.ks-dictionary-frame-panel:has(iframe[data-ks-dictionary-frame]){
   padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;min-height:0!important;height:auto!important;
  }
  html .app[data-ks-mobile-route="my-dictionary"] #view .ks-dictionary-frame-panel :is(.ks-edition,.sample-layout,.exercise-studio,.sample-list,.workbook-practice){
   background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;margin:0!important;padding:0!important;min-height:0!important;height:auto!important;
  }
  html .app[data-ks-mobile-route="my-dictionary"] #view .ks-dictionary-frame-panel .sample-index-heading h1{color:#e5f4ff!important}
  html .app[data-ks-mobile-route="my-dictionary"] #view .ks-dictionary-frame-panel:has(iframe[data-ks-dictionary-view="training"],iframe[data-ks-dictionary-view="detail"]) .sample-index-heading{display:none!important}
  html .app[data-ks-mobile-route="my-dictionary"] #view iframe[data-ks-dictionary-frame]{width:100%!important;min-height:0!important;max-height:none!important;border:0!important;border-radius:0!important;background:transparent!important;display:block!important}
 }
}
.ks-dictionary-frame-error{padding:20px;border-radius:20px;background:var(--ks-t-paper,#fff);color:var(--ks-t-text,#172c41)}
