    @font-face{
      font-family: "GlobalFont";
      src: url("../fonts/globalfont-light.ttf") format("truetype");
      font-weight: 300;
      font-style: normal;
      font-display: swap;
    }
    @font-face{
      font-family: "GlobalFont";
      src: url("../fonts/globalfont-bold.ttf") format("truetype");
      font-weight: 700;
      font-style: normal;
      font-display: swap;
    }

    :root{
      --size: 30px;
      --gap: 6px;
      --pad: 14px;
      --line: rgba(0,0,0,.08);
      --ink: #111;
      --bg: #fff;
      --label-font: "GlobalFont", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
      --topbar-h: 56px;
    }

    html,body{height:100%;}
body{
      margin:0;
      padding:0;
      font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
      background:var(--bg);
      color:var(--ink);

      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
    }


header{
      position: fixed;
      top: var(--topbar-h);
      left: 0;
      right: 0;
      z-index: 1000;

      background: #fff;

      backdrop-filter: blur(6px);
      border-bottom: 1px solid var(--line);
      padding: 10px var(--pad);
      display:flex;
      flex-direction:column;
      gap:10px;
    }


    /* ===== Header rows (clean left→right) ===== */
    .row1,
    .row2,
    .row3{
      display:flex;
      gap:10px;
      align-items:center;
      flex-wrap:wrap;
      width:100%;
    }

    /* Row 1 */
    .row1{ justify-content:flex-start; }
    .row1 .scope-toggle{ margin-left:auto; }

    /* Row 2 */
    .row2{ justify-content:flex-start; }
    .row2 .flipwrap{
      flex: 1 1 260px;
      min-width: 200px;
      overflow: visible;
    }
    .row2 .flipopen{
      width:100%;
      max-width:none;
      min-width:0;
    }
    .row2 .cjkvar{ margin-left:auto; }

    /* Row 3 */
    .row3{ justify-content:flex-start; }
    .row3 .metaCountWrap{ margin-left:auto; }
    #userFontWrap,
    #lexEmbedToggle{
      display: none !important;
    }


input[type="search"]{
      /* neutralize native search styling (Android/iOS) */
      -webkit-appearance: none;
      appearance: none;

      flex: 1 1 320px;
      min-width: 220px;

      /* force stable “one-line” field height */
      height: 34px;
      line-height: 34px;
      padding: 0 10px;

      border: 1px solid var(--line);
      border-radius: 10px;
      font-size: 14px;

      outline: none;
      box-sizing: border-box;
    }

    input[type="search"]:focus{ border-color: rgba(0,0,0,.25); }
    input[type="search"]::-webkit-search-cancel-button{
      -webkit-appearance: none;
      appearance: none;
      display: none;
      width: 0; height: 0; margin: 0;
    }


    .rowMeta{
      display:flex;
      gap:10px;
      align-items:center;
      justify-content:space-between;
      flex-wrap:wrap;
      font-size:12px;
      opacity:.78;
    }
    .metaTitle{
      font-family: var(--label-font);
      font-weight: 700;
      letter-spacing:.2px;
      opacity:.9;
    }
    .metaCountWrap{
      display:inline-flex;
      align-items:center;
      gap:6px;
    }
    .metaCountBtns{
      display:inline-flex;
      align-items:center;
      gap:4px;
    }
    body.lex-welcome .metaCountBtns{
      display:none;
    }
    body.lex-welcome[data-power="1"] .metaCountBtns{
      display:inline-flex;
    }
    body.lex-welcome #q{
      display:none;
    }
    body.lex-welcome[data-power="1"] #q{
      display:block;
    }
    .metaCount{
      font-family: var(--label-font);
      font-weight: 700;
      opacity:.85;
      white-space:nowrap;
    }
    .metaCountBtn{
      appearance:none;
      border: 0;
      background: transparent;
      border-radius: 7px;
      width: 34px;
      height: 34px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      cursor:pointer;
      font-family: var(--label-font);
      font-weight: 700;
      font-size: 14px;
      line-height: 1;
      padding:0;
      background-repeat: no-repeat;
      background-position: center;
      background-size: contain;
      transition: transform .12s ease, opacity .12s ease, background-color .12s ease;
    }
    .metaCountBtnDown{
      width: 30px;
      height: 30px;
      background-image: url("/expose/z_index/glass-.png");
    }
    .metaCountBtnUp{
      width: 40px;
      height: 40px;
      background-image: url("/expose/z_index/glass+.png");
    }
    .metaCountBtn:hover{
      transform: translateY(-2px);
      background-color: transparent;
    }
    .metaCountBtn:focus{ outline:none; border-color: rgba(0,0,0,.25); }

    .lex-hero{
      max-width: 980px;
      width: 70%;
      margin: 0 auto;
      padding: 6px 0 2px;
      font-family: var(--label-font);
    }
    .lex-hero-wrap{
      position: relative;
      width: 100%;
      padding: 18px 0 26px;
      overflow: hidden;
    }
    .lex-hero-bg{
      position: fixed;
      inset: calc(var(--topbar-h) + var(--lex-header-h) + 5px) 0 0 0;
      display: grid;
      grid-template-columns: repeat(auto-fill, 40px);
      grid-auto-rows: 40px;
      gap: 25px;
      padding: 10px 10px;
      box-sizing: border-box;
      font-size: 40px;
      line-height: 40px;
      color: rgba(0,0,0,.15);
      pointer-events: none;
      user-select: none;
      z-index: 0;
    }
    .lex-deko-glyph{
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
    }
    .lex-deko-pulse{
      animation: lexDekoPulse 2s ease-in-out infinite;
      transform-origin: center;
    }
    @keyframes lexDekoPulse{
      0%{ transform: scale(1); }
      50%{ transform: scale(0); }
      100%{ transform: scale(1); }
    }
    .lex-hero-panel{
      position: relative;
      z-index: 1;
      width: 50vw;
      max-width: 980px;
      min-width: 360px;
      margin: 0 auto;
      padding: 18px 18px;
      box-sizing: border-box;
      border-radius: 18px;
      border: 1px solid rgba(0,0,0,.08);
      background: rgba(255,255,255,.88);
    }
    .lex-hero-panel .lex-hero,
    .lex-hero-panel .lex-hero-follow,
    .lex-hero-panel .lex-hero-sep{
      width: 100%;
      max-width: none;
    }
    .lex-hero span{ display:block; }
    .lex-hero-dedicated{
      font-weight: 300;
      font-size: 13px;
      line-height: 1.5;
      color: rgba(0,0,0,.55);
      margin: 0 0 18px;
    }
    .lex-hero-title{
      font-weight: 700;
      font-size: 32px;
      line-height: 1.2;
      color: rgba(0,0,0,1);
      margin: 0 0 6px;
    }
    .lex-hero-sub{
      font-weight: 300;
      font-size: 15px;
      line-height: 1.6;
      color: rgba(0,0,0,.65);
      margin: 0 0 22px;
    }
    .lex-hero-lib{
      display: block;
      width: 50px;
      height: 50px;
      margin: 2em 0 0;
    }
    .lex-hero-explore{
      font-weight: 500;
      font-size: 26px;
      line-height: 1.6;
      color: rgba(0,0,0,1);
      margin: 0 0 10px;
    }
    .lex-hero-body{
      font-weight: 300;
      font-size: 15px;
      line-height: 1.7;
      color: rgba(0,0,0,.72);
      margin: 0 0 16px;
    }
    .lex-hero-collapse{
      margin: 12px 0 0;
    }
    .lex-hero-collapse-summary{
      cursor: pointer;
      user-select: none;
      font-family: var(--label-font);
      font-weight: 600;
      font-size: 14.5px;
      color: rgba(0,0,0,.55);
      margin: 6px 0 10px;
    }
    .lex-hero-follow{
      width: 70%;
      max-width: 980px;
      margin: 0 auto;
    }
    .lex-hero-sep{
      width: 70%;
      max-width: 980px;
      margin: 10px auto 16px;
      display: flex;
      gap: 12px;
      align-items: baseline;
      justify-content: flex-start;
      text-align: left;
      font-size: 100px;
      line-height: 1;
      color: rgba(0,0,0,.9);
    }
    .lex-hero-sep-main{
      display: inline-block;
      transform: scaleX(-1);
    }
    .lex-hero-sep-mini{
      display: inline-block;
      font-size: 45px;
      transform: scaleX(-1);
    }

    .tabs{
      width: 100%;
      display:flex;
      flex-wrap:wrap;
      gap:8px;
    }
    .tab{
      appearance:none;
      border: 1px solid var(--line);
      background:#fff;
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 13px;
      cursor:pointer;
      user-select:none;
    }
