  :root{
    --bg:#FBF7F0;
    --card:#FFFFFF;
    --ink:#22304A;
    --ink-soft:#5E6778;
    --line:#ECE4D6;
    --blue:#3A66B0;
    --blue-d:#2B4E8A;
    --blue-tint:#E3EBF7;
    --yellow:#F5D98E;
    --yellow-d:#DDBC62;
    --coral:#B5553F;
    --coral-d:#8A3F2E;
    --coral-tint:#F8E7E0;
    --teal:#2F7A70;
    --teal-d:#225A53;
    --teal-tint:#E0F0EC;
    /* soft pastel fills for the topic tiles */
    --tile-blue:#DDE7F6;   --tile-blue-d:#BCCDE8;
    --tile-yellow:#FAEBC4; --tile-yellow-d:#EBD39A;
    --tile-coral:#F6DDD4;  --tile-coral-d:#E6BFB1;
    --tile-teal:#D6ECE7;   --tile-teal-d:#B3D6CE;
    --display:'Comfortaa',sans-serif;
    --body:'Manrope',sans-serif;
    --radius:22px;
  }
  *{box-sizing:border-box;}
  html{scroll-behavior:smooth;}
  body{
    margin:0;
    background:var(--bg);
    color:var(--ink);
    font-family:var(--body);
    font-weight:500;
    -webkit-font-smoothing:antialiased;
  }
  ::selection{background:var(--yellow);}
  button{font-family:var(--body);}
  .icon{width:1.1em;height:1.1em;display:block;}

  /* --- Header + hero --- */
  .site-header{
    max-width:900px;
    margin:0 auto;
    padding:1.3rem 1.25rem 0;
  }
  .brand-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1rem;
  }
  .brand{
    font-family:var(--display);
    font-weight:700;
    font-size:2rem;
    color:var(--blue);
    letter-spacing:-0.01em;
  }
  .word-total-pill{
    font-weight:800;
    font-size:0.82rem;
    padding:0.45rem 0.8rem;
    border-radius:999px;
    background:var(--card);
    box-shadow:0 3px 0 var(--line);
    white-space:nowrap;
  }
  .hero{
    margin-top:1.1rem;
    background:var(--tile-yellow);
    border-radius:28px;
    padding:1.3rem 1.3rem 1.35rem;
    box-shadow:0 7px 0 var(--tile-yellow-d);
  }
  .hero-title{
    font-family:var(--display);
    font-weight:700;
    font-size:2rem;
    line-height:1.1;
  }
  .hero-sub{
    font-weight:600;
    font-size:0.98rem;
    margin-top:0.4rem;
  }

  /* --- Sticky controls: category pills + search --- */
  .controls{
    position:sticky;
    top:0;
    z-index:20;
    background:var(--bg);
    padding:1rem 1.25rem 0.2rem;
    margin-top:0.6rem;
  }
  .controls-inner{
    max-width:860px;
    margin:0 auto;
  }
  .tabs{
    display:flex;
    gap:0.55rem;
    overflow-x:auto;
    scrollbar-width:none;
    padding:0.15rem 0.1rem 0.6rem;
  }
  .tabs::-webkit-scrollbar{display:none;}
  .tab{
    flex:0 0 auto;
    cursor:pointer;
    min-height:44px;
    padding:0.55rem 1rem;
    font-size:0.92rem;
    font-weight:800;
    color:var(--ink);
    background:var(--card);
    border:none;
    border-radius:999px;
    box-shadow:0 4px 0 var(--line);
    display:flex;
    align-items:center;
    gap:0.45rem;
    white-space:nowrap;
    transition:transform .1s ease, box-shadow .1s ease, background .15s ease;
  }
  .tab .tab-emoji{font-size:1.05rem;}
  .tab:hover{background:#FFFDF8;}
  .tab:active{transform:translateY(3px);box-shadow:0 1px 0 var(--line);}
  .tab.active{
    background:var(--blue);
    color:#fff;
    box-shadow:0 4px 0 var(--blue-d);
  }
  .tab:focus-visible{outline:3px solid var(--yellow);outline-offset:2px;}

  .search-row{
    display:flex;
    align-items:center;
    gap:0.75rem;
    padding:0.5rem 0 0.8rem;
  }
  .search-box{
    position:relative;
    flex:1 1 260px;
    min-width:200px;
  }
  .search-box input{
    width:100%;
    height:50px;
    padding:0 1rem 0 2.8rem;
    border:2px solid transparent;
    background:var(--card);
    border-radius:16px;
    box-shadow:0 4px 0 var(--line);
    font-family:var(--body);
    font-size:1rem;
    font-weight:600;
    color:var(--ink);
  }
  .search-box input::placeholder{color:var(--ink-soft);}
  .search-box input:focus{
    outline:none;
    border-color:var(--blue);
  }
  .search-box .search-icon{
    position:absolute;
    left:1rem;
    top:50%;
    transform:translateY(-50%);
    color:var(--ink-soft);
    width:20px;
    height:20px;
    pointer-events:none;
  }
  main{
    max-width:900px;
    margin:0 auto;
    padding:0.4rem 1.25rem 5rem;
  }

  /* --- Category banner + theme tiles --- */
  .category-count-banner{
    display:flex;
    align-items:center;
    gap:0.6rem;
    padding:0.8rem 0.2rem 1rem;
  }
  .category-count-emoji{
    font-size:1.5rem;
    line-height:1;
  }
  .category-count-text{
    font-family:var(--display);
    font-weight:700;
    font-size:1.25rem;
  }
  .category-count-text strong{
    font-family:var(--body);
    font-weight:800;
    font-size:0.85rem;
    padding:0.25rem 0.6rem;
    border-radius:999px;
    background:var(--card);
    box-shadow:0 3px 0 var(--line);
    margin-left:0.3rem;
    vertical-align:middle;
  }
  .theme-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
    gap:1.1rem 0.9rem;
    padding-bottom:0.5rem;
  }
  .theme-list-item{
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    gap:0.9rem;
    min-height:128px;
    padding:0.95rem 1rem 1rem;
    border-radius:var(--radius);
    background:var(--tile-blue);
    color:var(--ink);
    box-shadow:0 6px 0 var(--tile-blue-d);
    cursor:pointer;
    transition:transform .1s ease, box-shadow .1s ease;
  }
  .theme-list-item.tile-1{background:var(--tile-yellow);box-shadow:0 6px 0 var(--tile-yellow-d);}
  .theme-list-item.tile-2{background:var(--tile-coral);box-shadow:0 6px 0 var(--tile-coral-d);}
  .theme-list-item.tile-3{background:var(--tile-teal);box-shadow:0 6px 0 var(--tile-teal-d);}
  .theme-list-item:hover{transform:translateY(-2px);}
  .theme-list-item:active{transform:translateY(4px);box-shadow:0 2px 0 var(--tile-blue-d);}
  .theme-list-item.tile-1:active{box-shadow:0 2px 0 var(--tile-yellow-d);}
  .theme-list-item.tile-2:active{box-shadow:0 2px 0 var(--tile-coral-d);}
  .theme-list-item.tile-3:active{box-shadow:0 2px 0 var(--tile-teal-d);}
  .theme-list-item:focus-visible{outline:3px solid var(--ink);outline-offset:3px;}
  .theme-tile-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
  }
  .theme-list-emoji{
    font-size:1.5rem;
    line-height:1;
    width:44px;
    height:44px;
    border-radius:14px;
    background:rgba(255,255,255,0.65);
    display:flex;
    align-items:center;
    justify-content:center;
  }
  .theme-list-meta{
    font-weight:800;
    font-size:0.8rem;
    padding:0.25rem 0.6rem;
    border-radius:999px;
    background:rgba(255,255,255,0.65);
  }
  .theme-list-title{
    font-weight:800;
    font-size:1.02rem;
    line-height:1.2;
  }


  /* --- Downloads section --- */
  .dl-intro{margin:0.2rem 0.2rem 1.1rem;color:var(--ink-soft);font-weight:600;line-height:1.5;}
  .dl-list{display:grid;gap:1.2rem;padding-bottom:0.5rem;}
  .dl-card{display:flex;gap:1rem;align-items:flex-start;padding:1.1rem;border-radius:var(--radius);
    background:var(--tile-yellow);box-shadow:0 6px 0 var(--tile-yellow-d);color:var(--ink);}
  .dl-card.tile-1{background:var(--tile-blue);box-shadow:0 6px 0 var(--tile-blue-d);}
  .dl-card.tile-2{background:var(--tile-teal);box-shadow:0 6px 0 var(--tile-teal-d);}
  .dl-card.tile-3{background:var(--tile-coral);box-shadow:0 6px 0 var(--tile-coral-d);}
  .dl-icon{flex:none;width:56px;height:56px;border-radius:16px;background:rgba(255,255,255,0.7);
    display:flex;align-items:center;justify-content:center;font-size:1.7rem;}
  .dl-body{flex:1;min-width:0;}
  .dl-title{font-family:var(--display);font-weight:700;font-size:1.15rem;line-height:1.25;margin:0.1rem 0 0.35rem;}
  .dl-desc{font-size:0.92rem;line-height:1.5;margin:0 0 0.7rem;}
  .dl-meta{display:flex;flex-wrap:wrap;gap:0.4rem;margin-bottom:0.2rem;}
  .dl-chip{font-weight:800;font-size:0.75rem;padding:0.25rem 0.6rem;border-radius:999px;background:rgba(255,255,255,0.7);}
  .dl-chip.free{background:var(--teal);color:#fff;}
  .dl-actions{display:flex;flex-wrap:wrap;gap:0.6rem;margin-top:0.85rem;}
  .dl-btn{display:inline-flex;align-items:center;gap:0.45rem;min-height:44px;padding:0.55rem 1.1rem;border-radius:14px;
    font:inherit;font-size:0.9rem;font-weight:800;cursor:pointer;text-decoration:none;border:2px solid transparent;
    transition:transform .1s ease, box-shadow .1s ease;}
  .dl-btn.primary{background:var(--blue);color:#fff;box-shadow:0 4px 0 var(--blue-d);}
  .dl-btn.primary:active{transform:translateY(3px);box-shadow:0 1px 0 var(--blue-d);}
  .dl-btn.secondary{background:var(--card);color:var(--blue);border-color:var(--line);box-shadow:0 4px 0 var(--line);}
  .dl-btn.secondary:hover{border-color:var(--blue);}
  .dl-btn.secondary:active{transform:translateY(3px);box-shadow:0 1px 0 var(--line);}
  .dl-btn:focus-visible{outline:3px solid var(--ink);outline-offset:3px;}
  .dl-btn .icon{width:18px;height:18px;}
  @media (max-width:480px){ .dl-card{flex-direction:column;} }

  /* --- Search results grouped by theme --- */
  .theme-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:0.6rem;
    padding:1.4rem 0.2rem 0.7rem;
  }
  .theme-header:first-child{padding-top:0.4rem;}
  .theme-header span:first-child{
    font-family:var(--display);
    font-weight:700;
    font-size:1.15rem;
  }
  .theme-count{
    font-weight:800;
    font-size:0.8rem;
    padding:0.2rem 0.6rem;
    border-radius:999px;
    background:var(--card);
    box-shadow:0 3px 0 var(--line);
  }

  /* --- Page headers inside the detail view --- */
  .passage-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1rem;
    flex-wrap:wrap;
    padding:0.4rem 0.2rem 1.1rem;
  }
  .passage-title{
    display:flex;
    align-items:center;
    gap:0.8rem;
  }
  .passage-title-gr{
    font-family:var(--display);
    font-weight:700;
    font-size:1.6rem;
    color:var(--ink);
  }
  .passage-title-en{
    font-weight:700;
    font-size:0.88rem;
    color:var(--ink-soft);
    margin-top:0.3rem;
  }
  .grammar-explanation{
    font-size:0.98rem;
    line-height:1.6;
    font-weight:600;
    background:var(--card);
    border-radius:var(--radius);
    box-shadow:0 5px 0 var(--line);
    padding:1rem 1.15rem;
    margin:0 0 1.2rem;
  }
  .grammar-lab-group{
    padding:0.4rem 0 0.8rem;
  }
  .grammar-set-label{
    font-family:var(--display);
    font-weight:700;
    font-size:1.1rem;
    color:var(--teal);
    padding:0.6rem 0.2rem 0.7rem;
  }
  .word-entry.grammar-variant-no-tag{
    grid-template-columns:1fr;
  }

  /* --- Word cards --- */
  .word-entry{
    display:grid;
    grid-template-columns:56px 1fr;
    gap:1rem;
    align-items:start;
    padding:1.15rem 1.15rem 1.2rem 1rem;
    margin-bottom:1rem;
    background:var(--card);
    border-radius:var(--radius);
    box-shadow:0 6px 0 var(--line);
  }
  .word-entry.form-row{
    grid-template-columns:120px 1fr;
  }
  .form-row .word-emoji{
    font-size:0.85rem;
    font-weight:800;
    color:var(--teal);
    text-align:left;
    line-height:1.3;
    padding-top:0.5rem;
  }
  .word-emoji{
    font-size:2.1rem;
    line-height:1;
    text-align:center;
    padding-top:0.2rem;
  }
  .word-main{min-width:0;}
  .word-head{
    display:flex;
    align-items:center;
    gap:0.55rem;
    flex-wrap:wrap;
    margin-bottom:0.2rem;
  }
  .word-gr{
    font-family:var(--display);
    font-weight:700;
    font-size:1.6rem;
    color:var(--blue);
    margin-right:0.15rem;
  }
  /* inline (not inline-block) so a word never gets separated from the
     punctuation touching it, e.g. "γρήγορα" / "." on two lines */
  .word-unit{display:inline;}
  .gr-ex-text .word-unit{
    cursor:pointer;
    border-radius:6px;
    padding:0 0.06em;
    margin:0 -0.06em;
    transition:background .15s ease;
  }
  .gr-ex-text .word-unit:hover{background:var(--blue-tint);}
  .gr-ex-text .word-unit:focus-visible{
    outline:2px solid var(--blue);
    outline-offset:1px;
    background:var(--blue-tint);
  }
  .gr-ex-text .word-unit.word-unit-selected{background:#BCD2F7;}
  .syl{
    transition:color .18s ease, background .18s ease; /* fade-out only, see .syl.speaking */
    border-radius:4px;
  }
  .syl.speaking{
    transition:none; /* snap on instantly so the highlight never lags the voice */
    color:var(--coral-d);
    background:var(--yellow);
    padding:0 0.05em;
    margin:0 -0.05em;
  }
  .word-pron{
    color:var(--ink-soft);
    font-size:0.92rem;
    font-weight:700;
  }
  .audio-btn{
    background:var(--blue);
    color:#fff;
    border:none;
    width:44px;
    height:44px;
    border-radius:14px;
    box-shadow:0 4px 0 var(--blue-d);
    cursor:pointer;
    font-size:1rem;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    transition:transform .1s ease, box-shadow .1s ease, background .15s ease;
  }
  .audio-btn .icon{width:20px;height:20px;}
  .audio-btn:hover{filter:brightness(1.08);}
  .audio-btn:active{transform:translateY(3px);box-shadow:0 1px 0 var(--blue-d);}
  .audio-btn.playing{background:var(--teal);box-shadow:0 4px 0 var(--teal-d);}
  .audio-btn.slow-btn{
    background:var(--yellow);
    color:var(--ink);
    box-shadow:0 4px 0 var(--yellow-d);
  }
  .audio-btn.slow-btn:active{box-shadow:0 1px 0 var(--yellow-d);}
  .audio-btn.slow-btn.playing{background:var(--teal);color:#fff;box-shadow:0 4px 0 var(--teal-d);}
  .audio-btn-sm{
    background:var(--teal);
    border:none;
    color:#fff;
    width:30px;
    height:30px;
    border-radius:10px;
    box-shadow:0 3px 0 var(--teal-d);
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    margin:0.1rem 0 0.1rem 0.3rem;
    vertical-align:middle;
    transition:transform .1s ease, box-shadow .1s ease;
  }
  .audio-btn-sm .icon{width:16px;height:16px;}
  .audio-btn-sm:hover{filter:brightness(1.1);}
  .audio-btn-sm:active{transform:translateY(2px);box-shadow:0 1px 0 var(--teal-d);}
  .audio-btn-sm.playing{background:var(--blue);box-shadow:0 3px 0 var(--blue-d);}
  .audio-btn-sm.slow-btn{background:var(--yellow);color:var(--ink);box-shadow:0 3px 0 var(--yellow-d);}
  .audio-btn-sm.slow-btn.playing{background:var(--blue);color:#fff;box-shadow:0 3px 0 var(--blue-d);}
  .audio-note{
    display:inline-flex;
    align-items:center;
    gap:0.3rem;
    font-size:0.8rem;
    color:var(--ink-soft);
    margin-left:0.4rem;
  }
  .word-en{
    display:inline-block;
    color:var(--ink);
    background:var(--tile-yellow);
    font-weight:800;
    font-size:1rem;
    padding:0.2rem 0.7rem;
    border-radius:999px;
    margin:0.35rem 0 0.7rem;
    transition:color .18s ease, background .18s ease;
  }
  .word-en.en-speaking{
    transition:none;
    background:var(--blue);
    color:#fff;
  }
  .word-mnemonic{
    font-size:0.92rem;
    line-height:1.5;
    font-weight:600;
    color:var(--ink);
    background:var(--coral-tint);
    border-radius:16px;
    padding:0.75rem 0.9rem;
    margin:0 0 0.7rem;
  }
  .word-mnemonic strong{color:var(--coral-d);font-weight:800;}
  .word-example{
    background:var(--bg);
    border-radius:16px;
    padding:0.75rem 0.9rem;
    margin-top:0.2rem;
  }
  .word-example .gr-ex{
    font-family:var(--display);
    font-weight:700;
    font-size:1.02rem;
    line-height:1.8;
    color:var(--ink);
    margin:0 0 0.2rem;
  }
  .gr-ex-text{display:inline;}
  .word-example .en-ex{
    font-size:0.9rem;
    font-weight:600;
    color:var(--ink-soft);
    margin:0;
  }
  .forms-btn{
    display:inline-flex;
    align-items:center;
    min-height:44px;
    margin:0.85rem 0.5rem 0 0;
    padding:0.55rem 1rem;
    background:var(--card);
    border:2px solid var(--line);
    border-radius:14px;
    box-shadow:0 4px 0 var(--line);
    color:var(--blue);
    font-size:0.88rem;
    font-weight:800;
    cursor:pointer;
    transition:transform .1s ease, box-shadow .1s ease;
  }
  .forms-btn:hover{border-color:var(--blue);}
  .forms-btn:active{transform:translateY(3px);box-shadow:0 1px 0 var(--line);}
  .deepdive-btn{
    background:var(--teal);
    border-color:var(--teal);
    color:#fff;
    box-shadow:0 4px 0 var(--teal-d);
  }
  .deepdive-btn:hover{border-color:var(--teal-d);}
  .deepdive-btn:active{box-shadow:0 1px 0 var(--teal-d);}
  .deepdive-note{
    font-size:0.88rem;
    font-weight:600;
    color:var(--ink-soft);
    padding:0 0.2rem 0.8rem;
  }

  /* --- Detail view (conjugations / declensions / related forms) --- */
  .detail-view{
    max-width:900px;
    margin:0 auto;
    padding:1.3rem 1.25rem 5rem;
  }
  .back-btn{
    display:inline-flex;
    align-items:center;
    gap:0.3rem;
    min-height:44px;
    background:var(--card);
    border:none;
    color:var(--ink);
    padding:0.5rem 1rem 0.5rem 0.7rem;
    border-radius:999px;
    box-shadow:0 3px 0 var(--line);
    font-size:0.92rem;
    font-weight:800;
    cursor:pointer;
    margin-bottom:1.3rem;
  }
  .back-btn .icon{width:18px;height:18px;}
  .back-btn:hover{color:var(--blue);}
  .back-btn:active{transform:translateY(2px);box-shadow:0 1px 0 var(--line);}
  .detail-header{
    display:flex;
    align-items:center;
    gap:1rem;
    flex-wrap:wrap;
    background:var(--card);
    border-radius:28px;
    box-shadow:0 7px 0 var(--line);
    padding:1.3rem 1.3rem;
    margin-bottom:1.5rem;
  }
  .detail-header .word-emoji{font-size:2.8rem;}
  .detail-header .word-gr{font-size:2.3rem;}
  .detail-note{
    background:var(--teal-tint);
    border-radius:18px;
    padding:0.9rem 1.05rem;
    font-size:0.92rem;
    font-weight:600;
    color:var(--ink);
    line-height:1.55;
    margin-bottom:1.3rem;
  }
  .form-group-title{
    font-family:var(--display);
    font-weight:700;
    font-size:1.3rem;
    color:var(--ink);
    margin:1.8rem 0 0.8rem;
  }
  .form-group-title:first-of-type{margin-top:0;}
  .form-sub-title{
    font-size:0.8rem;
    text-transform:uppercase;
    letter-spacing:0.08em;
    color:var(--teal);
    font-weight:800;
    margin:1rem 0 0.5rem;
  }
  .related-forms{
    display:flex;
    flex-wrap:wrap;
    gap:0.6rem;
    margin:0.3rem 0 0;
  }
  .adj-opp{margin-bottom:0.4rem;}
  .word-opp{font-size:0.88rem;font-weight:700;color:var(--ink-soft);margin:0.1rem 0 0.6rem;}
  .opp-link{background:none;border:none;padding:0;font:inherit;font-weight:800;color:var(--blue);cursor:pointer;text-decoration:underline;text-underline-offset:3px;}
  .oneword-card{background:var(--tile-yellow);border-radius:20px;padding:1rem 1.1rem;margin:0.2rem 0 0.4rem;box-shadow:0 5px 0 var(--line);}
  .oneword-head{font-family:var(--display);font-weight:700;font-size:1.05rem;color:var(--ink);margin-bottom:0.6rem;display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap;}
  .irr-badge{background:var(--coral);color:#fff;font-family:inherit;font-size:0.72rem;font-weight:800;letter-spacing:0.04em;text-transform:uppercase;border-radius:999px;padding:0.2rem 0.6rem;}
  .oneword-sup{margin:0.8rem 0 0;font-weight:700;color:var(--ink);display:flex;align-items:center;gap:0.5rem;flex-wrap:wrap;}
  .oneword-ex{margin:0.8rem 0 0;font-weight:700;color:var(--ink);line-height:1.5;}
  .oneword-ex-en{display:block;font-weight:600;color:var(--ink-soft);font-size:0.9rem;}
  .oneword-tip{margin:0.6rem 0 0;font-size:0.85rem;font-weight:600;color:var(--ink-soft);}
  .decl-intro{font-size:0.92rem;font-weight:600;color:var(--ink-soft);margin:0 0 0.4rem;}
  .decl-table{width:100%;border-collapse:separate;border-spacing:0;background:var(--card);border-radius:18px;box-shadow:0 5px 0 var(--line);overflow:hidden;margin-bottom:0.6rem;table-layout:fixed;}
  .decl-table th,.decl-table td{padding:0.35rem 0.4rem;text-align:left;vertical-align:middle;border-bottom:1px solid var(--line);}
  .decl-table tr:last-child th,.decl-table tr:last-child td{border-bottom:none;}
  .decl-table thead th{font-size:0.75rem;text-transform:uppercase;letter-spacing:0.06em;color:var(--ink-soft);font-weight:800;padding-top:0.6rem;}
  .decl-table thead th:first-child,.decl-table tbody th{width:3.6rem;}
  .decl-table tbody th{font-size:0.8rem;font-weight:800;color:var(--teal);padding-left:0.8rem;}
  .decl-cell{background:none;border:none;padding:0.3rem 0.35rem;border-radius:10px;cursor:pointer;text-align:left;width:100%;min-height:44px;font:inherit;color:var(--ink);}
  .decl-cell:hover,.decl-cell:focus-visible{background:var(--tile-blue);}
  .decl-gr{display:block;font-weight:800;font-size:1rem;color:var(--blue);overflow-wrap:anywhere;}
  .decl-pron{display:block;font-size:0.75rem;font-weight:600;color:var(--ink-soft);overflow-wrap:anywhere;}
  .decl-empty{color:var(--ink-soft);font-weight:700;padding-left:0.8rem !important;}
  .gender-badge{display:inline-block;font-size:0.74rem;font-weight:800;border-radius:999px;padding:0.12rem 0.55rem;margin-right:0.45rem;vertical-align:middle;letter-spacing:0.01em;}
  .gender-badge.g-m{background:var(--tile-blue);color:var(--blue);}
  .gender-badge.g-f{background:var(--tile-coral);color:var(--coral);}
  .gender-badge.g-n{background:var(--tile-teal);color:var(--teal);}
  .gender-filter{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;margin:0 0 1rem;}
  .gf-label{font-size:0.78rem;font-weight:800;text-transform:uppercase;letter-spacing:0.08em;color:var(--ink-soft);margin-right:0.2rem;}
  .gf-btn{min-height:40px;border:none;border-radius:999px;padding:0.4rem 0.95rem;font:inherit;font-size:0.9rem;font-weight:800;cursor:pointer;background:var(--card);color:var(--ink);box-shadow:0 4px 0 var(--line);}
  .gf-btn.g-m{color:var(--blue);} .gf-btn.g-f{color:var(--coral);} .gf-btn.g-n{color:var(--teal);}
  .gf-btn.active{background:var(--ink);color:#fff;box-shadow:0 4px 0 var(--line);}
  .gf-btn.g-m.active{background:var(--blue);} .gf-btn.g-f.active{background:var(--coral);} .gf-btn.g-n.active{background:var(--teal);}
  .quiz-entry{display:flex;align-items:center;gap:0.9rem;width:100%;text-align:left;border:none;cursor:pointer;font:inherit;color:var(--ink);background:var(--tile-yellow);border-radius:24px;padding:1rem 1.15rem;margin:0 0 1.2rem;box-shadow:0 6px 0 var(--yellow-d, var(--line));}
  .quiz-entry-emoji{font-size:2rem;line-height:1;}
  .quiz-entry-text{flex:1;display:flex;flex-direction:column;gap:0.15rem;}
  .quiz-entry-text strong{font-family:var(--display);font-size:1.1rem;}
  .quiz-entry-text span{font-size:0.9rem;font-weight:600;color:var(--ink-soft);}
  .quiz-entry-go{font-size:1.4rem;font-weight:800;color:var(--blue);}
  .quiz-progress{display:flex;justify-content:space-between;font-weight:800;font-size:0.9rem;color:var(--ink-soft);margin-bottom:0.5rem;}
  .quiz-bar{height:10px;border-radius:999px;background:var(--line);overflow:hidden;margin-bottom:1.2rem;}
  .quiz-bar div{height:100%;background:var(--teal);border-radius:999px;transition:width .3s ease;}
  .quiz-card{background:var(--card);border-radius:28px;box-shadow:0 7px 0 var(--line);padding:1.4rem 1.3rem;}
  .quiz-prompt{font-size:0.8rem;font-weight:800;text-transform:uppercase;letter-spacing:0.08em;color:var(--teal);margin:0 0 0.9rem;}
  .quiz-word{display:flex;align-items:center;gap:0.8rem;margin-bottom:0.3rem;}
  .quiz-emoji{font-size:2.6rem;line-height:1;}
  .quiz-gr{font-family:var(--display);font-weight:700;font-size:2.2rem;color:var(--blue);overflow-wrap:anywhere;}
  .quiz-en{font-weight:700;color:var(--ink-soft);margin:0.2rem 0 1.1rem;}
  .quiz-sentence{font-size:1.35rem;font-weight:800;color:var(--ink);line-height:1.5;margin:0 0 0.3rem;}
  .quiz-blank{color:var(--coral);}
  .quiz-hint{font-size:0.85rem;font-weight:700;color:var(--ink-soft);margin:-0.6rem 0 1.1rem;}
  .quiz-options{display:flex;flex-wrap:wrap;gap:0.7rem;}
  .quiz-opt{min-width:84px;min-height:56px;border:none;border-radius:18px;font-family:var(--display);font-weight:700;font-size:1.4rem;cursor:pointer;background:var(--bg);color:var(--ink);box-shadow:0 5px 0 var(--line);padding:0.4rem 1.2rem;}
  .quiz-opt:hover:not(:disabled){background:var(--tile-blue);}
  .quiz-opt:disabled{cursor:default;opacity:0.55;}
  .quiz-opt.correct{background:var(--teal);color:#fff;opacity:1;box-shadow:0 5px 0 var(--teal-d);}
  .quiz-opt.wrong{background:var(--coral);color:#fff;opacity:1;box-shadow:0 5px 0 var(--coral-d);}
  .quiz-feedback{margin-top:1.2rem;border-radius:18px;padding:0.9rem 1rem;}
  .quiz-feedback.ok{background:var(--tile-teal);} .quiz-feedback.bad{background:var(--tile-coral);}
  .quiz-fb-title{font-weight:800;margin-bottom:0.35rem;}
  .quiz-feedback.ok .quiz-fb-title{color:var(--teal);} .quiz-feedback.bad .quiz-fb-title{color:var(--coral);}
  .quiz-fb-answer{display:flex;align-items:center;flex-wrap:wrap;gap:0.4rem;font-size:1.05rem;}
  .quiz-actions{display:flex;flex-wrap:wrap;gap:0.7rem;margin-top:1.1rem;}
  .quiz-next{min-height:48px;border:none;border-radius:16px;background:var(--blue);color:#fff;font:inherit;font-weight:800;font-size:1rem;padding:0.6rem 1.4rem;cursor:pointer;box-shadow:0 5px 0 var(--blue-d);}
  .quiz-secondary{min-height:48px;border:none;border-radius:16px;background:var(--bg);color:var(--ink);font:inherit;font-weight:800;font-size:1rem;padding:0.6rem 1.4rem;cursor:pointer;box-shadow:0 5px 0 var(--line);}
  .quiz-done{text-align:center;}
  .quiz-done-score{font-family:var(--display);font-weight:700;font-size:3.4rem;color:var(--blue);}
  .quiz-done-score span{font-size:1.4rem;color:var(--ink-soft);margin-left:0.3rem;}
  .quiz-done-msg{font-weight:800;font-size:1.1rem;margin:0.3rem 0 0.2rem;}
  .quiz-done .quiz-actions{justify-content:center;}
  .theme-empty{font-weight:700;color:var(--ink-soft);background:var(--card);border-radius:20px;padding:1.2rem;box-shadow:0 5px 0 var(--line);}
  .related-chip{
    min-height:44px;
    background:var(--card);
    border:none;
    border-radius:999px;
    box-shadow:0 4px 0 var(--line);
    padding:0.5rem 1rem;
    font-size:0.95rem;
    font-weight:800;
    cursor:pointer;
    color:var(--ink);
  }
  .related-chip:hover{color:var(--blue);}
  .related-chip .en-hint{color:var(--ink-soft);font-weight:600;font-size:0.8rem;margin-left:0.35rem;}
  .en-word{
    transition:color .18s ease, background .18s ease;
    border-radius:4px;
  }
  .en-word.en-word-active{
    transition:none;
    color:var(--ink);
    background:var(--yellow);
    padding:0 0.15em;
    margin:0 -0.15em;
  }
  .empty-state{
    text-align:center;
    padding:3rem 1.5rem;
    margin-top:0.5rem;
    background:var(--card);
    border-radius:var(--radius);
    box-shadow:0 6px 0 var(--line);
    font-weight:700;
    color:var(--ink-soft);
  }
  .empty-state .big{font-size:2.4rem;margin-bottom:0.6rem;}

  footer{
    max-width:900px;
    margin:0 auto;
    padding:1.5rem 1.25rem 3rem;
    color:var(--ink-soft);
    font-size:0.85rem;
    font-weight:600;
    line-height:1.6;
  }

  @media (max-width:560px){
    .brand{font-size:1.75rem;}
    .hero-title{font-size:1.75rem;}
    .theme-grid{grid-template-columns:repeat(2, minmax(0, 1fr));gap:1rem 0.8rem;}
    .theme-list-item{min-height:124px;padding:0.85rem 0.85rem 0.9rem;}
    .theme-list-title{font-size:0.95rem;}
    .word-entry{grid-template-columns:40px 1fr;gap:0.7rem;padding:1rem 1rem 1.1rem 0.8rem;}
    .word-entry.form-row{grid-template-columns:78px 1fr;}
    .form-row .word-emoji{font-size:0.74rem;}
    .word-emoji{font-size:1.7rem;}
    .word-gr{font-size:1.4rem;}
    .detail-header .word-gr{font-size:1.9rem;}
  }

  @media (prefers-reduced-motion: reduce){
    html{scroll-behavior:auto;}
    *{transition:none !important;}
  }

  /* --- Multi-page additions --- */
  a.tab{text-decoration:none;}
  .brand-link{text-decoration:none;}
  a.theme-list-item{text-decoration:none;}
  .page-title-row{margin-top:0.9rem;}
  .home-section-title{font-family:var(--display);font-weight:700;font-size:1.25rem;margin:0.4rem 0.2rem 0.9rem;}
  .home-tile-sub{font-weight:700;font-size:0.8rem;color:var(--ink-soft);margin-top:0.25rem;}
  .home-search{margin-top:1rem;}
  .home-results{display:grid;gap:0.6rem;}
  .home-result{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:0.4rem 0.9rem;padding:0.8rem 1rem;
    background:var(--card);border-radius:16px;box-shadow:0 4px 0 var(--line);color:var(--ink);text-decoration:none;}
  .home-result:hover{background:#FFFDF8;}
  .hr-gr{font-weight:800;color:var(--blue);font-size:1.05rem;}
  .hr-en{font-weight:600;}
  .hr-cat{font-size:0.75rem;font-weight:800;padding:0.2rem 0.55rem;border-radius:999px;background:var(--tile-yellow);white-space:nowrap;}
  .home-empty{padding:2rem 0;text-align:center;font-weight:700;color:var(--ink-soft);}
  @media (max-width:480px){ .home-result{grid-template-columns:1fr auto;} .hr-en{grid-column:1 / 2;} }
