/* KBIBLE KO / EN: compact single switch, plus legible mobile home cards.
 * Installed after the existing site styles, does not change other site functions.
 */
.kb-ui-language,
.kb-ui-language.kb-ui-language--header {
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  position:relative;
  inset:auto;
  flex:0 0 auto;
  width:auto;
  min-width:0;
  max-width:none;
  height:auto;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  transform:none;
  z-index:1;
  font-family:system-ui,-apple-system,"Noto Sans KR",sans-serif;
}
.kb-ui-language.kb-ui-language--header {margin-inline:auto .4rem;}
.kb-ui-language button {
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:50px;
  width:auto;
  height:34px;
  min-height:34px;
  padding:5px 10px;
  border-radius:9px;
  border:1px solid color-mix(in srgb, var(--accent,#dfb754) 48%, #777 52%);
  background:color-mix(in srgb, var(--surface,#111a18) 85%, transparent);
  color:var(--text,#f4f4f5);
  box-shadow:none;
  font-family:inherit;
  font-size:13px;
  font-weight:750;
  letter-spacing:0;
  line-height:1;
  white-space:nowrap;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.kb-ui-language button:hover {border-color:var(--accent,#dfb754);background:color-mix(in srgb,var(--accent,#dfb754) 14%,var(--surface,#111a18));}
.kb-ui-language button:focus-visible {outline:2px solid #78bafb;outline-offset:3px;}
.kb-ui-language.kb-ui-language--floating {
  position:fixed;
  z-index:310;
  top:calc(8px + env(safe-area-inset-top,0px));
  right:10px;
  margin:0;
}
/* Both variants work in light and dark themes. */
html[data-mode="light"] .kb-ui-language button,
html[data-color-mode="light"] .kb-ui-language button,
html[data-bible-color-mode="light"] .kb-ui-language button {
  background:#fff;
  color:#202a3b;
  border-color:#b7c3d1;
  box-shadow:0 1px 3px rgba(18,30,50,.06);
}
/* The previous light-mode stylesheet targeted aria-pressed=true; this
 * single action deliberately has aria-pressed=false in either language. */
html[data-mode="light"] body.kb-home-page .kb-ui-language button {
  background:#fff!important;
  color:#202a3b!important;
  border-color:#aebacd!important;
}
@media (max-width:760px) {
  /* Keep the switch IN the header, between the logo and account controls. */
  body.kb-home-page .header .header-inner {
    gap:5px!important;
    flex-wrap:nowrap!important;
    min-width:0;
  }
  body.kb-home-page .header .header-brand {min-width:0;flex:0 1 auto;gap:.45rem;}
  body.kb-home-page .header .header-actions {margin-left:0!important;flex:0 0 auto;gap:4px!important;}
  body.kb-home-page .kb-ui-language.kb-ui-language--header {margin-left:auto;margin-right:2px;}
  body.kb-home-page .header #btnThemeCycle,
  body.kb-home-page .header #btnModeCycle {display:none!important;}
  /* Theme controls remain available in the home page's theme/mode section. */
  body.kb-home-page .header .hdr-register {padding:7px 8px!important;font-size:12px!important;}
  body.kb-home-page .header .hdr-login {padding:6px!important;min-width:36px!important;min-height:36px!important;justify-content:center;}
  body.kb-home-page .header .hdr-login span:last-child {
    position:absolute!important;
    width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;
    overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;
  }
  body.kb-home-page .header .btn-menu {width:36px!important;min-width:36px!important;height:36px!important;}
  .kb-ui-language button {min-width:44px;height:34px;min-height:34px;padding:5px 8px;font-size:12px;}

  /* Every mobile home-service tile occupies a COMPLETE row. */
  body.kb-home-page .services-wrap .svc-grid,
  body.kb-home-page .svc-chapter .svc-grid,
  .kb-home-page .services-wrap .svc-grid,
  .kb-home-page .svc-chapter .svc-grid {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:12px!important;
  }
  body.kb-home-page .services-wrap .svc-card,
  body.kb-home-page .svc-chapter .svc-card {
    width:100%;min-width:0;max-width:100%;
    display:grid;
    grid-template-columns:58px minmax(0,1fr);
    column-gap:14px;
    row-gap:5px;
    align-items:center;
    min-height:0;
    padding:18px 16px!important;
    overflow-wrap:break-word;
    word-break:keep-all;
    white-space:normal!important;
    text-overflow:clip;
  }
  body.kb-home-page .svc-card .svc-icon {
    grid-column:1;grid-row:1 / span 3;
    width:56px;height:56px;
    margin:0;
    font-size:1.65rem;
  }
  body.kb-home-page .svc-card .svc-title {
    grid-column:2;grid-row:1;
    min-width:0;
    margin:0;
    font-size:clamp(1.12rem,4.8vw,1.38rem)!important;
    line-height:1.38!important;
    white-space:normal!important;
    overflow-wrap:break-word!important;
    word-break:keep-all!important;
  }
  body.kb-home-page .svc-card .svc-desc {
    grid-column:2;grid-row:2;
    display:block;
    min-width:0;
    margin:0;
    font-size:clamp(.81rem,3.15vw,.9rem)!important;
    line-height:1.55!important;
    white-space:normal!important;
    word-break:keep-all!important;
    overflow-wrap:anywhere;
  }
  body.kb-home-page .svc-card .svc-arrow {
    grid-column:2;grid-row:3;
    min-width:0;
    margin:2px 0 0;
    font-size:.8rem;
    line-height:1.5;
    white-space:normal!important;
    opacity:1!important;
    transform:none!important;
  }
  body.kb-home-page .svc-card .svc-badge {
    top:10px;right:11px;font-size:.62rem;
  }
  body.kb-home-page .svc-card:has(.svc-badge) .svc-title {padding-right:3.5rem;}
}
@media (max-width:390px) {
  body.kb-home-page .header .header-inner {padding-inline:8px!important;}
  body.kb-home-page .header .header-logo {width:30px;height:30px;}
  body.kb-home-page .header .header-wordmark-top {font-size:1rem;letter-spacing:.035em;}
  body.kb-home-page .header .hdr-register {font-size:11px!important;padding-inline:6px!important;}
  body.kb-home-page .header .btn-menu {min-width:32px!important;width:32px!important;}
  .kb-ui-language button {min-width:42px;padding-inline:7px;font-size:11px;}
}