.tab[aria-selected="true"]{
      border-color: rgba(0,0,0,.35);
      background: rgba(0,0,0,.06);
    }

/* === Emoji Domain Button (left of Unicode World) ======================= */
.emojiBtn{
  appearance:none;
  border: 1px solid var(--line);
  background:#fff;
  border-radius: 9px;
  width: auto;
  padding: 0 10px;
  height: 34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  cursor:pointer;
  flex: 0 0 auto;
  line-height: 1;
  font-family: var(--label-font);
  font-weight: 700;
  font-size: 12px;
}
.emojiBtn:hover{ background: rgba(0, 150, 60, .18); }
.emojiBtn:focus{ outline:none; border-color: rgba(0,0,0,.25); }
.emojiBtn.emoji-active{
  background: rgba(0, 150, 60, .18);
  border-color: rgba(0, 120, 40, .35);
  color: rgba(0, 120, 40, 1);
}
    .emojiBtnGlyph{
      font-size: 18px;
      line-height: 1;
    }
    .flipopen:hover{ background: rgba(0, 150, 60, .18); }
    .powerpill-toggle:hover{ background: rgba(0, 150, 60, .18); }
/* ====================================================================== */


    .subtabs{
      width: 100%;
      display:none;
      flex-wrap:wrap;
      gap:8px;
    }
    .subtabs.show{ display:flex; }
    .subtab{
      appearance:none;
      border: 1px solid var(--line);
      background:#fff;
      border-radius: 999px;
      padding: 5px 9px;
      font-size: 12px;
      cursor:pointer;
      user-select:none;
      opacity:.9;
    }
    .subtab[aria-selected="true"]{
      border-color: rgba(0,0,0,.35);
      background: rgba(0,0,0,.06);
      opacity:1;
    }

:root{ --lex-header-h: 0px; }

body{
      padding-top: calc(var(--topbar-h) + var(--lex-header-h));
}

/* === Topbar (shared with index.php) ==================================== */
.rs-topbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: var(--topbar-h);
      background: #fff;
      background-image: url("/expose/z_index/rainbow2.png");
      background-repeat: no-repeat;
      background-position: center;
      background-size: 100% 100%;
      border-bottom: 0;
      z-index: 1100;
      overflow: hidden;
      transform: translateZ(0);
      font: 14px/1.2 var(--label-font);
}

.rs-topbar-inner {
      width: 100%;
      margin: 0;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 20px;
      box-sizing: border-box;
      position: relative;
      z-index: 1;
}

.rs-topbar::before,
.rs-topbar::after{
      content: "";
      position: absolute;
      inset: 0;
      background-repeat: no-repeat;
      background-position: center;
      background-size: 100% 100%;
      pointer-events: none;
      z-index: 0;
      will-change: opacity;
}
.rs-topbar::before{
      background-image: url("/expose/z_index/rainbow1.png");
      opacity: 1;
      animation: topbar-rainbow-one 20s ease-in-out infinite;
}
.rs-topbar::after{
      background-image: url("/expose/z_index/rainbow3.png");
      opacity: 0;
      animation: topbar-rainbow-three 20s ease-in-out infinite;
}
@keyframes topbar-rainbow-one{
      0%   { opacity: 1; }
      25%  { opacity: 0; }
      50%  { opacity: 0; }
      75%  { opacity: 0; }
      100% { opacity: 1; }
}
@keyframes topbar-rainbow-three{
      0%   { opacity: 0; }
      25%  { opacity: 0; }
      50%  { opacity: 1; }
      75%  { opacity: 0; }
      100% { opacity: 0; }
}

.rs-brand {
      display: inline-flex;
      gap: 10px;
      align-items: baseline;
      font-weight: 400;
      letter-spacing: .02em;
      color: #111;
      text-decoration: none;
}
.rs-brand small { font-weight: 500; opacity: .7; letter-spacing: .03em; }
.fx-brand { display: inline-flex; }
.rs-actions { display: inline-flex; gap: 10px; align-items: center; }

.rs-link {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      height: 34px;
      padding: 0 12px;
      border-radius: 8px;
      text-decoration: none;
      border: 1px solid #e5e7eb;
      color: #111;
      background: #fff;
}
.rs-link:hover { background: #f8f9fb; }

.rs-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      height: 34px;
      padding: 0 14px;
      border-radius: 8px;
      border: 0;
      color: #fff;
      background: #111;
      cursor: pointer;
}
.rs-btn:hover { filter: brightness(1.07); }

.rs-login { position: relative; }
.rs-login > summary {
      list-style: none;
      cursor: pointer;
      user-select: none;
      outline: none;
}
.rs-login > summary::-webkit-details-marker { display: none; }
.rs-login > summary .rs-link { border-color: #e5e7eb; }

.rs-login[open] .rs-panel,
.rs-login:focus-within .rs-panel { display: block; }

.rs-panel {
      position: absolute;
      right: 0;
      top: calc(100% + 8px);
      display: none;
      width: 280px;
      padding: 14px;
      border-radius: 12px;
      background: #fff;
      box-shadow: 0 10px 30px rgba(0,0,0,.10), 0 2px 10px rgba(0,0,0,.06);
      border: 1px solid #eef0f4;
      z-index: 1200;
}
.rs-field { display: grid; gap: 6px; margin-bottom: 10px; }
.rs-field label { font-size: 12px; color: #555; }
.rs-input {
      height: 36px;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      padding: 0 10px;
      font: inherit;
      width: 100%;
}
.rs-input:focus { outline: 2px solid #3b82f6; outline-offset: 2px; border-color: #bfdbfe; }
.rs-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.rs-muted { font-size: 12px; color: #666; text-decoration: none; }
.rs-muted:hover { text-decoration: underline; }

main{padding: 10px var(--pad) 40px;}
    section{
      padding: 12px 0 16px;
      border-bottom: 1px solid var(--line);
    }
    .lex-hero-section{
      border-bottom: 0;
    }

    /* Section header: supports BOTH models */
    .sec-head{
      display:flex;
      align-items:baseline;
      gap:10px;
      font-family: var(--label-font);
      line-height: 1.15;
      margin: 0 0 10px;
    }

    .sec-title{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      align-items:baseline;
    }
    .sec-name{
      font-weight: 700;
      font-size: 15px;
    }
    .sec-info{
      font-weight: 300;
      font-size: 12px;
      opacity: .75;
      white-space: nowrap;
    }
    .sec-uv{
      margin-left:auto;
      font-family: var(--label-font);
      font-weight:700;
      font-size: 11px;
      letter-spacing:.35px;
      padding: 4px 8px;
      border-radius: 999px;
      border: 1px solid rgba(0,0,0,.12);
      background: rgba(0,0,0,.04);
      white-space: nowrap;
    }

    .grid{
      display:flex;
      flex-wrap:wrap;
      gap: var(--gap);
      width:100%;
    }
    .g{
      font-size: var(--size);
      line-height: 1;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      padding: 2px;
      border-radius: 8px;
      user-select:text;
      cursor: default;
      position: relative;
      transition: transform .08s ease, background .08s ease, outline-color .08s ease;
      will-change: transform;
    }
    .g:hover{ transform: translateY(-2px); background: rgba(0,0,0,.06); }

    .g.copied{
      outline: 2px solid rgba(0,0,0,.35);
      background: rgba(0,0,0,.08);
    }

/* Badges komplett deaktivieren (keine schwarzen Info-Zeilen mehr) */
.g .badge,
.g .sbadge{
  display:none !important;
}

    /* Empirical year colors (optional) */
    .g .sbadge.y2010{ background: rgba(122,75,18,.92); }
    .g .sbadge.y2020{ background: rgba(156,122,0,.92); }
    .g .sbadge.y2021{ background: rgba(11,122,58,.92); }


    .status{
      padding: 20px var(--pad);
      font-size: 14px;
      opacity: .8;
    }
    .small{ font-size: 12px; opacity: .7; }

    /* Clipboard window */
    .clipboard{
      position: fixed;
      right: 16px;
      bottom: 16px;
      width: 260px;
      max-width: 80vw;
      max-height: 60vh;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 14px;
      box-shadow: 0 12px 30px rgba(0,0,0,.18);
      z-index: 50;
      display:flex;
      flex-direction:column;
      overflow:hidden;
      font-size: 12px;
    }


    .clipboard-header{
      cursor: move;
      padding: 6px 10px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:8px;
      background: #f8f8f8;
      border-bottom: 1px solid var(--line);
      font-family: var(--label-font);
    }
    .clipboard-title{
      font-weight:700;
      font-size:12px;
      letter-spacing:.4px;
      text-transform:uppercase;
      color: rgba(0, 150, 60, .95);
    }
    .clipboard-body{
      padding: 6px;
      overflow:auto;
      flex: 1 1 auto;
    }
    .clipboard-footer{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      padding: 8px 10px;
      background: #fff;
      border-top: 1px solid rgba(0,0,0,.12);
    }
    .clipboard-grid{
      display:flex;
      flex-wrap:wrap;
      gap: var(--gap);
    }
    .clipboard-empty{
      font-size:11px;
      opacity:.7;
      padding:4px 2px;
    }
    .clipboard-resizer{
      position:static;
      width: var(--size);
      height: var(--size);
      cursor: se-resize;
      border-radius:4px;
      background: transparent;
      border: 0;
      padding: 0;
      display:flex;
      align-items:center;
      justify-content:center;
      font-size: 18px;
      line-height: 1;
      color: rgba(0,0,0,.6);
    }

    [hidden]{ display:none !important; }

    .clipboard-grid .g{ position: relative; }

    .clipboard-delete{
      position: static;
      width: 30px;
      height: 30px;
      border: 0;
      padding: 0;
      background: transparent url("/expose/z_index/delete.png") no-repeat center;
      background-size: contain;
      cursor: pointer;
      opacity: .9;
    }
    .clipboard-delete:hover{ opacity: 1; }
    .clipboard-delete:focus{ outline: none; }
    @keyframes clipPulse{
      0%{ transform: scale(1); opacity:.9; }
      50%{ transform: scale(1.18); opacity:1; }
      100%{ transform: scale(1); opacity:.9; }
    }
    .clipboard-delete[aria-pressed="true"]{
      opacity: 1;
      animation: clipPulse .7s ease-in-out infinite;
    }

    .clipboard-sep{ display:none; }

    @keyframes clipWiggle{
      0%{ transform: rotate(-5deg); }
      50%{ transform: rotate(5deg); }
      100%{ transform: rotate(-5deg); }
    }
    .clipboard.is-delete .clipboard-grid .g{
      animation: clipWiggle .16s ease-in-out infinite;
      transform-origin: 50% 50%;
    }

    /* ===== Flipmenus (no native select) ===== */
    .flipwrap{
      display:flex;
      gap:8px;
      align-items:center;
      flex: 0 0 auto;
      flex-wrap:wrap;
      position: relative;
    }

    .flipopen{
      appearance:none;
      border: 1px solid var(--line);
      background:#fff;
      border-radius: 9px;
      height: 34px;
      padding: 0 10px;
      font-size: 12px;
      cursor:pointer;
      min-width: 190px;
      max-width: 42vw;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:8px;
      font-family: var(--label-font);
      font-weight: 700;
    }
    .flipwrap.flip-active .flipopen{
      background: rgba(0, 150, 60, .18);
      border-color: rgba(0, 120, 40, .35);
      color: rgba(0, 120, 40, 1);
    }

    .flipopen:focus{ outline:none; border-color: rgba(0,0,0,.25); }

    .flipopenLabel{
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }

    .flippanel{
      position:absolute;
      left: 0;
      top: calc(100% + 6px);
      width: min(520px, calc(100vw - 2*var(--pad)));
      max-height: min(56vh, 520px);
      overflow:auto;
      background: rgba(255,255,255,.98);
      border: 1px solid var(--line);
      border-radius: 12px;
      box-shadow: 0 16px 40px rgba(0,0,0,.18);
      z-index: 2000;
      padding: 5px;
    }


    .flipitem{
      width:100%;
      display:flex;
      align-items:center;
      gap:8px;
      padding: 7px 8px;
      border-radius: 10px;
      border: 1px solid transparent;
      background:transparent;
      cursor:pointer;
      text-align:left;
    }

    .flipitem:hover{ background: rgba(0,0,0,.05); }
    .flipitem[aria-selected="true"]{
      border-color: rgba(0,0,0,.18);
      background: rgba(0,0,0,.06);
    }
    .flipitem-disabled{
      opacity: .45;
      text-decoration: line-through;
      cursor: not-allowed;
    }

    .flipsample{
      flex: 0 0 auto;
      font-size: 16px;
      line-height:1;
      width: 40px;
      text-align:center;
      border-radius: 9px;
      padding: 5px 0;
      background: rgba(0,0,0,.04);
      letter-spacing: .5px;
    }


.fliplabel{
      font-family: var(--label-font);
      font-weight: 700;
      font-size: 12px;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

/* ===== User Font Flipmenu (local) ===================================== */
.userfontopen{
  min-width: 170px;
  max-width: 34vw;
}

.userfontpanel{
  width: min(420px, calc(100vw - 2*var(--pad)));
  max-height: min(52vh, 420px);
  overflow: hidden; /* up to 10 items => no scroll; JS toggles overflow when needed */
}

.userfontitem{
  width:100%;
  display:flex;
  align-items:center;
  gap:8px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background:transparent;
  cursor:pointer;
  text-align:left;
}

.userfontitem:hover{ background: rgba(0,0,0,.05); }
.userfontitem[aria-selected="true"]{
  border-color: rgba(0,0,0,.18);
  background: rgba(0,0,0,.06);
}

.userfontlabel{
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--label-font);
  font-weight: 700;
  font-size: 12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.userfontx{
  flex: 0 0 auto;
  appearance:none;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  border-radius: 8px;
  width: 24px;
  height: 24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size: 14px;
  line-height: 1;
  opacity: .75;
}
.userfontx:hover{ background: rgba(0,0,0,.05); opacity: 1; }
/* ====================================================================== */



@media (max-width: 820px){

      /* Mobile: hide meta title + glyph count */
      .rowMeta{
        display:none !important;
      }


   

      /* Row 1 */
      input[type="search"]{
        width: 100%;
        min-width: 0;
        height: 34px;
        line-height: 34px;
        padding: 0 10px;
        box-sizing: border-box;
      }

      /* Mobile: keep the new row layout, but ensure the search field goes full width */
      .row1{ display:flex; flex-wrap:wrap; }
      .row1 input[type="search"]{
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
      }
      .row1 .scope-toggle{
        margin-left: 0;
      }

      .row2{ display:flex; flex-wrap:wrap; }
      .row2 .cjkvar{
        margin-left: 0;
      }

      .row2 .flipwrap{
        flex: 1 1 100%;
        min-width: 0;
      }
      .row2 .flipopen{
        min-width: 0;
        width: 100%;
        max-width: none;
      }



.flipopenLabel{
        max-width: 100%;
      }
      .flippanel{ width: calc(100vw - 2*var(--pad)); }

    }

  
@media (min-width: 1024px){
  header{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    flex-direction: row;
    gap:10px;
  }
  .row1,
  .row2,
  .row3{
    display:inline-flex;
    align-items:center;
    gap:10px;
    width:auto !important;
    flex: 0 0 auto;
    flex-wrap:nowrap;
  }
  .row1{
    flex: 1 1 auto;
    margin-right: auto;
  }
  .row2{
    flex: 0 0 auto;
    margin-left: auto;
  }
  .row3{
    display:none;
  }
  .row1 .scope-toggle,
  .row2 .cjkvar{
    margin-left:0;
  }
  input[type="search"]{
    flex: 0 0 170px;
    min-width: 140px;
    width: 170px;
    height: 34px;
    line-height: 34px;
  }
  .scope-toggle,
  .powerpill,
  .emojiBtn,
  .cjkvar,
  .flipwrap{
    flex: 0 0 auto;
    width: auto;
  }
  .row2 .flipwrap{
    flex: 0 0 auto;
    min-width: 0;
  }
  .row2 .flipopen{
    width: max-content;
    max-width: 200px;
    min-width: 0;
  }
  #flipOpenEast{
    max-width: 240px;
  }
}

/* === Embed-Fonts (Power Mode) ========================================= */
:root{
  --lex-font-stack: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
.g, .glyph, .glyphs, .grid{
  font-family: var(--lex-font-stack, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);
}


#lexFontOverlay{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(1px);
  z-index: 2147483000;
}
#lexFontOverlay[data-on="1"]{ display:flex; }

#lexFontOverlay .box{
  width: min(520px, calc(100vw - 2*var(--pad)));
  min-height: 74px; /* title/subline remain stable */
  padding: 16px 18px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(0,0,0,.10);
  background: #fff;
  display:block;
}

#lexFontOverlay .row{
  display:flex;
  gap: 12px;
  align-items: center;
}


#lexFontOverlay .spin{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.18);
  border-top-color: rgba(0,0,0,.65);
  animation: lexSpin 0.9s linear infinite;
  flex: 0 0 auto;
}


@keyframes lexSpin{
  to { transform: rotate(360deg); }
}

#lexFontOverlay .txt{
  display:flex;
  flex-direction:column;
  gap: 3px;
  min-width: 0;
}

#lexFontOverlay .t{
  font-weight: 700;
  font-size: 14px;
  margin: 0;
  line-height: 18px;   /* fixed line height */
  height: 18px;        /* fixed height => no jiggle */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#lexFontOverlay .s{
  font-size: 13px;
  color: rgba(0,0,0,.6);
  margin: 0;
  line-height: 16px;   /* fixed line height */
  height: 32px;        /* reserve 2 lines => stable height while content changes */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}


/* Powersearch: Cancel button inside overlay */
#lexFontOverlay .btn{
  appearance:none;
  border: 1px solid rgba(0,0,0,.14);
  background: rgba(0,0,0,.06);
  color: rgba(0,0,0,.82);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: var(--label-font);
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  display: none;
  align-self: flex-start;
  margin-top: 10px; /* sits under the subline */
}

#lexFontOverlay[data-cancel="1"] .btn{ display:inline-flex; }
#lexFontOverlay .btn:hover{ background: rgba(0,0,0,.10); }
#lexFontOverlay .btn:focus{ outline:none; border-color: rgba(0,0,0,.30); }


.metaToggle{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(0,0,0,.10);
  font-size: 12px;
  color: rgba(0,0,0,.60);
  user-select: none;
}
.metaToggle input{
  width: 14px;
  height: 14px;
  accent-color: #111;
}
/* ====================================================================== */


  /* Embed-Fonts Toggle */
  .embed-toggle{
    display: inline-flex;
    align-items: center;
    height: 34px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.12);
    background: #fff;
    position: relative;
  }
  .embed-toggle input{
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .embed-btn{
    appearance: none;
    border: 0;
    background: transparent;
    height: 34px;
    padding: 0 10px;
    font-family: var(--label-font);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .2px;
    color: rgba(0,0,0,.55);
    cursor: pointer;
    white-space: nowrap;
  }
.embed-toggle[data-mode="all"] .embed-all{
  background: rgba(0, 150, 60, .18);
  color: rgba(0, 120, 40, 1);
}
.embed-toggle[data-mode="ui"] .embed-ui{
  background: rgba(0, 150, 60, .18);
  color: rgba(0, 120, 40, 1);
}

/* === Powersearch: green pulsing frame on search field =================== */
@keyframes psPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 180, 70, .30); border-color: rgba(0, 180, 70, .45); }
  70%  { box-shadow: 0 0 0 10px rgba(0, 180, 70, 0); border-color: rgba(0, 180, 70, .65); }
  100% { box-shadow: 0 0 0 0 rgba(0, 180, 70, 0); border-color: rgba(0, 180, 70, .45); }
}

body[data-power="1"] input[type="search"]{
  animation: psPulse 1.25s ease-out infinite;
}

/* optional: while building -> slightly faster/stronger */
body[data-power="1"][data-power-building="1"] input[type="search"]{
  animation-duration: .85s;
}

    /* === Eastbar: Flipmenu + JP/KR/SC/TC/HK buttons ==================== */
    .eastbar{
      display:flex;
      align-items:center;
      gap: 8px;
      width: 100%;
      min-width: 0;
    }
    .eastbar .flipwrap{
      flex: 1 1 auto;
      min-width: 0;
    }

    .cjkvar{
      display:inline-flex;
      gap: 6px;
      flex: 0 0 auto;
      align-items:center;
      padding-left: 8px;
      border-left: 1px solid rgba(0,0,0,.10);
    }

    .cjkbtn{
      appearance:none;
      border: 1px solid rgba(0,0,0,.14);
      background: #fff;
      border-radius: 999px;
      padding: 6px 9px;
      font-size: 11px;
      font-family: var(--label-font);
      font-weight: 700;
      letter-spacing: .25px;
      cursor: pointer;
      line-height: 1;
      user-select: none;
      opacity: .95;
    }
    .cjkbtn:hover{ background: rgba(0,0,0,.05); }

    .cjkbtn[aria-pressed="true"]{
      border-color: rgba(0, 120, 40, .35);
      background: rgba(0, 150, 60, .18);
      color: rgba(0, 120, 40, 1);
    }

.cjkbtn:disabled{
      opacity: .35;
      cursor: not-allowed;
    }

/* === Switch feedback: blink only the clicked button ===================== */
@keyframes lexBtnBlink{
  0%   { opacity: 1; }
  50%  { opacity: .45; }
  100% { opacity: 1; }
}

/* applied to the one button that triggered a heavy switch */
.lex-busy{
  animation: lexBtnBlink .55s linear infinite;
}

/* optional: keep it visible even if button hover styles exist */
.lex-busy:hover{
  background: #fff;
}

    @media (max-width: 820px){
      .cjkvar{
        /* mobile: Buttons bleiben sichtbar, aber kompakt */
        padding-left: 6px;
        gap: 5px;
      }
      .cjkbtn{
        padding: 6px 8px;
        font-size: 10.5px;
      }
    }
/* ===== Glyph Info Window (pretty) ===================================== */
#lexInfoPop{
  position: fixed;
  z-index: 2147483200;
  max-width: min(420px, calc(100vw - 24px));
  min-width: 260px;

  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 50px rgba(0,0,0,.18);

  padding: 10px 12px;
  overflow: hidden;

  transform: translateZ(0);
  backdrop-filter: blur(6px);

  /* Ensure tooltip inherits the same active font stack as the grid (incl. BabelStoneHan etc.) */
  font-family: var(--lex-font-stack, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);

  /* CRITICAL: Tooltip must not steal hover/mouse events */
  pointer-events: none;
}



#lexInfoPop[hidden]{ display:none !important; }

#lexInfoPop .lip-head{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin-bottom: 8px;
}

#lexInfoPop .lip-glyph{
  font-size: 68px;
  line-height: 1;
  width: 88px;
  height: 88px;
  border-radius: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family: var(--lex-font-stack, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);
  background: rgba(0,0,0,.04);
  flex: 0 0 auto;

  overflow: hidden; /* IMPORTANT: clip scaled combined emoji inside the rounded box */
}

/* IMPORTANT: transform/scale must apply reliably => inline-block */
#lexInfoPop .lip-glyph .lip-glyph-inner{
  display: inline-block;
  white-space: nowrap;
  transform-origin: center center;
  will-change: transform;
}




#lexInfoPop .lip-main{
  min-width: 0;
  flex: 1 1 auto;
}

#lexInfoPop .lip-name{
  font-family: var(--label-font);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  margin: 0 0 4px;
  color: rgba(0,0,0,.90);
  word-break: break-word;
}



#lexInfoPop .lip-sub{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin: 0;
}

#lexInfoPop .lip-pill{
  font-family: var(--label-font);
  font-weight: 300;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(0,0,0,.78);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Codepoint line: plain text (GlobalFont light), same size as pills */
#lexInfoPop .lip-cp{
  font-family: var(--label-font);
  font-weight: 300;     /* GlobalFont light */
  font-size: 11px;      /* same as pills */
  line-height: 1;
  color: rgba(0,0,0,.78);
  white-space: nowrap;
}


/* Platform support pills (iOS/Android) */
#lexInfoPop .lip-pill[data-support="true"]{
  color: rgba(0,120,0,.95);
}
#lexInfoPop .lip-pill[data-support="false"]{
  color: rgba(180,0,0,.95);
}
#lexInfoPop .lip-pill::after{
  content: "✗";
  color: rgba(180,0,0,.95);
  font-weight: 700;
}
#lexInfoPop .lip-pill[data-support="true"]::after{
  content: "✓";
  color: rgba(0,120,0,.95);
}




#lexInfoPop .lip-grid{
  display:grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,.08);
}

#lexInfoPop .lip-k{
  font-family: var(--label-font);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .2px;
  color: rgba(0,0,0,.55);
  text-transform: uppercase;
}

#lexInfoPop .lip-v{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  font-size: 12.5px;
  color: rgba(0,0,0,.86);
  word-break: break-word;
}

#lexInfoPop .lip-v.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: rgba(0,0,0,.82);
}

#lexInfoPop .lip-v.kdef{
  font-family: var(--label-font);
  font-weight: 700; /* GlobalFont bold */
  color: rgba(0,0,0,.92);
}
/* ====================================================================== */

/* === Runtime-Tofu Styling ============================================= */
.g[data-missing="1"]{
  /* hellrosa */
  background: rgba(255, 192, 203, .35);

  /* 15% Opacity nur fürs Zeichen (nicht fürs ganze Element) */
  color: rgba(0,0,0,.22);

  /* optional: visuelles Signal ohne „Lärm“ */
  outline: 1px solid rgba(255, 105, 180, .25);
}
/* ====================================================================== */



/* ============================================================
   Curated vs Complete Pill Switch (lexSafeOnlyToggle)
   - checked   => Curated (left)
   - unchecked => Complete (right)
   ============================================================ */

:root{
  --pill-h: 40px;
  --pill-w: 230px;
  --pill-r: 999px;
  --pill-pad: 3px;

  --curated: #16a34a;   /* green */
  --complete: #dc2626;  /* red */

  --pill-bg: rgba(17,24,39,.06);
  --pill-border: rgba(17,24,39,.14);
  --pill-ink: rgba(17,24,39,.88);
  --pill-muted: rgba(17,24,39,.55);
}

/* label wrapper aligns like your other toggles */
.scopeSwitch{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

/* hide the real checkbox but keep it accessible */
.scopeSwitch > input{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* pill container */
.scopePill{
  position: relative;
  width: var(--pill-w);
  height: var(--pill-h);
  padding: var(--pill-pad);
  border-radius: var(--pill-r);
  border: 1px solid var(--pill-border);
  background: #fff;
  box-shadow:
    0 1px 0 rgba(0,0,0,.04),
    0 6px 20px rgba(0,0,0,.06);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

/* sides */
.scopeSide{
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  font-family: var(--label-font);
  padding: 2px 6px;
}

.scopeNum{
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .2px;
  color: var(--pill-ink);
}

.scopeLbl{
  margin-top: 2px;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--pill-muted);
}

/* thumb */
.scopeThumb{
  position: absolute;
  z-index: 1;
  top: var(--pill-pad);
  left: var(--pill-pad);
  width: calc(50% - (var(--pill-pad) * 2));
  height: calc(100% - (var(--pill-pad) * 2));
  border-radius: calc(var(--pill-r) - var(--pill-pad));
  background: var(--pill-bg);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.06),
    0 6px 16px rgba(0,0,0,.10);
}

/* checked = curated (left) */
.scopeSwitch > input:checked + .scopePill .scopeThumb{
  transform: translateX(0);
  background: color-mix(in srgb, var(--curated) 18%, #fff);
}

/* unchecked = complete (right) */
.scopeSwitch > input:not(:checked) + .scopePill .scopeThumb{
  transform: translateX(100%);
  background: color-mix(in srgb, var(--complete) 16%, #fff);
}

/* emphasize active side */
.scopeSwitch > input:checked + .scopePill .scopeCurated .scopeNum{ color: var(--curated); }
.scopeSwitch > input:checked + .scopePill .scopeCurated .scopeLbl{ color: var(--curated); }

.scopeSwitch > input:not(:checked) + .scopePill .scopeComplete .scopeNum{ color: var(--complete); }
.scopeSwitch > input:not(:checked) + .scopePill .scopeComplete .scopeLbl{ color: var(--complete); }

/* dim inactive side */
.scopeSwitch > input:checked + .scopePill .scopeComplete .scopeNum{ color: rgba(17,24,39,.45); }
.scopeSwitch > input:checked + .scopePill .scopeComplete .scopeLbl{ color: rgba(17,24,39,.38); }

.scopeSwitch > input:not(:checked) + .scopePill .scopeCurated .scopeNum{ color: rgba(17,24,39,.45); }
.scopeSwitch > input:not(:checked) + .scopePill .scopeCurated .scopeLbl{ color: rgba(17,24,39,.38); }

/* focus ring (keyboard accessibility) */
.scopeSwitch > input:focus-visible + .scopePill{
  outline: 3px solid rgba(37,99,235,.28);
  outline-offset: 2px;
}

/* screen-reader only helper */
.srOnly{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ============================================================
   Embed Fonts Pill Switch (lexEmbedFontsToggle)
   - checked   => VIEW ALL / EMBED (left)
   - unchecked => VIEW UI  / SYSTEM (right)
   IMPORTANT: HTML structure is:
     input + .srOnly + .embedPill
   ============================================================ */

:root{
  --embed-pill-h: 40px;
  --embed-pill-w: 210px;
  --embed-pill-r: 999px;
  --embed-pill-pad: 3px;

  --embed-all: #2563eb;     /* blue */
  --embed-ui:  #111827;     /* dark */

  --embed-bg: rgba(17,24,39,.06);
  --embed-border: rgba(17,24,39,.14);
  --embed-ink: rgba(17,24,39,.88);
  --embed-muted: rgba(17,24,39,.50);
}

.embedSwitch{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.embedSwitch > input{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.embedPill{
  position: relative;
  width: var(--embed-pill-w);
  height: var(--embed-pill-h);
  padding: var(--embed-pill-pad);
  border-radius: var(--embed-pill-r);
  border: 1px solid var(--embed-border);
  background: #fff;
  box-shadow:
    0 1px 0 rgba(0,0,0,.04),
    0 6px 20px rgba(0,0,0,.06);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.embedSide{
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  font-family: var(--label-font);
  padding: 2px 6px;
}

.embedNum{
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: .2px;
  color: var(--embed-ink);
}

.embedLbl{
  margin-top: 2px;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--embed-muted);
}

.embedThumb{
  position: absolute;
  z-index: 1;
  top: var(--embed-pill-pad);
  left: var(--embed-pill-pad);
  width: calc(50% - (var(--embed-pill-pad) * 2));
  height: calc(100% - (var(--embed-pill-pad) * 2));
  border-radius: calc(var(--embed-pill-r) - var(--embed-pill-pad));
  background: var(--embed-bg);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.06),
    0 6px 16px rgba(0,0,0,.10);
}

/* checked = VIEW ALL (left) */
.embedSwitch > input:checked + .srOnly + .embedPill .embedThumb{
  transform: translateX(0);
  background: color-mix(in srgb, var(--embed-all) 16%, #fff);
}

/* unchecked = VIEW UI (right) */
.embedSwitch > input:not(:checked) + .srOnly + .embedPill .embedThumb{
  transform: translateX(100%);
  background: color-mix(in srgb, var(--embed-ui) 10%, #fff);
}

/* emphasize active side */
.embedSwitch > input:checked + .srOnly + .embedPill .embedAll .embedNum,
.embedSwitch > input:checked + .srOnly + .embedPill .embedAll .embedLbl{
  color: var(--embed-all);
}

.embedSwitch > input:not(:checked) + .srOnly + .embedPill .embedUi .embedNum,
.embedSwitch > input:not(:checked) + .srOnly + .embedPill .embedUi .embedLbl{
  color: var(--embed-ui);
}

/* dim inactive side */
.embedSwitch > input:checked + .srOnly + .embedPill .embedUi .embedNum,
.embedSwitch > input:checked + .srOnly + .embedPill .embedUi .embedLbl{
  color: rgba(17,24,39,.40);
}

.embedSwitch > input:not(:checked) + .srOnly + .embedPill .embedAll .embedNum,
.embedSwitch > input:not(:checked) + .srOnly + .embedPill .embedAll .embedLbl{
  color: rgba(17,24,39,.40);
}

/* focus ring */
.embedSwitch > input:focus-visible + .srOnly + .embedPill{
  outline: 3px solid rgba(37,99,235,.28);
  outline-offset: 2px;
}

/* Make pill toggles feel iOS-like on touch */
label.toggle{
  touch-action: pan-y;        /* allow vertical scroll, keep horizontal gestures for us */
  -webkit-tap-highlight-color: transparent;
}
label.toggle input{
  touch-action: pan-y;
}

/* ============================================================
   Powersearch: green pill + attached scope select
   ============================================================ */

.powerpill{
  display: inline-flex;
  align-items: center;
  height: 34px;
  border-radius: 9px;
  overflow: visible;                /* allow dropdown panel to render */
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.85);
  gap: 0;                           /* bewusst: keine Lücke */
}

/* Left segment: the toggle pill */
.powerpill-toggle{
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  cursor: pointer;
  user-select: none;
  background: rgba(37, 99, 235, .16);     /* soft blue */
  border-right: 1px solid rgba(0,0,0,.10);
  border-radius: 9px 0 0 9px;
}

.powerpill-toggle input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.powerpill-label{
  font-family: var(--label-font);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .2px;
  color: rgba(18, 55, 140, 1);
  white-space: nowrap;
}

/* Toggle ON state: stronger green */
.powerpill.is-on .powerpill-toggle{
  background: rgba(0, 150, 60, .18);
}
.powerpill.is-on .powerpill-label{
  color: rgba(0, 120, 40, 1);
}

.powerpill-toggle input:checked ~ .powerpill-label{
  /* no-op; kept for safety if you ever change markup */
}

/* Use the label background to signal ON (no :has needed) */
.powerpill-toggle input:checked + .powerpill-label{
  /* text only; background stays on label wrapper below */
}
.powerpill-toggle:focus-within{
  outline: none;
}

/* We change wrapper background via an attribute hook from JS (optional),
   but we can also do it only via the label segment: */
.powerpill-toggle input:checked + .powerpill-label{
  /* nothing else needed */
}

/* Right segment: select */
.powerpill-scope{
  display: inline-flex;
  align-items: center;
  height: 34px;
  margin: 0;
  padding: 0;
  background: rgba(255,255,255,.7);
  border-radius: 0 9px 9px 0;
}

.powerpill-btn{
  height: 34px;
  border: 0;
  background: transparent;
  padding: 0 24px 0 10px;
  font-family: var(--label-font);
  font-weight: 800;
  font-size: 12px;
  color: rgba(0,0,0,.72);
  cursor: pointer;
  outline: none;
  appearance: none;
}

/* subtle caret (optional, pure CSS) */
.powerpill-scope{
  position: relative;
}
.powerpill-scope::after{
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: rgba(0,0,0,.55);
  pointer-events: none;
}
.powerpill-panel{
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: rgba(255,255,255,.98);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  padding: 6px;
  z-index: 200;
}
.powerpill-item{
  width: 100%;
  height: 32px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  padding: 0 8px;
  font-family: var(--label-font);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.powerpill-item:hover{
  color: rgba(0,0,0,.55);
}
.powerpill-item[aria-selected="true"]{
  border-color: rgba(0, 120, 40, .35);
  background: rgba(0, 150, 60, .18);
  color: rgba(0, 120, 40, 1);
}

/* Focus ring for the whole group when interacting */
.powerpill:focus-within{
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
  border-color: rgba(37, 99, 235, .35);
}

/* Optional: make ON state more obvious by tinting the LEFT segment background */
.powerpill-toggle input:checked{
  /* cannot style parent directly without :has, so we tint via label wrapper: */
}
.powerpill-toggle input:checked + .powerpill-label{
  /* still text only; tint is done on the segment itself via a class if desired */
}

/* Optional small improvement: if you want ON tint without :has,
   add class "is-on" on .powerpill from JS. */
.powerpill.is-on .powerpill-toggle{
  background: rgba(0, 150, 60, .18);
}
/* ============================================================
   Scope Toggle (SAFE / GLOBAL)
   ============================================================ */
.scope-toggle{
  display: inline-flex;
  align-items: center;
  height: 34px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  position: relative;
}
.scope-toggle input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.scope-btn{
  appearance: none;
  border: 0;
  background: transparent;
  height: 34px;
  padding: 0 10px;
  font-family: var(--label-font);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .2px;
  color: rgba(0,0,0,.55);
  cursor: pointer;
  white-space: nowrap;
}
.scope-toggle[data-mode="safe"] .scope-global:hover{
  background: rgba(0, 150, 60, .18);
}
.scope-toggle[data-mode="global"] .scope-safe:hover{
  background: rgba(0, 150, 60, .18);
}
.scope-toggle[data-mode="safe"] .scope-safe{
  background: rgba(0, 150, 60, .18);
  color: rgba(0, 120, 40, 1);
}
.scope-toggle[data-mode="global"] .scope-global{
  background: rgba(0, 150, 60, .18);
  color: rgba(0, 120, 40, 1);
}
/* === Glyph Info Pop: spacing between CP line and support pills === */
#lexInfoPop .lip-main .lip-sub.lip-sub-ios{
  margin-top: 4px;
}
#lexInfoPop .lip-main .lip-sub.lip-sub-android{
  margin-top: 4px;
}

/* === LIP: Pills unten bündig, CP->iOS exakt 4px ======================= */

/* Container soll beide Spalten auf gleiche Höhe ziehen (Glyph bestimmt Höhe) */
.lip-head{
  align-items: stretch;
}

/* Rechte Spalte als Column, damit wir die Pills nach unten drücken können */
.lip-head .lip-main{
  display: flex;
  flex-direction: column;
}

/* Pills-Gruppe: nach unten drücken + oben 4px Abstand zur CP-Zeile */
.lip-head .lip-main .lip-pills{
  margin-top: auto;
  padding-top: 7px;    /* CP -> iOS exakt 4px (auch wenn auto-space=0) */
  display: flex;
  flex-direction: column;
  gap: 4px;            /* iOS -> Android ebenfalls 4px */
}

/* Falls <p> standardmäßig Margins hat: neutralisieren, damit 4px exakt bleibt */
.lip-head .lip-main .lip-pills .lip-sub{
  margin: 0;
}
