/* ═══════════════════════════════════════════════════════
   JLPT Simulatore — Foglio di stile
   Tema: carta washi · inchiostro · lacca · oro
   ═══════════════════════════════════════════════════════ */

*{box-sizing:border-box;margin:0;padding:0}

:root{
  --ink:#1A0A00;
  --ink2:#5C3D2E;
  --ink3:#9E7A6A;
  --parchment:#F5EFE0;
  --parchment2:#EDE4D0;
  --parchment3:#DDD0B8;
  --lacca:#8B1A1A;
  --lacca-lt:#B83232;
  --lacca-dk:#5C0E0E;
  --lacca-bg:#F9ECEC;
  --gold:#B8860B;
  --gold-lt:#D4A017;
  --gold-bg:#FBF4E0;
  --jade:#1A5C3A;
  --jade-bg:#E8F5ED;
  --jade-lt:#2E8A58;
  --aqua:#30CDD4;
  --aqua-dk:#147D84;
  --aqua-bg:rgba(48,205,212,.12);
  --indigo:#2A3580;
  --indigo-bg:#ECEFFE;
  --plum:#6B2B6B;
  --plum-bg:#F5EBF5;
  --amber:#8B4513;
  --amber-bg:#FDF2E5;
  --bd:rgba(92,61,46,0.18);
  --bd2:rgba(92,61,46,0.35);
  --r:14px;
  --rm:10px;
  --font:'Crimson Pro',Georgia,serif;
  --font-jp:'Noto Serif JP','Shippori Mincho',serif;
  --font-display:'DM Serif Display',Georgia,serif;

/* ── DEPTH EFFECT VARIABLES (usate dal tema Rilievo) ── */
  --depth-shadow-light:rgba(255,255,255,0.82);
  --depth-shadow-dark:rgba(92,61,46,0.28);
  --depth-border-top:rgba(255,255,255,0.72);
  --depth-border-bottom:rgba(92,61,46,0.22);
  --depth-inset-light:rgba(255,255,255,0.55);
  --depth-inset-dark:rgba(92,61,46,0.12);
}
/* Kihon Master — verifica finale. */
.kihon-master-dot{border-color:#d1a743!important;background:linear-gradient(135deg,#fff1bd,#fffaf0)!important;color:#704b08!important}.kihon-master-dot span{background:#c89429!important;color:#fff!important}.kihon-master-dot.is-active{box-shadow:0 0 0 3px rgba(202,151,43,.18),0 8px 22px rgba(122,78,10,.15)}
.kihon-master-page{gap:20px}.kihon-master-hero{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(250px,.62fr);align-items:center;min-height:340px;overflow:hidden;border:1px solid rgba(211,164,58,.45);border-radius:25px;background:radial-gradient(circle at 75% 20%,rgba(255,229,149,.18),transparent 32%),linear-gradient(135deg,#133f3d,#172d2d 58%,#531f1a);color:#fff8e9;box-shadow:0 20px 52px rgba(21,49,46,.2)}.kihon-master-hero>div{padding:clamp(30px,6vw,65px)}.kihon-master-kicker{display:inline-flex;padding:7px 12px;border:1px solid rgba(255,226,149,.45);border-radius:999px;background:rgba(255,255,255,.08);color:#f2cc73;font:800 11px sans-serif;letter-spacing:.08em;text-transform:uppercase}.kihon-master-hero h1{margin:13px 0;color:#fff9e9;font:400 clamp(45px,7vw,76px)/.95 var(--font-display)}.kihon-master-hero p{max-width:610px;color:rgba(255,255,255,.78);font-size:18px;line-height:1.55}.kihon-master-hero img{width:100%;max-height:380px;object-fit:contain;filter:drop-shadow(0 18px 24px rgba(0,0,0,.25))}
.kihon-master-map{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.kihon-master-map>div{display:grid;grid-template-columns:34px 1fr;align-items:center;gap:8px;min-height:54px;padding:9px;border:1px solid var(--bd);border-radius:13px;background:rgba(255,255,255,.58);color:var(--ink3);transition:.25s}.kihon-master-map b{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#eee8db;color:#756c5d;font:800 10px sans-serif}.kihon-master-map span{font:700 11px/1.2 var(--font)}.kihon-master-map>div.is-current{border-color:var(--kihon-coral);background:#fff1ed;color:#8d2c24;transform:translateY(-2px)}.kihon-master-map>div.is-current b{background:var(--kihon-coral);color:#fff}.kihon-master-map>div.is-done{border-color:rgba(40,123,119,.32);background:#e5f3ef;color:#175c56}.kihon-master-map>div.is-done b{background:var(--kihon-teal);color:#fff}
.kihon-master-quiz{padding:clamp(24px,5vw,48px)!important;background:linear-gradient(145deg,#fff9ed,#fff)!important}.kihon-master-quiz[hidden],.kihon-master-result[hidden]{display:none!important}.kihon-master-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.kihon-master-head h2{margin:5px 0!important}.kihon-master-count{flex:none;color:var(--kihon-teal);font:800 18px sans-serif}.kihon-master-track{height:7px;margin:6px 0 23px;overflow:hidden;border-radius:999px;background:#e7dfd2}.kihon-master-track i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--kihon-teal),#e8af4c);transition:width .35s}.kihon-master-prompt{margin:22px auto 7px;max-width:830px;color:var(--ink);font:600 clamp(23px,4vw,35px)/1.25 var(--font-jp);text-align:center}.kihon-master-quiz .kihon-choice-row{max-width:900px;margin:23px auto 12px}.kihon-master-quiz .kihon-choice-row button{flex:1 1 250px;min-height:54px;font-size:17px}.kihon-master-quiz .kihon-mini-feedback{text-align:center}
.kihon-master-result{position:relative;display:grid;grid-template-columns:minmax(240px,.65fr) minmax(0,1fr);align-items:center;gap:clamp(25px,6vw,70px);overflow:hidden;padding:clamp(28px,6vw,65px);border:1px solid rgba(212,163,52,.55);border-radius:25px;background:radial-gradient(circle at 20% 40%,rgba(246,194,88,.2),transparent 28%),linear-gradient(135deg,#123f3b,#18302d 60%,#5b211a);color:white;box-shadow:0 20px 52px rgba(21,49,46,.22)}.kihon-master-result h2{margin:13px 0;color:#fff8e9;font:400 clamp(35px,5vw,55px)/1 var(--font-display)}.kihon-master-result p{max-width:650px;color:rgba(255,255,255,.76);font-size:17px;line-height:1.55}.kihon-master-result button{margin-top:15px;padding:12px 18px;border:1px solid rgba(255,255,255,.38);border-radius:999px;background:rgba(255,255,255,.1);color:white;font:800 13px sans-serif;cursor:pointer}.kihon-master-seal{position:relative;display:grid;place-items:center;isolation:isolate}.kihon-master-seal img{width:min(100%,310px);filter:drop-shadow(0 20px 22px rgba(0,0,0,.32));animation:kihonMasterReveal .85s cubic-bezier(.2,.9,.25,1.2)}.kihon-master-seal>div{position:absolute;z-index:2;bottom:2%;left:50%;display:grid;min-width:145px;padding:8px 14px;border:2px solid #e0b84d;border-radius:11px;background:linear-gradient(#fff8dc,#f5e2aa);color:#6a310e;text-align:center;transform:translateX(-50%) rotate(-3deg);box-shadow:0 6px 14px rgba(50,20,0,.28)}.kihon-master-seal b{font:800 27px var(--font-jp)}.kihon-master-seal strong{font:900 11px sans-serif;letter-spacing:.11em}.kihon-master-seal small{font:800 9px sans-serif}@keyframes kihonMasterReveal{0%{opacity:0;transform:scale(.55) rotate(-18deg)}70%{transform:scale(1.06) rotate(2deg)}100%{opacity:1;transform:scale(1)}}
@media(max-width:850px){.kihon-master-hero{grid-template-columns:1fr;text-align:center}.kihon-master-hero>div{padding-bottom:8px}.kihon-master-hero img{max-height:290px}.kihon-master-map{grid-template-columns:repeat(2,1fr)}.kihon-master-result{grid-template-columns:1fr;text-align:center}.kihon-master-result p{margin-inline:auto}.kihon-master-seal img{width:min(70vw,290px)}}@media(max-width:480px){.kihon-master-map{grid-template-columns:1fr 1fr}.kihon-master-map>div{grid-template-columns:27px 1fr;padding:7px}.kihon-master-map b{width:26px;height:26px}.kihon-master-quiz .kihon-choice-row button{flex-basis:100%;font-size:15px}.kihon-master-result{padding:30px 18px}}@media(prefers-reduced-motion:reduce){.kihon-master-seal img{animation:none}.kihon-master-map>div,.kihon-master-track i{transition:none}}

.kihon-mini-hero.is-plain{background:linear-gradient(135deg,#edf4f0,#fff0dc)}
.kihon-register-scene{display:grid;gap:9px;margin:18px 0}.kihon-register-scene span{padding:11px;border-radius:11px;background:var(--parchment);color:var(--ink3);font:700 12px var(--font)}.kihon-register-scene b{display:block;margin-top:3px;color:var(--ink);font:600 18px var(--font-jp)}
.kihon-plain-focus{display:grid;place-items:center;margin:20px 0;padding:20px;border-radius:15px;background:#e2f2ee}.kihon-plain-focus b{color:#155d59;font:700 38px var(--font-jp)}.kihon-plain-focus small{color:var(--ink3);font:700 11px var(--font)}
.kihon-plain-uses{display:grid;gap:9px;margin:18px 0;padding-left:20px;color:var(--ink2);line-height:1.45}.kihon-plain-uses li::marker{color:var(--kihon-teal)}
.kihon-plain-forms{display:grid;grid-template-columns:minmax(220px,.65fr) minmax(0,1.35fr);gap:25px;align-items:center;padding:clamp(24px,4vw,40px);border:1px solid rgba(40,123,119,.22);border-radius:20px;background:linear-gradient(135deg,#e7f3ef,#fff9ed)}.kihon-plain-forms h2,.kihon-register-table h2{margin:8px 0;color:var(--lacca-dk);font:400 clamp(27px,4vw,40px) var(--font-display)}
.kihon-plain-form-grid{display:grid;grid-template-columns:repeat(2,minmax(130px,1fr));gap:10px}.kihon-plain-form-grid span{display:grid;place-items:center;padding:14px;border-radius:13px;background:rgba(255,255,255,.78);box-shadow:0 5px 16px rgba(26,10,0,.05)}.kihon-plain-form-grid small{color:var(--ink3);font:800 9px sans-serif;text-transform:uppercase}.kihon-plain-form-grid b{margin:4px;color:var(--kihon-coral);font:700 26px var(--font-jp)}.kihon-plain-form-grid em{color:var(--kihon-teal);font:700 11px var(--font);font-style:normal}
.kihon-register-table{padding:clamp(24px,4vw,40px);border:1px solid var(--bd);border-radius:20px;background:rgba(255,255,255,.65)}.kihon-register-head,.kihon-register-row{display:grid;grid-template-columns:minmax(0,1fr) 36px minmax(0,1fr) minmax(90px,.55fr);align-items:center;gap:8px;max-width:850px;margin:auto;text-align:center}.kihon-register-head{margin-top:22px;color:var(--ink3);font:800 10px sans-serif;text-transform:uppercase}.kihon-register-head b:first-child{grid-column:1}.kihon-register-head b:last-child{grid-column:3}.kihon-register-row{margin-top:8px}.kihon-register-row span{padding:11px;border-radius:11px;background:#f2eee5;font:600 clamp(16px,3vw,22px) var(--font-jp)}.kihon-register-row span:nth-of-type(2){background:#e2f2ee;color:#155d59}.kihon-register-row i{color:var(--kihon-coral);font-style:normal}.kihon-register-row small{color:var(--ink3);font-weight:700}.kihon-register-note{display:flex;justify-content:center;gap:14px;flex-wrap:wrap;margin:20px auto 0;padding-top:16px;border-top:1px solid var(--bd);color:var(--ink2)}.kihon-register-note strong{color:var(--kihon-coral);font:700 19px var(--font-jp)}
.kihon-plain-practice .kihon-exercise-sentence{margin:18px 0 3px;color:var(--ink);font:600 clamp(21px,4vw,34px) var(--font-jp);text-align:center}.kihon-plain-practice .kihon-choice-row{max-width:700px;margin:18px auto}.kihon-plain-practice .kihon-choice-row button{min-width:115px;font-size:18px}
@media(max-width:700px){.kihon-plain-forms{grid-template-columns:1fr}.kihon-register-head,.kihon-register-row{grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr)}.kihon-register-row small{grid-column:1/4;margin-bottom:5px}.kihon-register-head{grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr)}}
@media(max-width:480px){.kihon-plain-form-grid{grid-template-columns:1fr 1fr}.kihon-register-row span{padding:9px 5px;font-size:16px}.kihon-register-note{display:grid;text-align:center}}

.kihon-mini-hero.is-subject{background:linear-gradient(135deg,#eef5ef,#f7e1c4)}
.kihon-context-memory{display:grid;gap:8px;margin:18px 0;text-align:center}.kihon-context-memory span{padding:11px;border-radius:11px;background:var(--parchment);font:600 18px var(--font-jp)}.kihon-context-memory span:last-child{background:#e2f2ee;color:#155d59}.kihon-context-memory small{display:block;color:var(--ink3);font:700 11px var(--font)}.kihon-context-memory i{color:var(--kihon-coral);font:800 9px sans-serif;letter-spacing:.08em;text-transform:uppercase}
.kihon-subject-rule{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;margin:22px 0;text-align:center}.kihon-subject-rule b{padding:12px;border-radius:11px;background:#f2eee5;color:var(--ink2)}.kihon-subject-rule i{color:var(--kihon-coral);font-style:normal}.kihon-subject-rule strong{display:grid;place-items:center;width:58px;height:58px;justify-self:center;border-radius:50%;background:#e2f2ee;color:var(--kihon-teal);font-size:29px}.kihon-subject-rule small{grid-column:3;color:var(--ink3);font-weight:700}
.kihon-subject-demo{display:grid;grid-template-columns:minmax(0,.8fr) minmax(330px,1.2fr);gap:28px;align-items:center;padding:clamp(24px,4vw,40px);border:1px solid rgba(40,123,119,.2);border-radius:20px;background:linear-gradient(135deg,#fff9ed,#e7f3ef)}.kihon-subject-demo h2,.kihon-real-dialogue h2{margin:8px 0 12px;color:var(--lacca-dk);font:400 clamp(28px,4vw,41px) var(--font-display)}.kihon-subject-demo p{color:var(--ink2);line-height:1.5}.kihon-subject-demo-stage{display:grid;place-items:center;gap:10px}.kihon-full-sentence{display:flex;justify-content:center;gap:7px;flex-wrap:wrap}.kihon-full-sentence span{padding:11px 13px;border-radius:11px;background:white;font:600 21px var(--font-jp);box-shadow:0 5px 14px rgba(26,10,0,.06)}.kihon-subject-token{background:#f8dcd7!important;color:#8d2c24;transition:opacity .3s ease,transform .3s ease,max-width .3s ease,padding .3s ease,margin .3s ease}.kihon-subject-demo-stage>i{color:var(--kihon-coral);font-style:normal}.kihon-natural-sentence{padding:12px 18px;border-radius:12px;background:#e2f2ee;color:#155d59;font:700 24px var(--font-jp)}.kihon-subject-demo-stage>small{color:var(--ink3);font-weight:700;text-align:center}.kihon-subject-demo-stage button{border:0;border-radius:999px;padding:11px 16px;background:var(--kihon-teal);color:white;font-weight:800;cursor:pointer}.kihon-subject-demo-stage.is-natural .kihon-subject-token{max-width:0;padding-inline:0;overflow:hidden;opacity:0;transform:translateY(-10px)}
.kihon-real-dialogue{padding:clamp(24px,4vw,40px);border:1px solid var(--bd);border-radius:20px;background:rgba(255,255,255,.65)}.kihon-dialogue-line{display:flex;align-items:flex-start;gap:12px;max-width:720px;margin:14px auto}.kihon-dialogue-line>span{display:grid;place-items:center;min-width:58px;height:32px;border-radius:999px;background:#f8dcd7;color:#8d2c24;font:700 12px var(--font-jp)}.kihon-dialogue-line p{margin:0;padding:12px 15px;border-radius:4px 15px 15px;background:#fff7ea;box-shadow:0 5px 15px rgba(26,10,0,.05)}.kihon-dialogue-line b{font:600 19px var(--font-jp)}.kihon-dialogue-line small{display:block;margin-top:3px;color:var(--ink3);font-weight:700}.kihon-dialogue-line.is-aki{justify-content:flex-end}.kihon-dialogue-line.is-aki>span{order:2;background:#e2f2ee;color:#155d59}.kihon-dialogue-line.is-aki p{border-radius:15px 4px 15px;background:#edf7f4}.kihon-dialogue-explain{display:grid;gap:7px;max-width:720px;margin:20px auto 0;padding-top:16px;border-top:1px solid var(--bd);text-align:center}.kihon-dialogue-explain s{color:var(--ink3);font:600 16px var(--font-jp)}.kihon-dialogue-explain strong{color:var(--kihon-teal);font-size:13px}
.kihon-subject-practice .kihon-subject-context{max-width:760px;margin:16px auto 5px;padding:12px 15px;border-left:3px solid var(--kihon-teal);border-radius:0 10px 10px 0;background:#e7f3ef;color:#174f4c;font-size:14px;line-height:1.45}.kihon-subject-practice .kihon-exercise-sentence{margin:17px 0 5px;color:var(--ink);font:600 clamp(19px,3.5vw,31px) var(--font-jp);text-align:center}.kihon-subject-practice .kihon-choice-row{max-width:850px;margin:17px auto}.kihon-subject-practice .kihon-choice-row button{min-width:145px;font:700 14px var(--font)}.kihon-subject-natural-answer{display:grid;place-items:center;gap:3px;margin:12px auto 0;padding:11px;border-radius:11px;background:#e2f2ee;color:#155d59}.kihon-subject-natural-answer small{font:800 9px sans-serif;text-transform:uppercase}.kihon-subject-natural-answer strong{font:700 21px var(--font-jp)}
@media(max-width:700px){.kihon-subject-demo{grid-template-columns:1fr}.kihon-subject-rule{grid-template-columns:1fr auto 1fr}.kihon-dialogue-line b{font-size:17px}}
@media(max-width:480px){.kihon-subject-demo{padding:21px 16px}.kihon-full-sentence span{font-size:18px}.kihon-natural-sentence{font-size:20px}.kihon-dialogue-line{gap:7px}.kihon-dialogue-line>span{min-width:46px}.kihon-subject-practice .kihon-choice-row{display:grid}}

.kihon-subject-token{max-width:100px}.kihon-subject-natural-answer[hidden]{display:none!important}

.kihon-mini-hero.is-time-place{background:linear-gradient(135deg,#edf6f3,#e7f1fb)}
.kihon-order-pairs{display:grid;gap:8px;margin:18px 0}.kihon-order-pairs span{padding:11px;border-radius:10px;background:var(--parchment);font:600 17px var(--font-jp);text-align:center}
.kihon-location-pair{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:18px 0}.kihon-location-pair span{padding:14px 8px;border-radius:12px;background:#e2f2ee;text-align:center}.kihon-location-pair b{display:block;color:#155d59;font:700 23px var(--font-jp)}.kihon-location-pair small{color:var(--ink3);font-weight:700}
.kihon-place-action{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;margin:18px 0;padding:16px;border-radius:13px;background:#fff1cc;text-align:center}.kihon-place-action b,.kihon-place-action strong{font:700 22px var(--font-jp)}.kihon-place-action b{color:#795a08}.kihon-place-action strong{color:#8d2c24}.kihon-place-action i{color:var(--kihon-coral);font-style:normal}.kihon-place-action small{grid-column:1/4;color:var(--ink3);font-weight:700}
.kihon-ni-de-contrast{display:grid;grid-template-columns:minmax(240px,.8fr) minmax(0,1.2fr);gap:25px;align-items:center;padding:clamp(24px,4vw,40px);border:1px solid rgba(40,123,119,.2);border-radius:20px;background:linear-gradient(135deg,#e7f3ef,#fff9ed)}.kihon-ni-de-contrast h2,.kihon-progressive-builder h2{margin:8px 0;color:var(--lacca-dk);font:400 clamp(27px,4vw,40px) var(--font-display)}.kihon-ni-de-examples{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:9px}.kihon-ni-de-examples span{padding:14px;border-radius:12px;background:rgba(255,255,255,.78);text-align:center}.kihon-ni-de-examples b{display:block;font:700 20px var(--font-jp)}.kihon-ni-de-examples span:first-child b{color:#2d6382}.kihon-ni-de-examples span:last-child b{color:#8d2c24}.kihon-ni-de-examples small{display:block;color:var(--ink3);font-weight:700}.kihon-ni-de-examples i{color:var(--kihon-coral);font-style:normal;font-size:23px}
.kihon-relative-time{padding:17px 21px;border-left:4px solid #e1a947;border-radius:0 14px 14px 0;background:#fff3d5}.kihon-relative-time p{margin:7px 0 0;color:#674c18;line-height:1.5}.kihon-relative-time b{font:700 17px var(--font-jp)}
.kihon-progressive-builder{display:grid;grid-template-columns:minmax(220px,.65fr) minmax(0,1.35fr);gap:28px;align-items:center;padding:clamp(24px,4vw,40px);border:1px solid var(--bd);border-radius:20px;background:var(--ink);color:#fff9ed}.kihon-progressive-builder h2{color:#fff9ed}.kihon-progressive-builder p{color:rgba(255,255,255,.7);line-height:1.5}.kihon-progressive-stage{display:grid;place-items:center;gap:13px}.kihon-progressive-tokens{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap}.kihon-progressive-tokens span{padding:11px 12px;border-radius:11px;background:#f2eee5;color:var(--ink);font:700 18px var(--font-jp);opacity:.15;transform:translateY(5px) scale(.94);transition:opacity .3s ease,transform .3s ease}.kihon-progressive-tokens span.is-visible{opacity:1;transform:none}.kihon-progressive-tokens span.time{background:#fff1cc;color:#795a08}.kihon-progressive-tokens span.place{background:#dcebf4;color:#2d6382}.kihon-progressive-tokens span.object{background:#e2f2ee;color:#155d59}.kihon-progressive-tokens span.verb{background:#f7d7d2;color:#8d2c24}.kihon-progressive-tokens small{display:block;font:800 9px var(--font);text-align:center}.kihon-progressive-tokens i{color:rgba(255,255,255,.7);font-style:normal;opacity:0;transition:opacity .25s ease}.kihon-progressive-stage[data-step="1"] i:nth-of-type(1),.kihon-progressive-stage[data-step="2"] i:nth-of-type(-n+2),.kihon-progressive-stage[data-step="3"] i:nth-of-type(-n+3),.kihon-progressive-stage[data-step="4"] i{opacity:1}.kihon-progressive-meaning{min-height:24px;color:#f3cf77;font-weight:800;text-align:center}.kihon-progressive-stage button{border:0;border-radius:999px;padding:11px 17px;background:var(--kihon-teal);color:white;font-weight:800;cursor:pointer}
.kihon-time-place-practice .kihon-exercise-sentence{margin:18px 0 3px;color:var(--ink);font:600 clamp(23px,4vw,36px) var(--font-jp);text-align:center}.kihon-time-place-practice .kihon-choice-row{max-width:520px;margin:18px auto}.kihon-time-place-practice .kihon-choice-row button{min-width:90px;font-size:22px}
@media(max-width:700px){.kihon-ni-de-contrast,.kihon-progressive-builder{grid-template-columns:1fr}.kihon-ni-de-examples{grid-template-columns:1fr}.kihon-ni-de-examples i{transform:rotate(90deg);text-align:center}}
@media(max-width:480px){.kihon-progressive-tokens{display:grid;grid-template-columns:1fr auto 1fr}.kihon-progressive-tokens span:last-child{grid-column:1/4;justify-self:center}.kihon-progressive-tokens i:last-of-type{grid-column:1/4;transform:rotate(90deg);justify-self:center}.kihon-ni-de-contrast{padding:21px 16px}}

.kihon-mini-hero.is-adjective{background:linear-gradient(135deg,#fff4dc,#edf6ef)}
.kihon-quality-chain{display:flex;align-items:center;justify-content:center;gap:9px;margin:20px 0}.kihon-quality-chain span,.kihon-quality-chain b{padding:13px 16px;border-radius:12px;background:#f2eee5;font:700 22px var(--font-jp);text-align:center}.kihon-quality-chain b{background:#f8dcd7;color:#8d2c24}.kihon-quality-chain small{display:block;color:var(--ink3);font:700 10px var(--font)}.kihon-quality-chain i{color:var(--kihon-coral);font-style:normal}
.kihon-adjective-stack{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:7px;margin:18px 0;text-align:center}.kihon-adjective-stack span,.kihon-adjective-stack strong{padding:12px 8px;border-radius:11px;background:#f2eee5;font:700 20px var(--font-jp)}.kihon-adjective-stack span{background:#e2f2ee;color:#155d59}.kihon-adjective-stack i{color:var(--kihon-coral);font-style:normal;font-weight:800}.kihon-adjective-stack b{grid-column:1/4;padding:10px;border-radius:10px;background:#fff1cc;color:#795a08;font:700 21px var(--font-jp)}.kihon-adjective-stack small{display:block;color:var(--ink3);font:700 10px var(--font)}
.kihon-adjective-position{display:grid;grid-template-columns:minmax(220px,.65fr) minmax(0,1.35fr);gap:25px;align-items:center;padding:clamp(24px,4vw,40px);border:1px solid rgba(40,123,119,.2);border-radius:20px;background:linear-gradient(135deg,#e7f3ef,#fff9ed)}.kihon-adjective-position h2,.kihon-adjective-switch h2{margin:8px 0;color:var(--lacca-dk);font:400 clamp(27px,4vw,40px) var(--font-display)}.kihon-adjective-formulas{display:grid;gap:10px}.kihon-adjective-formulas span{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;padding:14px;border-radius:12px;background:rgba(255,255,255,.8);text-align:center}.kihon-adjective-formulas b{color:var(--kihon-teal)}.kihon-adjective-formulas i{color:var(--kihon-coral);font-style:normal}.kihon-adjective-formulas strong{color:var(--ink)}.kihon-adjective-formulas small{grid-column:1/4;color:var(--ink3);font:700 13px var(--font-jp)}
.kihon-adjective-switch{display:grid;grid-template-columns:minmax(250px,.85fr) minmax(0,1.15fr);gap:28px;align-items:center;padding:clamp(24px,4vw,40px);border:1px solid var(--bd);border-radius:20px;background:rgba(255,255,255,.65)}.kihon-adjective-switch p{color:var(--ink2);line-height:1.5}.kihon-adjective-live{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px}.kihon-adjective-live>span{padding:18px 12px;border-radius:14px;background:#fff1cc;color:#795a08;font:700 clamp(19px,3vw,26px) var(--font-jp);text-align:center;transition:background .25s ease,color .25s ease}.kihon-adjective-live>span.sentence{background:#e2f2ee;color:#155d59}.kihon-adjective-live small{display:block;margin-top:4px;color:var(--ink3);font:700 11px var(--font)}.kihon-adjective-live i{color:var(--kihon-coral);font-size:22px;font-style:normal}.kihon-adjective-live[data-type="na"]>span:first-child{background:#e7e5f5;color:#524886}
.kihon-adjective-limit{display:flex;align-items:center;justify-content:center;gap:15px;flex-wrap:wrap;padding:17px 20px;border-left:4px solid var(--kihon-coral);border-radius:0 14px 14px 0;background:#f9e4df;color:#74342d}.kihon-adjective-limit strong{font-size:15px}.kihon-adjective-limit span{font-size:13px}
.kihon-adjective-practice .kihon-exercise-sentence{margin:18px 0 3px;color:var(--ink);font:600 clamp(24px,4vw,37px) var(--font-jp);text-align:center}.kihon-adjective-practice .kihon-choice-row{max-width:440px;margin:18px auto}.kihon-adjective-practice .kihon-choice-row button{min-width:85px;font-size:22px}
@media(max-width:700px){.kihon-adjective-position,.kihon-adjective-switch{grid-template-columns:1fr}.kihon-adjective-live{grid-template-columns:1fr}.kihon-adjective-live i{transform:rotate(90deg);text-align:center}}
@media(max-width:480px){.kihon-adjective-position,.kihon-adjective-switch{padding:21px 16px}.kihon-adjective-formulas span{grid-template-columns:1fr auto 1fr}.kihon-adjective-stack span,.kihon-adjective-stack strong{font-size:17px}}

.kihon-mini-hero.is-question{background:linear-gradient(135deg,#eef5fb,#fff0db)}
.kihon-ka-formula{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap;margin:20px 0}.kihon-ka-formula span,.kihon-ka-formula b{padding:11px 13px;border-radius:11px;background:#f2eee5;font:700 18px var(--font-jp)}.kihon-ka-formula b{background:#f8dcd7;color:#8d2c24;font-size:28px}.kihon-ka-formula strong{color:var(--kihon-coral);font-size:28px}
.kihon-question-intonation{display:flex;align-items:flex-end;justify-content:center;gap:5px;height:70px;margin:12px 0}.kihon-question-intonation span{font:700 24px var(--font-jp)}.kihon-question-intonation i{width:70px;height:34px;border-top:3px solid var(--kihon-teal);border-radius:50% 50% 0 0;transform:rotate(-13deg)}.kihon-question-intonation b{align-self:flex-start;color:var(--kihon-coral);font:700 26px var(--font-jp)}
.kihon-mystery-slot{display:flex;align-items:center;justify-content:center;gap:7px;margin:20px 0}.kihon-mystery-slot span,.kihon-mystery-slot b,.kihon-mystery-slot i{padding:11px;border-radius:10px;font:700 21px var(--font-jp);font-style:normal}.kihon-mystery-slot span{background:#f8dcd7;color:#8d2c24}.kihon-mystery-slot b{background:#fff1cc;color:#795a08}.kihon-mystery-slot i{background:#e2f2ee;color:#155d59}.kihon-mystery-slot+small{display:block;color:var(--ink3);font-weight:700;text-align:center}
.kihon-question-word-lab{display:grid;grid-template-columns:minmax(300px,1.2fr) minmax(240px,.8fr);gap:26px;align-items:center;padding:clamp(24px,4vw,40px);border:1px solid rgba(40,123,119,.2);border-radius:20px;background:linear-gradient(135deg,#e8f3f0,#fff9ed)}.kihon-question-word-lab h2,.kihon-question-transform h2{margin:8px 0;color:var(--lacca-dk);font:400 clamp(28px,4vw,41px) var(--font-display)}.kihon-question-word-buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:18px}.kihon-question-word-buttons button{display:grid;place-items:center;padding:12px 7px;border:1px solid var(--bd);border-radius:13px;background:rgba(255,255,255,.75);cursor:pointer}.kihon-question-word-buttons button.is-selected{border-color:var(--kihon-teal);background:#dff1ed;box-shadow:0 6px 16px rgba(40,123,119,.14)}.kihon-question-word-buttons b{color:var(--kihon-coral);font:700 29px var(--font-jp)}.kihon-question-word-buttons small{color:var(--ink3);font-weight:800}.kihon-question-word-live{display:grid;place-items:center;padding:22px;border-radius:17px;background:rgba(255,255,255,.82);box-shadow:0 8px 24px rgba(26,10,0,.06)}.kihon-question-word-live .word{color:var(--kihon-coral);font:700 52px var(--font-jp)}.kihon-question-word-live .reading{color:var(--ink3);font-weight:700}.kihon-question-word-live .meaning{margin-top:4px;color:var(--kihon-teal)}.kihon-question-word-live .jp{margin:15px 0 2px;font:700 22px var(--font-jp)}.kihon-question-word-live .it{color:var(--ink3);font-style:normal}
.kihon-question-transform{display:grid;grid-template-columns:minmax(230px,.75fr) minmax(0,1.25fr);gap:28px;align-items:center;padding:clamp(24px,4vw,40px);border:1px solid var(--bd);border-radius:20px;background:rgba(255,255,255,.65)}.kihon-question-transform p{color:var(--ink2)}.kihon-question-transform-stage{display:grid;place-items:center;gap:8px}.kihon-question-transform-stage .statement,.kihon-question-transform-stage .question{padding:13px 18px;border-radius:12px;font:700 clamp(20px,3vw,29px) var(--font-jp);transition:opacity .3s ease,transform .3s ease}.kihon-question-transform-stage .statement{background:#f2eee5;color:var(--ink)}.kihon-question-transform-stage .question{background:#e2f2ee;color:#155d59;opacity:.18;transform:scale(.95)}.kihon-question-transform-stage>i{color:var(--kihon-coral);font-style:normal}.kihon-question-transform-stage .translation{color:var(--ink3);font-weight:700;opacity:.25}.kihon-question-transform-stage button{border:0;border-radius:999px;padding:11px 17px;background:var(--kihon-teal);color:white;font-weight:800;cursor:pointer}.kihon-question-transform-stage.is-question .statement{opacity:.32}.kihon-question-transform-stage.is-question .question,.kihon-question-transform-stage.is-question .translation{opacity:1;transform:none}
.kihon-question-practice .kihon-exercise-sentence{margin:18px 0 3px;color:var(--ink);font:600 clamp(23px,4vw,36px) var(--font-jp);text-align:center}.kihon-question-practice .kihon-choice-row{max-width:520px;margin:18px auto}.kihon-question-practice .kihon-choice-row button{min-width:90px;font-size:22px}
@media(max-width:700px){.kihon-question-word-lab,.kihon-question-transform{grid-template-columns:1fr}.kihon-question-word-buttons{grid-template-columns:repeat(4,1fr)}}
@media(max-width:480px){.kihon-question-word-lab,.kihon-question-transform{padding:21px 16px}.kihon-question-word-buttons{grid-template-columns:repeat(2,1fr)}.kihon-ka-formula span{font-size:16px}.kihon-mystery-slot span,.kihon-mystery-slot b,.kihon-mystery-slot i{font-size:18px}}

.kihon-mini-hero.is-sentence{background:linear-gradient(135deg,#fff2dc,#e8f4ef)}
.kihon-sentence-checklist{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.kihon-sentence-checklist>div{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;column-gap:9px;align-items:center;padding:13px;border:1px solid var(--bd);border-radius:13px;background:rgba(255,255,255,.68)}.kihon-sentence-checklist span{grid-row:1/3;display:grid;place-items:center;width:31px;height:31px;border-radius:50%;background:#e2f2ee;color:var(--kihon-teal);font-weight:900}.kihon-sentence-checklist b{color:var(--ink);font-size:13px}.kihon-sentence-checklist small{color:var(--ink3);font-weight:700}
.kihon-zero-builder{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(310px,.75fr);gap:20px;align-items:start}.kihon-zero-controls{display:grid;gap:10px}.kihon-zero-group{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:13px;border:1px solid var(--bd);border-radius:14px;background:rgba(255,255,255,.65)}.kihon-zero-group>strong{min-width:110px;color:var(--ink2);font-size:12px}.kihon-zero-group button{border:1px solid var(--bd2);border-radius:999px;padding:8px 11px;background:var(--parchment);color:var(--ink);font:700 14px var(--font-jp);cursor:pointer}.kihon-zero-group button.is-selected{border-color:var(--kihon-teal);background:#dff1ed;color:#155d59;box-shadow:0 4px 12px rgba(40,123,119,.12)}.kihon-zero-result{position:sticky;top:16px;display:grid;place-items:center;padding:24px;border-radius:19px;background:var(--ink);color:#fff9ed;text-align:center}.kihon-zero-tokens{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;margin:18px 0}.kihon-zero-tokens span{padding:9px 11px;border-radius:10px;background:#f2eee5;color:var(--ink);font:700 17px var(--font-jp)}.kihon-zero-tokens span.time{background:#fff1cc;color:#795a08}.kihon-zero-tokens span.theme{background:#f8dcd7;color:#8d2c24}.kihon-zero-tokens span.place{background:#dcebf4;color:#2d6382}.kihon-zero-tokens span.object{background:#e2f2ee;color:#155d59}.kihon-zero-tokens span.action{background:#f7d7d2;color:#8d2c24}.kihon-zero-tokens span.is-omitted{border:1px dashed rgba(255,255,255,.45);background:rgba(255,255,255,.1);color:#fff}.kihon-zero-tokens mark{padding:1px 3px;border-radius:4px;background:rgba(184,66,53,.16);color:inherit}.kihon-zero-tokens i{color:rgba(255,255,255,.45);font-style:normal}.kihon-zero-tokens small{display:block;font:700 8px var(--font)}.kihon-zero-jp{font:700 clamp(20px,3vw,28px) var(--font-jp)}.kihon-zero-it{color:#f2cf76;font-weight:800}.kihon-zero-context-note{margin-top:9px;padding:10px;border-radius:10px;background:rgba(255,255,255,.08);color:rgba(255,255,255,.7);font-size:12px;line-height:1.4}
.kihon-final-formula{padding:clamp(24px,4vw,40px);border:1px solid rgba(40,123,119,.23);border-radius:20px;background:linear-gradient(135deg,#e7f3ef,#fff9ed);text-align:center}.kihon-final-formula h2{margin:8px auto 4px;color:var(--lacca-dk);font:400 clamp(22px,3.5vw,36px) var(--font-display)}.kihon-final-formula>i{display:block;margin:8px;color:var(--kihon-coral);font-style:normal;font-size:24px}.kihon-final-formula>div:last-of-type{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}.kihon-final-formula span,.kihon-final-formula strong{padding:12px 14px;border-radius:11px;background:#fff1cc;color:#795a08;font:700 20px var(--font-jp)}.kihon-final-formula span:nth-child(2){background:#f8dcd7;color:#8d2c24}.kihon-final-formula span:nth-child(3){background:#dcebf4;color:#2d6382}.kihon-final-formula span:nth-child(4){background:#e2f2ee;color:#155d59}.kihon-final-formula strong{background:var(--ink);color:#fff}.kihon-final-formula small{display:block;font:800 8px var(--font);text-transform:uppercase}.kihon-final-formula p{margin:18px 0 0;color:var(--ink2);font-weight:700}
.kihon-sentence-practice .kihon-exercise-translation{margin:17px auto;color:var(--ink);font-size:17px;font-weight:800}.kihon-sentence-practice .kihon-choice-row{display:grid;max-width:880px;margin:14px auto}.kihon-sentence-practice .kihon-choice-row button{width:100%;font-size:15px;line-height:1.5}
@media(max-width:850px){.kihon-sentence-checklist{grid-template-columns:repeat(2,1fr)}.kihon-zero-builder{grid-template-columns:1fr}.kihon-zero-result{position:static}}
@media(max-width:480px){.kihon-sentence-checklist{grid-template-columns:1fr 1fr}.kihon-sentence-checklist>div{padding:9px}.kihon-sentence-checklist b{font-size:11px}.kihon-zero-group>strong{width:100%;min-width:0}.kihon-zero-result{padding:20px 13px}.kihon-final-formula{padding:21px 14px}.kihon-final-formula>div:last-of-type{display:grid;grid-template-columns:1fr 1fr}.kihon-final-formula strong{grid-column:1/3}}

/* Kihon sentence builder: explicit input alternative and centered slot labels. */
.kihon-input-modes span:first-child{position:relative;margin-right:52px}
.kihon-input-modes span:first-child::after{content:'oppure';position:absolute;left:calc(100% + 10px);top:50%;transform:translateY(-50%);color:rgba(255,255,255,.72);font:800 10px sans-serif;text-transform:uppercase}
.kihon-build-slots>span{width:100%;text-align:center}

/* The Kihon path grows horizontally as new lessons are released. */
.kihon-lesson-rail{scroll-snap-type:x proximity;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;cursor:grab;padding-inline:2px 24px;mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 34px),transparent)}
.kihon-lesson-rail:active{cursor:grabbing}.kihon-lesson-dot,.kihon-lesson-more{flex:0 0 auto;scroll-snap-align:start}.kihon-lesson-more{padding-right:22px}

/* Kihon lessons 02–04. */
.kihon-course [data-kihon-lesson][hidden]{display:none!important}.kihon-lesson-page{display:grid;gap:18px;margin-top:18px}.kihon-mini-hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,.72fr);align-items:center;min-height:300px;overflow:hidden;border:1px solid var(--bd);border-radius:24px;background:linear-gradient(135deg,#fff9ed,#f5e1ce);box-shadow:0 16px 45px rgba(66,37,17,.1)}.kihon-mini-hero>div:first-child{padding:clamp(28px,5vw,58px)}.kihon-mini-hero h1{margin:10px 0 14px;color:var(--lacca-dk);font:400 clamp(34px,5vw,58px)/1 var(--font-display)}.kihon-mini-hero p{color:var(--ink2);font-size:19px;line-height:1.5}.kihon-mini-hero img{width:100%;height:100%;min-height:300px;object-fit:cover}.kihon-mini-hero.is-negative{background:linear-gradient(135deg,#fff7ec,#f8dcd7)}.kihon-mini-hero.is-particles{background:linear-gradient(135deg,#e8f4f1,#fff9ed)}.kihon-hero-type{display:grid!important;place-items:center;padding:28px!important;color:var(--kihon-coral);font:600 clamp(35px,6vw,67px)/1.05 var(--font-jp);text-align:center}.kihon-hero-type small{display:block;margin-top:14px;color:var(--ink3);font:800 11px sans-serif}.kihon-lesson-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.kihon-concept-card{padding:clamp(22px,3vw,34px);border:1px solid var(--bd);border-radius:19px;background:rgba(255,255,255,.65)}.kihon-concept-card h2{margin:8px 0 18px;color:var(--lacca-dk);font:400 clamp(25px,3vw,35px)/1.08 var(--font-display)}.kihon-concept-card p{color:var(--ink2);font-size:16px;line-height:1.5}.kihon-concept-card aside{margin-top:18px;padding:12px;border-radius:12px;background:#e9f4f1;color:#174f4c;font-size:13px}.kihon-formula,.kihon-switcher,.kihon-choice-row{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin:16px 0}.kihon-formula b,.kihon-switcher button,.kihon-choice-row button{padding:10px 12px;border:1px solid var(--bd2);border-radius:10px;background:var(--parchment);color:var(--ink);font:700 15px var(--font-jp)}.kihon-switcher button,.kihon-choice-row button{cursor:pointer}.kihon-switcher button.is-selected{border-color:var(--kihon-teal);background:#dff1ed}.kihon-live-sentence{text-align:center!important;color:var(--ink)!important;font:600 23px var(--font-jp)!important}.kihon-live-sentence strong{display:block;color:var(--kihon-coral);font:700 14px var(--font)}.kihon-choice-row button.is-correct{background:#dff5eb;color:#155f4f}.kihon-choice-row button.is-wrong{background:#fde5e1;color:#8d2c24}.kihon-transform{display:grid;gap:10px;text-align:center}.kihon-transform span{padding:13px;border-radius:11px;background:var(--parchment);font:600 18px var(--font-jp)}.kihon-transform small{display:block;font:600 12px var(--font)}.kihon-particle-cloud{display:grid!important;grid-template-columns:repeat(3,58px);gap:10px;justify-content:center;padding:28px!important}.kihon-particle-cloud b{display:grid;place-items:center;aspect-ratio:1;border-radius:50%;background:#fffaf0;color:var(--kihon-teal);font:700 29px var(--font-jp)}.kihon-particle-grid{display:grid;grid-template-columns:repeat(6,minmax(105px,1fr));gap:10px}.kihon-particle-grid button{display:grid;place-items:center;padding:16px 8px;border:1px solid var(--bd);border-radius:15px;background:rgba(255,255,255,.65);color:var(--ink)}.kihon-particle-grid button.is-selected{border-color:var(--kihon-teal);background:#e2f2ee}.kihon-particle-grid b{font:700 33px var(--font-jp);color:var(--kihon-coral)}.kihon-particle-grid span{font:700 10px sans-serif}.kihon-particle-grid strong{margin-top:6px;font-size:11px}.kihon-particle-detail{display:flex;align-items:center;gap:20px;padding:22px;border-radius:17px;background:#e9f4f1}.kihon-particle-detail>div{min-width:74px;text-align:center}.kihon-particle-detail span{display:block;color:var(--kihon-teal);font:700 42px var(--font-jp)}.kihon-particle-detail strong,.kihon-particle-detail em{display:block}.kihon-particle-detail em{font:600 20px var(--font-jp)}
@media(max-width:820px){.kihon-mini-hero{grid-template-columns:1fr}.kihon-mini-hero img{max-height:360px;object-fit:contain}.kihon-lesson-grid{grid-template-columns:1fr}.kihon-particle-grid{grid-template-columns:repeat(3,1fr)}}@media(max-width:480px){.kihon-mini-hero>div:first-child{padding:25px 19px}.kihon-mini-hero h1{font-size:37px}.kihon-particle-grid{grid-template-columns:repeat(2,1fr)}.kihon-particle-detail{align-items:flex-start;padding:16px}}
.kihon-practice-card{position:relative;overflow:visible}.kihon-success-banner{position:absolute;z-index:50;left:50%;bottom:18px;display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;align-items:center;column-gap:10px;min-width:min(290px,calc(100% - 28px));padding:12px 18px;border:1px solid rgba(255,255,255,.72);border-radius:16px;background:linear-gradient(135deg,#207b67,#39a487);color:#fff;box-shadow:0 16px 38px rgba(19,91,73,.3);opacity:0;transform:translate(-50%,18px) scale(.9);transition:opacity .24s ease,transform .38s cubic-bezier(.2,.9,.25,1.25)}.kihon-success-banner.is-visible{opacity:1;transform:translate(-50%,0) scale(1)}.kihon-success-banner>span{grid-row:1/3;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#fff;color:#207b67;font:800 16px var(--font-jp)}.kihon-success-banner strong{font:800 15px sans-serif}.kihon-success-banner small{color:rgba(255,255,255,.78);font:700 11px sans-serif}.kihon-success-banner .sakura{z-index:60}@media(prefers-reduced-motion:reduce){.kihon-success-banner{transition:none}.kihon-success-banner .sakura{display:none}}
.kihon-particle-practice{width:100%;box-sizing:border-box;margin-top:2px}.kihon-exercise-progress{display:inline-block;padding:5px 9px;border-radius:999px;background:#e2f2ee;color:var(--kihon-teal);font:800 10px sans-serif;text-transform:uppercase}.kihon-particle-practice .kihon-exercise-sentence{margin:18px 0 3px;color:var(--ink);font:600 clamp(24px,4vw,38px) var(--font-jp);text-align:center}.kihon-exercise-translation{display:block;color:var(--ink3);font-size:15px;text-align:center}.kihon-particle-practice .kihon-choice-row{max-width:520px;margin:18px auto 12px}.kihon-particle-practice .kihon-choice-row button{min-width:82px;font-size:23px}.kihon-particle-practice .kihon-choice-row button:disabled{opacity:.58}.kihon-particle-practice .kihon-choice-row button.is-correct{opacity:1}

/* Donut Chart progress widget - test copy */
.progress-widget {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 45;
}

.progress-ring-btn {
  width: 64px;
  height: 58px;
  position: relative;
  border: 0;
  border-radius: 28px;
  background: #1a1a2e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.progress-ring-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.progress-ring-btn:active {
  transform: scale(0.97);
}

/* Let WKWebView pan without waiting for a page-wide touchmove handler. */
html, body {
  touch-action:pan-x pan-y;
}

.progress-widget .ring-svg {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}

.progress-widget .ring-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.progress-widget .ring-pct {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.progress-widget .ring-label {
  display: none;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 1px;
}

.progress-widget .arrow-hint {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.progress-widget .arrow-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

.progress-widget .arrow-icon {
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.4);
  animation: progressBounce 1.2s infinite;
}

@keyframes progressBounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(4px);
  }
}

.progress-widget .progress-card {
  position: absolute;
  top: calc(100% + 18px);
  right: -86px;
  width: min(580px, calc(100vw - 28px));
  max-width: 580px;
  max-height: 0;
  padding: 24px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  background: #1a1a2e;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  transition:
    max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease,
    transform 0.35s ease;
  z-index: 60;
}

.progress-widget .progress-card.open {
  max-height: 660px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.progress-widget .progress-card::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 92px;
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
  background: #1a1a2e;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-widget .progress-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.progress-widget .progress-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.progress-widget .progress-card-title {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.progress-widget .progress-card-subtitle {
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  font-style: italic;
  margin-top: 3px;
}

.progress-widget .dettagli-btn {
  background: transparent;
  border: 1.5px solid #e84057;
  color: #e84057;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.progress-widget .dettagli-btn:hover {
  background: #e84057;
  color: #fff;
}

.progress-widget .progress-card-body {
  display: flex;
  gap: 24px;
  align-items: center;
}

.progress-widget .donut-wrap {
  position: relative;
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-widget .donut-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.progress-widget .donut-pct {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.progress-widget .donut-lbl {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.progress-widget .bars {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-widget .bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.progress-widget .bar-row[data-progress-section] {
  margin: -4px;
  padding: 4px;
  border-radius: 9px;
  cursor: pointer;
}

.progress-widget .bar-row[data-progress-section]:hover,
.progress-widget .bar-row[data-progress-section]:focus-visible {
  background: var(--progress-card-action-bg, rgba(255,255,255,.08));
  outline: 2px solid var(--progress-card-action, #9f1f1f);
  outline-offset: 1px;
}

.progress-widget .bar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.progress-widget .bar-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.progress-widget .bar-name {
  flex: 1;
}

.progress-widget .bar-completion {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
}

.progress-widget .bar-pct {
  font-weight: 700;
  font-size: 13px;
}

.progress-widget .bar-track {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-widget .bar-fill {
  height: 100%;
  border-radius: 99px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-widget .progress-card-footer {
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  display: flex;
  gap: 24px;
  font-size: 12px;
  flex-wrap: wrap;
}

.progress-widget .progress-sensei-summary {
  flex: 1 0 100%;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.45;
  font-style: italic;
}

.progress-widget .footer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.6);
}

.progress-widget .footer-val {
  font-weight: 700;
}

body.theme-dark-base .progress-ring-btn,
body.theme-carbon-fire .progress-ring-btn,
body.theme-shinjuku .progress-ring-btn {
  background: #1a1a2e;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body.theme-dark-base .progress-widget .progress-card,
body.theme-carbon-fire .progress-widget .progress-card,
body.theme-shinjuku .progress-widget .progress-card {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-dark-base .progress-widget .progress-card::before,
body.theme-carbon-fire .progress-widget .progress-card::before,
body.theme-shinjuku .progress-widget .progress-card::before {
  background: #1a1a2e;
}

@media (max-width: 640px) {
  .progress-ring-btn {
    width: 48px;
    height: 44px;
    border-radius: 20px;
  }

  .progress-widget .ring-svg {
    width: 40px;
    height: 40px;
  }

  .progress-widget .ring-pct {
    font-size: 10px;
  }

  .progress-widget .progress-card {
    position: fixed;
    top: 116px;
    left: 4vw;
    right: 4vw;
    width: auto;
    padding: 18px;
    overflow: auto;
  }

  .progress-widget .progress-card.open {
    max-height: calc(100vh - 140px);
  }

  .progress-widget .progress-card::before {
    display: none;
  }

  .progress-widget .progress-card-body {
    flex-direction: column;
    align-items: stretch;
  }

  .progress-widget .progress-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .progress-widget .progress-card-actions {
    width: 100%;
  }

  .progress-widget .progress-card-actions button {
    flex: 1 1 0;
  }

  .progress-widget .donut-wrap {
    margin: 0 auto;
  }
}

/* ── BODY & LAYOUT ── */
html{
  touch-action:manipulation;
  -webkit-text-size-adjust:100%;
}

body{
  font-family:var(--font);
  background:var(--parchment);
  color:var(--ink);
  min-height:100vh;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(184,134,11,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(139,26,26,0.05) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='400' height='400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

button,
a,
[role="button"],
.mode-card,
.lvl-btn,
.ch,
.nbtn{
  touch-action:manipulation;
}

#wrap{
  max-width:640px;
  margin:0 auto;
  padding:2rem 1.25rem 3rem;
  zoom:.9;
}
.screen{display:none;animation:fadeUp .35s ease}
.screen.active{display:block}
body.screen-print-favorites .screen:not(#sc-print-favorites){display:none !important}
body.screen-print-favorites #sc-print-favorites.active{display:block !important}

@keyframes fadeUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.6}}
@keyframes dotBounce{0%,80%,100%{transform:translateY(0)}40%{transform:translateY(-6px)}}

/* ── TYPOGRAPHY ── */
h1{font-family:var(--font-display);font-size:26px;font-weight:400;margin-bottom:4px;color:var(--ink);letter-spacing:.02em}
h2{font-family:var(--font-display);font-size:20px;font-weight:400;margin-bottom:1rem}
h3{font-size:14px;font-weight:600;margin-bottom:.6rem;color:var(--ink2);text-transform:uppercase;letter-spacing:.08em}

/* ── HEADER ── */
.app-header{
  display:flex;align-items:flex-start;justify-content:space-between;
  margin-bottom:2rem;
  padding-bottom:1.5rem;
  border-bottom:1px solid var(--bd);
}
.app-subtitle{font-size:13px;color:var(--ink3);font-style:italic;margin-top:2px;letter-spacing:.02em}
.header-main{
  position:relative;
  min-width:0;
}
.header-menu-wrap{
  position:relative;
  width:max-content;
  margin-top:8px;
}
.header-kanji{
  font-family:var(--font-display);
  font-size:32px;font-weight:400;
  color:var(--lacca);opacity:.9;line-height:1;
  letter-spacing:.03em;
  padding-top:4px;
  text-shadow:2px 3px 8px rgba(139,26,26,0.15);
}
.header-side{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
  flex-shrink:0;
}
.header-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}
.header-icon-btn{
  width:54px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  color:var(--lacca-dk);
  cursor:pointer;
  font-family:var(--font);
  font-weight:800;
  transition:all .18s ease;
}
.header-icon-btn:hover{
  background:transparent;
  transform:translateY(-1px);
}
.header-menu-btn{
  border:1px solid rgba(92,61,46,.22);
  border-radius:14px;
  background:rgba(255,252,245,.56);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.62),
    0 8px 18px rgba(92,61,46,.08);
}
.header-menu-btn[aria-expanded="true"]{
  border-color:rgba(184,134,11,.46);
  background:rgba(255,250,241,.82);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 10px 22px rgba(92,61,46,.12);
}
.header-print-favorites img{
  width:44px;
  height:44px;
  object-fit:contain;
  display:block;
  transform:translateY(4px);
}
.header-print-favorites{
  position:relative;
}
.header-favorites-count{
  position:absolute;
  right:-7px;
  bottom:1px;
  min-width:20px;
  height:20px;
  display:grid;
  place-items:center;
  padding:0 5px;
  border:1px solid rgba(255,248,236,.88);
  border-radius:999px;
  background:linear-gradient(180deg,#b3332f,#8f1c1b);
  color:#fff8ec;
  font-size:11px;
  font-weight:900;
  line-height:1;
  box-shadow:0 4px 10px rgba(74,20,16,.22);
}
.journey-widget{
  position:relative;
  flex:0 0 auto;
}
.journey-trigger{
  width:164px;
  min-height:64px;
  display:grid;
  grid-template-columns:58px 1fr 16px;
  align-items:center;
  gap:8px;
  border:1px solid rgba(163,112,72,.42);
  border-radius:18px;
  padding:7px 10px 7px 8px;
  background:
    radial-gradient(circle at 22% 18%,rgba(255,255,255,.64),transparent 28%),
    linear-gradient(145deg,rgba(255,249,232,.96),rgba(244,225,190,.88));
  color:#2a150b;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.74),
    0 8px 18px rgba(92,61,46,.14);
  cursor:pointer;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.journey-trigger:hover,
.journey-trigger[aria-expanded="true"]{
  transform:translateY(-1px);
  border-color:rgba(184,134,11,.64);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    0 12px 24px rgba(92,61,46,.18);
}
.journey-trigger-map{
  position:relative;
  width:56px;
  height:46px;
  display:block;
  border-radius:14px;
  overflow:hidden;
  background:#f4ead0;
  border:1px solid rgba(163,112,72,.18);
}
.journey-map-island{
  position:absolute;
  left:12px;
  top:5px;
  width:28px;
  height:34px;
  border-radius:56% 44% 48% 52%;
  background:linear-gradient(145deg,#a6c879,#6d9f55);
  transform:rotate(24deg);
  box-shadow:
    6px 10px 0 -7px #8fba64,
    -6px 22px 0 -8px #76a95c,
    12px 24px 0 -9px #9cc871;
}
.journey-map-route{
  position:absolute;
  left:17px;
  top:12px;
  width:27px;
  height:22px;
  border-top:3px dotted rgba(255,250,238,.92);
  border-right:3px dotted rgba(255,250,238,.92);
  border-radius:50%;
  transform:rotate(18deg);
}
.journey-map-pin{
  position:absolute;
  left:26px;
  top:18px;
  width:14px;
  height:14px;
  border-radius:50% 50% 50% 0;
  background:#d24b3c;
  transform:rotate(-45deg);
  box-shadow:0 2px 6px rgba(116,38,28,.25);
}
.journey-map-pin::after{
  content:"";
  position:absolute;
  inset:4px;
  border-radius:50%;
  background:#fff5dd;
}
.journey-trigger-copy{
  display:grid;
  gap:2px;
  min-width:0;
  text-align:left;
}
.journey-trigger-place{
  font-size:15px;
  font-weight:900;
  line-height:1.05;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.journey-trigger-day,
.journey-trigger-km{
  color:#4f3627;
  font-size:12px;
  font-weight:800;
  line-height:1.1;
}
.journey-trigger-arrow{
  color:#8a5a32;
  font-size:36px;
  font-weight:900;
  line-height:1;
}
.journey-card{
  position:fixed;
  z-index:70;
  top:96px;
  left:50%;
  width:min(94vw,980px);
  max-height:calc(100vh - 118px);
  overflow:auto;
  display:none;
  transform:translateX(-50%) translateY(-8px);
  opacity:0;
  pointer-events:none;
  border:1px solid rgba(173,126,77,.42);
  border-radius:24px;
  padding:20px;
  background:
    radial-gradient(circle at 20% 14%,rgba(255,255,255,.62),transparent 18%),
    radial-gradient(circle at 74% 22%,rgba(228,197,134,.24),transparent 24%),
    linear-gradient(135deg,#fbefd6 0%,#f3dfb9 52%,#ecd2a5 100%);
  box-shadow:0 24px 70px rgba(49,31,20,.26),inset 0 1px 0 rgba(255,255,255,.68);
  transition:opacity .2s ease,transform .2s ease;
}
.journey-card.open{
  display:block;
  opacity:1;
  pointer-events:auto;
  transform:translateX(-50%) translateY(0);
}
body.journey-diary-open{
  overflow:hidden;
}
.journey-card-main{
  display:grid;
  grid-template-columns:260px minmax(300px,1fr) 260px;
  gap:18px;
  align-items:stretch;
}
.journey-card-info,
.journey-map-panel,
.journey-unlocks{
  min-width:0;
}
.journey-title-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:18px;
}
.journey-title{
  font-family:var(--font-display);
  color:#1f0d05;
  font-size:40px;
  line-height:1;
  letter-spacing:.08em;
}
.journey-subtitle{
  margin-top:6px;
  color:#4f3627;
  font-size:14px;
  font-weight:800;
}
.journey-stamp{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border:2px solid #b63a2d;
  color:#b63a2d;
  font-family:var(--font-display);
  font-size:18px;
  line-height:1;
}
.journey-stat-list{
  border:1px solid rgba(163,112,72,.28);
  border-radius:12px;
  padding:11px 14px;
  background:rgba(255,252,245,.42);
}
.journey-stat{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:9px 0;
  border-bottom:1px dashed rgba(163,112,72,.24);
  color:#5c3d2e;
  font-size:13px;
  font-weight:800;
}
.journey-stat:last-child{border-bottom:0}
.journey-stat strong{
  color:#241008;
  text-align:right;
}
.journey-level-strip{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:6px;
  margin-top:14px;
}
.journey-level-strip span{
  display:grid;
  place-items:center;
  min-height:28px;
  border:1px solid rgba(163,112,72,.24);
  border-radius:999px;
  background:rgba(255,252,245,.38);
  color:#6a4a35;
  font-size:12px;
  font-weight:900;
}
.journey-level-strip span.active{
  background:#be3f36;
  border-color:#be3f36;
  color:#fff8e8;
}
.journey-map-panel{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:310px;
}
.journey-map-art{
  position:relative;
  min-height:280px;
  border-radius:18px;
  overflow:hidden;
  background:
    radial-gradient(circle at 20% 28%,rgba(105,158,188,.18),transparent 18%),
    radial-gradient(circle at 78% 68%,rgba(105,158,188,.16),transparent 20%),
    linear-gradient(180deg,rgba(237,248,245,.28),rgba(255,248,229,.15));
}
.journey-fuji{
  position:absolute;
  left:58px;
  top:36px;
  width:132px;
  height:92px;
  clip-path:polygon(50% 0,100% 100%,0 100%);
  background:linear-gradient(145deg,#d8e7e8 0 28%,#80a5b5 29% 60%,#6b8c9f 61%);
  opacity:.72;
}
.journey-fuji::after{
  content:"";
  position:absolute;
  left:43px;
  top:18px;
  width:46px;
  height:34px;
  clip-path:polygon(50% 0,100% 100%,0 100%);
  background:#fff9eb;
}
.journey-sea-cloud{
  position:absolute;
  width:72px;
  height:20px;
  border-radius:999px;
  border-top:4px solid rgba(108,144,160,.34);
  opacity:.72;
}
.cloud-a{left:28px;top:180px}
.cloud-b{right:42px;top:54px}
.journey-japan-shape{
  position:absolute;
  left:222px;
  top:18px;
  width:248px;
  height:226px;
}
.journey-japan-shape::before{
  content:"";
  position:absolute;
  left:56px;
  top:15px;
  width:118px;
  height:190px;
  border-radius:56% 44% 48% 52%;
  background:linear-gradient(145deg,#b1cf7b,#70a35a);
  transform:rotate(34deg);
  box-shadow:
    -58px 140px 0 -34px #8fbd68,
    -94px 167px 0 -42px #7fae5f,
    74px -6px 0 -54px #9fca74,
    105px -28px 0 -58px #6f9f58;
}
.journey-route-line{
  position:absolute;
  left:54px;
  top:54px;
  width:156px;
  height:132px;
  border-top:5px dotted rgba(255,248,232,.92);
  border-right:5px dotted rgba(255,248,232,.92);
  border-bottom:5px dotted rgba(255,248,232,.92);
  border-radius:54%;
  transform:rotate(34deg);
  z-index:2;
}
.journey-node{
  position:absolute;
  width:12px;
  height:12px;
  border-radius:50%;
  background:#fff5df;
  border:2px solid #d45648;
  z-index:3;
}
.node-1{left:42px;top:170px}
.node-2{left:82px;top:146px}
.node-3{left:126px;top:126px}
.node-4{left:145px;top:92px}
.node-5{left:184px;top:66px}
.journey-node.current{width:18px;height:18px;background:#fbd666}
.journey-pin-large{
  position:absolute;
  left:137px;
  top:76px;
  width:38px;
  height:38px;
  border-radius:50% 50% 50% 0;
  background:#d84e42;
  transform:rotate(-45deg);
  box-shadow:0 10px 18px rgba(116,38,28,.28);
  z-index:4;
}
.journey-pin-large::after{
  content:"";
  position:absolute;
  inset:10px;
  border-radius:50%;
  background:#fff4df;
}
.journey-pin-label{
  position:absolute;
  left:124px;
  top:42px;
  z-index:5;
  border-radius:10px;
  padding:8px 14px;
  background:#3b2419;
  color:#fff8ec;
  font-size:14px;
  font-weight:900;
  box-shadow:0 8px 18px rgba(49,31,20,.18);
}
.journey-pin-label::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-7px;
  width:12px;
  height:12px;
  background:#3b2419;
  transform:translateX(-50%) rotate(45deg);
}
.journey-path{
  margin-top:10px;
  color:#4d3324;
  text-align:center;
  font-size:13px;
  font-weight:900;
  letter-spacing:.02em;
}
.journey-unlocks{
  display:grid;
  gap:12px;
}
.journey-unlock-card{
  border:1px solid rgba(163,112,72,.3);
  border-radius:14px;
  padding:14px;
  background:rgba(255,252,245,.46);
}
.journey-unlock-kicker{
  color:#6a4a35;
  font-size:11px;
  font-weight:900;
  letter-spacing:.13em;
  text-transform:uppercase;
  margin-bottom:10px;
}
.journey-unlock-row{
  display:grid;
  grid-template-columns:58px 1fr;
  gap:12px;
  align-items:center;
}
.journey-location-medallion,
.journey-yokai-medallion{
  width:58px;
  height:58px;
  display:grid;
  place-items:center;
  border-radius:50%;
  border:1px solid rgba(163,112,72,.36);
  background:linear-gradient(145deg,#f7e8c6,#dcc18b);
  color:#7d2d20;
  font-family:var(--font-display);
  font-size:28px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72);
}
.journey-yokai-medallion{
  color:#ba3c30;
  background:linear-gradient(145deg,#fff1ce,#f0cc82);
}
.journey-unlock-card h3{
  margin:0 0 4px;
  color:#241008;
  font-size:18px;
  letter-spacing:0;
  text-transform:none;
}
.journey-unlock-card p{
  margin:4px 0 0;
  color:#4f3627;
  font-size:12px;
  font-weight:700;
  line-height:1.38;
}
.journey-rarity{
  display:inline-block;
  border:1px solid rgba(184,134,11,.52);
  border-radius:999px;
  padding:3px 7px;
  background:#f7ce69;
  color:#4b2e0e;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
}
.journey-continue-btn{
  width:100%;
  min-height:54px;
  border:1px solid rgba(95,23,19,.42);
  border-radius:16px;
  background:linear-gradient(180deg,#c64f47,#9f2f2d);
  color:#fff9ef;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.26),0 10px 22px rgba(113,39,31,.22);
  font-size:18px;
  font-weight:900;
  cursor:pointer;
  transition:transform .18s ease,box-shadow .18s ease;
}
.journey-continue-btn:hover{
  transform:translateY(-1px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.3),0 13px 26px rgba(113,39,31,.28);
}
.journey-continue-btn span{
  display:inline-grid;
  place-items:center;
  width:24px;
  height:24px;
  margin-left:8px;
  border-radius:50%;
  background:rgba(255,255,255,.18);
}
.header-search-icon{
  width:36px;
  height:36px;
  display:block;
  transform:translateY(3px);
}
.header-search-icon .lens-fill{
  fill:#ecf9fc;
}
.header-search-icon .lens-stroke,
.header-search-icon .lens-shine{
  fill:none;
  stroke:#1a0a00;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.header-search-icon .lens-stroke{
  stroke-width:3.2;
}
.header-search-icon .lens-shine{
  stroke-width:2.8;
}
.header-search-btn:hover .lens-stroke,
.header-search-btn:hover .lens-shine{
  stroke:var(--gold);
}
.header-menu-icon{
  width:36px;
  height:36px;
  display:block;
}
.header-menu-icon path{
  fill:none;
  stroke:#1a0a00;
  stroke-width:3.2;
  stroke-linecap:round;
}
.header-menu-btn[aria-expanded="true"] .header-menu-icon path{
  stroke:var(--gold);
}
@media (hover:hover) and (pointer:fine){
  .header-menu-btn:hover{
    border-color:rgba(184,134,11,.46);
    background:rgba(255,250,241,.82);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.72),
      0 10px 22px rgba(92,61,46,.12);
  }
  .header-menu-btn:hover .header-menu-icon path{
    stroke:var(--gold);
  }
}
.home-menu-panel{
  position:absolute;
  left:0;
  top:calc(100% + 8px);
  z-index:30;
  min-width:220px;
  padding:14px;
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,252,245,.96);
  box-shadow:0 18px 42px rgba(92,61,46,.16);
  backdrop-filter:blur(10px);
}
.home-menu-section{
  display:grid;
  gap:10px;
}
.home-menu-title{
  color:var(--ink3);
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.theme-menu-options{
  display:grid;
  gap:8px;
}
.theme-option{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  min-height:38px;
  padding:8px 10px;
  border:1px solid rgba(92,61,46,.16);
  border-radius:12px;
  background:rgba(255,255,255,.56);
  color:var(--ink2);
  font-family:var(--font);
  font-size:13px;
  font-weight:800;
  text-align:left;
  cursor:pointer;
  transition:all .18s ease;
}
.theme-option.release-hidden-theme{
  display:none !important;
}
.theme-option:hover,
.theme-option.active{
  border-color:var(--gold);
  color:var(--lacca);
  background:rgba(255,250,241,.86);
}
.theme-swatch{
  width:18px;
  height:18px;
  border-radius:50%;
  border:1px solid rgba(26,10,0,.18);
  flex:0 0 auto;
  box-shadow:inset 0 0 0 3px rgba(255,255,255,.46);
}
.theme-swatch-classic{
  background:linear-gradient(135deg,#f7efe0 0%,#9f1d1d 55%,#c58f21 100%);
}
.theme-swatch-ink{
  background:linear-gradient(135deg,#f7efe0 0%,#1a0a00 58%,#8f7d67 100%);
}
.theme-swatch-sakura{
  background:linear-gradient(135deg,#fff7f8 0%,#d89aaa 56%,#8b1a1a 100%);
}
.theme-swatch-shinjuku{
  background:
    radial-gradient(circle at 30% 28%, rgba(0,216,255,.92) 0 13%, transparent 15%),
    radial-gradient(circle at 72% 70%, rgba(255,55,95,.95) 0 18%, transparent 20%),
    linear-gradient(135deg,#07080b 0%,#111521 44%,#ff375f 72%,#00d8ff 100%);
  border-color:rgba(255,55,95,.48);
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,.09),
    0 0 10px rgba(255,55,95,.22),
    0 0 14px rgba(0,216,255,.14);
}

/* ── HOME STUDY CARDS ── */
.home-briefing-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  align-items:stretch;
  margin:-.75rem 0 1.05rem;
}
.home-briefing-row.sensei-hidden{
  grid-template-columns:1fr;
}
.home-briefing-row.sensei-hidden .daily-kanji{
  height:auto;
  min-height:112px;
}
.sensei-banner{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-areas:
    "copy"
    "actions";
  align-items:center;
  gap:10px 12px;
  height:176px;
  min-height:0;
  margin:0;
  padding:14px;
  overflow:hidden;
  border:1px solid rgba(156,104,74,.24);
  border-radius:var(--r);
  background:
    linear-gradient(135deg,rgba(255,252,245,.88),rgba(255,246,226,.66)),
    radial-gradient(circle at 8% 20%,rgba(197,143,33,.16),transparent 30%);
  box-shadow:0 10px 28px rgba(92,61,46,.10);
  backdrop-filter:blur(8px);
  transform-origin:center;
  transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease,filter .2s ease;
}
@media (min-width:921px) and (hover:hover) and (pointer:fine){
  .sensei-banner:hover{
    transform:translateY(-2px);
    border-color:rgba(197,143,33,.48);
    box-shadow:
      0 16px 34px rgba(92,61,46,.16),
      0 0 0 1px rgba(197,143,33,.18),
      0 0 22px rgba(197,143,33,.14);
    filter:brightness(1.015);
  }
  body.theme-rilievo .sensei-banner:hover{
    border-color:transparent;
    box-shadow:var(--ri-up-hover);
  }
  body.theme-carbon-fire .sensei-banner:hover{
    border-color:rgba(255,48,70,.24);
    box-shadow:
      inset 1px 1px 0 rgba(255,255,255,.12),
      inset -2px -2px 4px rgba(0,0,0,.78),
      0 16px 38px rgba(0,0,0,.48),
      0 0 0 1px rgba(255,48,70,.24),
      0 0 22px rgba(255,48,70,.14);
  }
  body.theme-dark-base .sensei-banner:hover{
    border-color:rgba(255,55,95,.28);
    box-shadow:var(--pc-shadow),var(--pc-glow);
  }
}

/* iPhone landscape: the Sensei card must answer to a finger exactly as it
   answers to the desktop cursor. Keep this separate from the desktop hover
   query so portrait retains its quieter, compact behaviour. */
@media (orientation:landscape) and (max-height:520px) and (hover:none) and (pointer:coarse){
  .sensei-banner:hover,
  .sensei-banner:active{
    transform:translateY(-2px);
    border-color:rgba(197,143,33,.48);
    box-shadow:
      0 16px 34px rgba(92,61,46,.16),
      0 0 0 1px rgba(197,143,33,.18),
      0 0 22px rgba(197,143,33,.14);
    filter:brightness(1.015);
  }
  body.theme-rilievo .sensei-banner:hover,
  body.theme-rilievo .sensei-banner:active{
    border-color:transparent;
    box-shadow:var(--ri-up-hover);
  }
  body.theme-carbon-fire .sensei-banner:hover,
  body.theme-carbon-fire .sensei-banner:active,
  body.theme-carbon-flat .sensei-banner:hover,
  body.theme-carbon-flat .sensei-banner:active{
    border-color:rgba(255,48,70,.24);
    box-shadow:
      inset 1px 1px 0 rgba(255,255,255,.12),
      inset -2px -2px 4px rgba(0,0,0,.78),
      0 16px 38px rgba(0,0,0,.48),
      0 0 0 1px rgba(255,48,70,.24),
      0 0 22px rgba(255,48,70,.14);
  }
  body.theme-dark-base .sensei-banner:hover,
  body.theme-dark-base .sensei-banner:active{
    border-color:rgba(255,55,95,.28);
    box-shadow:var(--pc-shadow),var(--pc-glow);
  }
  body.theme-shinjuku .sensei-banner:hover,
  body.theme-shinjuku .sensei-banner:active{
    border-color:rgba(0,232,255,.42);
    box-shadow:
      0 0 0 1px rgba(255,47,134,.22),
      0 0 28px rgba(0,232,255,.24),
      0 0 30px rgba(255,47,134,.18),
      0 18px 38px rgba(0,0,0,.58);
  }
}
@media (prefers-reduced-motion:reduce){
  .sensei-banner{transition:border-color .2s ease,box-shadow .2s ease,filter .2s ease}
  .sensei-banner:hover,
  .sensei-banner:active{transform:none !important}
}
body.theme-rilievo .sensei-banner{
  position:relative;
  isolation:isolate;
}
body.theme-rilievo .sensei-banner::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:url("assets/sensei-profile-washi-bg-waves-v2.png") center / cover no-repeat;
}
body.theme-rilievo .sensei-banner > *{
  position:relative;
  z-index:1;
}
.sensei-mark{
  grid-area:mark;
  display:none !important;
  width:52px;
  height:52px;
  place-items:center;
  border-radius:16px;
  border:1px solid rgba(147,25,24,.28);
  background:linear-gradient(145deg,#fff7e8,#e7c98c);
  color:#931918;
  font-family:"Noto Serif JP",serif;
  font-size:19px;
  font-weight:900;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.74),0 8px 18px rgba(147,25,24,.12);
}
.sensei-copy{min-width:0}
.sensei-copy{
  grid-area:copy;
}
.sensei-copy h2{
  margin:1px 0 3px;
  color:var(--ink);
  font-size:19px;
  line-height:1.1;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.sensei-copy p{
  margin:0;
  max-width:760px;
  color:var(--ink2);
  font-size:12px;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.sensei-insights{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:5px;
  margin-top:7px;
  overflow:hidden;
}
.sensei-chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  min-height:24px;
  padding:4px 7px;
  border-radius:999px;
  border:1px solid rgba(92,61,46,.16);
  background:rgba(255,255,255,.55);
  color:var(--ink2);
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
  min-width:0;
  justify-content:center;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sensei-chip strong{color:var(--lacca)}
.sensei-actions{
  grid-area:actions;
  display:flex;
  flex-direction:row;
  align-items:stretch;
  gap:6px;
  min-width:0;
}
.sensei-actions button{
  flex:1 1 0;
  min-height:34px;
  padding:7px 9px;
  border-radius:10px;
  font-family:var(--font);
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}
.sensei-primary{
  border:0;
  background:linear-gradient(180deg,#b53a35,#8f1c1b);
  color:#fff8ec;
  box-shadow:0 10px 22px rgba(147,25,24,.18);
}
.sensei-secondary{
  border:1px solid rgba(147,25,24,.28);
  background:rgba(255,255,255,.44);
  color:#8b2d27;
}
.sensei-restore{
  align-self:start;
  justify-self:stretch;
  min-height:48px;
  padding:10px 14px;
  border:1px solid rgba(147,25,24,.24);
  border-radius:14px;
  background:rgba(255,255,255,.56);
  color:#8b2d27;
  font:inherit;
  font-weight:900;
  cursor:pointer;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  box-shadow:0 10px 26px rgba(92,61,46,.08);
}
body.theme-rilievo .sensei-restore{
  position:relative;
  isolation:isolate;
}
body.theme-rilievo .sensei-restore::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  border-radius:inherit;
  pointer-events:none;
  background:url("assets/sensei-profile-washi-bg-waves-v2.png") center 67% / 100% auto no-repeat;
}
body.theme-rilievo .sensei-restore > *{
  position:relative;
  z-index:1;
}
.sensei-restore span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sensei-hidden-ninja{
  width:39px;
  height:39px;
  flex:0 0 39px;
  display:grid;
  place-items:center;
  overflow:visible;
  transform:translateX(-62px);
  border:0;
  background:transparent;
  padding:0;
  cursor:pointer;
}
/* iPad Pro 12.9/13-inch only: move the hidden Sensei head 7 mm to the right.
   Keep its vertical position, size and the iPhone layout unchanged. */
@media (min-width:1000px) and (min-height:1000px){
  .sensei-hidden-ninja{
    transform:translateX(-26px);
  }
}
.sensei-hidden-ninja:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:4px;
}
.sensei-hidden-ninja img{
  grid-area:1 / 1;
  width:39px;
  height:39px;
  object-fit:contain;
  display:block;
}
.sensei-hidden-ninja-red{
  display:none !important;
}
body.theme-carbon-fire .sensei-hidden-ninja-black,
body.theme-carbon-flat .sensei-hidden-ninja-black{
  display:none !important;
}
body.theme-carbon-fire .sensei-hidden-ninja-red,
body.theme-carbon-flat .sensei-hidden-ninja-red{
  display:block !important;
}
.sensei-restore-open{
  border:0;
  background:transparent;
  padding:6px 0 6px 8px;
  color:#931918;
  font:inherit;
  font-weight:900;
  font-size:13px;
  cursor:pointer;
}
.home-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin:-.75rem 0 1.75rem;
}
.home-card{
  border:1px solid var(--bd);
  border-radius:var(--r);
  background:rgba(255,255,255,.52);
  padding:16px;
  box-shadow:0 4px 18px rgba(26,10,0,.05);
  backdrop-filter:blur(6px);
}
.daily-kanji{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  grid-template-areas:
    "head head"
    "kanji title"
    "kanji readings"
    "note note";
  column-gap:13px;
  row-gap:2px;
  height:176px;
  min-height:0;
  padding:14px;
  align-items:center;
  overflow:hidden;
}
body.theme-rilievo .daily-kanji{
  position:relative;
  isolation:isolate;
}
body.theme-rilievo .daily-kanji::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:url("assets/sensei-profile-washi-bg-waves-v2.png") center / cover no-repeat;
  -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 58%,rgba(0,0,0,.72) 76%,transparent 100%);
  mask-image:linear-gradient(to bottom,#000 0%,#000 58%,rgba(0,0,0,.72) 76%,transparent 100%);
}

body.theme-rilievo .daily-kanji > *{
  position:relative;
  z-index:1;
}

/* Touch iOS: neutralizza l'hover che WebKit può lasciare agganciato dopo un
   tap. Il rilievo luminoso resta visibile soltanto durante la pressione. */
@media(hover:none), (pointer:coarse){
  body.theme-rilievo .sensei-banner:hover,
  body.theme-rilievo .daily-kanji:hover{
    transform:none !important;
    border-color:transparent !important;
    box-shadow:var(--ri-up) !important;
    filter:none !important;
  }
  body.theme-rilievo .sensei-banner:active,
  body.theme-rilievo .daily-kanji:active{
    transform:translateY(-2px) !important;
    box-shadow:var(--ri-up-hover) !important;
  }
}
.home-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.daily-kanji .home-card-head{
  grid-area:head;
  margin-bottom:0;
}
.home-kicker{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.14em;
  color:var(--ink3);
  font-weight:700;
}
.daily-kanji-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
.daily-kanji-fav{
  width:32px;
  height:32px;
  border:1px solid transparent;
  border-radius:999px;
  background:transparent;
  margin-top:0;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.daily-kanji-fav{
  font-size:24px;
}
.daily-kanji-fav.unsaved{
  color:var(--ink3);
  text-shadow:none;
  filter:none;
}
.daily-kanji-fav.saved{
  color:var(--gold-lt);
  text-shadow:0 1px 4px rgba(184,134,11,.28);
}
.daily-kanji-back{
  width:32px;
  height:32px;
  border:0;
  border-radius:0;
  background:transparent;
  margin-top:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--lacca);
  font-size:17px;
  font-weight:800;
  font-family:var(--font);
  cursor:pointer;
}
.daily-kanji-fav:hover,
.daily-kanji-fav:active,
.daily-kanji-fav:focus,
.daily-kanji-fav:focus-visible,
.daily-kanji-fav.saved,
.daily-kanji-fav.unsaved{
  border-color:transparent !important;
  outline:0 !important;
  background-color:transparent !important;
  background-image:none !important;
  box-shadow:none !important;
  -webkit-appearance:none;
  appearance:none;
  -webkit-tap-highlight-color:transparent;
}
.daily-kanji-back:hover{
  background:transparent;
  color:var(--gold);
}
.daily-kanji-next{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:0;
  background:transparent;
  padding:0;
  cursor:pointer;
  transition:transform .15s ease;
}
.daily-kanji-next:hover{
  background:transparent;
  transform:scale(1.12);
}
.daily-refresh-icon{
  width:24px;
  height:24px;
  display:block;
  color:var(--ink3);
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
  transition:color .15s ease;
}
.daily-kanji-next:hover .daily-refresh-icon{
  color:var(--gold);
}
.daily-kanji-fav.unsaved + .daily-kanji-next .daily-refresh-icon{
  color:var(--ink3);
  filter:none;
}
.daily-kanji-next.unsaved .daily-refresh-icon{
  color:var(--ink3);
  filter:none;
}
.home-kanji{
  grid-area:kanji;
  font-family:var(--font-jp);
  font-size:50px;
  line-height:1;
  color:var(--lacca);
  margin-bottom:0;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.daily-term-reference .home-kanji{
  font-size:30px;
  line-height:1.12;
  max-width:100%;
  word-break:keep-all;
}
.home-title{
  grid-area:title;
  font-size:16px;
  color:var(--ink);
  font-weight:600;
  margin-bottom:0;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.daily-term-reference .home-title{
  font-size:15px;
  line-height:1.18;
}
.home-note{
  grid-area:note;
  font-size:12px;
  color:var(--ink2);
  line-height:1.35;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.daily-note-entry{
  display:inline;
}
.daily-note-link{
  display:inline-flex;
  align-items:baseline;
  gap:1px;
  max-width:100%;
  border:none;
  background:rgba(255,255,255,.48);
  color:var(--ink);
  font-family:var(--font-jp);
  font-size:13px;
  font-weight:700;
  line-height:1.5;
  padding:1px 4px;
  border-radius:6px;
  border-bottom:1px dotted rgba(139,26,26,.55);
  cursor:pointer;
  white-space:nowrap;
}
.daily-note-link:hover{
  color:var(--lacca);
  background:rgba(249,236,236,.78);
}
.daily-note-link span{
  color:var(--ink2);
  font-weight:500;
}
.daily-note-meaning,
.daily-note-text,
.daily-note-sep{
  color:var(--ink2);
}
.home-favorites-card{
  border-color:rgba(184,134,11,.28);
  background:rgba(255,255,255,.6);
}
.home-favorites-title{
  margin-top:4px;
  font-size:18px;
  color:var(--ink);
  font-weight:700;
}
.home-favorites-title span{
  color:var(--lacca);
  font-family:var(--font-jp);
}
.home-favorites-toggle{
  border:1px solid rgba(184,134,11,.42);
  border-radius:999px;
  background:var(--gold-bg);
  color:var(--amber);
  padding:7px 12px;
  font-family:var(--font);
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.home-favorites-toggle:hover:not(:disabled){
  border-color:var(--gold);
  transform:translateY(-1px);
}
.home-favorites-toggle:disabled{
  opacity:.45;
  cursor:default;
}
.home-favorites-list{
  display:grid;
  gap:8px;
  margin-top:12px;
  max-height:360px;
  overflow:auto;
  padding-right:2px;
}
.home-favorites-list.collapsed{
  display:none;
  margin-top:0;
}
.home-fav-empty{
  border:1px dashed rgba(156,104,74,.28);
  border-radius:var(--rm);
  padding:12px;
  color:var(--ink3);
  font-size:13px;
  font-style:italic;
  background:rgba(255,255,255,.35);
}
.home-fav-row{
  display:grid;
  grid-template-columns:30px 1fr;
  gap:8px;
  align-items:start;
  border:1px solid rgba(184,134,11,.18);
  border-radius:var(--rm);
  background:rgba(255,255,255,.5);
  padding:10px 11px;
}
.home-fav-main{
  border:none;
  background:transparent;
  color:inherit;
  text-align:left;
  cursor:pointer;
  min-width:0;
  font-family:var(--font);
}
.home-fav-main:hover .home-fav-jp{color:var(--lacca)}
.home-fav-source{
  color:var(--gold);
  font-size:9px;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
  margin-bottom:4px;
}
.home-fav-jp{
  font-family:var(--font-jp);
  font-size:15px;
  color:var(--ink);
  line-height:1.55;
  overflow-wrap:anywhere;
}
.home-fav-it{
  color:var(--ink2);
  font-size:12px;
  line-height:1.45;
  margin-top:2px;
  overflow-wrap:anywhere;
}
.reading-grid{
  grid-area:readings;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin:2px 0;
}
.reading-grid div{
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.5);
  padding:6px 8px;
}
.reading-grid span{
  display:block;
  font-size:9px;
  color:var(--ink3);
  text-transform:uppercase;
  letter-spacing:.12em;
  margin-bottom:3px;
}
.reading-grid strong{
  font-family:var(--font-jp);
  color:var(--ink);
  font-size:13px;
  font-weight:500;
}
.sentence-builder{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}
.sentence-builder select{
  width:100%;
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.75);
  color:var(--ink);
  padding:10px 12px;
  font-family:var(--font-jp);
  outline:none;
}
.phrase-output{
  margin-top:12px;
  padding:12px;
  border-radius:var(--rm);
  background:rgba(237,228,208,.58);
  border-left:3px solid var(--gold);
}
.phrase-jp{
  font-family:var(--font-jp);
  font-size:22px;
  color:var(--ink);
  line-height:1.7;
}
.phrase-reading{
  font-size:12px;
  color:var(--ink3);
  font-style:italic;
  margin-top:2px;
}
.phrase-it{
  font-size:12px;
  color:var(--ink2);
  margin-top:4px;
}
.phrase-examples{
  margin-top:12px;
  display:grid;
  gap:8px;
}
.phrase-ex-title{
  color:var(--ink3);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-weight:700;
}
.phrase-mini{
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.42);
  padding:10px 12px;
}
.phrase-mini-jp{
  font-family:var(--font-jp);
  color:var(--ink);
  font-size:15px;
  line-height:1.6;
}

/* ── SECTION LABEL ── */
.section-label{
  font-size:10px;font-weight:600;letter-spacing:.16em;
  color:var(--ink3);text-transform:uppercase;
  margin-bottom:10px;
  display:flex;align-items:center;gap:8px;
}
.section-label::after{content:'';flex:1;height:1px;background:var(--bd)}

/* ── LEVEL PICKER ── */
.lvl-picker{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:1.75rem}
.lvl-btn{
  padding:13px 4px;border-radius:var(--rm);
  --lvl-accent:var(--lacca);
  --lvl-border:var(--bd);
  --lvl-border-strong:rgba(139,26,26,.38);
  --lvl-bg:rgba(255,255,255,0.5);
  --lvl-bg-strong:rgba(255,255,255,0.82);
  --lvl-shadow:rgba(139,26,26,.12);
  --lvl-shadow-strong:rgba(139,26,26,.18);
  --lvl-sub:var(--ink3);
  --lvl-sub-strong:var(--ink2);
  border:1px solid var(--lvl-border);
  background:var(--lvl-bg);
  cursor:pointer;font-size:14px;font-weight:600;
  color:var(--lvl-accent);text-align:center;
  transition:all .2s ease;font-family:var(--font-jp);
  backdrop-filter:blur(4px);
}
.lvl-n5{
  --lvl-accent:#7b8f2c;
  --lvl-border:rgba(123,143,44,.24);
  --lvl-border-strong:rgba(123,143,44,.42);
  --lvl-bg:linear-gradient(135deg,rgba(242,247,223,.66),rgba(255,255,255,.58));
  --lvl-bg-strong:linear-gradient(135deg,rgba(235,245,202,.9),rgba(255,255,255,.76));
  --lvl-shadow:rgba(123,143,44,.13);
  --lvl-shadow-strong:rgba(123,143,44,.22);
  --lvl-sub:#77844a;
  --lvl-sub-strong:#6f812a;
}
.lvl-n4{
  --lvl-accent:#b17b1f;
  --lvl-border:rgba(177,123,31,.24);
  --lvl-border-strong:rgba(177,123,31,.42);
  --lvl-bg:linear-gradient(135deg,rgba(252,241,214,.68),rgba(255,255,255,.58));
  --lvl-bg-strong:linear-gradient(135deg,rgba(250,231,188,.9),rgba(255,255,255,.76));
  --lvl-shadow:rgba(177,123,31,.13);
  --lvl-shadow-strong:rgba(177,123,31,.22);
  --lvl-sub:#9c7b43;
  --lvl-sub-strong:#9d6b18;
}
.lvl-n3{
  --lvl-accent:#9f4d42;
  --lvl-border:rgba(159,77,66,.24);
  --lvl-border-strong:rgba(159,77,66,.42);
  --lvl-bg:linear-gradient(135deg,rgba(250,228,220,.66),rgba(255,255,255,.58));
  --lvl-bg-strong:linear-gradient(135deg,rgba(246,211,202,.9),rgba(255,255,255,.76));
  --lvl-shadow:rgba(159,77,66,.13);
  --lvl-shadow-strong:rgba(159,77,66,.22);
  --lvl-sub:#9a675f;
  --lvl-sub-strong:#8f3f36;
}
.lvl-n2{
  --lvl-accent:#6b587f;
  --lvl-border:rgba(107,88,127,.24);
  --lvl-border-strong:rgba(107,88,127,.42);
  --lvl-bg:linear-gradient(135deg,rgba(240,232,248,.68),rgba(255,255,255,.58));
  --lvl-bg-strong:linear-gradient(135deg,rgba(228,216,242,.9),rgba(255,255,255,.76));
  --lvl-shadow:rgba(107,88,127,.13);
  --lvl-shadow-strong:rgba(107,88,127,.22);
  --lvl-sub:#786b87;
  --lvl-sub-strong:#5f4d75;
}
.lvl-n1{
  --lvl-accent:#365f86;
  --lvl-border:rgba(54,95,134,.24);
  --lvl-border-strong:rgba(54,95,134,.42);
  --lvl-bg:linear-gradient(135deg,rgba(225,240,247,.68),rgba(255,255,255,.58));
  --lvl-bg-strong:linear-gradient(135deg,rgba(207,230,241,.9),rgba(255,255,255,.76));
  --lvl-shadow:rgba(54,95,134,.13);
  --lvl-shadow-strong:rgba(54,95,134,.22);
  --lvl-sub:#5d7485;
  --lvl-sub-strong:#2f5a7c;
}
.lvl-btn:hover{
  border-color:var(--lvl-border-strong);
  background:var(--lvl-bg-strong);
  transform:translateY(-1px);
  box-shadow:0 4px 12px var(--lvl-shadow);
}
.lvl-btn.sel{
  border-color:var(--lvl-border-strong);
  background:var(--lvl-bg-strong);
  color:var(--lvl-accent);
  box-shadow:0 5px 16px var(--lvl-shadow-strong);
  transform:translateY(-1px);
}
.lvl-sub{font-size:11px;font-weight:500;margin-top:4px;color:var(--lvl-sub);font-family:var(--font);letter-spacing:.025em;font-style:italic}
.lvl-btn.sel .lvl-sub{color:var(--lvl-sub-strong)}

/* ── KANA EMPTY TAB ── */
.kana-tab-wrap{
  margin:0 0 1.75rem;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.kana-tab-card{
  position:relative;
  max-width:100%;
  min-height:96px;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.section-mastery-seal{
  position:absolute;
  z-index:50;
  top:10px;
  right:10px;
  display:block;
  width:43px;
  height:43px;
  object-fit:contain;
  pointer-events:none;
  filter:drop-shadow(0 3px 4px rgba(83,51,6,.22));
}
.section-mastery-seal[hidden]{display:none}
@media(max-width:600px){
  .section-mastery-seal{top:0;right:0;width:34px;height:34px}
}
/* iPhone landscape: conserva esattamente il badge Kiwami del portrait.
   La larghezza landscape supera 600px, quindi usiamo l'altezza corta
   per distinguere l'iPhone da iPad e desktop. */
@media(orientation:landscape) and (max-height:520px){
  .section-mastery-seal{
    top:0;
    right:0;
    width:34px;
    height:34px;
    transform:none;
    transform-origin:center;
  }
}
.kana-tab-card:hover{
  border-color:rgba(48,205,212,.5);
  box-shadow:0 6px 20px rgba(48,205,212,.09);
  transform:translateY(-2px);
}
.kana-tab-card:hover::before{
  opacity:1;
}
.kihon-tab-card .mc-icon{
  letter-spacing:.08em;
}
.kihon-area{
  width:100%;
}
#sc-kihon.active,
#sc-kana.active{
  touch-action:pan-y;
  overscroll-behavior-x:contain;
}
.kihon-intro-card{
  min-height:132px;
}
.kihon-intro-card .home-kicker{font-size:13px}
.kihon-course{--kihon-coral:#b84235;--kihon-teal:#287b77;--kihon-paper:#fffaf0;max-width:1180px;margin:0 auto 80px;color:var(--ink);container-type:inline-size}
.kihon-lesson-rail{display:flex;align-items:center;gap:10px;overflow:auto;padding:4px 2px 14px;scrollbar-width:none}.kihon-lesson-rail::-webkit-scrollbar{display:none}
.kihon-lesson-dot{display:flex;align-items:center;gap:8px;white-space:nowrap;border:1px solid var(--bd);border-radius:999px;padding:7px 13px;background:rgba(255,255,255,.54);color:var(--ink2);font:700 13px var(--font)}
.kihon-lesson-dot span{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--parchment2);font:700 11px sans-serif}.kihon-lesson-dot.is-active{background:var(--ink);color:#fff8e9;border-color:var(--ink)}.kihon-lesson-dot.is-active span{background:var(--kihon-coral);color:white}.kihon-lesson-dot.is-locked{opacity:.52}.kihon-lesson-more{font-size:12px;color:var(--ink3)}
.kihon-story-card{display:grid;grid-template-columns:minmax(300px,.8fr) minmax(460px,1.2fr);overflow:hidden;border:1px solid var(--bd);border-radius:24px;background:var(--kihon-paper);box-shadow:0 18px 50px rgba(66,37,17,.12)}
.kihon-story-copy{padding:clamp(28px,5vw,66px);display:flex;flex-direction:column;justify-content:center}.kihon-eyebrow{color:var(--kihon-coral);font:800 11px/1.2 sans-serif;letter-spacing:.15em;text-transform:uppercase}.kihon-story-copy h1{font:400 clamp(38px,5vw,70px)/.96 var(--font-display);color:var(--lacca-dk);margin:14px 0 20px}.kihon-lead{font-size:clamp(18px,2vw,22px);line-height:1.5;color:var(--ink2)}
.kihon-goal{display:flex;align-items:center;gap:12px;margin:24px 0;padding:12px 14px;border:1px solid rgba(184,134,11,.25);border-radius:12px;background:var(--gold-bg)}.kihon-goal>span{font:700 18px var(--font-jp);color:var(--gold)}.kihon-goal p{line-height:1.35}.kihon-primary{align-self:flex-start;border:0;border-radius:999px;padding:13px 20px;background:var(--kihon-coral);color:#fff;font:800 14px sans-serif;cursor:pointer;box-shadow:0 8px 20px rgba(184,66,53,.2);transition:.2s}.kihon-primary:hover{transform:translateY(-2px)}.kihon-primary span{margin-left:10px}
.kihon-hero-figure{position:relative;min-height:0;aspect-ratio:16/9;background:var(--parchment2);overflow:hidden}.kihon-hero-figure img{display:block;width:100%;height:100%;object-fit:contain;object-position:center}.kihon-hero-labels{position:absolute;inset:0;pointer-events:none}.kihon-hero-labels span{position:absolute;top:35%;transform:translate(-50%,-50%) rotate(1deg);width:13%;text-align:center;color:#4f2d1d;font:700 clamp(12px,1.65vw,25px)/1.1 var(--font-jp);text-shadow:0 1px rgba(255,255,255,.8)}.kihon-hero-labels span:nth-child(1){left:53%}.kihon-hero-labels span:nth-child(2){left:71%}.kihon-hero-labels span:nth-child(3){left:89%}.kihon-hero-labels small{display:block;margin-top:4px;color:#936249;font:700 clamp(7px,.72vw,11px)/1 sans-serif;text-transform:uppercase;letter-spacing:.06em}.kihon-hero-figure figcaption{position:absolute;left:18px;right:18px;bottom:16px;padding:9px 14px;border-radius:999px;background:rgba(26,10,0,.78);backdrop-filter:blur(8px);color:#fff;font:600 13px sans-serif;text-align:center}
.kihon-anatomy-flow{display:grid;gap:18px;margin-top:20px}.kihon-chapter{display:grid;grid-template-columns:70px 1fr;border:1px solid var(--bd);border-radius:20px;background:rgba(255,255,255,.58);box-shadow:0 6px 24px rgba(26,10,0,.05);overflow:hidden;scroll-margin-top:90px}.kihon-chapter-num{display:grid;place-items:start center;padding-top:34px;background:rgba(184,66,53,.07);border-right:1px solid var(--bd);font:600 30px var(--font-jp);color:var(--kihon-coral)}.kihon-chapter-body{padding:clamp(24px,4vw,48px)}.kihon-chapter h2,.kihon-summary h2{margin:7px 0 12px;font:400 clamp(27px,4vw,44px)/1.04 var(--font-display);color:var(--lacca-dk)}.kihon-chapter-body>p{max-width:780px;font-size:18px;line-height:1.55;color:var(--ink2)}
.kihon-hero-labels span{white-space:nowrap;font-size:clamp(10px,1.65vw,25px)}
.kihon-panels{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:28px 0 12px}.kihon-panel{position:relative;min-height:215px;padding:24px 14px 18px;border:1.5px dashed var(--bd2);border-radius:17px;background:var(--parchment);color:var(--ink);opacity:.45;filter:saturate(.4);cursor:pointer;transition:.3s}.kihon-panel:after{content:'→';position:absolute;right:-23px;top:44%;z-index:2;color:var(--ink3);font-size:28px}.kihon-panel:last-child:after{display:none}.kihon-panel.is-revealed{opacity:1;filter:none;border-style:solid;transform:translateY(-3px);box-shadow:0 10px 22px rgba(26,10,0,.08)}.kihon-panel-verb.is-revealed{border-color:var(--kihon-coral);background:#fff2eb}.kihon-panel-count{position:absolute;top:10px;left:12px;font:800 10px sans-serif;color:var(--ink3)}.kihon-panel-icon{display:block;font-size:52px;margin-bottom:10px}.kihon-panel small,.kihon-panel em{display:block}.kihon-panel small{color:var(--ink3);font:800 11px sans-serif;text-transform:uppercase;letter-spacing:.08em}.kihon-panel strong{display:block;margin:6px 0 3px;font:600 27px var(--font-jp)}.kihon-panel em{font-size:14px;color:var(--ink2)}.kihon-tap-hint{text-align:center!important;max-width:none!important;font-size:13px!important;color:var(--kihon-teal)!important}
.kihon-order-compare{display:grid;gap:12px;margin:26px 0}.kihon-order-row{display:grid;grid-template-columns:44px repeat(3,minmax(90px,1fr)) 90px;align-items:center;gap:10px;padding:12px;border-radius:14px;background:var(--parchment);border:1px solid var(--bd)}.kihon-lang{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--ink);color:white;font:800 10px sans-serif}.kihon-word{padding:12px;border-radius:10px;text-align:center;font-size:19px;font-weight:700}.kihon-word.subject{background:#e6f2f0;color:#155d59}.kihon-word.object{background:#fff1cc;color:#795a08}.kihon-word.verb{background:#f9dfdb;color:#8d2c24}.kihon-order-row>strong{text-align:center;font:800 12px sans-serif;color:var(--ink3)}
.kihon-sensei-note{display:flex;gap:14px;align-items:center;padding:14px 18px;border-radius:14px;background:#e9f4f1;color:#174f4c}.kihon-sensei-face,.kihon-avatar{display:grid;place-items:center;flex:0 0 auto;width:46px;height:46px;border-radius:50%;background:var(--kihon-teal);color:#fff;font:700 20px var(--font-jp)}.kihon-sensei-note strong{display:block;font:800 11px sans-serif;text-transform:uppercase;letter-spacing:.08em;margin-bottom:3px}
.kihon-identity-builder{position:relative;margin-top:18px}.kihon-identity-row{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1.15fr);align-items:stretch;gap:8px;margin:14px 0}.kihon-identity-row>i{align-self:center;color:var(--ink3);font-style:normal}.kihon-identity-row .kihon-word,.kihon-identity-ending{display:flex;min-width:0;min-height:94px;flex-direction:column;align-items:center;justify-content:center;padding:10px 7px;border:1px solid var(--bd);border-radius:13px;text-align:center}.kihon-identity-row .kihon-word{background:var(--parchment2);color:var(--ink)}.kihon-identity-row .kihon-word strong,.kihon-identity-ending strong{font:600 clamp(18px,2vw,25px)/1.15 var(--font-jp)}.kihon-identity-row small{font:800 9px sans-serif;color:var(--ink3);letter-spacing:.06em;text-transform:uppercase}.kihon-identity-row em{margin-top:4px;color:var(--ink2);font-size:11px}.kihon-identity-ending{border-color:rgba(184,66,53,.3);background:#fff1e9;color:var(--lacca-dk)}.kihon-identity-builder .kihon-live-sentence{margin:13px 0 5px}.kihon-identity-builder.is-updated .kihon-live-sentence{animation:kihonIdentityPop .34s ease}.kihon-identity-builder .kihon-word-picker{top:auto;max-width:calc(100% - 2px)}@keyframes kihonIdentityPop{0%{transform:scale(.97);opacity:.55}60%{transform:scale(1.025)}100%{transform:scale(1);opacity:1}}@media(max-width:600px){.kihon-identity-row{grid-template-columns:1fr auto 1fr}.kihon-identity-row>i:nth-of-type(2){display:none}.kihon-identity-ending{grid-column:1/4;min-height:62px}.kihon-identity-row .kihon-word{min-height:86px}}
.kihon-order-compare{position:relative}.kihon-composer-hint{padding:9px 12px;border-radius:10px;background:rgba(184,66,53,.08);color:var(--kihon-coral);font:800 12px sans-serif;text-align:center}.kihon-word.is-editable{border:0;cursor:pointer;animation:kihonNudge 3.8s ease-in-out infinite}.kihon-word.is-editable small{display:block;margin-top:4px;font:700 9px sans-serif;opacity:.65;text-transform:uppercase}.kihon-word-picker{position:absolute;z-index:30;width:220px;max-height:255px;overflow:auto;padding:7px;border:1px solid var(--bd2);border-radius:14px;background:#fffaf0;box-shadow:0 16px 36px rgba(26,10,0,.22)}.kihon-word-picker button{display:flex;width:100%;justify-content:space-between;align-items:center;gap:10px;padding:9px;border:0;border-radius:9px;background:transparent;color:var(--ink);cursor:pointer;text-align:left}.kihon-word-picker button:hover{background:var(--parchment2)}.kihon-word-picker small{color:var(--ink3);font-family:var(--font-jp)}.kihon-composer-translation{text-align:center;font:600 22px var(--font-jp);color:var(--ink)}.kihon-composer-translation strong{display:block;margin-top:3px;font:700 15px var(--font);color:var(--kihon-coral)}.kihon-composer-note{text-align:center;font-size:12px;color:var(--ink3)}@keyframes kihonNudge{0%,92%,100%{transform:rotate(0)}94%{transform:rotate(-1.2deg)}97%{transform:rotate(1.2deg)}}@media(prefers-reduced-motion:reduce){.kihon-word.is-editable{animation:none}}
.kihon-sensei-face,.kihon-avatar{width:54px;height:54px;border-radius:0;background:transparent;color:inherit}.kihon-sensei-face img,.kihon-avatar img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 3px 4px rgba(26,10,0,.2))}
.kihon-word.is-editable{animation:kihonNudgeFrequent 2.4s ease-in-out infinite}.kihon-word.is-editable:nth-of-type(3){animation-delay:.25s}.kihon-word.is-editable:nth-of-type(4){animation-delay:.5s}@keyframes kihonNudgeFrequent{0%,31%,39%,71%,79%,100%{transform:rotate(0)}33%,73%{transform:rotate(-1.5deg)}36%,76%{transform:rotate(1.5deg)}}@media(prefers-reduced-motion:reduce){.kihon-word.is-editable{animation:none}}
.kihon-context-demo{margin-top:25px;padding:20px;border-radius:18px;background:linear-gradient(145deg,#e9f5f2,#fffaf0);border:1px solid rgba(40,123,119,.18)}.kihon-chat-line{display:flex;gap:12px;align-items:flex-start;margin-bottom:14px}.kihon-chat-line.is-answer{margin-left:56px}.kihon-chat-line div{padding:12px 16px;border-radius:4px 16px 16px 16px;background:#fff;box-shadow:0 4px 12px rgba(26,10,0,.06)}.kihon-chat-line small{font:800 10px sans-serif;color:var(--ink3);text-transform:uppercase}.kihon-chat-line p{font:600 21px var(--font-jp);margin:3px 0}.kihon-chat-line em{color:var(--ink2)}.kihon-optional{display:inline-block;transition:.35s}.kihon-context-demo.context-on .kihon-optional{opacity:.14;text-decoration:line-through;transform:scale(.9)}.kihon-context-toggle{display:flex;align-items:center;justify-content:center;gap:10px;margin:8px auto 0;border:0;background:transparent;color:var(--kihon-teal);font:800 13px sans-serif;cursor:pointer}.kihon-toggle-track{width:42px;height:23px;padding:3px;border-radius:999px;background:#b9c9c7;transition:.25s}.kihon-toggle-track i{display:block;width:17px;height:17px;border-radius:50%;background:#fff;transition:.25s}.kihon-context-toggle[aria-pressed="true"] .kihon-toggle-track{background:var(--kihon-teal)}.kihon-context-toggle[aria-pressed="true"] i{transform:translateX(19px)}
.kihon-build-zone{margin-top:24px;padding:22px;border-radius:18px;background:var(--ink);color:#fff8e9}.kihon-build-slots{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.kihon-build-slots>span{min-height:72px;display:grid;place-items:center;border:1.5px dashed rgba(255,255,255,.3);border-radius:12px;color:rgba(255,255,255,.4);font:700 12px sans-serif}.kihon-build-slots>span.filled{background:#fff9ed;color:var(--ink);border-style:solid;font:600 24px var(--font-jp)}.kihon-build-slots>span.wrong{animation:kihonShake .3s;border-color:#ff8175}.kihon-build-slots .verb-slot{border-color:rgba(255,114,94,.55)}.kihon-build-bank{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:18px 0}.kihon-build-bank button{min-width:140px;padding:10px;border:1px solid rgba(255,255,255,.28);border-radius:11px;background:rgba(255,255,255,.1);color:white;font:600 20px var(--font-jp);cursor:pointer}.kihon-build-bank button small{display:block;margin-top:2px;font:500 11px sans-serif;color:rgba(255,255,255,.65)}.kihon-build-bank button:disabled{opacity:.2}.kihon-build-feedback{text-align:center;color:#f5d8a2;font-size:14px}.kihon-build-zone.is-complete .kihon-build-feedback{color:#8ee0c4;font-weight:800}.kihon-reset{display:block;margin:12px auto 0;border:0;background:transparent;color:rgba(255,255,255,.58);font:700 12px sans-serif;text-decoration:underline;cursor:pointer}@keyframes kihonShake{25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
.kihon-input-modes{display:flex;justify-content:center;gap:8px;margin:0 0 13px}.kihon-input-modes span{padding:5px 10px;border:1px solid rgba(255,255,255,.16);border-radius:999px;background:rgba(255,255,255,.06);color:rgba(255,255,255,.72);font:800 10px sans-serif;letter-spacing:.05em;text-transform:uppercase}.kihon-build-bank button{touch-action:none;user-select:none;-webkit-user-select:none;transition:opacity .18s,transform .18s,box-shadow .18s}.kihon-build-bank button.dragging{opacity:.18;transform:scale(.95)}.kihon-build-slots>span.drag-over{border-color:#82e0c0;background:rgba(130,224,192,.15);color:#b9f2df;transform:translateY(-3px);box-shadow:0 0 0 3px rgba(130,224,192,.12)}.kihon-build-slots>span.drop-correct{animation:kihonDrop .3s ease}.kihon-token-ghost{position:fixed;z-index:9999;margin:0;pointer-events:none;opacity:.94;min-width:140px;padding:10px;border:1px solid rgba(255,255,255,.45);border-radius:11px;background:#493329;color:white;font:600 20px var(--font-jp);box-shadow:0 15px 38px rgba(0,0,0,.35);transform:rotate(-2deg) scale(1.04)}.kihon-token-ghost small{display:block;margin-top:2px;color:rgba(255,255,255,.7);font:500 11px sans-serif}@keyframes kihonDrop{0%{transform:scale(.9)}65%{transform:scale(1.05)}100%{transform:scale(1)}}
.kihon-summary{display:grid;grid-template-columns:100px 1fr;align-items:center;gap:24px;padding:clamp(24px,4vw,44px);border-radius:20px;background:linear-gradient(135deg,#f7e7d0,#fffaf0);border:1px solid rgba(184,134,11,.3)}.kihon-summary-seal{display:grid;place-items:center;width:92px;height:92px;border:3px double var(--kihon-coral);border-radius:50%;color:var(--kihon-coral);font:700 24px/1.05 var(--font-jp);transform:rotate(-4deg)}.kihon-summary-seal small{font:800 11px sans-serif}.kihon-summary h2{font-size:clamp(25px,3vw,38px)}.kihon-summary p{color:var(--ink2);line-height:1.5}
@media(max-width:820px){.kihon-story-card{grid-template-columns:1fr}.kihon-story-copy{order:2}.kihon-order-row{grid-template-columns:38px repeat(3,1fr)}.kihon-order-row>strong{grid-column:2/5}.kihon-word{font-size:16px;padding:10px 5px}}
@media(max-width:600px){.kihon-intro-card{display:none}.kihon-story-card{border-radius:18px}.kihon-story-copy{padding:26px 20px}.kihon-story-copy h1{font-size:43px}.kihon-chapter{grid-template-columns:1fr}.kihon-chapter-num{display:none}.kihon-chapter-body{padding:25px 18px}.kihon-panels{grid-template-columns:1fr}.kihon-panel{min-height:128px;display:grid;grid-template-columns:48px 1fr;align-items:center;text-align:left;padding:17px 18px}.kihon-panel:after{content:'↓';top:auto;bottom:-28px;right:48%;}.kihon-panel-icon{grid-row:1/4;margin:0;font-size:38px}.kihon-panel small,.kihon-panel strong,.kihon-panel em{grid-column:2}.kihon-panel strong{font-size:23px}.kihon-chat-line.is-answer{margin-left:22px}.kihon-avatar{width:38px;height:38px}.kihon-build-zone{padding:14px}.kihon-build-slots>span{min-height:62px}.kihon-build-slots>span.filled{font-size:18px}.kihon-build-bank button{min-width:0;flex:1 1 30%;font-size:17px;padding:9px 5px}.kihon-summary{grid-template-columns:1fr}.kihon-summary-seal{width:72px;height:72px}}
@container (max-width:820px){.kihon-story-card{grid-template-columns:1fr}.kihon-story-copy{order:2}.kihon-story-copy h1{font-size:clamp(40px,12cqw,62px)}.kihon-order-row{grid-template-columns:38px repeat(3,1fr)}.kihon-order-row>strong{grid-column:2/5}}
@media(max-width:600px){.kihon-intro-card{display:block;padding:16px;margin-bottom:14px;min-height:0}.kihon-intro-card h2{font-size:24px}.kihon-intro-card p{font-size:15px;line-height:1.5}}
body.theme-carbon-fire .kihon-story-card,body.theme-dark-base .kihon-story-card,body.theme-shinjuku .kihon-story-card{color:#1a0a00}
body.theme-carbon-fire .kihon-story-copy h1,body.theme-carbon-fire .kihon-chapter h2,body.theme-carbon-fire .kihon-summary h2,body.theme-dark-base .kihon-story-copy h1,body.theme-dark-base .kihon-chapter h2,body.theme-dark-base .kihon-summary h2,body.theme-shinjuku .kihon-story-copy h1,body.theme-shinjuku .kihon-chapter h2,body.theme-shinjuku .kihon-summary h2{color:#5c0e0e;text-shadow:none}
body.theme-carbon-fire .kihon-story-copy p,body.theme-carbon-fire .kihon-chapter-body>p,body.theme-carbon-fire .kihon-summary p,body.theme-dark-base .kihon-story-copy p,body.theme-dark-base .kihon-chapter-body>p,body.theme-dark-base .kihon-summary p,body.theme-shinjuku .kihon-story-copy p,body.theme-shinjuku .kihon-chapter-body>p,body.theme-shinjuku .kihon-summary p{color:#5c3d2e}
@media (max-width:700px){
  #sc-kana.active,
  #sc-kihon.active{
    margin-top:max(0px, calc(env(safe-area-inset-top, 0px) + 5mm - 2rem));
  }
}

.kana-intro-card,
.kana-board{
  border:1px solid var(--bd);
  border-radius:var(--r);
  background:rgba(255,255,255,.58);
  box-shadow:0 4px 20px rgba(26,10,0,.05);
  backdrop-filter:blur(6px);
}
.kana-intro-card{
  padding:18px;
  margin-bottom:14px;
}
.kana-intro-card h2{
  margin:5px 0 6px;
  color:var(--lacca-dk);
}
.kana-intro-card p{
  color:var(--ink2);
  line-height:1.6;
}
.kana-systems{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
  margin-bottom:14px;
}
.kana-board{
  padding:16px;
  overflow:hidden;
}
.kana-board-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding-bottom:12px;
  margin-bottom:13px;
  border-bottom:1px solid var(--bd);
}
.kana-board-head h2{
  margin:3px 0 0;
  color:var(--ink);
}
.kana-script{
  font-family:var(--font-jp);
  color:var(--lacca);
  font-size:28px;
  line-height:1;
  opacity:.92;
}
.kana-section-title{
  margin:16px 0 8px;
  color:var(--ink3);
  font-size:10px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.kana-section-title:first-of-type{
  margin-top:0;
}
.kana-chart{
  display:grid;
  gap:6px;
}
.kana-row{
  display:grid;
  grid-template-columns:34px repeat(var(--kana-cols),minmax(0,1fr));
  gap:6px;
  align-items:stretch;
}
.kana-row-label{
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  color:var(--ink3);
  font-size:11px;
  font-weight:800;
  background:rgba(237,228,208,.58);
}
.kana-cell{
  appearance:none;
  min-height:58px;
  border:1px solid rgba(156,104,74,.22);
  border-radius:10px;
  background:rgba(255,255,255,.7);
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  font-family:var(--font);
  transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease;
}
.kana-cell:not(.empty):hover{
  transform:translateY(-1px);
  border-color:rgba(139,26,26,.34);
  box-shadow:0 6px 14px rgba(26,10,0,.08);
}
.kana-cell.empty{
  opacity:.28;
  background:transparent;
  border-style:dashed;
  cursor:default;
}
.kana-char{
  font-family:var(--font-jp);
  color:var(--lacca-dk);
  font-size:25px;
  line-height:1;
}
.kana-romaji{
  color:var(--ink3);
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
  line-height:1;
}
.kana-extended-board{
  margin-bottom:10px;
}
.kana-practice-modal{
  position:fixed;
  inset:0;
  z-index:75;
  place-items:center;
  padding:24px;
  background:rgba(31,18,10,.42);
  backdrop-filter:blur(4px);
}
.kana-practice-card{
  width:min(612px,calc(100vw - 48px));
  border:1px solid rgba(135,99,61,.28);
  border-radius:22px;
  background:linear-gradient(145deg,rgba(255,252,241,.96),rgba(238,222,190,.94));
  box-shadow:0 24px 70px rgba(26,10,0,.28),inset 0 1px 0 rgba(255,255,255,.72);
  padding:16px;
}
.kana-practice-head{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:center;
  margin-bottom:14px;
}
.kana-practice-head h2{
  margin:2px 0 0;
  color:var(--lacca-dk);
  font:900 32px/1 var(--font-jp);
  text-align:center;
}
.kana-practice-stage{
  border-radius:18px;
  background:linear-gradient(160deg,rgba(42,25,14,.93),rgba(19,14,10,.95));
  border:1px solid rgba(91,55,24,.7);
  padding:16px;
}
.kana-practice-stage svg{
  display:block;
  width:min(100%,396px);
  aspect-ratio:1;
  margin:0 auto;
  overflow:visible;
  touch-action:none;
}
.kana-practice-stage .kw-stroke-active{
  stroke-width:5.4;
}
.kana-practice-stage .kw-stroke-ghost,
.kana-practice-stage .kw-stroke-done{
  stroke-width:5;
}
.kana-practice-ghost{
  fill:rgba(255,242,210,.24);
  font:400 82px/1 var(--font-jp);
  paint-order:stroke;
  stroke:rgba(25,14,9,.36);
  stroke-width:1.1;
  pointer-events:none;
  user-select:none;
}
.kana-practice-ghost.katakana{font-size:80px}
.kana-practice-ghost.composite{font-size:58px}
.kana-practice-ghost.hidden{display:none}
.kana-practice-line{
  fill:none;
  stroke:#4fa8ff;
  stroke-width:3.8;
  stroke-linecap:round;
  stroke-linejoin:round;
  opacity:.92;
  filter:drop-shadow(0 0 6px rgba(79,168,255,.35));
}
.kana-practice-status{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:12px 2px 0;
  color:var(--ink2);
  font:800 13px/1 var(--font);
}
.kana-practice-status strong{
  color:var(--lacca-dk);
  font-size:16px;
}
.kana-practice-controls{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}
.kana-practice-controls .kw-button{
  width:100%;
  justify-content:center;
  min-height:38px;
  padding-inline:10px;
  white-space:normal;
}
.kana-practice-controls .kw-unavailable{
  opacity:.68;
  box-shadow:none;
}
.kana-practice-feedback{
  min-height:34px;
  margin:12px 2px 0;
  color:var(--ink2);
  font-size:13px;
  line-height:1.45;
}
.kana-practice-foot{
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:12px;
  align-items:center;
  margin-top:14px;
}
.kana-learned-label-short{display:none}
.kana-practice-reading{
  color:var(--ink2);
  font:900 18px/1 var(--font);
  letter-spacing:.08em;
  text-transform:uppercase;
}

@media(max-width:640px){
  .kana-practice-modal{
    padding:10px;
  }
  .kana-practice-card{
    width:calc(100vw - 20px);
    max-height:calc(100dvh - 20px);
    overflow:auto;
    padding:12px;
  }
  .kana-practice-head{
    grid-template-columns:1fr;
    gap:8px;
    margin-bottom:10px;
  }
  .kana-practice-head h2{
    display:none;
  }
  .kana-practice-head .home-kicker{
    margin:0;
  }
  .kana-practice-controls{
    grid-template-columns:1fr 1fr;
  }
  .kana-practice-foot{
    grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);
    gap:8px;
    margin-top:10px;
  }
  .kana-practice-foot .kw-button{
    min-width:0;
    padding-inline:8px;
    white-space:nowrap;
  }
  .kana-learned-label-short{display:inline}
  .kana-learned-label-wide{display:none}
  .kana-practice-reading{
    display:none;
  }
}

/* ── MODE GRID ── */
.mode-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:1.75rem}
.mode-card{
  border:1px solid var(--bd);border-radius:var(--r);
  padding:18px 12px;cursor:pointer;text-align:center;
  transition:all .2s ease;
  background:rgba(255,255,255,0.45);
  backdrop-filter:blur(4px);
  position:relative;overflow:hidden;
}
.mode-card::before{content:'';position:absolute;inset:0;background:linear-gradient(135deg,rgba(255,255,255,.3) 0%,transparent 100%);opacity:0;transition:opacity .2s}
.mode-card:hover{border-color:var(--bd2);box-shadow:0 6px 20px rgba(26,10,0,0.08);transform:translateY(-2px)}
.mode-card:hover::before{opacity:1}
.mode-card.sel{border:1.5px solid var(--lacca);background:linear-gradient(135deg,rgba(139,26,26,0.06) 0%,rgba(255,255,255,0.7) 100%);box-shadow:0 6px 20px rgba(139,26,26,0.12)}
.mc-icon{font-size:28px;margin-bottom:8px;font-family:var(--font-jp);color:var(--lacca);display:block;transition:transform .2s}
.mode-card:hover .mc-icon{transform:scale(1.1)}
.mode-card.sel .mc-icon{color:var(--lacca-dk)}
.mc-name{font-size:13px;font-weight:600;color:var(--ink);letter-spacing:.03em}
.mc-desc{font-size:10px;color:var(--ink3);margin-top:4px;line-height:1.5;font-style:italic}
.mode-card.sel .mc-name{color:var(--lacca-dk)}

/* ── GRAMMAR SUBMODE ── */
.grammar-mode-switch,
.kanji-mode-switch{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:-.75rem 0 1.5rem;
}
.kanji-mode-switch{display:none}
.grammar-mode-switch.logic-available{grid-template-columns:repeat(3,minmax(0,1fr))}
.grammar-logic-btn{display:none}
.grammar-mode-switch.logic-available .grammar-logic-btn{display:block}
.grammar-mode-switch:not(.logic-available) .grammar-complete-btn{order:1}
.grammar-mode-switch:not(.logic-available) .grammar-builder-btn{order:2}
.grammar-mode-btn,
.kanji-mode-btn{
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.46);
  color:var(--ink2);
  padding:13px 14px;
  text-align:center;
  cursor:pointer;
  font-family:var(--font);
  transition:all .18s ease;
}
.grammar-mode-btn span,
.kanji-mode-btn span{
  display:block;
  color:var(--ink);
  font-weight:800;
  font-size:14px;
  margin-bottom:3px;
}
.grammar-mode-btn small,
.kanji-mode-btn small{
  display:block;
  color:var(--ink3);
  font-size:11px;
  line-height:1.35;
  font-style:italic;
}
.grammar-mode-btn:hover,
.kanji-mode-btn:hover{
  border-color:var(--lacca);
  background:rgba(255,255,255,.78);
  transform:translateY(-1px);
}
.grammar-mode-btn.sel,
.kanji-mode-btn.sel{
  border-color:var(--lacca);
  background:linear-gradient(135deg,rgba(139,26,26,.08),rgba(255,255,255,.78));
  box-shadow:0 5px 16px rgba(139,26,26,.10);
}
.grammar-mode-btn.sel span,
.kanji-mode-btn.sel span{color:var(--lacca-dk)}

.grammar-mode-switch.logic-available .grammar-mode-btn{
  padding:12px 10px;
}
.grammar-mode-switch.logic-available .grammar-mode-btn span{
  font-size:13px;
}
.grammar-mode-switch.logic-available .grammar-mode-btn small{
  font-size:10px;
}

.grammar-reference-panel{
  display:none;
  margin:-.65rem 0 1.35rem;
}
.grammar-ref-shell{
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.42);
  box-shadow:0 4px 14px rgba(26,10,0,.05);
  overflow:hidden;
}
.grammar-ref-toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  border:none;
  background:transparent;
  color:var(--ink);
  padding:13px 14px;
  text-align:center;
  font-family:var(--font);
  cursor:pointer;
}
.grammar-ref-toggle span{
  display:block;
  width:100%;
}
.grammar-ref-toggle strong{
  display:block;
  color:var(--lacca-dk);
  font-size:14px;
  letter-spacing:.02em;
}
.grammar-ref-toggle small{
  display:block;
  color:var(--ink3);
  font-size:10px;
  font-style:italic;
  line-height:1.35;
  margin-top:3px;
}
.grammar-ref-list{
  display:grid;
  gap:9px;
  max-height:420px;
  overflow:auto;
  padding:0 10px 12px;
  scrollbar-width:thin;
}
.grammar-ref-item{
  position:relative;
  border:1px solid rgba(92,61,46,.14);
  border-radius:calc(var(--rm) - 4px);
  background:rgba(255,250,242,.72);
  padding:12px 52px 12px 12px;
}
.grammar-ref-point{
  color:var(--lacca-dk);
  font-family:var(--font-jp);
  font-size:20px;
  font-weight:700;
  line-height:1.35;
  margin-bottom:7px;
}
.grammar-ref-use,
.grammar-ref-meaning{
  color:var(--ink);
  font-size:12px;
  line-height:1.45;
  margin-top:5px;
}
.grammar-ref-use span,
.grammar-ref-meaning span{
  display:inline-block;
  color:var(--ink3);
  font-size:9px;
  font-weight:800;
  letter-spacing:.12em;
  margin-right:6px;
  text-transform:uppercase;
}
.grammar-ref-examples{
  display:grid;
  gap:4px;
  margin:8px 0;
}
.grammar-ref-examples p{
  margin:0;
  color:var(--ink);
  font-size:14px;
  line-height:1.55;
}
.grammar-ref-example-jp{
  display:block;
  font-family:var(--font-jp);
  word-spacing:0;
}
.grammar-ref-example-jp ruby{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  vertical-align:baseline;
  margin:0 .02em;
  ruby-position:under;
}
.grammar-ref-example-jp rt{
  color:var(--ink3);
  font-size:9px;
  line-height:1;
  text-align:center;
  white-space:nowrap;
}
.grammar-ref-example-it{
  display:block;
  color:var(--ink3);
  font-family:var(--font);
  font-size:11px;
  font-style:italic;
  line-height:1.4;
  margin-top:1px;
}
.grammar-ref-note{
  color:var(--ink2);
  font-size:11px;
  line-height:1.45;
  font-style:italic;
}
.grammar-ref-user-note{
  margin-top:8px;
  padding:8px 10px;
  border:1px solid rgba(184,134,11,.2);
  border-radius:10px;
  background:rgba(184,134,11,.08);
  color:var(--amber);
  font:700 12px/1.5 var(--font);
}
.grammar-ref-note-btn{
  position:absolute;
  right:12px;
  bottom:12px;
  width:32px;
  height:32px;
  border:1px solid rgba(139,26,26,.24);
  border-radius:999px;
  background:rgba(255,250,242,.92);
  color:var(--lacca);
  display:grid;
  place-items:center;
  cursor:pointer;
  font:900 22px/1 var(--font);
  box-shadow:0 3px 10px rgba(26,10,0,.07);
}
.grammar-ref-note-btn:hover{
  border-color:rgba(139,26,26,.42);
  background:#fffaf2;
  color:var(--lacca-dk);
}
.grammar-ref-note-btn.has-note{
  font-size:18px;
  border-color:rgba(184,134,11,.42);
  color:var(--amber);
}
.grammar-ref-note-btn.is-open{
  background:var(--lacca);
  color:#fffaf2;
}
.grammar-ref-note-btn.has-note.is-open{
  background:rgba(255,250,242,.96);
  color:var(--amber);
}
.grammar-ref-note-panel{
  display:none;
  margin-top:10px;
  padding:10px;
  border:1px solid rgba(184,134,11,.24);
  border-radius:12px;
  background:rgba(255,250,242,.76);
}
.grammar-ref-note-panel.is-open{
  display:block;
}
.grammar-ref-note-panel label{
  display:block;
  margin-bottom:6px;
  color:var(--gold);
  font:900 10px/1 var(--font);
  letter-spacing:.12em;
  text-transform:uppercase;
}
.grammar-ref-note-panel textarea{
  width:100%;
  min-height:62px;
  max-height:180px;
  resize:vertical;
  border:1px solid rgba(92,61,46,.22);
  border-radius:10px;
  background:rgba(255,255,255,.78);
  color:var(--ink);
  font:600 16px/1.45 var(--font);
  padding:9px 10px;
  outline:none;
  -webkit-text-size-adjust:100%;
}
.grammar-ref-note-panel textarea:focus{
  border-color:rgba(139,26,26,.48);
  box-shadow:0 0 0 3px rgba(139,26,26,.1);
}
.grammar-ref-note-hint{
  margin-top:5px;
  color:var(--ink3);
  font-size:10px;
  font-style:italic;
  line-height:1.35;
}

/* ── KANJI WRITING DOJO ── */
.kanji-writing-screen{
  min-height:100%;
  background:
    radial-gradient(circle at 18% 8%,rgba(255,255,255,.54),transparent 26%),
    linear-gradient(135deg,var(--bg),var(--paper) 42%,#dfcfaf);
}
/* The dojo is an interaction surface, not selectable document text. Prevent
   iOS/WKWebView from opening Copy, Look Up, Translate, Search Web or Share
   during a long press while preserving selection everywhere else in the app. */
#sc-kanji-writing,
#sc-kanji-writing *{
  -webkit-touch-callout:none !important;
  -webkit-user-select:none !important;
  user-select:none !important;
  -webkit-user-drag:none;
}
.kanji-writing-screen.active{
  display:flex;
  justify-content:center;
  align-items:flex-start;
  width:100%;
  min-height:100vh;
}
.kanji-writing-screen::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.18;
  background-image:
    linear-gradient(rgba(112,85,52,.10) 1px,transparent 1px),
    linear-gradient(90deg,rgba(112,85,52,.08) 1px,transparent 1px);
  background-size:22px 22px;
  mix-blend-mode:multiply;
}
body.screen-kanji-writing #wrap{
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
  filter:none;
  zoom:1;
}
.kw-wrap{
  width:min(1280px,calc(100vw - 48px));
  margin:0 auto;
  padding:28px 0 34px;
  position:relative;
}
.kw-topbar{
  display:flex;
  justify-content:center;
  align-items:center;
  margin-bottom:20px;
  padding-bottom:16px;
  border-bottom:1px solid rgba(128,92,55,.24);
  position:relative;
  min-height:54px;
}
.kw-topbar .back-btn{
  position:absolute;
  left:0;
  top:50%;
  transform:translateY(-50%);
}
.kw-top-actions{
  position:absolute;
  right:0;
  top:50%;
  transform:translateY(-50%);
}
.kw-heading{
  margin:0;
  max-width:min(760px,calc(100% - 190px));
  color:var(--ink);
  font-family:var(--font-display);
  font-size:clamp(26px,3.2vw,42px);
  font-weight:900;
  letter-spacing:0;
  line-height:1.12;
  text-align:center;
}
.kw-layout{
  display:grid;
  grid-template-columns:minmax(260px,330px) minmax(360px,1fr) minmax(250px,300px);
  gap:18px;
  align-items:stretch;
  width:100%;
}
.kw-panel{
  border:1px solid rgba(135,99,61,.26);
  border-radius:22px;
  background:linear-gradient(145deg,rgba(255,252,241,.9),rgba(238,222,190,.8));
  box-shadow:0 22px 60px rgba(52,32,18,.18),inset 0 1px 0 rgba(255,255,255,.72);
  overflow:hidden;
}
.kw-panel-head{
  padding:16px 18px;
  color:#f9ead0;
  background:linear-gradient(180deg,var(--lacca),var(--lacca-dk));
  text-align:center;
  letter-spacing:.12em;
  font:900 15px/1 var(--font);
  text-transform:uppercase;
}
.kw-panel-body{padding:18px}
.kw-kanji-card{
  min-height:620px;
  display:grid;
  grid-template-rows:auto 1fr auto;
  background:
    radial-gradient(circle at 50% 20%,rgba(200,151,63,.16),transparent 28%),
    linear-gradient(160deg,rgba(42,25,14,.93),rgba(19,14,10,.95));
  border-color:rgba(91,55,24,.7);
  color:#f8ead0;
  position:relative;
}
.kw-kanji-card::before{
  content:"";
  position:absolute;
  inset:16px;
  border:2px solid rgba(183,132,45,.55);
  border-radius:18px;
  pointer-events:none;
  box-shadow:inset 0 0 34px rgba(0,0,0,.35);
}
.kw-dojo-label{
  justify-self:center;
  margin-top:16px;
  padding:8px 28px;
  border:1px solid rgba(218,170,77,.64);
  border-radius:999px;
  color:#f4d091;
  background:linear-gradient(180deg,var(--lacca),var(--lacca-dk));
  font:900 13px/1 var(--font);
  letter-spacing:.12em;
  text-transform:uppercase;
  position:relative;
  z-index:2;
}
.kw-board{
  position:relative;
  align-self:center;
  width:min(100%,560px);
  margin:0 auto;
  aspect-ratio:1;
  padding:14px;
  z-index:2;
}
.kw-board svg{display:block;width:100%;height:100%;overflow:visible;touch-action:none}
.kw-grid-line{stroke:rgba(255,235,190,.16);stroke-width:.55}
.kw-grid-dash{stroke:rgba(255,235,190,.22);stroke-width:.65;stroke-dasharray:3 3}
.kw-stroke-ghost{
  fill:none;
  stroke:rgba(255,242,210,.22);
  stroke-width:4.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.kw-stroke-done{
  fill:none;
  stroke:#fff0ce;
  stroke-width:4.4;
  stroke-linecap:round;
  stroke-linejoin:round;
  filter:drop-shadow(0 2px 1px rgba(0,0,0,.28));
}
.kw-stroke-active{
  fill:none;
  stroke:#d9a544;
  stroke-width:5.4;
  stroke-linecap:round;
  stroke-linejoin:round;
  filter:drop-shadow(0 0 7px rgba(218,166,64,.72));
}
.kw-stroke-demo{
  fill:none;
  stroke:#fff6d8;
  stroke-width:5.4;
  stroke-linecap:round;
  stroke-linejoin:round;
  filter:drop-shadow(0 0 8px rgba(255,230,158,.64));
}
.kw-draw-line{
  fill:none;
  stroke:#4fa8ff;
  stroke-width:3.8;
  stroke-linecap:round;
  stroke-linejoin:round;
  opacity:.9;
  filter:drop-shadow(0 0 6px rgba(79,168,255,.35));
}
.kw-stroke-number{
  font:900 4.8px/1 var(--font);
  fill:#dfbf76;
  paint-order:stroke;
  stroke:#1b100b;
  stroke-width:1.2;
}
.kw-free-kanji-glyph{
  fill:rgba(255,242,210,.24);
  font:400 92px/1 var(--font-jp);
  paint-order:stroke;
  stroke:rgba(25,14,9,.34);
  stroke-width:1.2;
  pointer-events:none;
  user-select:none;
}
.kw-numbers-hidden .kw-stroke-number{display:none}
.kw-status-bar{
  margin:0 24px 22px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:center;
  color:#f4e3c5;
  position:relative;
  z-index:2;
}
.kw-meter{
  height:10px;
  border-radius:999px;
  background:rgba(255,240,208,.18);
  box-shadow:inset 0 1px 4px rgba(0,0,0,.35);
  overflow:hidden;
}
.kw-meter i{
  display:block;
  height:100%;
  width:0%;
  background:linear-gradient(90deg,var(--lacca),#e8b74f);
  transition:width .25s ease;
}
.kw-stroke-count{font:900 15px/1 var(--font);letter-spacing:.04em}
.kw-info-row{
  display:grid;
  grid-template-columns:88px 1fr;
  gap:12px;
  align-items:center;
  padding:12px 0;
  border-bottom:1px solid rgba(124,91,57,.18);
}
.kw-info-row:last-child{border-bottom:0}
.kw-info-label{
  color:var(--ink3);
  font:900 12px/1 var(--font);
  letter-spacing:.12em;
  text-transform:uppercase;
}
.kw-info-value{font-size:18px;font-weight:800;color:var(--ink)}
.kw-card-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.kw-card-action-group{
  margin-top:8px;
  min-width:78px;
}
.kw-card-action-group .q-action-btn{
  color:var(--lacca);
}
.kw-card-action-group .q-action-btn.saved{
  color:var(--gold);
}
.kw-floating-panel{
  margin:-4px 0 16px;
}
.kw-big-kanji{
  font:400 86px/1 var(--font-jp);
  color:var(--lacca);
  margin-bottom:4px;
}
.kw-fav-btn{
  appearance:none;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border:1px solid rgba(137,92,48,.32);
  border-radius:50%;
  background:rgba(255,252,242,.72);
  color:var(--lacca);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72),0 8px 18px rgba(70,42,24,.12);
  cursor:pointer;
  font:900 24px/1 var(--font);
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
}
.kw-fav-btn:hover{
  transform:translateY(-1px) scale(1.04);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.82),0 10px 22px rgba(70,42,24,.16);
}
.kw-fav-btn.saved{
  color:#c49435;
  background:linear-gradient(180deg,#fff4d7,#ead5a7);
  border-color:rgba(196,148,53,.42);
}
.kw-actions{
  display:grid;
  gap:10px;
}
.kw-button{
  appearance:none;
  border:1px solid rgba(137,92,48,.35);
  border-radius:14px;
  padding:12px 14px;
  background:linear-gradient(180deg,#fff4d7,#ead5a7);
  color:#341d12;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7),0 7px 14px rgba(70,42,24,.12);
  cursor:pointer;
  font:900 15px/1.05 var(--font);
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;
}
.kw-button:hover{
  transform:translateY(-1px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 10px 18px rgba(70,42,24,.16);
}
.kw-button.kw-primary{
  background:linear-gradient(180deg,var(--lacca),var(--lacca-dk));
  border-color:rgba(95,22,20,.5);
  color:#fff3d7;
}
.kw-button.kw-toggle-active{
  border-color:rgba(143,31,29,.42);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.78),0 7px 16px rgba(143,31,29,.16);
}
.kw-next-muted{
  opacity:.72;
}
.kw-button.kw-ghost{background:rgba(255,250,236,.52)}
.kw-toggle-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}
.kw-feedback{
  min-height:74px;
  margin-top:16px;
  padding:14px;
  border:1px solid rgba(137,92,48,.18);
  border-radius:16px;
  background:rgba(255,252,242,.5);
  color:#5a4031;
  font:700 16px/1.45 var(--font-display);
}
.kw-tips{
  display:grid;
  gap:12px;
  margin-top:16px;
  color:#604631;
  font:700 15px/1.42 var(--font-display);
}
.kw-tip{
  padding:13px;
  border:1px solid rgba(137,92,48,.18);
  border-radius:16px;
  background:rgba(255,252,242,.45);
}
.kw-tip strong{color:var(--lacca)}
.kw-credit{
  margin-top:14px;
  color:#806653;
  font:700 12px/1.45 var(--font);
}
.kw-credit a{
  color:var(--lacca);
  text-decoration:none;
  border-bottom:1px dotted rgba(143,31,29,.6);
}
.kw-favorites-box{
  margin-top:16px;
  border:1px solid rgba(137,92,48,.18);
  border-radius:16px;
  background:rgba(255,252,242,.5);
  overflow:hidden;
}
.kw-favorites-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 13px;
  border-bottom:1px solid rgba(137,92,48,.14);
  color:var(--ink);
  font:900 13px/1 var(--font);
  letter-spacing:.06em;
  text-transform:uppercase;
}
.kw-favorites-head span{
  min-width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border-radius:50%;
  color:#fff3d7;
  background:var(--lacca);
}
.kw-favorites-list{
  display:grid;
  gap:8px;
  max-height:180px;
  overflow:auto;
  padding:12px;
}
.kw-fav-empty{
  color:var(--ink3);
  font:700 13px/1.45 var(--font-display);
}
.kw-fav-item{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:10px;
  align-items:center;
  padding:9px 10px;
  border:1px solid rgba(137,92,48,.14);
  border-radius:12px;
  background:rgba(255,250,236,.58);
}
.kw-fav-item-char{
  color:var(--lacca);
  font:400 30px/1 var(--font-jp);
}
.kw-fav-item-meta{
  min-width:0;
  color:var(--ink);
  font:800 13px/1.25 var(--font);
}
.kw-fav-item-meta span{
  display:block;
  margin-top:3px;
  color:var(--ink3);
  font:700 12px/1.25 var(--font-display);
}
.kw-shake{animation:kw-shake .22s linear 2}
@keyframes kw-shake{
  0%,100%{transform:translateX(0)}
  33%{transform:translateX(-5px)}
  66%{transform:translateX(5px)}
}
@media(max-width:980px){
  .kw-wrap{width:min(720px,calc(100vw - 28px))}
  .kw-topbar{
    justify-content:flex-end;
    min-height:62px;
  }
  .kw-heading{
    max-width:calc(100% - 112px);
    text-align:right;
  }
  .kw-layout{grid-template-columns:1fr}
  .kw-kanji-card{min-height:0}
}
@media(max-width:560px){
  .kw-wrap{width:calc(100vw - 24px);padding:18px 0 24px}
  .kw-heading{font-size:clamp(22px,7vw,30px)}
  .kw-panel-body{padding:15px}
  .kw-kanji-card{min-height:0}
  .kw-board{padding:4px 8px}
  .kw-status-bar{margin:0 18px 12px}
}
@media(max-width:980px) and (orientation:landscape){
  body.screen-kanji-writing{overflow:hidden}
  body.screen-kanji-writing .kanji-writing-screen.active{
    position:fixed;
    left:var(--kw-vleft, 0px);
    top:var(--kw-vtop, 0px);
    width:var(--kw-vw, 100dvw);
    height:var(--kw-vh, 100dvh);
    min-height:0;
    align-items:flex-start;
    justify-content:center;
    overflow:hidden;
    padding:0;
  }
  body.screen-kanji-writing .kw-wrap{
    width:calc(var(--kw-vw, 100dvw) - 10px);
    height:calc(var(--kw-vh, 100dvh) - 10px);
    max-width:980px;
    padding:6px 0;
    display:flex;
    flex-direction:column;
  }
  body.screen-kanji-writing .kw-topbar{
    min-height:44px;
    margin-bottom:8px;
    padding-bottom:8px;
    justify-content:center;
    flex:0 0 auto;
  }
  body.screen-kanji-writing .kw-topbar .back-btn{left:0}
  body.screen-kanji-writing .kw-top-actions{
    gap:5px;
    top:calc(50% + 10px);
  }
  body.screen-kanji-writing .kw-top-actions .repeat-top-btn{
    width:32px;
    min-width:32px;
    height:32px;
  }
  body.screen-kanji-writing .kw-top-actions .repeat-top-icon{
    width:19px;
    height:19px;
  }
  body.screen-kanji-writing .kw-top-actions .kw-deck-icon{
    width:22px;
    height:27px;
  }
  body.screen-kanji-writing .kw-top-actions .kw-map-icon{
    width:23px;
    height:23px;
  }
  body.screen-kanji-writing .kw-top-actions .fav-top-btn{
    padding:5px 9px;
    font-size:11px;
  }
  body.screen-kanji-writing .kw-heading{
    max-width:min(520px,calc(100% - 120px));
    font-size:clamp(18px,2.8vw,24px);
    line-height:1.05;
    text-align:center;
  }
  body.screen-kanji-writing .kw-layout{
    grid-template-columns:minmax(190px,.9fr) minmax(270px,1.25fr) minmax(190px,.9fr);
    gap:10px;
    align-items:stretch;
    flex:1 1 auto;
    min-height:0;
    height:calc(var(--kw-vh, 100dvh) - 68px);
  }
  body.screen-kanji-writing .kw-panel{
    min-height:0;
    border-radius:16px;
  }
  body.screen-kanji-writing .kw-panel-head{
    padding:8px 10px;
    font-size:11px;
  }
  body.screen-kanji-writing .kw-panel-body{padding:9px}
  body.screen-kanji-writing .kw-big-kanji{font-size:50px}
  body.screen-kanji-writing .kw-fav-btn{width:34px;height:34px;font-size:19px}
  body.screen-kanji-writing .kw-info-row{
    grid-template-columns:58px 1fr;
    gap:7px;
    padding:6px 0;
  }
  body.screen-kanji-writing .kw-info-label{font-size:9px}
  body.screen-kanji-writing .kw-info-value{font-size:13px}
  body.screen-kanji-writing .kw-feedback{
    min-height:46px;
    margin-top:7px;
    padding:8px;
    border-radius:12px;
    font-size:12px;
    line-height:1.25;
  }
  body.screen-kanji-writing .kw-kanji-card{
    align-self:stretch;
    justify-content:center;
  }
  body.screen-kanji-writing .kw-board{
    width:min(100%,calc(var(--kw-vh, 100dvh) - 108px),286px);
    margin-top:6px;
    padding:2px 6px;
  }
  body.screen-kanji-writing .kw-status-bar{
    margin:0 15px 8px;
    gap:7px;
  }
  body.screen-kanji-writing .kw-meter{height:8px}
  body.screen-kanji-writing .kw-stroke-count{font-size:12px}
  body.screen-kanji-writing .kw-actions{gap:7px}
  body.screen-kanji-writing .kw-button{
    border-radius:11px;
    padding:8px 9px;
    font-size:12px;
  }
  body.screen-kanji-writing .kw-deck-add-wrap{margin-top:8px}
  body.screen-kanji-writing .kw-toggle-row{gap:7px;margin-top:7px}
  body.screen-kanji-writing .kw-favorites-box{
    margin-top:8px;
    border-radius:13px;
  }
  body.screen-kanji-writing .kw-favorites-head{
    padding:8px 9px;
    font-size:10px;
  }
  body.screen-kanji-writing .kw-favorites-head span{
    min-width:22px;
    height:22px;
  }
  body.screen-kanji-writing .kw-favorites-list{
    max-height:102px;
    gap:6px;
    padding:8px;
  }
  body.screen-kanji-writing .kw-fav-item{
    padding:7px 8px;
    border-radius:10px;
  }
  body.screen-kanji-writing .kw-fav-item-char{font-size:23px}
  body.screen-kanji-writing .kw-fav-item-meta{font-size:11px}
  body.screen-kanji-writing .kw-fav-item-meta span{font-size:10px}
}
@media(max-width:767px) and (orientation:portrait){
  body.screen-kanji-writing{
    width:var(--kw-vw, 100dvw);
    height:var(--kw-vh, 100dvh);
    overflow:hidden;
    overscroll-behavior:none;
  }
  body.screen-kanji-writing .kanji-writing-screen.active{
    position:fixed;
    left:calc(var(--kw-vleft, 0px) + (var(--kw-vw, 100dvw) / 2));
    top:calc(var(--kw-vtop, 0px) + (var(--kw-vh, 100dvh) / 2));
    width:var(--kw-vh, 100dvh);
    height:var(--kw-vw, 100dvw);
    min-height:0;
    padding:0;
    overflow:hidden;
    align-items:center;
    justify-content:center;
    transform:translate(-50%,-50%) rotate(90deg);
    transform-origin:center center;
  }
  body.screen-kanji-writing .kanji-writing-screen.active::before{
    width:100%;
    height:100%;
  }
  body.screen-kanji-writing .kw-wrap{
    width:760px;
    height:390px;
    max-width:none;
    padding:5px 0;
    display:flex;
    flex-direction:column;
    transform:scale(var(--kw-portrait-scale, 1));
    transform-origin:center center;
  }
  body.screen-kanji-writing .kw-topbar{
    min-height:42px;
    margin-bottom:7px;
    padding-bottom:7px;
    justify-content:center;
    flex:0 0 auto;
  }
  body.screen-kanji-writing .kw-heading{
    max-width:min(500px,calc(100% - 108px));
    font-size:clamp(17px,3.1vh,23px);
    text-align:center;
  }
  body.screen-kanji-writing .kw-top-actions{
    gap:5px;
    top:calc(50% + 10px);
  }
  body.screen-kanji-writing .kw-top-actions .repeat-top-btn{
    width:31px;
    min-width:31px;
    height:31px;
  }
  body.screen-kanji-writing .kw-top-actions .repeat-top-icon{
    width:18px;
    height:18px;
  }
  body.screen-kanji-writing .kw-top-actions .kw-deck-icon{
    width:20px;
    height:25px;
  }
  body.screen-kanji-writing .kw-top-actions .kw-map-icon{
    width:22px;
    height:22px;
  }
  body.screen-kanji-writing .kw-top-actions .fav-top-btn{
    padding:5px 8px;
    font-size:10px;
  }
  body.screen-kanji-writing .kw-layout{
    grid-template-columns:minmax(184px,.9fr) minmax(260px,1.24fr) minmax(184px,.9fr);
    gap:8px;
    align-items:stretch;
    flex:1 1 auto;
    min-height:0;
    height:330px;
  }
  body.screen-kanji-writing .kw-panel{min-height:0;border-radius:15px}
  body.screen-kanji-writing .kw-panel-head{
    padding:7px 9px;
    font-size:10px;
  }
  body.screen-kanji-writing .kw-panel-body{padding:8px}
  body.screen-kanji-writing .kw-big-kanji{font-size:46px}
  body.screen-kanji-writing .kw-fav-btn{width:32px;height:32px;font-size:18px}
  body.screen-kanji-writing .kw-info-row{
    grid-template-columns:54px 1fr;
    gap:6px;
    padding:5px 0;
  }
  body.screen-kanji-writing .kw-info-label{font-size:9px}
  body.screen-kanji-writing .kw-info-value{font-size:12px}
  body.screen-kanji-writing .kw-feedback{
    min-height:42px;
    margin-top:6px;
    padding:7px;
    border-radius:11px;
    font-size:11px;
    line-height:1.2;
  }
  body.screen-kanji-writing .kw-kanji-card{
    align-self:stretch;
    justify-content:center;
  }
  body.screen-kanji-writing .kw-board{
    width:min(100%,270px);
    margin-top:5px;
    padding:2px 5px;
  }
  body.screen-kanji-writing .kw-status-bar{
    margin:0 13px 7px;
    gap:6px;
  }
  body.screen-kanji-writing .kw-meter{height:8px}
  body.screen-kanji-writing .kw-stroke-count{font-size:11px}
  body.screen-kanji-writing .kw-actions{gap:6px}
  body.screen-kanji-writing .kw-button{
    border-radius:10px;
    padding:7px 8px;
    font-size:11px;
  }
  body.screen-kanji-writing .kw-deck-add-wrap{margin-top:7px}
  body.screen-kanji-writing .kw-toggle-row{
    gap:6px;
    margin-top:6px;
  }
  body.screen-kanji-writing .kw-favorites-box{
    margin-top:7px;
    border-radius:12px;
  }
  body.screen-kanji-writing .kw-favorites-head{
    padding:7px 8px;
    font-size:10px;
  }
  body.screen-kanji-writing .kw-favorites-head span{
    min-width:22px;
    height:22px;
  }
  body.screen-kanji-writing .kw-favorites-list{
    max-height:88px;
    gap:5px;
    padding:7px;
  }
  body.screen-kanji-writing .kw-fav-item{
    padding:7px 8px;
    border-radius:10px;
  }
  body.screen-kanji-writing .kw-fav-item-char{font-size:23px}
  body.screen-kanji-writing .kw-fav-item-meta{font-size:11px}
  body.screen-kanji-writing .kw-fav-item-meta span{font-size:10px}
}

/* Pratica dal dizionario su iPhone: Esci e Preferiti simmetrici rispetto ai bordi. */
@media (max-width:767px) and (orientation:portrait),
       (max-width:980px) and (max-height:500px) and (orientation:landscape){
  body.daily-kanji-writing .kw-top-actions{
    top:50% !important;
    right:0 !important;
    transform:translateY(-50%) !important;
  }
  body.daily-kanji-writing .kw-topbar .back-btn,
  body.daily-kanji-writing .kw-top-actions .fav-top-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    height:28px;
    min-height:28px;
    padding:5px 12px;
    font-size:12px;
    line-height:1;
  }
}

/* iPad portrait: dojo sempre centrato e comandi su una riga separata dal titolo. */
@media(min-width:768px) and (max-width:1180px) and (orientation:portrait){
  body.screen-kanji-writing,
  body.screen-kanji-writing #wrap{
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    overflow-x:hidden;
  }
  body.screen-kanji-writing .kanji-writing-screen.active{
    position:relative;
    left:auto;
    top:auto;
    width:100%;
    min-height:100dvh;
    padding:0;
    align-items:flex-start;
    justify-content:center;
    transform:none;
  }
  body.screen-kanji-writing .kw-wrap{
    width:min(920px,calc(100% - 48px));
    max-width:920px;
    margin-inline:auto;
    padding-top:max(28px,env(safe-area-inset-top));
    transform:none;
  }
  body.screen-kanji-writing .kw-topbar{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    grid-template-rows:auto auto;
    align-items:center;
    justify-content:stretch;
    column-gap:14px;
    row-gap:23px;
    min-height:0;
    padding-bottom:16px;
  }
  body.screen-kanji-writing .kw-heading{
    grid-column:1/-1;
    grid-row:1;
    width:100%;
    max-width:100%;
    text-align:center;
  }
  body.screen-kanji-writing .kw-topbar .back-btn{
    position:static;
    grid-column:1;
    grid-row:2;
    justify-self:start;
    transform:none;
  }
  body.screen-kanji-writing .kw-top-actions{
    position:static;
    grid-column:3;
    grid-row:2;
    justify-self:end;
    transform:none;
  }
}

/* iPhone only, every JLPT level and dictionary/deck/map entry point.
   Fit the whole SVG between the label and progress bar, inside the gold frame.
   Keeping the viewBox unchanged also preserves pointer-to-stroke coordinates. */
@media (max-width:767px) and (orientation:portrait),
       (max-width:980px) and (max-height:500px) and (orientation:landscape){
  html.ios-iphone body.screen-kanji-writing .kw-top-actions{
    top:50% !important;
    transform:translateY(-50%) !important;
    align-items:center;
  }
  html.ios-iphone body.screen-kanji-writing .kw-board{
    position:absolute;
    inset:48px 24px;
    align-self:stretch;
    justify-self:stretch;
    width:auto;
    height:auto;
    min-width:0;
    min-height:0;
    margin:0;
    padding:0;
    aspect-ratio:auto;
    transform:none;
  }
  html.ios-iphone body.screen-kanji-writing .kw-board svg{
    overflow:hidden;
  }
  html.ios-iphone body.screen-kanji-writing .kw-status-bar{
    position:absolute;
    inset:auto 24px 20px;
    margin:0;
  }
}
@media (max-width:980px) and (max-height:500px) and (orientation:landscape){
  html.ios-iphone body.screen-kanji-writing .kw-heading{
    font-size:clamp(16px,calc(2.8vw - 2px),22px);
    max-width:calc(100% - 350px);
  }
}
@media (max-width:767px) and (orientation:portrait){
  html.ios-iphone body.screen-kanji-writing .kw-heading{
    font-size:clamp(15px,calc(3.1vh - 2px),21px);
    max-width:calc(100% - 320px);
  }
}

/* ── OPTIONS ── */
.opts-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:1rem}
.opt-box{background:rgba(255,255,255,0.5);border:1px solid var(--bd);border-radius:var(--rm);padding:14px;backdrop-filter:blur(4px)}
.opt-box label{font-size:10px;color:var(--ink3);display:block;margin-bottom:7px;text-transform:uppercase;letter-spacing:.1em;font-weight:600}
.opt-box select{width:100%;font-size:13px;background:transparent;color:var(--ink);border:none;border-bottom:1px solid var(--bd2);border-radius:0;padding:4px 0;font-family:var(--font);cursor:pointer;outline:none}

/* ── POOL INFO ── */
.pool-info{font-size:12px;color:var(--ink3);margin-bottom:1.25rem;padding:10px 14px;background:rgba(255,255,255,0.4);border-radius:var(--rm);border:1px solid var(--bd);font-style:italic}
.pool-info span{font-weight:600;color:var(--ink);font-style:normal}

/* ── START BUTTON ── */
.start-btn{
  width:100%;padding:16px;
  background:linear-gradient(135deg,var(--lacca) 0%,var(--lacca-dk) 100%);
  color:#fff;border:none;border-radius:var(--rm);
  font-size:16px;font-weight:600;cursor:pointer;
  font-family:var(--font-display);letter-spacing:.06em;
  transition:all .25s ease;
  box-shadow:0 6px 24px rgba(139,26,26,0.3),0 2px 6px rgba(139,26,26,0.2);
  position:relative;overflow:hidden;
}
.start-btn::after{content:'';position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.15),transparent);transition:left .5s}
.start-btn:hover{transform:translateY(-2px);box-shadow:0 10px 32px rgba(139,26,26,0.4)}
.start-btn:hover::after{left:100%}

/* ── EXAM HEADER ── */
.exam-header{display:flex;align-items:center;gap:10px;margin-bottom:1.25rem;flex-wrap:wrap;padding-bottom:1rem;border-bottom:1px solid var(--bd)}
.back-btn{font-size:12px;color:var(--lacca-dk);cursor:pointer;border:1px solid rgba(139,26,26,.32);background:rgba(255,255,255,0.5);padding:5px 12px;border-radius:20px;transition:all .15s;letter-spacing:.04em;font-family:var(--font)}
.back-btn:hover{color:var(--lacca);border-color:var(--lacca);background:var(--lacca-bg)}
.exam-title{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:14px;
  font-weight:600;
  color:var(--ink2);
  letter-spacing:.04em;
  flex-wrap:wrap;
}
.exam-title-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:27px;
  padding:4px 13px 5px;
  border-radius:999px;
  border:1.5px solid rgba(48,205,212,.68);
  background:var(--aqua-bg);
  color:var(--aqua-dk);
  font-size:12px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  box-shadow:0 2px 10px rgba(48,205,212,.09);
}
.exam-title-mode{min-width:74px}
.exam-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.timer-box{font-size:14px;font-weight:700;padding:5px 14px;border-radius:20px;background:rgba(255,255,255,0.6);border:1px solid var(--bd);color:var(--ink);font-family:var(--font-jp);transition:all .3s}
.timer-box.warn{background:var(--amber-bg);color:var(--amber);border-color:var(--amber)}
.timer-box.danger{background:var(--lacca-bg);color:var(--lacca);border-color:var(--lacca);animation:pulse 1s infinite}
.fav-top-btn{
  font-size:12px;
  color:var(--ink2);
  cursor:pointer;
  border:1px solid rgba(184,134,11,.35);
  background:var(--gold-bg);
  padding:6px 12px;
  border-radius:20px;
  font-family:var(--font);
  font-weight:700;
  letter-spacing:.03em;
  transition:all .15s;
}
.fav-top-btn:hover{border-color:var(--gold);color:var(--amber);transform:translateY(-1px)}
.fav-top-btn.favorite-added{
  animation:favoriteTopTremble .58s cubic-bezier(.2,.9,.25,1);
}
.fav-top-btn.favorite-added .fav-top-star{
  animation:favoriteStarGlow .64s ease;
}
.repeat-top-btn.repeat-added{
  animation:favoriteTopTremble .58s cubic-bezier(.2,.9,.25,1);
}
.repeat-top-btn.repeat-added .repeat-top-icon{
  animation:favoriteStarGlow .64s ease;
}
.repeat-top-btn.repeat-added .kw-deck-icon{
  animation:favoriteStarGlow .64s ease;
}
.fav-top-btn .fav-top-star{
  display:inline-block;
  color:var(--gold-lt);
  margin:0 4px 0 0;
  text-shadow:0 1px 4px rgba(184,134,11,.28);
}
.fav-top-btn .fav-count-badge{color:var(--lacca);margin-left:4px}
@keyframes favoriteTopTremble{
  0%,100%{transform:translateX(0) rotate(0deg)}
  15%{transform:translateX(-2px) rotate(-1deg)}
  30%{transform:translateX(2px) rotate(1deg)}
  45%{transform:translateX(-1px) rotate(-.5deg)}
  60%{transform:translateX(1px) rotate(.5deg)}
  78%{transform:translateX(0) scale(1.04)}
}
@keyframes favoriteStarGlow{
  0%{transform:scale(1);filter:none;text-shadow:0 1px 4px rgba(184,134,11,.28)}
  38%{transform:scale(1.45) rotate(-10deg);filter:drop-shadow(0 0 10px rgba(218,165,32,.85));text-shadow:0 0 10px rgba(218,165,32,.85),0 0 18px rgba(255,236,150,.55)}
  100%{transform:scale(1);filter:none;text-shadow:0 1px 4px rgba(184,134,11,.28)}
}
@keyframes answerButtonBorderShimmer{
  0%,28%{background-position:150% 0}
  72%,100%{background-position:-150% 0}
}
.repeat-top-btn{
  width:38px;
  min-width:38px;
  height:38px;
  border-radius:999px;
  border:1px solid rgba(156,104,74,.28);
  background:rgba(255,255,255,.52);
  color:var(--lacca-dk);
  cursor:pointer;
  display:inline-grid;
  place-items:center;
  position:relative;
  transition:transform .15s,border-color .15s,color .15s,background .15s;
}
.repeat-top-btn:hover{
  transform:translateY(-1px);
  border-color:var(--lacca);
  color:var(--lacca);
  background:rgba(255,255,255,.82);
}
.repeat-top-icon,
.grammar-repeat-icon{
  width:22px;
  height:22px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1.65;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.kw-deck-icon{
  width:23px;
  height:29px;
  display:block;
  object-fit:contain;
}
.kw-map-icon{
  width:25px;
  height:25px;
  display:block;
  object-fit:contain;
}
.repeat-count-badge{
  position:absolute;
  right:-4px;
  bottom:-4px;
  min-width:17px;
  height:17px;
  padding:0 4px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:var(--lacca);
  color:#fffaf6;
  font-size:10px;
  font-weight:800;
  line-height:1;
  border:1px solid rgba(255,255,255,.75);
}
.kw-deck-add-wrap{
  margin-top:16px;
}
.kw-deck-add-btn{
  width:100%;
}
.kw-deck-add-btn.saved{
  border-color:rgba(139,26,26,.34);
  background:linear-gradient(135deg,rgba(139,26,26,.12),rgba(255,255,255,.68));
  color:var(--lacca-dk);
}
.kw-session-complete{
  position:fixed;
  inset:0;
  z-index:80;
  place-items:center;
  padding:24px;
  background:rgba(31,18,10,.42);
  backdrop-filter:blur(4px);
}
.kw-session-complete-card{
  width:min(440px,calc(100vw - 48px));
  border:1px solid rgba(139,26,26,.28);
  border-radius:22px;
  background:linear-gradient(145deg,rgba(255,252,241,.96),rgba(238,222,190,.94));
  box-shadow:0 24px 70px rgba(26,10,0,.28),inset 0 1px 0 rgba(255,255,255,.72);
  padding:24px;
  text-align:center;
}
.kw-session-complete-card h2{
  margin:0 0 10px;
  color:var(--lacca-dk);
  font:900 28px/1.05 var(--font-display);
}
.kw-session-complete-card p{
  margin:0 0 20px;
  color:var(--ink2);
  font:800 15px/1.45 var(--font);
}
.kw-session-complete-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.favorites-panel{
  margin:-.75rem 0 1.25rem;
  border:1px solid rgba(184,134,11,.32);
  border-radius:var(--r);
  background:rgba(255,255,255,.72);
  box-shadow:0 8px 28px rgba(26,10,0,.08);
  backdrop-filter:blur(8px);
  overflow:hidden;
}
.favorites-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 16px;
  border-bottom:1px solid var(--bd);
  background:var(--gold-bg);
}
.favorites-head h2{font-size:17px;margin:0;color:var(--ink)}
.favorites-head button{
  width:28px;height:28px;border-radius:50%;
  border:1px solid var(--bd);
  background:rgba(255,255,255,.7);
  color:var(--ink2);
  cursor:pointer;
}
.fav-empty{padding:16px;color:var(--ink3);font-size:13px;font-style:italic}
.repeat-panel{
  border-color:rgba(139,26,26,.24);
}
/* Repeat browsing replaces the question view; the original session is paused. */
#sc-exam.repeat-study-only > .q-bar-wrap,
#sc-exam.repeat-study-only > #q-area,
#sc-exam.repeat-study-only > .nav-row,
#sc-exam.repeat-study-only #timer-box{
  display:none !important;
}
.repeat-head{
  background:var(--lacca-bg);
}
.repeat-item{
  display:grid;
  grid-template-columns:34px 1fr;
  gap:10px;
  padding:14px 16px;
  border-bottom:1px solid rgba(139,26,26,.12);
}
.repeat-item.kw-deck-item{
  grid-template-columns:1fr;
}
.repeat-item:last-child{border-bottom:none}
.repeat-item-icon{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  margin-top:2px;
}
.repeat-grammar-title{
  font-family:var(--font-jp);
  color:var(--lacca-dk);
  font-size:20px;
  line-height:1.35;
  margin-bottom:4px;
}
.repeat-grammar-explanation,
.repeat-grammar-sentence{
  color:var(--ink2);
  line-height:1.55;
  font-size:13px;
}
.repeat-sensei-note{
  margin:5px 0 6px;
  color:var(--lacca-dk);
  font:800 12px/1.35 var(--font);
}
.repeat-grammar-sentence{
  font-family:var(--font-jp);
  color:var(--ink);
  margin-top:5px;
}
.repeat-practice-btn{
  margin-top:9px;
  border:1px solid rgba(139,26,26,.28);
  background:var(--lacca-bg);
  color:var(--lacca-dk);
  border-radius:999px;
  padding:7px 12px;
  font-family:var(--font);
  font-weight:800;
  cursor:pointer;
}
.repeat-practice-btn:hover{
  border-color:var(--lacca);
  color:var(--lacca);
}
.kw-deck-review-row{
  padding:14px 16px 4px;
}
.repeat-all-footer{
  padding:16px;
  border-top:1px solid rgba(139,26,26,.16);
}
.repeat-all-footer .repeat-practice-btn{
  min-height:44px;
}
.kw-deck-review-all-btn{
  width:100%;
  margin-top:0;
  background:linear-gradient(180deg,var(--lacca),var(--lacca-dk));
  border-color:rgba(95,22,20,.45);
  color:#fff3d7;
}
.kw-deck-review-all-btn:hover{
  color:#fff8e8;
  box-shadow:0 6px 16px rgba(139,26,26,.18);
}

/* ── KANJI LEVEL MAP ── */
.kanji-map-screen{
  min-height:100%;
  background:
    radial-gradient(circle at 18% 8%,rgba(255,255,255,.54),transparent 26%),
    linear-gradient(135deg,var(--bg),var(--paper) 42%,#dfcfaf);
}
.kanji-map-screen.active{
  display:flex;
  justify-content:center;
  align-items:flex-start;
  width:100%;
  min-height:100vh;
}
.kw-map-wrap{
  width:min(1280px,calc(100vw - 48px));
  margin:0 auto;
  padding:28px 0 34px;
}
.kw-map-topbar{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:16px;
  margin-bottom:16px;
  padding-bottom:16px;
  border-bottom:1px solid rgba(128,92,55,.24);
}
.kw-map-heading{
  margin:0;
  color:var(--ink);
  font-family:var(--font-display);
  font-size:clamp(28px,3vw,42px);
  line-height:1.05;
  text-align:center;
}
.kw-map-heading span{color:var(--lacca)}
.kw-map-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.kw-map-actions .kw-button{
  padding:10px 13px;
  white-space:nowrap;
}
.kw-map-actions .kw-button:disabled{
  opacity:.48;
  cursor:not-allowed;
  transform:none;
}
.kw-map-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
.kw-map-summary div{
  padding:12px 14px;
  border:1px solid rgba(135,99,61,.24);
  border-radius:16px;
  background:rgba(255,252,241,.78);
  box-shadow:0 10px 24px rgba(52,32,18,.08);
}
.kw-map-summary span{
  display:block;
  margin-bottom:4px;
  color:var(--ink3);
  font:900 11px/1 var(--font);
  letter-spacing:.1em;
  text-transform:uppercase;
}
.kw-map-summary strong{
  color:var(--lacca-dk);
  font:900 28px/1 var(--font-display);
}
.kw-map-panel{
  border:1px solid rgba(135,99,61,.26);
  border-radius:22px;
  background:linear-gradient(145deg,rgba(255,252,241,.9),rgba(238,222,190,.8));
  box-shadow:0 22px 60px rgba(52,32,18,.16),inset 0 1px 0 rgba(255,255,255,.72);
  padding:14px;
}
.kw-map-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(82px,1fr));
  gap:8px;
  max-height:calc(100vh - 230px);
  overflow:auto;
  padding:2px 4px 4px 2px;
}
.kw-map-cell{
  min-height:112px;
  border:1px solid rgba(137,92,48,.22);
  border-radius:12px;
  background:rgba(255,250,236,.62);
  color:var(--ink);
  cursor:pointer;
  display:grid;
  grid-template-rows:auto auto 1fr;
  gap:4px;
  justify-items:center;
  padding:9px 7px 8px;
  text-align:center;
  transition:transform .14s ease,border-color .14s ease,background .14s ease,box-shadow .14s ease;
}
.kw-map-cell:hover{
  transform:translateY(-1px);
  border-color:rgba(139,26,26,.32);
  box-shadow:0 8px 16px rgba(52,32,18,.08);
}
.kw-map-cell.selected{
  border-color:var(--lacca);
  background:rgba(139,26,26,.10);
  box-shadow:inset 0 0 0 1px rgba(139,26,26,.18);
}
.kw-map-cell.learned{
  border-color:rgba(47,118,88,.42);
  background:linear-gradient(180deg,rgba(223,242,230,.82),rgba(255,250,236,.72));
}
.kw-map-cell.learned .kw-map-char{color:#1f6b4d}
.kw-map-char{
  color:var(--lacca-dk);
  font:900 30px/1 var(--font-jp);
}
.kw-map-reading{
  color:#2f241d;
  font:800 11px/1.2 var(--font-jp);
  min-height:14px;
}
.kw-map-readings{
  width:100%;
  display:grid;
  gap:3px;
  color:#2f241d;
  font:800 11px/1.16 var(--font-jp);
}
.kw-map-readings span{
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  gap:4px;
  align-items:center;
  min-width:0;
}
.kw-map-readings b{
  color:var(--lacca);
  font:900 9px/1 var(--font);
  letter-spacing:.04em;
  text-transform:uppercase;
}
.kw-map-readings span:last-child b{
  color:#6e553b;
}
.kw-map-meaning{
  color:var(--ink3);
  font:700 11px/1.2 var(--font);
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.fav-item{
  position:relative;
  display:grid;
  grid-template-columns:30px 1fr;
  gap:10px;
  padding:14px 16px;
  border-bottom:1px solid rgba(184,134,11,.16);
}
.fav-item:last-child{border-bottom:none}
.fav-main{
  min-width:0;
  padding-right:42px;
}
.fav-source{
  color:var(--gold);
  font-size:10px;
  font-weight:700;
  letter-spacing:.09em;
  text-transform:uppercase;
  margin-bottom:5px;
}
.fav-user-note{
  margin-top:8px;
  padding:8px 10px;
  border-radius:var(--rm);
  background:rgba(184,134,11,.08);
  border:1px solid rgba(184,134,11,.18);
  color:var(--amber);
  font-size:12px;
  line-height:1.55;
}
.fav-note-btn{
  position:absolute;
  right:13px;
  bottom:13px;
  width:32px;
  height:32px;
  border:1px solid rgba(139,26,26,.22);
  border-radius:999px;
  background:rgba(255,250,242,.86);
  color:var(--lacca);
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 3px 10px rgba(26,10,0,.07);
}
.fav-note-btn svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.fav-note-btn:hover{
  border-color:rgba(139,26,26,.42);
  background:#fffaf2;
  color:var(--lacca-dk);
}
.fav-note-btn.has-note{
  border-color:rgba(184,134,11,.42);
  color:var(--amber);
  background:rgba(255,250,242,.96);
}
.fav-note-dot{
  position:absolute;
  right:5px;
  top:5px;
  width:7px;
  height:7px;
  border-radius:999px;
  background:var(--lacca);
  box-shadow:0 0 0 2px rgba(255,250,242,.96);
}
.fav-note-sheet-backdrop{
  position:fixed;
  inset:0;
  z-index:90;
  align-items:flex-end;
  justify-content:center;
  padding:18px;
  background:rgba(22,14,10,.28);
  backdrop-filter:blur(5px);
}
body.favorite-note-sheet-open{
  overflow:hidden;
}
.fav-note-sheet{
  width:min(560px,100%);
  max-height:min(620px,calc(100vh - 48px));
  overflow:auto;
  border:1px solid rgba(184,134,11,.32);
  border-radius:18px;
  background:linear-gradient(180deg,rgba(255,252,242,.98),rgba(244,232,207,.98));
  box-shadow:0 20px 60px rgba(26,10,0,.24);
  padding:16px;
}
.fav-note-sheet-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
}
.fav-note-sheet-kicker,
.fav-note-sheet-label,
.fav-note-sheet-source{
  color:var(--gold);
  font:900 10px/1.2 var(--font);
  letter-spacing:.12em;
  text-transform:uppercase;
}
.fav-note-sheet-head h3{
  margin:4px 0 0;
  color:var(--ink);
  font:900 22px/1.1 var(--font-display);
}
.fav-note-sheet-close{
  flex:0 0 auto;
  width:34px;
  height:34px;
  border:1px solid rgba(92,61,46,.18);
  border-radius:999px;
  background:rgba(255,255,255,.62);
  color:var(--ink2);
  cursor:pointer;
  font-size:24px;
  line-height:1;
}
.fav-note-sheet-context{
  margin-bottom:12px;
  padding:12px;
  border:1px solid rgba(184,134,11,.22);
  border-radius:14px;
  background:rgba(255,250,242,.68);
}
.fav-note-sheet-jp{
  margin-top:7px;
  color:var(--ink);
  font:800 22px/1.55 var(--font-jp);
}
.fav-note-sheet-reading,
.fav-note-sheet-it{
  color:var(--ink2);
  font-size:13px;
  line-height:1.5;
}
.fav-note-sheet-label{
  display:block;
  margin:0 0 7px;
}
.fav-note-sheet textarea{
  width:100%;
  min-height:118px;
  max-height:240px;
  resize:none;
  overflow:hidden;
  border:1px solid rgba(92,61,46,.24);
  border-radius:14px;
  background:rgba(255,255,255,.8);
  color:var(--ink);
  font:600 16px/1.5 var(--font);
  padding:12px;
  outline:none;
  -webkit-text-size-adjust:100%;
  touch-action:manipulation;
}
.fav-note-sheet textarea:focus{
  border-color:rgba(139,26,26,.48);
  box-shadow:0 0 0 3px rgba(139,26,26,.1);
}
.fav-note-sheet-status{
  min-height:17px;
  margin-top:7px;
  color:var(--ink3);
  font-size:11px;
  font-style:italic;
  line-height:1.35;
}
.print-favorites-screen{
  padding-bottom:24px;
}
.print-favorites-header{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:10px;
}
.print-favorites-header>.back-btn{justify-self:start}
.print-favorites-header>.exam-title{
  grid-column:2;
  justify-self:center;
  text-align:center;
}
.print-favorites-header>.exam-actions{
  grid-column:3;
  justify-self:end;
  margin-left:0;
}
.print-create-list-btn{
  min-height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:4px 7px;
  border-color:transparent;
  background:transparent;
  color:var(--lacca-dk);
}
.print-create-list-btn:hover{
  border-color:transparent;
  background:transparent;
  color:var(--gold);
}
.print-create-list-icon{
  width:27.5px;
  height:27.5px;
  flex:0 0 27.5px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:4;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.print-create-list-image{
  width:27.5px;
  height:27.5px;
  flex:0 0 27.5px;
  display:none;
  object-fit:contain;
  filter:brightness(0) saturate(100%) invert(34%) sepia(26%) saturate(3735%) hue-rotate(331deg) brightness(39%) contrast(111%);
}
.ios-ipad .print-create-list-image{display:block}
.ios-ipad .print-create-list-icon{display:none}
.print-create-list-btn span{font-size:11px;white-space:nowrap}
.print-fav-filter-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin:9px 0 14px;
}
.print-fav-filter{
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:9px 15px;
  border:1px solid rgba(255,255,255,.78);
  border-radius:999px;
  background:rgba(255,250,242,.54);
  color:var(--ink2);
  cursor:pointer;
  font:800 15px/1 var(--font);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 5px 16px rgba(92,61,46,.06);
  transition:transform .16s, background .16s, border-color .16s, color .16s, box-shadow .16s;
}
.print-fav-filter:hover{
  transform:translateY(-1px);
  background:rgba(255,250,242,.76);
  border-color:rgba(184,134,11,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    0 8px 20px rgba(92,61,46,.1);
}
.print-fav-filter.active{
  background:rgba(255,250,242,.9);
  border-color:rgba(139,26,26,.28);
  color:var(--lacca);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.86),
    0 8px 22px rgba(139,26,26,.12);
}
.print-fav-filter-icon{
  color:var(--gold);
  font-family:var(--font-jp);
  font-size:18px;
  line-height:1;
}
.print-fav-filter strong{
  min-width:22px;
  color:var(--lacca);
  font:900 14px/1 var(--font);
  text-align:right;
}
.print-fav-filter:disabled{
  opacity:.48;
  cursor:not-allowed;
  transform:none;
}
.print-fav-review-start{
  border-color:rgba(139,26,26,.24);
  background:linear-gradient(135deg,rgba(255,250,242,.9),rgba(245,230,197,.68));
}
.print-fav-review-start .print-fav-filter-icon{
  color:var(--lacca);
}
.print-fav-review-kanji{
  min-width:32px;
  font-size:16px;
  letter-spacing:-.08em;
}
@media(max-width:640px){
  .print-favorites-header{grid-template-columns:minmax(74px,1fr) auto minmax(74px,1fr)}
  .print-create-list-btn{width:34px;min-width:34px;padding:4px}
  .print-create-list-btn span{display:none}
  .print-fav-filter-row{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin:8px 0 12px;
  }
  .print-fav-filter{
    width:100%;
    min-height:40px;
    justify-content:flex-start;
    padding:8px 12px;
    font-size:14px;
  }
  .print-fav-filter strong{
    margin-left:auto;
  }
  .print-fav-review-start{
    grid-column:1 / -1;
    justify-content:center;
  }
  .print-fav-review-start strong{
    margin-left:0;
  }
}
.print-fav-review-shell{
  border:1px solid rgba(184,134,11,.28);
  border-radius:var(--r);
  background:rgba(255,250,242,.72);
  padding:18px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    0 12px 34px rgba(26,10,0,.08);
}
.print-fav-review-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
}
.print-fav-review-top h2,
.print-fav-review-shell h2{
  margin:0;
  color:var(--ink);
  font-size:clamp(28px,4vw,46px);
  line-height:.98;
}
.print-fav-review-exit{
  min-height:38px;
  border:1px solid rgba(92,61,46,.18);
  border-radius:999px;
  background:rgba(255,255,255,.56);
  color:var(--ink2);
  font:800 14px/1 var(--font);
  padding:9px 15px;
  cursor:pointer;
}
.print-fav-review-progress{
  height:7px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(92,61,46,.12);
  margin-bottom:14px;
}
.print-fav-review-progress span{
  display:block;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--lacca),var(--gold));
  transition:width .24s ease;
}
.print-fav-review-card{
  border:1px solid rgba(92,61,46,.16);
  border-radius:18px;
  background:rgba(255,255,255,.68);
  padding:18px;
}
.print-fav-review-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}
.print-fav-review-meta span{
  display:inline-flex;
  min-height:28px;
  align-items:center;
  border:1px solid rgba(184,134,11,.22);
  border-radius:999px;
  background:rgba(245,230,197,.54);
  color:var(--ink2);
  font:800 12px/1 var(--font);
  padding:6px 10px;
}
.print-fav-review-prompt{
  margin:0 0 12px;
  color:var(--ink2);
  font:700 16px/1.5 var(--font);
}
.print-fav-review-jp{
  min-height:96px;
  display:grid;
  place-items:center;
  border:1px solid rgba(184,134,11,.24);
  border-radius:16px;
  background:linear-gradient(180deg,rgba(255,250,242,.82),rgba(245,230,197,.48));
  color:var(--ink);
  font:900 clamp(32px,7vw,74px)/1.12 var(--font-jp);
  text-align:center;
  padding:20px;
  overflow-wrap:anywhere;
}
.print-fav-review-cover,
.print-fav-review-answer{
  margin-top:14px;
  border:1px dashed rgba(92,61,46,.24);
  border-radius:14px;
  background:rgba(255,250,242,.58);
  padding:14px;
}
.print-fav-review-cover{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--ink3);
  font-weight:800;
}
.print-fav-review-cover button,
.print-fav-review-actions button{
  min-height:42px;
  border:1px solid rgba(92,61,46,.18);
  border-radius:12px;
  background:rgba(255,255,255,.7);
  color:var(--ink);
  font:900 15px/1 var(--font);
  padding:10px 16px;
  cursor:pointer;
  box-shadow:0 5px 14px rgba(26,10,0,.06);
}
.print-fav-review-actions button.pri,
.print-fav-review-cover button{
  border-color:rgba(139,26,26,.28);
  background:linear-gradient(180deg,#b83a34,#8b1a1a);
  color:#fffaf2;
}
.print-fav-review-answer{
  display:grid;
  gap:10px;
}
.print-fav-review-answer div{
  display:grid;
  gap:4px;
}
.print-fav-review-answer span{
  color:var(--gold);
  font:900 10px/1 var(--font);
  letter-spacing:.12em;
  text-transform:uppercase;
}
.print-fav-review-answer strong{
  color:var(--ink);
  font:800 16px/1.45 var(--font);
}
.print-fav-review-answer .personal strong{
  color:var(--amber);
}
.print-fav-review-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:10px;
  margin-top:14px;
}
.print-fav-review-score{
  display:flex;
  align-items:flex-end;
  gap:10px;
  margin:16px 0;
}
.print-fav-review-score strong{
  color:var(--lacca);
  font:900 clamp(56px,10vw,92px)/.8 var(--font);
}
.print-fav-review-score span{
  color:var(--ink2);
  font:800 18px/1.2 var(--font);
}
.print-fav-review-breakdown{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.print-fav-review-breakdown span{
  border:1px solid rgba(92,61,46,.14);
  border-radius:999px;
  background:rgba(255,255,255,.58);
  color:var(--ink2);
  font:800 13px/1 var(--font);
  padding:8px 11px;
}
@media(max-width:640px){
  .print-fav-review-shell{
    padding:14px;
  }
  .print-fav-review-top{
    align-items:center;
  }
  .print-fav-review-jp{
    min-height:84px;
    padding:16px;
  }
  .print-fav-review-cover,
  .print-fav-review-actions{
    display:grid;
    grid-template-columns:1fr;
  }
  .print-fav-review-actions button{
    width:100%;
  }
}
.print-fav-hero{
  border:1px solid rgba(184,134,11,.26);
  border-radius:var(--r);
  background:rgba(255,255,255,.62);
  padding:18px;
  margin-bottom:14px;
  box-shadow:0 5px 20px rgba(26,10,0,.05);
}
.print-fav-kicker{
  color:var(--gold);
  font-size:11px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
  margin-bottom:5px;
}
.print-fav-hero h2{
  margin:0 0 5px;
  color:var(--ink);
}
.print-fav-hero p{
  color:var(--ink2);
  line-height:1.55;
}
.print-fav-list{
  display:grid;
  gap:12px;
}
.print-fav-card{
  position:relative;
  border:1px solid var(--bd);
  border-radius:var(--r);
  background:rgba(255,255,255,.74);
  padding:15px 48px 48px 15px;
  box-shadow:0 4px 16px rgba(26,10,0,.045);
  break-inside:avoid;
  page-break-inside:avoid;
}
.print-fav-meta{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  color:var(--gold);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.1em;
  margin-bottom:8px;
}
.print-fav-meta-right{
  display:inline-flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  margin-left:auto;
  margin-right:-34px;
  white-space:nowrap;
}
.print-fav-date::before{
  content:"·";
  margin-right:6px;
}
.print-fav-star{
  width:24px;
  height:24px;
  border:0;
  background:transparent;
  color:var(--gold-lt);
  cursor:pointer;
  display:inline-grid;
  place-items:center;
  padding:0;
  margin:-6px -3px -4px 0;
  font-size:22px;
  line-height:1;
  text-shadow:0 1px 5px rgba(184,134,11,.3);
  transition:transform .15s,color .15s,text-shadow .15s,opacity .15s;
}
.print-fav-star:hover{
  transform:scale(1.12);
  color:var(--gold);
}
.print-fav-star.favorite-added{
  animation:favoriteTopTremble .58s cubic-bezier(.2,.9,.25,1);
}
.print-fav-star.unsaved{
  color:var(--ink3);
  cursor:pointer;
  opacity:.72;
  text-shadow:none;
}
.print-fav-star.unsaved:hover{
  transform:scale(1.12);
  color:var(--gold);
}
.print-fav-card.is-pending-removal{
  opacity:.74;
}
.print-fav-jp{
  font-family:var(--font-jp);
  color:var(--ink);
  font-size:20px;
  line-height:1.75;
  margin-bottom:6px;
}
.print-fav-kanji-practice{
  display:inline-flex;
  align-items:center;
  gap:9px;
  min-height:44px;
  max-width:100%;
  padding:0;
  border:0;
  background:transparent;
  text-align:left;
  cursor:pointer;
  -webkit-appearance:none;
  appearance:none;
  -webkit-tap-highlight-color:transparent;
}
.print-fav-kanji-practice > span{
  display:grid;
  place-items:center;
  flex:0 0 74px;
  width:74px;
  height:74px;
  border:1px solid rgba(92,61,46,.22);
  border-radius:16px;
  background:linear-gradient(145deg,rgba(255,252,245,.9),rgba(237,228,208,.72));
  color:var(--lacca);
  font-family:var(--font-jp);
  font-size:50px;
  line-height:1;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    inset 0 -2px 5px rgba(92,61,46,.08),
    0 8px 18px rgba(92,61,46,.11);
}
.print-fav-kanji-practice:focus-visible{
  outline:0;
}
.print-fav-kanji-practice:focus-visible > span{
  outline:2px solid var(--gold);
  outline-offset:4px;
}
.print-fav-kanji-practice small{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:2px 8px;
  border:1px solid rgba(184,134,11,.3);
  border-radius:999px;
  background:rgba(251,244,224,.8);
  color:var(--gold);
  font:800 10px/1.2 var(--font);
  letter-spacing:.04em;
  white-space:nowrap;
}
@media(max-width:520px){
  .print-fav-kanji-practice > span{
    flex-basis:62px;
    width:62px;
    height:62px;
    border-radius:14px;
    font-size:36px;
  }
}
.print-fav-reading{
  color:var(--lacca-dk);
  font-size:13px;
  line-height:1.5;
  margin-bottom:6px;
}
.print-fav-it,
.print-fav-note,
.print-fav-user-note{
  color:var(--ink2);
  font-size:14px;
  line-height:1.55;
}
.print-fav-note,
.print-fav-user-note{
  margin-top:7px;
  padding-top:7px;
  border-top:1px dashed rgba(92,61,46,.2);
}
.print-fav-user-note{
  color:var(--amber);
}
.print-fav-note-toggle{
  position:absolute;
  right:14px;
  bottom:14px;
  width:32px;
  height:32px;
  border:1px solid rgba(139,26,26,.24);
  border-radius:999px;
  background:rgba(255,250,242,.9);
  color:var(--lacca);
  display:grid;
  place-items:center;
  cursor:pointer;
  font-size:24px;
  font-weight:900;
  line-height:1;
  box-shadow:0 3px 10px rgba(26,10,0,.08);
  transition:transform .16s,background .16s,color .16s,border-color .16s,box-shadow .16s;
}
.print-fav-deck-toggle{
  position:absolute;
  right:54px;
  bottom:14px;
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  padding:5px;
  border:1px solid rgba(139,26,26,.24);
  border-radius:999px;
  background:rgba(255,250,242,.9);
  cursor:pointer;
  box-shadow:0 3px 10px rgba(26,10,0,.08);
}
.print-fav-deck-toggle img{
  width:20px;
  height:20px;
  object-fit:contain;
}
.favorite-deck-backdrop{
  position:fixed;
  z-index:5000;
  inset:0;
  display:grid;
  place-items:center;
  padding:max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));
  background:rgba(20,10,6,.62);
  backdrop-filter:blur(8px);
}
.favorite-deck-modal{
  position:relative;
  width:min(470px,100%);
  max-height:min(720px,calc(100dvh - 36px));
  overflow:auto;
  padding:28px;
  border:1px solid rgba(184,134,11,.32);
  border-radius:22px;
  background:linear-gradient(145deg,#fffaf0,#f0e0bf);
  color:var(--ink);
  box-shadow:0 26px 70px rgba(20,10,6,.34);
}
.favorite-deck-close{position:absolute;top:14px;right:14px}
.favorite-deck-modal-icon{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  margin-bottom:10px;
  border-radius:14px;
  background:rgba(139,26,26,.08);
}
.favorite-deck-modal-icon img{width:32px;height:32px;object-fit:contain}
.favorite-deck-modal h2{margin:5px 42px 8px 0;font:900 28px/1.1 var(--font-display)}
.favorite-deck-modal p{margin:0 0 18px;color:var(--ink2);font-size:14px;line-height:1.5}
.favorite-deck-name-label{
  display:block;
  margin-bottom:7px;
  color:var(--gold);
  font-size:10px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.favorite-deck-name-input{
  width:100%;
  min-height:46px;
  padding:10px 13px;
  border:1px solid rgba(92,61,46,.25);
  border-radius:12px;
  background:rgba(255,255,255,.75);
  color:var(--ink);
  font:700 16px var(--font);
  outline:none;
}
.favorite-deck-name-input:focus{border-color:rgba(139,26,26,.5);box-shadow:0 0 0 3px rgba(139,26,26,.1)}
.favorite-deck-add-all,.favorite-deck-choice{
  display:flex;
  align-items:center;
  gap:11px;
  margin-top:12px;
  padding:12px;
  border:1px solid rgba(92,61,46,.16);
  border-radius:12px;
  background:rgba(255,255,255,.48);
  cursor:pointer;
}
.favorite-deck-add-all input,.favorite-deck-choice input{width:20px;height:20px;accent-color:var(--lacca)}
.favorite-deck-choice-list{display:grid;gap:8px;margin:4px 0 16px}
.favorite-deck-choice{margin:0}
.favorite-deck-choice>span{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1;min-width:0}
.favorite-deck-choice strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.favorite-deck-choice small{color:var(--ink3);white-space:nowrap}
.favorite-deck-management{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid rgba(92,61,46,.15);
}
.favorite-deck-management-list{display:grid;gap:8px}
.favorite-deck-management-row{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 40px;
  align-items:center;
  gap:10px;
  min-height:54px;
  padding:7px 7px 7px 11px;
  border:1px solid rgba(92,61,46,.16);
  border-radius:12px;
  background:rgba(255,255,255,.5);
}
.favorite-deck-management-icon{
  color:var(--gold);
  font:700 24px/1 var(--font-jp);
  text-align:center;
}
.favorite-deck-management-copy{display:grid;min-width:0;gap:2px}
.favorite-deck-management-copy strong{overflow:hidden;color:var(--ink);text-overflow:ellipsis;white-space:nowrap}
.favorite-deck-management-copy small{color:var(--ink3);font-size:11px}
.favorite-deck-delete-btn{
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid rgba(139,26,26,.2);
  border-radius:11px;
  background:rgba(255,250,242,.76);
  color:var(--lacca);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.favorite-deck-delete-btn svg,.favorite-deck-delete-icon svg{
  width:21px;
  height:21px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.favorite-deck-delete-icon{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  margin-bottom:10px;
  border-radius:14px;
  background:rgba(139,26,26,.1);
  color:var(--lacca);
}
.favorite-deck-empty{
  padding:18px;
  border:1px dashed rgba(184,134,11,.42);
  border-radius:13px;
  color:var(--ink3);
  text-align:center;
}
.favorite-deck-modal-status{min-height:20px;margin-top:8px;color:var(--lacca);font-size:12px;font-weight:700}
.favorite-deck-modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:16px}
.favorite-deck-modal-actions button{
  min-height:40px;
  padding:9px 15px;
  border:1px solid rgba(139,26,26,.25);
  border-radius:999px;
  background:rgba(255,255,255,.66);
  color:var(--lacca-dk);
  font-weight:800;
  cursor:pointer;
}
.favorite-deck-modal-actions button.pri{background:var(--lacca);color:#fff;border-color:var(--lacca-dk)}
.favorite-deck-modal-actions button.danger{background:var(--lacca);color:#fff;border-color:var(--lacca-dk)}
@media(max-width:520px){
  .favorite-deck-modal{padding:23px 18px}
  .favorite-deck-modal h2{font-size:25px}
  .favorite-deck-modal-actions button{flex:1}
}
.print-fav-note-toggle:hover{
  transform:translateY(-1px);
  background:#fffaf2;
  border-color:rgba(139,26,26,.42);
  box-shadow:0 7px 16px rgba(26,10,0,.12);
}
.print-fav-note-toggle.is-open{
  background:var(--lacca);
  color:#fffaf2;
  border-color:rgba(139,26,26,.58);
}
.print-fav-note-toggle.has-note:not(.is-open){
  font-size:18px;
  background:rgba(255,250,242,.96);
  border-color:rgba(184,134,11,.38);
  box-shadow:0 4px 13px rgba(184,134,11,.12);
}
.print-fav-note-toggle.has-note.is-open{
  font-size:18px;
  background:rgba(255,250,242,.96);
  color:var(--ink);
  border-color:rgba(184,134,11,.38);
  box-shadow:0 4px 13px rgba(184,134,11,.12);
}
.print-fav-note-panel{
  display:none;
  margin-top:12px;
  padding:12px;
  border:1px solid rgba(184,134,11,.24);
  border-radius:14px;
  background:rgba(255,250,242,.72);
}
.print-fav-note-panel.is-open{
  display:block;
}
.print-fav-note-panel label{
  display:block;
  margin-bottom:7px;
  color:var(--gold);
  font-size:10px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.print-fav-note-panel textarea{
  width:100%;
  min-height:43px;
  max-height:220px;
  resize:none;
  overflow:hidden;
  border:1px solid rgba(92,61,46,.22);
  border-radius:12px;
  background:rgba(255,255,255,.76);
  color:var(--ink);
  font:600 16px/1.45 var(--font);
  padding:10px 12px;
  outline:none;
  box-shadow:inset 0 1px 2px rgba(26,10,0,.04);
  -webkit-text-size-adjust:100%;
  touch-action:manipulation;
}
.print-fav-note-panel textarea:focus{
  border-color:rgba(139,26,26,.48);
  box-shadow:0 0 0 3px rgba(139,26,26,.1), inset 0 1px 2px rgba(26,10,0,.04);
}
.print-fav-note-hint{
  min-height:16px;
  margin-top:6px;
  color:var(--ink3);
  font-size:11px;
  font-style:italic;
  line-height:1.35;
}
.print-fav-removal-note{
  min-height:0;
  margin-top:8px;
  color:var(--ink3);
  font-size:12px;
  font-style:italic;
}
.print-fav-empty{
  border:1px dashed rgba(184,134,11,.4);
  border-radius:var(--r);
  padding:22px;
  background:rgba(255,255,255,.56);
  color:var(--ink3);
  font-style:italic;
  text-align:center;
}
.print-download-status{
  min-height:20px;
  margin:0 0 14px;
  color:var(--ink3);
  font-size:13px;
  line-height:1.45;
}
.print-download-status a{
  color:var(--lacca);
  font-weight:800;
  text-decoration:underline;
  text-underline-offset:3px;
}
.print-download-status.error{
  color:var(--lacca);
  font-weight:700;
}
.print-qr-btn{
  width:38px;
  min-width:38px;
  padding:6px;
}
.print-pdf-btn{
  width:38px;
  min-width:38px;
  height:34px;
  padding:5px;
  display:inline-grid;
  place-items:center;
  border-color:transparent;
  background:transparent;
  color:var(--lacca-dk);
}
.print-pdf-btn:hover{
  background:transparent;
  border-color:transparent;
  color:var(--gold);
}
.pdf-download-icon{
  width:26px;
  height:26px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:4;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.qr-mini-icon{
  width:19px;
  height:19px;
  display:block;
  border-radius:3px;
  background:
    linear-gradient(var(--lacca-dk) 0 0) 0 0/7px 7px no-repeat,
    linear-gradient(var(--lacca-dk) 0 0) 12px 0/7px 7px no-repeat,
    linear-gradient(var(--lacca-dk) 0 0) 0 12px/7px 7px no-repeat,
    linear-gradient(var(--gold) 0 0) 12px 12px/3px 3px no-repeat,
    linear-gradient(var(--lacca-dk) 0 0) 16px 16px/3px 3px no-repeat,
    linear-gradient(var(--lacca-dk) 0 0) 8px 10px/3px 3px no-repeat,
    rgba(255,255,255,.72);
  border:1px solid rgba(92,61,46,.22);
}
.qr-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:50;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(26,10,0,.48);
  backdrop-filter:blur(5px);
}
.qr-modal{
  width:min(420px,100%);
  border:1px solid var(--bd2);
  border-radius:20px;
  background:var(--parchment);
  padding:22px;
  box-shadow:0 20px 70px rgba(26,10,0,.28);
}
.qr-modal-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:10px;
}
.qr-modal-head h2{
  margin:2px 0 0;
  color:var(--lacca);
}
.qr-modal-copy{
  color:var(--ink2);
  line-height:1.55;
  margin-bottom:14px;
}
.qr-canvas-wrap{
  display:grid;
  place-items:center;
  border:1px solid var(--bd);
  border-radius:var(--r);
  background:rgba(255,255,255,.72);
  padding:14px;
  overflow:auto;
}
.qr-canvas-wrap canvas{
  width:min(100%,280px) !important;
  max-width:280px;
  height:auto !important;
  border-radius:8px;
}
.qr-share-link{
  display:block;
  margin-top:10px;
  color:var(--lacca);
  font-size:13px;
  font-weight:800;
  text-align:center;
  text-decoration:underline;
  text-underline-offset:3px;
  word-break:break-word;
}
.qr-modal-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:12px;
}
.qr-modal-status{
  min-height:18px;
  margin-top:10px;
  color:var(--ink3);
  font-size:12px;
  line-height:1.45;
}
.qr-modal-status.error{
  color:var(--lacca);
  font-weight:700;
}

/* ── PROGRESS BAR ── */
.q-bar-wrap{width:100%;background:var(--parchment3);border-radius:3px;height:3px;margin-bottom:1.5rem;overflow:hidden}
.q-bar{height:100%;background:linear-gradient(90deg,var(--lacca),var(--gold));border-radius:3px;transition:width .4s ease}

/* ── QUESTION CARD ── */
.q-card{background:rgba(255,255,255,0.65);border:1px solid var(--bd);border-radius:var(--r);padding:24px;margin-bottom:1rem;box-shadow:0 4px 20px rgba(26,10,0,0.06);backdrop-filter:blur(8px);position:relative}
.q-card-top-actions{
  position:absolute;
  top:18px;
  right:24px;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
}
.q-next-top{
  min-width:154px;
}
.q-meta{display:flex;gap:8px;align-items:center;margin-bottom:14px;flex-wrap:wrap;padding-right:286px;min-height:42px}
.q-num{
  font-size:14px;
  color:var(--ink2);
  font-weight:800;
  letter-spacing:.035em;
}
.q-card-action-group{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:0;
  border-radius:0;
  background:transparent;
  border:none;
  box-shadow:none;
}
.q-action-btn{
  width:34px;
  height:34px;
  margin:0;
  flex:0 0 auto;
  color:var(--lacca);
  display:grid;
  place-items:center;
  padding:0;
  border:none;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  appearance:none;
  -webkit-appearance:none;
}
.q-action-btn:hover{
  color:var(--lacca-dk);
  transform:scale(1.1);
}
.q-action-btn.saved{
  color:var(--gold-lt);
  filter:drop-shadow(0 1px 7px rgba(184,134,11,.35));
}
.q-action-btn .grammar-repeat-icon{
  width:27px;
  height:27px;
  stroke-width:1.7;
}
.q-fav-btn{
  font-size:35px;
  color:var(--lacca);
  text-shadow:0 1px 5px rgba(139,26,26,.20);
}
.favorite-star.q-fav-btn{
  color:var(--lacca);
}
.favorite-star.q-fav-btn:hover{
  color:var(--lacca-dk);
}
.favorite-star.q-fav-btn.saved{
  color:var(--gold);
  text-shadow:0 1px 7px rgba(184,134,11,.38);
}

body.theme-rilievo .q-card-action-group{
  background:transparent;
  border-color:transparent;
  box-shadow:none;
}

body.theme-carbon-fire .q-card-action-group,
body.theme-dark-base .q-card-action-group,
body.theme-shinjuku .q-card-action-group{
  background:transparent;
  border-color:transparent;
  box-shadow:none;
}

body.theme-carbon-fire .q-action-btn,
body.theme-dark-base .q-action-btn,
body.theme-shinjuku .q-action-btn{
  color:var(--accent,#ff375f);
}

body.theme-carbon-fire .q-action-btn.saved,
body.theme-dark-base .q-action-btn.saved,
body.theme-shinjuku .q-action-btn.saved{
  color:var(--accent,#ff375f);
  filter:drop-shadow(0 0 8px rgba(255,55,95,.28));
}

@media(max-width:520px){
  html,
  body,
  #wrap{
    max-width:100%;
    overflow-x:hidden;
  }
  #wrap{
    width:100%;
    box-sizing:border-box;
    padding-left:20px;
    padding-right:20px;
  }
  .app-header{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    align-items:start;
  }
  .header-main{
    min-width:0;
    max-width:calc(100vw - 178px);
  }
  .app-subtitle{
    max-width:100%;
    line-height:1.35;
  }
  .header-side{
    min-width:0;
    max-width:126px;
  }
  .header-kanji{
    font-size:28px;
  }
  .header-actions{
    gap:4px;
    max-width:126px;
    flex-wrap:nowrap;
  }
  .header-icon-btn{
    width:36px;
    height:38px;
    min-width:36px;
    flex:0 0 36px;
    padding:0;
  }
  .header-print-favorites img{
    width:33px;
    height:33px;
  }
  .header-favorites-count{
    right:-9px;
    bottom:1px;
  }
  .header-search-icon{
    width:29px;
    height:29px;
  }
  .header-actions .progress-widget .progress-ring-btn,
  body.theme-classic .header-actions .progress-widget .progress-ring-btn,
  body.theme-rilievo .header-actions .progress-widget .progress-ring-btn,
  body.theme-carbon-fire .header-actions .progress-widget .progress-ring-btn,
  body.theme-dark-base .header-actions .progress-widget .progress-ring-btn,
  body.theme-shinjuku .header-actions .progress-widget .progress-ring-btn{
    width:36px !important;
    height:36px !important;
    min-width:36px !important;
    flex:0 0 36px;
  }
  #jlpt-progress-widget .ring-svg{
    width:34px !important;
    height:34px !important;
  }
  #jlpt-progress-widget .ring-center{
    width:22px;
    height:22px;
  }
  #jlpt-progress-widget .ring-pct{
    font-size:9px;
  }
  .progress-widget .progress-card{
    right:0;
  }
  .q-card-top-actions{
    top:16px;
    right:16px;
    gap:8px;
  }
  .q-card-action-group{
    min-height:38px;
    padding:3px 6px;
    gap:4px;
  }
  .q-action-btn{
    width:30px;
    height:30px;
  }
  .q-action-btn .grammar-repeat-icon{
    width:23px;
    height:23px;
  }
  .q-fav-btn{
    font-size:30px;
  }
  .q-num{
    font-size:13px;
  }
  .q-next-top{
    min-width:126px;
  }
  .q-meta{
    min-height:58px;
    padding-right:0;
    padding-top:42px;
  }
  .home-briefing-row{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin:-.65rem 0 .85rem;
  }
  .sensei-banner{
    grid-template-columns:1fr;
    grid-template-areas:
      "mark"
      "copy"
      "actions";
    align-items:center;
    gap:6px;
    height:154px;
    margin:0;
    padding:9px;
  }
  .sensei-mark{
    width:42px;
    height:36px;
    border-radius:14px;
    font-size:15px;
  }
  .sensei-copy h2{
    font-size:14px;
    -webkit-line-clamp:2;
  }
  .sensei-copy p{
    display:none;
  }
  .sensei-insights{
    flex-wrap:nowrap;
    overflow:hidden;
    gap:4px;
    margin-top:5px;
  }
  .sensei-chip{
    min-height:20px;
    padding:3px 6px;
    font-size:10px;
  }
  .sensei-actions{
    flex-direction:row;
    width:100%;
    min-width:0;
  }
  .sensei-actions button{
    flex:1 1 0;
    min-height:30px;
    padding:5px 6px;
    font-size:10px;
    white-space:nowrap;
  }
  .daily-kanji{
    height:154px;
    padding:9px;
    column-gap:8px;
    grid-template-columns:auto minmax(0,1fr);
  }
  .daily-kanji-actions{
    gap:4px;
  }
  .daily-kanji-fav,
  .daily-kanji-back,
  .daily-kanji-next{
    width:26px;
    height:26px;
  }
  .daily-kanji-fav{
    font-size:20px;
  }
  .daily-refresh-icon{
    width:20px;
    height:20px;
  }
  .home-kanji{
    font-size:36px;
  }
  .home-title{
    font-size:13px;
  }
  .daily-kanji .reading-grid div{
    padding:5px 6px;
  }
  .home-note{
    display:none;
  }
  .home-briefing-row.sensei-hidden .daily-kanji,
  .daily-kanji{
    height:auto;
    min-height:204px;
    row-gap:6px;
    align-items:start;
    overflow:visible;
  }
  .daily-kanji .home-card-head{
    align-items:center;
  }
  .daily-kanji .reading-grid{
    width:100%;
    gap:5px;
    margin:0;
  }
  .daily-kanji .reading-grid strong{
    display:block;
    min-width:0;
    font-size:12px;
    line-height:1.25;
    overflow-wrap:anywhere;
  }
  .daily-kanji .home-note{
    display:block;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    font-size:11.5px;
    line-height:1.35;
  }
  .daily-kanji .daily-note-entry,
  .daily-kanji .daily-note-text{
    overflow-wrap:anywhere;
  }
  .daily-kanji .daily-note-link{
    display:inline;
    white-space:normal;
  }
  .daily-kanji .daily-note-link span{
    display:inline;
  }

  /* Le voci kanji hanno sempre la stessa altezza: il refresh non sposta
     le card sottostanti anche quando letture ed esempi sono più lunghi. */
  .daily-kanji:not(.daily-term-reference){
    height:282px;
    min-height:282px;
  }
}

/* Home iPhone: contenuti ancorati in alto e accesso diretto alla pratica del kanji. */
.sensei-banner{
  grid-template-rows:minmax(0,1fr) auto;
  align-items:start;
}
.sensei-actions{align-self:end}
.daily-kanji{
  grid-template-areas:
    "head head"
    "kanji title"
    "kanji level"
    "kanji strokes"
    "readings readings"
    "note note";
  grid-template-rows:auto auto auto auto auto minmax(0,1fr);
  align-content:start;
  align-items:start;
}
.daily-kanji .home-kicker{
  color:var(--ink);
  font-size:19px;
  font-weight:800;
  line-height:1.1;
  letter-spacing:0;
  text-transform:none;
}
.daily-kanji-practice-link{
  align-self:start;
  display:grid;
  place-items:center;
  width:74px;
  height:74px;
  padding:0;
  border:1px solid rgba(92,61,46,.22);
  border-radius:16px;
  background:linear-gradient(145deg,rgba(255,252,245,.9),rgba(237,228,208,.72));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    inset 0 -2px 5px rgba(92,61,46,.08),
    0 8px 18px rgba(92,61,46,.11);
  text-align:center;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.daily-kanji-practice-link:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:4px;
}
.daily-kanji-practice-link.is-disabled{
  display:block;
  width:auto;
  height:auto;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  text-align:left;
  cursor:default;
  opacity:1;
}

@media(max-width:520px){
  .daily-kanji-practice-link:not(.is-disabled){
    width:62px;
    height:62px;
    border-radius:14px;
  }
}
.daily-kanji-level,
.daily-kanji-strokes{
  display:flex;
  align-items:baseline;
  gap:6px;
  min-width:0;
  color:var(--ink3);
  font-size:10px;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.daily-kanji-level{grid-area:level}
.daily-kanji-strokes{grid-area:strokes}
.daily-kanji-level strong,
.daily-kanji-strokes strong{
  color:var(--lacca);
  font-size:14px;
  letter-spacing:0;
}
body.daily-kanji-writing .kw-map-top-btn,
body.daily-kanji-writing .kw-deck-top-btn,
body.daily-kanji-writing #kw-repeat-panel,
body.daily-kanji-writing .kw-deck-add-wrap,
body.daily-kanji-writing #kw-next-kanji-btn{
  display:none !important;
}
/* Solo pratica standalone del dizionario: alza la griglia interna di circa 3 mm su iPhone. */
@media(max-width:980px) and (max-height:500px) and (orientation:landscape){
  body.daily-kanji-writing .kw-board{transform:translateY(-11px)}
}
@media(max-width:767px) and (orientation:portrait){
  body.daily-kanji-writing .kw-board{transform:translateX(-11px)}
}
@media(max-width:520px){
  .sensei-banner{
    grid-template-areas:
      "copy"
      "."
      "actions" !important;
    grid-template-rows:auto minmax(0,1fr) auto !important;
    align-content:stretch !important;
    align-items:start !important;
  }
  .sensei-copy{
    grid-area:copy;
    align-self:start;
    display:flex;
    flex-direction:column;
  }
  .sensei-copy h2{
    order:1;
    margin:0 0 3px;
    font-size:19px;
    line-height:1.1;
  }
  .sensei-copy #sensei-kicker{
    order:2;
    margin:0 0 5px;
    font-size:10px;
    line-height:1.2;
  }
  .sensei-copy p{
    order:3;
  }
  .sensei-insights{
    order:4;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    flex-wrap:nowrap;
    overflow:hidden;
  }
  .sensei-chip{flex:0 0 auto}
  .sensei-actions{
    grid-area:actions;
    align-self:end;
    width:100%;
  }
  .daily-kanji{align-content:start !important}
  .daily-kanji .home-card-head{align-self:start}
  .daily-kanji .home-kicker{font-size:19px}
  .daily-kanji-level,
  .daily-kanji-strokes{font-size:9px}
  .daily-kanji-level strong,
  .daily-kanji-strokes strong{font-size:13px}
}

/* ── BADGES ── */
.badge{font-size:10px;padding:2px 10px;border-radius:20px;font-weight:600;letter-spacing:.05em;text-transform:uppercase}
.b-grammar{background:rgba(107,43,107,0.1);color:var(--plum);border:1px solid rgba(107,43,107,0.2)}
.b-vocab{background:rgba(26,92,58,0.1);color:var(--jade);border:1px solid rgba(26,92,58,0.2)}
.b-reading{background:rgba(139,69,19,0.1);color:var(--amber);border:1px solid rgba(139,69,19,0.2)}
.b-listening{background:rgba(42,53,128,0.1);color:var(--indigo);border:1px solid rgba(42,53,128,0.2)}
.b-kanji{background:rgba(139,26,26,0.08);color:var(--lacca);border:1px solid rgba(139,26,26,0.2)}

.q-jp{font-family:var(--font-jp);font-size:24px;line-height:2;margin-bottom:14px;color:var(--ink);font-weight:400}
.q-jp-with-fav{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.q-jp-main{
  flex:1;
  min-width:0;
}
.q-kanji-target,
.kanji-question-target{
  color:var(--lacca);
  font-weight:700;
  text-shadow:0 2px 8px rgba(139,26,26,.12);
}
.kanji-question-layout{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  width:100%;
  margin:4px 0 20px;
  text-align:center;
}
.kanji-question-target{
  display:block;
  font-family:var(--font-jp);
  font-size:clamp(60px,17vw,104px);
  line-height:1.05;
  letter-spacing:.03em;
}
.kanji-question-prompt{
  display:block;
  max-width:100%;
  color:var(--ink);
  font-family:var(--font-jp);
  font-size:clamp(18px,4.8vw,25px);
  line-height:1.5;
  font-weight:500;
}
.grammar-fav-inline{
  flex:0 0 auto;
  margin-top:6px;
  color:var(--lacca);
  text-shadow:0 1px 5px rgba(139,26,26,.20);
}
.q-blank{display:inline-block;min-width:70px;border-bottom:2px solid var(--lacca);text-align:center;color:var(--lacca);margin:0 6px;padding:0 4px}
.q-passage{font-family:var(--font-jp);font-size:14px;color:var(--ink2);background:rgba(237,228,208,0.5);border-radius:var(--rm);padding:14px 16px;margin-bottom:14px;line-height:2.1;border-left:3px solid var(--lacca)}
.q-passage-jp{font-size:16px}
.q-passage-with-fav .reading-fav-inline{
  display:inline-flex;
  vertical-align:baseline;
  margin-left:8px;
  transform:translateY(3px);
}
.q-passage-with-fav .reading-fav-inline:hover{transform:translateY(3px) scale(1.14)}
.q-text{font-size:16px;color:var(--ink);line-height:1.8;margin-bottom:14px;font-family:var(--font-jp)}

/* ── AUDIO ── */
.audio-panel{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin:-2px 0 14px;
  padding:10px;
  border-radius:var(--rm);
  background:var(--indigo-bg);
  border:1px solid rgba(42,53,128,.18);
}
.audio-panel span{
  font-size:11px;
  color:var(--indigo);
  font-style:italic;
}
.audio-btn{
  border:none;
  border-radius:20px;
  background:var(--indigo);
  color:#fff;
  padding:8px 13px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  font-family:var(--font);
}
.audio-btn.ghost{
  background:rgba(255,255,255,.72);
  color:var(--indigo);
  border:1px solid rgba(42,53,128,.22);
}

/* ── CHOICES ── */
.choices{display:flex;flex-direction:column;gap:9px}
.ch{width:100%;text-align:left;padding:13px 16px;border:1px solid var(--bd);border-radius:var(--rm);background:rgba(255,255,255,0.5);cursor:pointer;font-size:14px;color:var(--ink);display:flex;gap:12px;align-items:flex-start;transition:all .18s ease;line-height:1.6;font-family:var(--font);backdrop-filter:blur(4px)}
.ch:hover:not(:disabled){border-color:var(--lacca);background:rgba(255,255,255,0.85);transform:translateX(4px);box-shadow:0 3px 12px rgba(26,10,0,0.08)}
.ch.correct{border-color:var(--jade-lt);background:var(--jade-bg);color:var(--jade);transform:translateX(4px)}
.ch.wrong{border-color:var(--lacca);background:var(--lacca-bg);color:var(--lacca)}
.ch:disabled{cursor:default}
.ch-letter{font-weight:700;min-width:22px;height:22px;background:var(--parchment3);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--ink3);flex-shrink:0;margin-top:1px;transition:all .18s}
.ch:hover:not(:disabled) .ch-letter{background:var(--lacca);color:#fff}
.ch.correct .ch-letter{background:var(--jade-lt);color:#fff}
.ch.wrong .ch-letter{background:var(--lacca);color:#fff}
.ch-jp{font-size:16px;font-family:var(--font-jp)}

/* ── FEEDBACK LABEL (pallino 正解 / もう一度) ── */
.ch,.manga-choice{position:relative;overflow:visible}
.ch::before,
.manga-choice::before{
  content:"";
  position:absolute;
  inset:-2px;
  padding:2px;
  border-radius:inherit;
  pointer-events:none;
  background:
    linear-gradient(115deg,
      transparent 0%,
      transparent 36%,
      rgba(184,134,11,.10) 43%,
      rgba(218,165,32,.80) 48%,
      rgba(255,250,214,.94) 50%,
      rgba(218,165,32,.70) 53%,
      transparent 61%,
      transparent 100%);
  background-size:240% 100%;
  background-position:150% 0;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite:exclude;
  opacity:0;
  animation:none;
}
.ch.correct::before,
.manga-choice.correct::before{
  opacity:.86;
  animation:answerButtonBorderShimmer 1.85s cubic-bezier(.22,.7,.2,1) infinite;
}
.ch:disabled:not(.correct):not(.wrong)::before,
.manga-choice:disabled:not(.correct):not(.wrong)::before{
  opacity:0;
  animation:none;
}
.feedback-label{
  position:absolute;
  right:14px;
  top:-14px;
  padding:4px 12px;
  border-radius:999px;
  color:#fffaf6;
  font-size:13px;
  font-weight:700;
  opacity:0;
  transform:translateY(8px) scale(.88);
  transition:all .32s ease;
  pointer-events:none;
  white-space:nowrap;
}
.correct .feedback-label{background:var(--jade)}
.wrong   .feedback-label{background:var(--lacca)}
.show-label .feedback-label{opacity:1;transform:translateY(0) scale(1)}

/* ── SENTENCE BUILDER ── */
.builder-heading{
  margin-bottom:8px;
}
.builder-heading .q-jp-main{
  font-family:var(--font-display);
  color:var(--lacca-dk);
  font-size:20px;
  line-height:1.5;
}
.builder-grammar-main{
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:8px 12px;
}
.builder-grammar-point{
  font-family:var(--font-display);
  color:var(--lacca-dk);
  font-size:clamp(22px,5vw,30px);
  line-height:1.25;
}
.builder-grammar-description{
  color:var(--lacca-dk);
  font-family:var(--font);
  font-size:16px;
  line-height:1.5;
  font-weight:800;
}
.builder-heading-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
.grammar-repeat-btn{
  width:28px;
  height:28px;
  border:none;
  background:transparent;
  color:var(--lacca);
  cursor:pointer;
  display:grid;
  place-items:center;
  padding:0;
  margin-top:4px;
  transition:transform .15s,color .15s,filter .15s;
}
.grammar-repeat-btn:hover{
  transform:scale(1.12);
  color:var(--lacca-dk);
}
.grammar-repeat-btn.saved{
  color:var(--lacca);
  filter:drop-shadow(0 1px 5px rgba(139,26,26,.25));
}
.builder-instruction{
  color:var(--ink3);
  font-size:13px;
  line-height:1.5;
  margin:-2px 0 12px;
  font-style:italic;
}
.logic-card{
  border:1px solid rgba(139,26,26,.18);
  border-radius:var(--rm);
  background:linear-gradient(135deg,rgba(255,255,255,.62),rgba(255,250,242,.42));
  padding:15px;
  margin:0 0 14px;
}
.logic-kicker{
  color:var(--ink3);
  font-size:10px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
  margin-bottom:8px;
}
.logic-sentence{
  color:var(--lacca-dk);
  font-family:var(--font-jp);
  font-size:clamp(23px,6vw,34px);
  line-height:1.45;
  font-weight:600;
}
.logic-reading{
  color:var(--ink3);
  font-family:var(--font-jp);
  font-size:13px;
  line-height:1.55;
  margin-top:2px;
}
.logic-sentence-it{
  color:var(--ink2);
  font-size:12px;
  line-height:1.5;
  margin-top:3px;
  font-style:italic;
}
.logic-section-title{
  color:var(--ink3);
  font-size:10px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
  margin:14px 0 7px;
}
.logic-breakdown{
  display:grid;
  gap:7px;
}
.logic-part{
  display:grid;
  grid-template-columns:minmax(72px,.65fr) 1fr;
  gap:9px;
  align-items:center;
  border:1px solid rgba(92,61,46,.13);
  border-radius:12px;
  background:rgba(255,255,255,.52);
  padding:8px 10px;
}
.logic-piece{
  color:var(--lacca);
  font-family:var(--font-jp);
  font-size:17px;
  font-weight:700;
  line-height:1.35;
}
.logic-role{
  color:var(--ink);
  font-size:12px;
  line-height:1.45;
}
.logic-key{
  color:var(--ink2);
  border-left:3px solid var(--lacca);
  background:rgba(139,26,26,.06);
  border-radius:0 12px 12px 0;
  padding:9px 11px;
  margin-top:12px;
  font-size:12px;
  line-height:1.5;
}
.logic-key span{
  display:block;
  color:var(--lacca-dk);
  font-size:10px;
  font-weight:800;
  letter-spacing:.10em;
  text-transform:uppercase;
  margin-bottom:3px;
}
.logic-question{
  color:var(--ink);
  font-family:var(--font-jp);
  font-size:17px;
  line-height:1.55;
  margin-top:14px;
  font-weight:600;
}
.logic-question-reading{
  color:var(--ink3);
  font-family:var(--font-jp);
  font-size:13px;
  line-height:1.55;
  margin-top:2px;
}
.logic-question-it{
  color:var(--ink2);
  font-size:12px;
  line-height:1.5;
  margin-top:3px;
  font-style:italic;
}
.sentence-builder-area{
  display:grid;
  gap:12px;
}
.builder-selected,
.builder-bank{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  border-radius:var(--rm);
}
.builder-selected{
  min-height:76px;
  align-items:center;
  padding:13px;
  border:1px solid rgba(139,26,26,.18);
  background:rgba(249,236,236,.48);
  transition:border-color .16s ease, background .16s ease, box-shadow .16s ease;
  position:relative;
  overflow:visible;
}
.builder-selected.builder-correct{
  border-color:var(--jade-lt);
  background:var(--jade-bg);
  box-shadow:0 5px 18px rgba(26,92,58,.08);
}
.builder-selected.builder-correct .feedback-label{
  background:var(--jade);
}
.builder-selected.builder-wrong{
  border-color:rgba(139,26,26,.32);
  background:var(--lacca-bg);
  box-shadow:0 5px 18px rgba(139,26,26,.08);
}
.builder-selected.drag-active{
  border-color:rgba(184,134,11,.55);
  background:rgba(251,244,224,.72);
  box-shadow:inset 0 0 0 1px rgba(184,134,11,.18);
}
.builder-selected.drag-end-target{
  box-shadow:inset 0 -3px 0 rgba(184,134,11,.55);
}
.builder-bank{
  padding:12px;
  border:1px solid var(--bd);
  background:rgba(255,255,255,.45);
}
.builder-placeholder{
  color:var(--ink3);
  font-size:13px;
  font-style:italic;
}
.builder-token{
  border:1px solid rgba(156,104,74,.28);
  border-radius:999px;
  background:rgba(255,255,255,.86);
  color:var(--ink);
  padding:8px 12px;
  font-family:var(--font-jp);
  font-size:14px;
  line-height:1.35;
  cursor:pointer;
  transition:all .16s ease;
  box-shadow:0 2px 7px rgba(26,10,0,.04);
}
.builder-token:hover:not(:disabled){
  border-color:var(--lacca);
  color:var(--lacca-dk);
  transform:translateY(-1px);
}
.builder-token.selected{
  background:#fffaf2;
  border-color:rgba(184,134,11,.45);
  color:var(--lacca-dk);
  font-weight:700;
  cursor:grab;
  touch-action:none;
}
.builder-token.selected:active{
  cursor:grabbing;
}
.builder-token.dragging{
  opacity:.18;
  pointer-events:none;
  border-style:dashed;
  box-shadow:none;
}
.builder-drag-ghost{
  position:fixed;
  z-index:9999;
  pointer-events:none;
  margin:0;
  opacity:.98;
  transform:scale(1.05);
  box-shadow:0 14px 30px rgba(26,10,0,.18);
  transition:none;
  will-change:left,top;
}
.builder-token.drag-over{
  border-color:var(--gold);
  box-shadow:inset 3px 0 0 var(--gold),0 5px 14px rgba(184,134,11,.12);
}
.builder-token.drag-over.drag-after{
  box-shadow:inset -3px 0 0 var(--gold),0 5px 14px rgba(184,134,11,.12);
}
.builder-token.used{
  opacity:.35;
  cursor:default;
}
.builder-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
}
.builder-clear,
.builder-check{
  border-radius:999px;
  padding:10px 12px;
  font-family:var(--font);
  font-weight:800;
  cursor:pointer;
  border:1px solid var(--bd);
  transition:all .16s ease;
}
.builder-clear{
  background:rgba(255,255,255,.58);
  color:var(--ink2);
}
.builder-check{
  background:var(--lacca);
  color:#fff;
  border-color:var(--lacca);
}
.builder-clear:disabled,
.builder-check:disabled{
  opacity:.42;
  cursor:default;
}
.builder-check:not(:disabled):hover,
.builder-clear:not(:disabled):hover{
  transform:translateY(-1px);
  box-shadow:0 5px 16px rgba(26,10,0,.08);
}
.builder-feedback-line{
  font-family:var(--font);
  color:inherit;
  margin-top:6px;
}
.builder-feedback-line .answer-clickable{
  display:inline-block;
  margin-left:4px;
}
.builder-feedback-it,
.builder-feedback-rule{
  margin-top:7px;
  color:inherit;
}
.builder-note-wrap{
  margin-top:12px;
}

/* ── EXPLANATION ── */
.explain{border-radius:var(--rm);padding:14px 52px 14px 16px;margin-top:12px;font-size:13px;line-height:1.8;display:none;border-left:3px solid var(--jade-lt);background:var(--jade-bg);color:var(--jade);animation:fadeUp .25s ease;position:relative}
.explain.wrong{background:var(--lacca-bg);color:var(--lacca-dk);border-left-color:var(--lacca)}
.answer-status-line{
  font-weight:700;
  margin-bottom:0;
}
.logic-feedback-answer{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:2px 7px;
  margin-top:5px;
}
.logic-feedback-jp{
  font-family:var(--font-jp);
  font-size:1.18em;
  font-weight:700;
}
.logic-feedback-it{
  flex-basis:100%;
  font-style:italic;
}
.logic-feedback-explanation{
  margin-top:5px;
}
.feedback-details-toggle{
  position:absolute;
  top:10px;
  right:12px;
  width:34px;
  height:34px;
  border:0;
  border-radius:999px;
  background:transparent;
  color:var(--jade);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-family:var(--ui-font);
  font-size:22px;
  font-weight:700;
  line-height:1;
  transition:all .16s ease;
}
.wrong .feedback-details-toggle{
  color:var(--lacca-dk);
}
.feedback-details-toggle:hover{
  background:rgba(255,255,255,.42);
  transform:translateY(-1px);
}
.feedback-details{
  margin-top:10px;
}
.feedback-details[hidden]{
  display:none;
}
.feedback-answer-line{
  margin:4px 0 10px;
  font-weight:700;
}
.answer-correct-label{
  color:inherit;
}
.answer-clickable{
  font-family:var(--font-jp);
  font-weight:700;
}
.reading-study-line{
  margin-top:10px;
}
.furigana-line{
  padding:10px 12px;
  border-radius:var(--rm);
  background:rgba(255,255,255,.55);
  color:var(--ink2);
  font-family:var(--font-jp);
  font-size:12px;
  line-height:2;
  border:1px solid var(--bd);
}
.translation-line{
  margin-top:10px;
  padding:12px 14px;
  border-radius:var(--rm);
  background:rgba(255,255,255,.68);
  color:var(--ink2);
  border:1px solid var(--bd);
  font-size:13px;
  line-height:1.65;
}
.translation-title{
  color:var(--gold);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.12em;
  margin-bottom:7px;
}
.translation-line p + p{margin-top:8px}
.translation-line strong{color:var(--ink)}
.translation-answer-jp{
  display:block;
  margin-top:4px;
  font-family:var(--font-jp);
  color:var(--lacca-dk);
}
.explanation-jp{
  font-family:var(--font-jp);
}
.furi-token{
  display:inline-block;
  position:relative;
  border:none;
  border-bottom:1px dotted var(--lacca);
  background:rgba(255,255,255,.55);
  color:var(--lacca-dk);
  border-radius:5px;
  padding:1px 4px;
  margin:0 1px;
  font-family:var(--font-jp);
  font-size:12px;
  cursor:pointer;
}
.furi-token:hover{
  background:var(--gold-bg);
  color:var(--gold);
}
.furi-token[data-reading]:hover::after,
.furi-token[data-reading]:focus-visible::after{
  content:attr(data-reading);
  position:absolute;
  left:50%;
  bottom:calc(100% + 7px);
  transform:translateX(-50%);
  z-index:20;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(156,104,74,.24);
  background:#fffaf2;
  box-shadow:0 8px 22px rgba(62,36,18,.14);
  color:var(--lacca);
  font-family:var(--font-jp);
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
  pointer-events:none;
}
.furi-token[data-reading]:hover::before,
.furi-token[data-reading]:focus-visible::before{
  content:"";
  position:absolute;
  left:50%;
  bottom:calc(100% + 2px);
  transform:translateX(-50%);
  z-index:21;
  border:5px solid transparent;
  border-top-color:#fffaf2;
  pointer-events:none;
}
.answer-token{
  font-weight:700;
}

/* ── TERM MODAL ── */
.term-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:50;
  place-items:center;
  padding:18px;
  background:rgba(26,10,0,.38);
  backdrop-filter:blur(5px);
}

/* A term definition is a self-contained modal on iPhone: page content may
   never scroll behind it, and only this card receives vertical gestures. */
body.term-modal-open .app-header{
  visibility:hidden !important;
  pointer-events:none !important;
}
@media (max-width:520px){
  html.term-modal-open{
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.term-modal-open{
    position:fixed !important;
    top:var(--term-modal-lock-offset, 0px) !important;
    right:0 !important;
    left:0 !important;
    width:100% !important;
    height:100dvh !important;
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  #term-modal{
    z-index:3000 !important;
    overflow:hidden;
    touch-action:none;
  }
  #term-modal .term-modal{
    max-height:calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px) !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    touch-action:pan-y;
  }
}
.term-modal{
  width:min(100%,420px);
  max-height:82vh;
  overflow:auto;
  border:1px solid var(--bd2);
  border-radius:var(--r);
  background:var(--parchment);
  box-shadow:0 18px 60px rgba(26,10,0,.28);
  padding:18px;
}
.term-modal-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  padding-bottom:12px;
  border-bottom:1px solid var(--bd);
  margin-bottom:14px;
}
.term-modal-head h2{
  font-family:var(--font-jp);
  font-size:28px;
  margin:0;
  color:var(--lacca);
}
.term-modal-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
.term-modal-head button{
  width:30px;height:30px;
  border-radius:50%;
  border:1px solid var(--bd);
  background:rgba(255,255,255,.65);
  color:var(--ink2);
  cursor:pointer;
}
.term-title-audio{
  border-color:rgba(139,26,26,.28) !important;
  background:rgba(139,26,26,.08) !important;
  color:var(--lacca) !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:800;
}
.term-title-audio:hover{
  background:rgba(139,26,26,.14) !important;
}
.term-close-btn{
  font-size:18px;
  font-weight:700;
}
.term-meaning{
  font-size:15px;
  color:var(--ink);
  background:rgba(255,255,255,.58);
  border-left:3px solid var(--lacca);
  border-radius:var(--rm);
  padding:11px 13px;
  margin-bottom:14px;
}
.term-section{
  margin-bottom:14px;
}
.term-section h3{
  margin-bottom:7px;
  font-size:11px;
  color:var(--ink3);
}
.term-row{
  padding:8px 10px;
  border-radius:var(--rm);
  border:1px solid var(--bd);
  background:rgba(255,255,255,.42);
  color:var(--ink2);
  font-size:12px;
  line-height:1.7;
  margin-bottom:6px;
  font-family:var(--font-jp);
}
.term-example-card{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px;
  border-radius:var(--rm);
  border:1px solid var(--bd);
  background:rgba(255,255,255,.46);
  margin-bottom:8px;
}
.term-example-main{
  flex:1;
  min-width:0;
}
.term-example-actions{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
  flex-shrink:0;
}
.term-example-jp{
  display:block;
  width:100%;
  color:var(--ink);
  font-family:var(--font-jp);
  font-size:15px;
  line-height:1.7;
}
.inline-study-token{
  border:0;
  background:transparent;
  color:inherit;
  cursor:pointer;
  font:inherit;
  padding:0 1px;
}
.inline-study-token:hover{
  color:var(--lacca);
  text-decoration:underline;
  text-decoration-style:dotted;
  text-underline-offset:4px;
}
.term-example-reading{
  color:var(--ink3);
  font-size:12px;
  line-height:1.55;
  margin-top:3px;
  font-family:var(--font-jp);
}
.term-example-it{
  color:var(--ink2);
  font-size:13px;
  line-height:1.55;
  margin-top:4px;
}
.term-audio-btn{
  border:1px solid rgba(139,26,26,.24);
  border-radius:999px;
  background:rgba(139,26,26,.07);
  color:var(--lacca);
  cursor:pointer;
  font-size:11px;
  font-weight:700;
  padding:7px 10px;
  white-space:nowrap;
  font-family:var(--font);
}
.term-audio-btn:hover{
  background:rgba(139,26,26,.12);
}
@media(max-width:520px){
  .term-example-card{
    flex-direction:column;
  }
  .term-example-actions{
    width:100%;
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
  }
  .term-audio-btn{
    flex:1;
  }
}
.term-note-label{
  display:block;
  color:var(--ink3);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:14px;
}
.term-note-input{
  width:100%;
  min-height:86px;
  margin-top:7px;
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.55);
  color:var(--ink);
  padding:10px 12px;
  resize:vertical;
  font-family:var(--font);
  font-size:13px;
  line-height:1.55;
  outline:none;
}
.term-note-input:focus{
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(184,134,11,.12);
}
.term-fav-btn{
  width:100%;
  border:1px solid rgba(184,134,11,.35);
  border-radius:var(--rm);
  background:var(--gold-bg);
  color:var(--ink2);
  padding:12px;
  cursor:pointer;
  font-family:var(--font);
  font-weight:700;
}
.term-fav-btn.saved{
  color:var(--gold);
  border-color:var(--gold);
}
.dictionary-search-backdrop{
  /* The mobile home header deliberately sits high for its menu.  Search is a
     full modal instead, so it must be above that header. */
  z-index:2000;
}
.dictionary-search-modal{
  width:min(100%,520px);
}
.dictionary-search-label{
  display:block;
  color:var(--ink3);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:14px;
}
.dictionary-search-input{
  width:100%;
  margin-top:8px;
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.68);
  color:var(--ink);
  padding:12px 14px;
  font-family:var(--font-jp);
  font-size:16px;
  line-height:1.4;
  outline:none;
}
.dictionary-search-input:focus{
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(184,134,11,.12);
}
.dictionary-search-results{
  display:grid;
  gap:8px;
}
.dictionary-empty{
  border:1px dashed rgba(184,134,11,.35);
  border-radius:var(--rm);
  color:var(--ink3);
  background:rgba(255,255,255,.42);
  padding:14px;
  line-height:1.55;
  font-size:13px;
}
.dictionary-result{
  width:100%;
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.58);
  color:var(--ink);
  cursor:pointer;
  text-align:left;
  padding:11px 12px;
  display:grid;
  gap:4px;
  transition:all .16s ease;
}
.dictionary-result:hover{
  border-color:rgba(184,134,11,.48);
  background:rgba(255,255,255,.78);
  transform:translateY(-1px);
}
.dictionary-result-jp{
  font-family:var(--font-jp);
  color:var(--lacca);
  font-size:20px;
  line-height:1.35;
}
.dictionary-result-reading{
  font-family:var(--font-jp);
  color:var(--ink3);
  font-size:13px;
}
.dictionary-result-meaning{
  color:var(--ink2);
  font-size:13px;
  line-height:1.45;
}

/* ── MORE EXAMPLES (grammatica) ── */
.more-examples-wrap{
  margin-top:14px;
  border-radius:var(--rm);
  overflow:hidden;
  border:1px solid rgba(107,43,107,0.2);
  background:rgba(245,235,245,0.5);
}
.more-ex-btn{
  width:100%;padding:12px 16px;
  background:transparent;
  border:none;
  cursor:pointer;
  font-size:13px;font-weight:600;
  color:var(--plum);
  font-family:var(--font);
  letter-spacing:.05em;
  text-align:left;
  transition:all .18s;
  display:flex;align-items:center;gap:8px;
}
.more-ex-btn:hover:not(:disabled){background:rgba(107,43,107,0.06)}
.more-ex-btn:disabled{color:var(--ink3);cursor:default}

.examples-panel{
  border-top:1px solid rgba(107,43,107,0.12);
}

/* Singolo esempio */
.ex-item{
  padding:14px 16px;
  border-bottom:1px solid rgba(107,43,107,0.1);
  animation:fadeUp .3s ease;
  display:grid;
  grid-template-columns:30px 1fr;
  gap:10px;
}
.ex-item:last-child{border-bottom:none}
.ex-item.has-note-action{grid-template-columns:30px minmax(0,1fr) 34px}
.grammar-example-note-btn{
  width:32px;height:32px;
  padding:0;
  appearance:none;
  align-self:start;
  border:1px solid rgba(139,26,26,.24);
  border-radius:999px;
  background:rgba(255,250,242,.9);
  color:var(--lacca);
  display:grid;place-items:center;
  cursor:pointer;
  font-size:24px;font-weight:900;line-height:1;
  box-shadow:0 3px 10px rgba(26,10,0,.08);
  transition:transform .16s,background .16s,color .16s,border-color .16s;
}
.grammar-example-note-btn:hover{transform:translateY(-1px);background:#fffaf2;border-color:rgba(139,26,26,.42)}
.grammar-example-note-btn.is-open{background:var(--lacca);color:#fffaf2}
.grammar-example-note-btn.has-note{font-size:17px;border-color:rgba(184,134,11,.38);color:var(--amber)}
.grammar-example-note-btn.has-note.is-open{font-size:24px;color:#fffaf2;border-color:rgba(139,26,26,.58)}
.grammar-example-close-glyph{display:block;width:100%;height:100%;font:400 27px/29px Arial,sans-serif;text-align:center;transform:translateY(-1px)}
.grammar-example-note-panel{
  grid-column:2/-1;
  padding:12px;
  border:1px solid rgba(184,134,11,.24);
  border-radius:14px;
  background:rgba(255,250,242,.72);
}
.grammar-example-note-panel label{display:block;margin-bottom:7px;color:var(--amber);font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.grammar-example-note-panel textarea{width:100%;min-height:52px;max-height:220px;resize:none;overflow:hidden;border:1px solid rgba(92,61,46,.22);border-radius:11px;background:rgba(255,255,255,.78);color:var(--ink);font:600 14px/1.5 var(--font);padding:10px;outline:none}
.grammar-example-note-panel textarea:focus{border-color:rgba(139,26,26,.44);box-shadow:0 0 0 3px rgba(139,26,26,.08)}
.favorite-star{
  width:26px;height:26px;
  border:none;
  background:transparent;
  color:var(--ink3);
  cursor:pointer;
  font-size:23px;
  line-height:1;
  padding:0;
  margin-top:2px;
  transition:transform .15s,color .15s,text-shadow .15s;
}
.favorite-star:hover{transform:scale(1.14);color:var(--gold)}
.favorite-star.saved{color:var(--gold-lt);text-shadow:0 1px 4px rgba(184,134,11,.28)}
.ex-body{min-width:0}
.ex-jp{
  font-family:var(--font-jp);
  font-size:18px;color:var(--ink);
  margin-bottom:3px;line-height:1.8;
}
.ex-roma{
  font-size:12px;color:var(--ink3);
  font-style:italic;margin-bottom:3px;
  letter-spacing:.03em;
}
.ex-it{
  font-size:13px;color:var(--ink2);
  margin-bottom:5px;
}
.ex-note{
  font-size:11px;color:var(--plum);
  background:rgba(107,43,107,0.07);
  border-radius:4px;padding:3px 8px;
  display:inline-block;
  letter-spacing:.03em;
}
.grammar-note-card{
  border-top:1px solid rgba(107,43,107,0.12);
  padding:14px 16px 16px;
  background:rgba(255,255,255,.32);
}
.grammar-note-input{
  min-height:78px;
  background:rgba(255,255,255,.72);
}

/* Loading dots */
.ex-loading{
  padding:18px;display:flex;gap:6px;justify-content:center;align-items:center;
}
.ex-dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--plum);opacity:.4;
  display:inline-block;
  animation:dotBounce 1.2s infinite ease-in-out;
}
.ex-dot:nth-child(2){animation-delay:.2s}
.ex-dot:nth-child(3){animation-delay:.4s}

.ex-error{
  padding:12px 16px;
  font-size:12px;color:var(--lacca);
  font-style:italic;
}

/* ── NAV ROW ── */
.nav-row{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:12px;
  align-items:center;
  margin-top:1.25rem;
  padding-bottom:max(0px,env(safe-area-inset-bottom));
}
.nbtn{justify-self:start;padding:11px 22px;border-radius:var(--rm);border:1px solid var(--bd);background:rgba(255,255,255,0.5);cursor:pointer;font-size:13px;color:var(--ink2);font-family:var(--font);letter-spacing:.04em;transition:all .18s}
.nbtn:hover{background:rgba(255,255,255,0.9);border-color:var(--bd2)}
.nbtn.pri{justify-self:end;min-width:150px;background:linear-gradient(135deg,var(--lacca) 0%,var(--lacca-dk) 100%);color:#fff;border-color:transparent;box-shadow:0 4px 14px rgba(139,26,26,0.3)}
.nbtn.pri:hover{box-shadow:0 6px 20px rgba(139,26,26,0.4);transform:translateY(-1px)}
.nbtn:disabled,
.nbtn.pri:disabled{
  cursor:not-allowed;
  opacity:.45;
  transform:none;
  box-shadow:none;
  filter:grayscale(.25);
}
.nbtn:disabled:hover,
.nbtn.pri:disabled:hover{
  transform:none;
  box-shadow:none;
}

/* ── RESULTS ── */
.results-wrap{padding:.5rem 0}
.pass-celebration{
  margin:4px 0 22px;
  border:1px solid rgba(184,134,11,.34);
  border-radius:22px;
  background:
    radial-gradient(circle at 24% 12%,rgba(255,244,210,.9),transparent 32%),
    linear-gradient(180deg,rgba(255,255,255,.75),rgba(251,244,229,.74));
  box-shadow:0 18px 44px rgba(64,39,14,.16);
  padding:18px;
  text-align:center;
  overflow:hidden;
}
.pass-copy{
  padding:4px 10px 14px;
}
.pass-kicker{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:64px;
  height:28px;
  padding:0 14px;
  border-radius:999px;
  background:rgba(46,138,88,.12);
  color:var(--jade);
  border:1px solid rgba(46,138,88,.25);
  font-family:var(--font-jp);
  font-weight:700;
  letter-spacing:.08em;
  margin-bottom:10px;
}
.pass-copy h2{
  margin:0 0 8px;
  color:var(--lacca);
  font-family:var(--font-jp);
  font-size:clamp(28px,4.8vw,44px);
  font-weight:800;
  letter-spacing:0;
}
.pass-copy p{
  margin:0 auto;
  max-width:680px;
  color:var(--ink2);
  font-size:15px;
  line-height:1.7;
}
.pass-image{
  display:block;
  width:100%;
  max-width:860px;
  margin:0 auto 16px;
  border-radius:18px;
  box-shadow:0 12px 34px rgba(95,56,18,.18);
}
.pass-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  max-width:760px;
  margin:0 auto;
}
.pass-actions button{
  min-height:46px;
  padding:12px 14px;
  border-radius:var(--rm);
  border:1px solid rgba(184,134,11,.38);
  background:rgba(255,255,255,.74);
  color:var(--ink2);
  cursor:pointer;
  font-family:var(--font);
  font-size:13px;
  font-weight:700;
  letter-spacing:.03em;
  transition:all .18s;
}
.pass-actions button:hover{
  transform:translateY(-1px);
  background:#fff;
  box-shadow:0 8px 22px rgba(64,39,14,.12);
}
.pass-actions button.pri{
  border-color:transparent;
  background:linear-gradient(135deg,var(--jade) 0%,#1f8f54 100%);
  color:#fff;
  box-shadow:0 8px 22px rgba(46,138,88,.28);
}
.score-wrap{text-align:center;margin:2rem 0 1.5rem}
.score-ring{width:140px;height:140px;border-radius:50%;margin:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;background:radial-gradient(circle,var(--jade-bg) 0%,rgba(230,248,236,0) 100%);border:2px solid var(--jade-lt);box-shadow:0 0 0 8px rgba(46,138,88,0.08),0 8px 32px rgba(26,10,0,0.1);position:relative}
.score-ring::before{content:'';position:absolute;inset:-8px;border-radius:50%;border:1px solid rgba(46,138,88,0.2)}
.score-ring.fail{background:radial-gradient(circle,var(--lacca-bg) 0%,rgba(249,236,236,0) 100%);border-color:var(--lacca);box-shadow:0 0 0 8px rgba(139,26,26,0.06),0 8px 32px rgba(26,10,0,0.1)}
.score-ring.fail::before{border-color:rgba(139,26,26,0.15)}
.score-pct{font-family:var(--font-display);font-size:36px;font-weight:400;color:var(--jade);line-height:1}
.score-ring.fail .score-pct{color:var(--lacca)}
.score-lbl{font-size:11px;color:var(--jade);margin-top:4px;letter-spacing:.06em;text-transform:uppercase}
.score-ring.fail .score-lbl{color:var(--lacca)}
.verdict{font-family:var(--font-display);font-size:22px;font-weight:400;text-align:center;margin-bottom:.4rem;margin-top:.75rem;color:var(--ink)}
.verdict-sub{font-size:13px;color:var(--ink3);text-align:center;margin-bottom:2rem;font-style:italic}
.rstats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:1.75rem}
.rstat{background:rgba(255,255,255,0.55);border:1px solid var(--bd);border-radius:var(--rm);padding:14px;text-align:center;backdrop-filter:blur(4px)}
.rstat .n{font-size:28px;font-weight:700;font-family:var(--font-display)}
.rstat .l{font-size:10px;color:var(--ink3);margin-top:3px;letter-spacing:.08em;text-transform:uppercase}
.review-list{display:flex;flex-direction:column;gap:8px;margin-bottom:1.75rem}
.rev-item{background:rgba(255,255,255,0.5);border:1px solid var(--bd);border-radius:var(--rm);padding:12px 15px;transition:all .15s}
.rev-item.ok{border-left:3px solid var(--jade-lt)}
.rev-item.err{border-left:3px solid var(--lacca)}
.rev-q{font-size:13px;color:var(--ink);margin-bottom:4px;font-family:var(--font-jp)}
.rev-ans{font-size:11px;color:var(--ink3);letter-spacing:.02em}
.rev-ans b{font-weight:600;color:var(--ink2)}
.r-actions{display:flex;gap:10px;margin-bottom:1rem}
.r-actions button{flex:1;padding:13px;border-radius:var(--rm);border:1px solid var(--bd);background:rgba(255,255,255,0.5);cursor:pointer;font-size:13px;color:var(--ink2);font-family:var(--font);letter-spacing:.04em;transition:all .18s}
.r-actions button:hover{background:rgba(255,255,255,0.9)}
.r-actions button.pri{background:linear-gradient(135deg,var(--lacca) 0%,var(--lacca-dk) 100%);color:#fff;border-color:transparent;box-shadow:0 4px 14px rgba(139,26,26,0.3)}
.r-actions button.pri:hover{box-shadow:0 6px 20px rgba(139,26,26,0.4);transform:translateY(-1px)}

/* ── MANGA INTERATTIVO ── */
.manga-mode-card{
  border-color:rgba(42,53,128,.25);
  background:linear-gradient(135deg,rgba(236,239,254,.58),rgba(255,255,255,.55));
}
.manga-mode-card .mc-icon,
.manga-mode-card .mc-name{
  color:var(--indigo);
}
.quiz-mode-card{
  border-color:rgba(107,43,107,.25);
  background:linear-gradient(135deg,rgba(245,235,245,.58),rgba(255,255,255,.55));
}
.quiz-mode-card .mc-icon,
.quiz-mode-card .mc-name{
  color:var(--plum);
}
.games-mode-card{
  border-color:rgba(184,134,11,.28);
  background:linear-gradient(135deg,rgba(251,244,224,.62),rgba(255,255,255,.55));
}
.games-mode-card .mc-icon,
.games-mode-card .mc-name{
  color:var(--gold);
}
.manga-hero-card,
.manga-episode-card,
.manga-reader,
.manga-ending-card{
  border:1px solid var(--bd);
  border-radius:var(--r);
  background:rgba(255,255,255,.56);
  box-shadow:0 8px 28px rgba(26,10,0,.07);
  backdrop-filter:blur(6px);
}
.manga-hero-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:18px;
  margin-bottom:14px;
  border-color:rgba(42,53,128,.18);
}
.manga-hero-card h2{
  margin:4px 0 6px;
  font-family:var(--font-jp);
  color:var(--indigo);
  font-size:25px;
}
.manga-hero-title{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.manga-hero-card p{
  color:var(--ink2);
  font-size:14px;
  line-height:1.6;
}
.manga-hero-mark{
  width:74px;
  height:74px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  font-family:var(--font-jp);
  font-size:38px;
  color:var(--lacca);
  background:radial-gradient(circle,#fff 0%,var(--indigo-bg) 74%);
  border:1px solid rgba(42,53,128,.18);
}
.quiz-hero-card{
  border-color:rgba(107,43,107,.2);
}
.games-hero-card{
  border-color:rgba(184,134,11,.24);
}
.quiz-hero-card h2,
.quiz-hero-mark{
  color:var(--plum);
}
.games-hero-card h2,
.games-hero-mark{
  color:var(--gold);
}
.quiz-hero-mark{
  background:radial-gradient(circle,#fff 0%,var(--plum-bg) 74%);
  border-color:rgba(107,43,107,.2);
}
.games-hero-mark{
  background:radial-gradient(circle,#fff 0%,var(--gold-bg) 74%);
  border-color:rgba(184,134,11,.24);
}
.manga-episode-grid{
  display:grid;
  gap:12px;
}
.manga-library{
  border:1px solid var(--bd);
  border-radius:var(--r);
  background:rgba(255,255,255,.46);
  box-shadow:0 10px 34px rgba(26,10,0,.08);
  backdrop-filter:blur(8px);
  padding:20px;
}
.manga-library-head{
  display:grid;
  gap:16px;
  margin-bottom:18px;
}
.manga-library-title-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  text-align:center;
}
.manga-library-icon{
  width:54px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  color:#fff;
  background:linear-gradient(145deg,var(--indigo),#6d45d8);
  box-shadow:0 12px 26px rgba(42,53,128,.24);
  font-family:var(--font-jp);
  font-size:20px;
  font-weight:800;
  letter-spacing:0;
  line-height:1;
}
.manga-hero-title-icon{
  flex:0 0 auto;
}
.manga-library-title-row h3{
  margin:0;
  color:var(--ink);
  font-size:28px;
  line-height:1;
}
.manga-library-title-row p{
  margin:8px 0 0;
  color:var(--ink2);
  font-size:14px;
  line-height:1.45;
}
.manga-library-tools{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  max-width:760px;
  width:100%;
  margin:0 auto;
}
.manga-search-box{
  min-height:48px;
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid rgba(42,53,128,.12);
  border-radius:16px;
  background:rgba(255,255,255,.58);
  padding:0 14px;
  color:var(--ink3);
}
.manga-search-box span{
  font-size:22px;
  line-height:1;
  transform:translateY(-1px);
}
.manga-search-box input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:var(--ink);
  font:inherit;
  font-weight:700;
}
.manga-search-box input::placeholder{color:rgba(92,61,46,.55)}
.manga-filter-menu-btn{
  min-height:48px;
  border:1px solid rgba(42,53,128,.12);
  border-radius:16px;
  background:rgba(255,255,255,.58);
  color:var(--ink);
  padding:0 16px;
  font:inherit;
  font-weight:800;
}
.manga-filter-tabs{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}
.manga-filter-chip{
  border:1px solid rgba(42,53,128,.12);
  border-radius:999px;
  min-height:38px;
  padding:0 18px;
  background:rgba(255,255,255,.58);
  color:var(--ink);
  font:inherit;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
  transition:all .18s;
}
.manga-filter-chip:hover{
  transform:translateY(-1px);
  border-color:rgba(42,53,128,.30);
}
.manga-filter-chip.sel{
  background:linear-gradient(145deg,#6f4edb,var(--indigo));
  color:#fff;
  border-color:transparent;
  box-shadow:0 12px 24px rgba(42,53,128,.22);
}
.manga-newsstand{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(164px,1fr));
  gap:18px;
  align-items:start;
}
.manga-shelf-card{
  min-width:0;
}
.manga-shelf-card.is-openable{
  cursor:pointer;
}
.manga-shelf-card.is-openable:focus-visible{
  outline:2px solid var(--indigo);
  outline-offset:6px;
  border-radius:14px;
}
.manga-shelf-card.is-openable:hover .manga-cover-wrap{
  transform:translateY(-2px);
}
.manga-cover-wrap{
  position:relative;
  aspect-ratio:2/3;
  border-radius:12px;
  overflow:hidden;
  background:#141620;
  box-shadow:0 16px 34px rgba(26,10,0,.16);
  transition:transform .16s ease, box-shadow .16s ease;
}
.manga-shelf-cover-img,
.manga-shelf-cover{
  width:100%;
  height:100%;
  display:block;
}
.manga-shelf-cover-img{
  object-fit:cover;
  object-position:center 15%;
}
.manga-shelf-cover{
  position:relative;
  overflow:hidden;
  padding:14px;
  color:#fff;
  background:linear-gradient(145deg,#202333,#080a12);
}
.manga-shelf-cover::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 28% 18%,rgba(255,255,255,.28),transparent 20%),
    linear-gradient(135deg,rgba(255,255,255,.16),transparent 44%,rgba(0,0,0,.28));
}
.manga-cover-station{background:linear-gradient(145deg,#e8ded0,#776b5d 46%,#2d354d)}
.manga-cover-sky{background:linear-gradient(145deg,#9ed3f8,#f8dfaa 55%,#364c8b)}
.manga-cover-rain{background:linear-gradient(145deg,#31435d,#182133 56%,#a6bacf)}
.manga-cover-letter{background:linear-gradient(145deg,#f5e6cb,#9a3342 52%,#251d2d)}
.manga-cover-neon{background:linear-gradient(145deg,#111627,#7337ff 48%,#ff3670)}
.manga-cover-moon{background:linear-gradient(145deg,#0d1324,#2a356f 54%,#d9c47a)}
.manga-cover-garden{background:linear-gradient(145deg,#183429,#5e8d62 48%,#f4d7e2)}
.manga-cover-kana-dojo{background:linear-gradient(145deg,#f1dfb8 0%,#8d221f 36%,#182216 64%,#0c0a07 100%)}
.manga-cover-kana-dojo::before{
  background:
    radial-gradient(circle at 32% 20%,rgba(255,230,170,.34),transparent 20%),
    radial-gradient(circle at 76% 70%,rgba(184,134,11,.32),transparent 24%),
    linear-gradient(145deg,rgba(255,255,255,.14),transparent 42%,rgba(0,0,0,.34));
}
.manga-cover-game-cards{background:linear-gradient(145deg,#f2d7a6 0%,#274563 46%,#121b2c 100%)}
.manga-cover-game-builder{background:linear-gradient(145deg,#f4e6c7 0%,#6b2b6b 48%,#1d1124 100%)}
.manga-cover-game-rush{background:linear-gradient(145deg,#f5c56d 0%,#9b332b 45%,#21100b 100%)}
.manga-cover-kanji-mahjong{background:linear-gradient(145deg,#f5e3bf 0%,#1f6b5c 42%,#172533 100%)}
.manga-cover-game-cards::before,
.manga-cover-game-builder::before,
.manga-cover-game-rush::before,
.manga-cover-kanji-mahjong::before{
  background:
    radial-gradient(circle at 34% 18%,rgba(255,248,236,.30),transparent 20%),
    radial-gradient(circle at 78% 74%,rgba(226,183,82,.32),transparent 24%),
    linear-gradient(145deg,rgba(255,255,255,.14),transparent 42%,rgba(0,0,0,.36));
}
.games-library-icon{
  background:linear-gradient(145deg,#d3a33a,var(--gold));
  box-shadow:0 12px 26px rgba(184,134,11,.22);
}
.games-library .manga-newsstand{
  grid-template-columns:repeat(auto-fit,minmax(164px,220px));
  justify-content:center;
}
.game-shelf-card.is-disabled{
  opacity:.72;
}
.game-shelf-card.is-disabled .manga-cover-wrap{
  filter:saturate(.82);
}
.game-shelf-card .manga-cover-title{
  font-size:clamp(18px,3vw,28px);
}
.game-shelf-card .manga-cover-art{
  font-size:clamp(44px,6vw,58px);
}
.manga-cover-ribbon,
.manga-cover-title,
.manga-cover-art,
.manga-cover-volume{
  position:relative;
  z-index:1;
}
.manga-cover-ribbon{
  display:inline-flex;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(0,0,0,.34);
  font-size:11px;
  font-weight:900;
}
.manga-cover-title{
  margin-top:16px;
  font-family:var(--font-jp);
  font-size:clamp(22px,4vw,34px);
  font-weight:900;
  line-height:1.05;
  text-shadow:0 2px 10px rgba(0,0,0,.38);
}
.manga-cover-art{
  position:absolute;
  right:10px;
  bottom:26px;
  font-family:var(--font-jp);
  font-size:64px;
  font-weight:900;
  opacity:.72;
  text-shadow:0 8px 22px rgba(0,0,0,.38);
}
.manga-cover-volume{
  position:absolute;
  right:12px;
  bottom:10px;
  font-family:var(--font-jp);
  font-size:24px;
  font-weight:900;
}
.manga-favorite-btn{
  position:absolute;
  right:8px;
  top:8px;
  z-index:2;
  width:32px;
  height:32px;
  border:0;
  border-radius:10px;
  background:rgba(9,10,18,.72);
  color:#ffd33d;
  font-size:20px;
  line-height:1;
  cursor:pointer;
}
.manga-favorite-btn.saved{
  background:rgba(9,10,18,.82);
  color:#ffd33d;
  text-shadow:0 0 10px rgba(255,211,61,.55);
}
.manga-shelf-info{
  padding:10px 2px 0;
}
.manga-shelf-status{
  color:var(--ink3);
  font-size:11px;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.manga-shelf-info h3{
  margin:5px 0 2px;
  color:var(--ink);
  font-size:17px;
  line-height:1.15;
}
.manga-shelf-info p{
  margin:0;
  color:var(--ink2);
  font-size:13px;
  line-height:1.35;
}
.manga-shelf-progress{
  display:grid;
  gap:5px;
  margin-top:8px;
  color:var(--ink3);
  font-size:12px;
  font-weight:800;
}
.manga-shelf-progress div{
  height:5px;
  border-radius:999px;
  background:rgba(42,53,128,.13);
  overflow:hidden;
}
.manga-shelf-progress i{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#6f4edb,var(--indigo));
}
.manga-shelf-open{
  display:none;
}
.manga-shelf-open:disabled{
  opacity:.58;
  cursor:not-allowed;
}
.manga-library-empty{
  grid-column:1/-1;
  border:1px dashed rgba(42,53,128,.24);
  border-radius:18px;
  padding:28px 18px;
  text-align:center;
  color:var(--ink2);
}
.manga-library-empty strong{
  display:block;
  color:var(--ink);
  font-size:18px;
}
body.theme-carbon-fire .manga-library,
body.theme-dark-base .manga-library,
body.theme-shinjuku .manga-library{
  background:rgba(255,255,255,.045);
  border-color:rgba(255,255,255,.08);
  box-shadow:0 18px 48px rgba(0,0,0,.36);
}
body.theme-carbon-fire .manga-library-title-row h3,
body.theme-dark-base .manga-library-title-row h3,
body.theme-shinjuku .manga-library-title-row h3,
body.theme-carbon-fire .manga-shelf-info h3,
body.theme-dark-base .manga-shelf-info h3,
body.theme-shinjuku .manga-shelf-info h3,
body.theme-carbon-fire .manga-library-empty strong,
body.theme-dark-base .manga-library-empty strong,
body.theme-shinjuku .manga-library-empty strong{
  color:var(--ink);
}
body.theme-carbon-fire .manga-library-title-row p,
body.theme-dark-base .manga-library-title-row p,
body.theme-shinjuku .manga-library-title-row p,
body.theme-carbon-fire .manga-shelf-info p,
body.theme-dark-base .manga-shelf-info p,
body.theme-shinjuku .manga-shelf-info p{
  color:var(--ink2);
}
body.theme-carbon-fire .manga-search-box,
body.theme-carbon-fire .manga-filter-menu-btn,
body.theme-carbon-fire .manga-filter-chip,
body.theme-dark-base .manga-search-box,
body.theme-dark-base .manga-filter-menu-btn,
body.theme-dark-base .manga-filter-chip,
body.theme-shinjuku .manga-search-box,
body.theme-shinjuku .manga-filter-menu-btn,
body.theme-shinjuku .manga-filter-chip{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.10);
  color:var(--ink);
}
body.theme-carbon-fire .manga-search-box input,
body.theme-dark-base .manga-search-box input,
body.theme-shinjuku .manga-search-box input{color:var(--ink)}
body.theme-carbon-fire .manga-search-box input::placeholder,
body.theme-dark-base .manga-search-box input::placeholder,
body.theme-shinjuku .manga-search-box input::placeholder{color:rgba(244,248,255,.46)}
body.theme-carbon-fire .manga-filter-chip.sel,
body.theme-dark-base .manga-filter-chip.sel,
body.theme-shinjuku .manga-filter-chip.sel{
  background:linear-gradient(145deg,#7b52ff,#4d2ac9);
  color:#fff;
  box-shadow:0 12px 28px rgba(0,0,0,.34),0 0 18px rgba(123,82,255,.20);
}
body.theme-carbon-fire .manga-shelf-progress div,
body.theme-dark-base .manga-shelf-progress div,
body.theme-shinjuku .manga-shelf-progress div{
  background:rgba(255,255,255,.12);
}
body.theme-carbon-fire .manga-shelf-open,
body.theme-dark-base .manga-shelf-open,
body.theme-shinjuku .manga-shelf-open{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.12);
  color:#cbbdff;
}
body.theme-carbon-fire .manga-library-empty,
body.theme-dark-base .manga-library-empty,
body.theme-shinjuku .manga-library-empty{
  border-color:rgba(255,255,255,.14);
  color:var(--ink2);
}
.manga-level-tabs{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:8px;
  margin:0 0 14px;
}
.manga-level-tab{
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.58);
  color:var(--ink3);
  cursor:pointer;
  min-height:78px;
  padding:10px 6px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  font-family:var(--font);
  transition:all .18s;
}
.manga-level-tab strong{
  font-family:var(--font-jp);
  color:inherit;
  font-size:18px;
  line-height:1;
}
.manga-level-tab span{
  font-size:10px;
  font-style:italic;
}
.manga-level-tab em{
  font-size:9px;
  color:inherit;
  opacity:.78;
  font-style:normal;
}
.manga-level-tab:hover{
  border-color:var(--indigo);
  color:var(--indigo);
  transform:translateY(-1px);
}
.manga-level-tab.sel{
  background:var(--indigo);
  color:#fff;
  border-color:transparent;
  box-shadow:0 8px 22px rgba(42,53,128,.22);
}
.manga-episode-card{
  display:grid;
  grid-template-columns:150px 1fr;
  gap:14px;
  padding:14px;
}
.manga-thumb-real{
  min-height:190px;
  border-radius:10px;
  overflow:hidden;
  border:1px solid rgba(26,10,0,.24);
  background:#111;
}
.manga-thumb-image{
  width:100%;
  height:100%;
  min-height:190px;
  display:block;
  object-fit:cover;
  object-position:center 15%;
  filter:saturate(.95) contrast(1.04);
}
.practice-card{
  grid-template-columns:86px 1fr;
  align-items:center;
}
.practice-card-icon{
  min-height:112px;
  border:1px solid var(--bd);
  border-radius:12px;
  background:rgba(255,255,255,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:var(--font-jp);
  font-size:42px;
  font-weight:700;
}
.quiz-practice-card .practice-card-icon{
  color:var(--plum);
  background:var(--plum-bg);
  border-color:rgba(107,43,107,.18);
}
.games-practice-card .practice-card-icon{
  color:var(--gold);
  background:var(--gold-bg);
  border-color:rgba(184,134,11,.22);
}
.manga-start-btn.disabled,
.manga-start-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  background:rgba(92,61,46,.16);
  color:var(--ink3);
  border-color:var(--bd);
  box-shadow:none;
}
.manga-start-btn.disabled:hover,
.manga-start-btn:disabled:hover{
  transform:none;
  box-shadow:none;
}
.manga-coming-soon{
  border:1px dashed rgba(42,53,128,.3);
  border-radius:var(--r);
  background:rgba(255,255,255,.48);
  padding:22px 16px;
  text-align:center;
}
.manga-coming-soon h3{
  font-family:var(--font-jp);
  color:var(--ink);
  text-transform:none;
  letter-spacing:0;
  font-size:18px;
  margin-bottom:8px;
}
.manga-coming-soon p{
  color:var(--ink2);
  font-size:13px;
  line-height:1.6;
  margin-bottom:12px;
}
.manga-episode-body h3{
  margin:3px 0 2px;
  color:var(--lacca);
  font-family:var(--font-jp);
  font-size:20px;
  text-transform:none;
  letter-spacing:0;
}
.manga-subtitle{
  color:var(--ink);
  font-size:15px;
  font-weight:700;
  margin-bottom:6px;
}
.manga-episode-body p{
  color:var(--ink2);
  font-size:13px;
  line-height:1.55;
  margin-bottom:10px;
}
.manga-complete-badge{
  display:inline-flex;
  margin-bottom:10px;
  padding:4px 9px;
  border-radius:999px;
  background:var(--jade-bg);
  color:var(--jade);
  font-size:11px;
  font-weight:800;
}
.manga-start-btn{
  border:1px solid rgba(42,53,128,.26);
  border-radius:999px;
  background:var(--indigo);
  color:#fff;
  min-height:38px;
  padding:8px 15px;
  font-family:var(--font);
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  transition:all .18s;
}
.manga-start-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 22px rgba(42,53,128,.22);
}
.manga-reader{
  padding:14px;
}
.manga-standalone-shell{
  border:1px solid var(--bd);
  border-radius:var(--r);
  background:rgba(255,255,255,.56);
  box-shadow:0 8px 28px rgba(26,10,0,.07);
  padding:12px;
  backdrop-filter:blur(6px);
  max-width:100%;
  overflow:hidden;
  touch-action:pan-y;
  overscroll-behavior:none;
}
.manga-standalone-back{
  border:1px solid rgba(42,53,128,.24);
  border-radius:999px;
  background:rgba(255,255,255,.68);
  color:var(--indigo);
  min-height:34px;
  padding:7px 12px;
  font-family:var(--font);
  font-weight:800;
  cursor:pointer;
}
.manga-standalone-frame{
  width:100%;
  min-height:78vh;
  border:0;
  border-radius:calc(var(--r) - 6px);
  background:transparent;
  box-shadow:inset 0 0 0 1px rgba(26,10,0,.08);
  display:block;
  max-width:100%;
  overflow:hidden;
  overscroll-behavior:none;
}

@media (min-width:900px){
  #wrap:has(#sc-manga.active),
  body.screen-manga #wrap{
    max-width:min(1760px, calc(100vw - 48px));
    padding-left:24px;
    padding-right:24px;
  }

  #wrap:has(#sc-manga.active) .manga-standalone-shell,
  body.screen-manga .manga-standalone-shell{
    width:100%;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    padding:0;
    backdrop-filter:none;
    overflow:visible;
  }

  #wrap:has(#sc-manga.active) .manga-standalone-topline,
  body.screen-manga .manga-standalone-topline{
    margin-bottom:12px;
  }

  #wrap:has(#sc-manga.active) .manga-standalone-frame,
  body.screen-manga .manga-standalone-frame{
    min-height:calc(100vh - 126px);
    height:calc(100vh - 126px);
    border-radius:20px;
    box-shadow:0 18px 48px rgba(26,10,0,.10);
  }
}
.manga-progress-line{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
  color:var(--ink3);
  font-size:12px;
  font-weight:700;
}
.manga-standalone-topline{
  justify-content:flex-start;
}
.manga-progress-line strong{
  color:var(--indigo);
  font-family:var(--font-jp);
}
.manga-panel{
  position:relative;
  overflow:hidden;
  border:2px solid rgba(26,10,0,.82);
  border-radius:4px;
  background:#fffaf2;
  min-height:360px;
}
.manga-art{
  position:relative;
  min-height:320px;
  overflow:hidden;
  background:
    linear-gradient(135deg,rgba(42,53,128,.10),rgba(255,255,255,.15) 48%,rgba(184,134,11,.12)),
    repeating-linear-gradient(90deg,rgba(26,10,0,.055) 0 1px,transparent 1px 12px);
}
.manga-thumb .manga-art,
.manga-art.compact{
  min-height:190px;
  height:100%;
  border-radius:10px;
}
.manga-speed-lines{
  position:absolute;
  inset:-20%;
  background:repeating-conic-gradient(from 8deg at 70% 40%,rgba(26,10,0,.16) 0deg 1.5deg,transparent 1.5deg 8deg);
  opacity:.18;
}
.manga-sky-dot{
  position:absolute;
  right:24px;
  top:22px;
  width:58px;
  height:58px;
  border-radius:50%;
  border:3px solid rgba(139,26,26,.65);
  background:rgba(255,255,255,.45);
}
.manga-building{
  position:absolute;
  left:24px;
  bottom:82px;
  width:46%;
  height:88px;
  border:3px solid rgba(26,10,0,.75);
  background:rgba(255,255,255,.52);
  box-shadow:18px 16px 0 rgba(42,53,128,.16);
}
.manga-art-counter .manga-building{
  width:62%;
  height:62px;
  bottom:106px;
  border-radius:4px;
}
.manga-art-train .manga-building{
  width:70%;
  height:86px;
  left:14px;
  bottom:104px;
  border-radius:44px 8px 8px 44px;
}
.manga-art-temple .manga-building{
  width:54%;
  height:112px;
  border-radius:8px 8px 0 0;
}
.manga-ground{
  position:absolute;
  left:-12%;
  right:-12%;
  bottom:0;
  height:92px;
  background:
    repeating-linear-gradient(-8deg,rgba(26,10,0,.18) 0 2px,transparent 2px 16px),
    rgba(245,239,224,.72);
  border-top:3px solid rgba(26,10,0,.65);
}
.manga-character{
  position:absolute;
  bottom:40px;
  width:52px;
  height:112px;
}
.manga-character::before{
  content:'';
  position:absolute;
  left:12px;
  top:0;
  width:30px;
  height:30px;
  border-radius:50%;
  border:3px solid rgba(26,10,0,.78);
  background:#fffaf2;
}
.manga-character::after{
  content:'';
  position:absolute;
  left:7px;
  top:32px;
  width:42px;
  height:74px;
  border:3px solid rgba(26,10,0,.78);
  border-radius:26px 26px 10px 10px;
  background:rgba(139,26,26,.16);
}
.manga-character span{
  position:absolute;
  left:0;
  top:24px;
  width:52px;
  height:30px;
  border-top:3px solid rgba(26,10,0,.78);
  transform:rotate(-10deg);
}
.manga-character-main{
  right:34px;
}
.manga-character-side{
  right:92px;
  transform:scale(.86);
  opacity:.86;
}
.manga-scene-label{
  position:absolute;
  left:18px;
  top:16px;
  padding:5px 10px;
  border:2px solid rgba(26,10,0,.72);
  background:rgba(255,255,255,.7);
  color:var(--ink);
  font-family:var(--font-jp);
  font-weight:800;
  letter-spacing:.04em;
}
.manga-page-copy{
  position:absolute;
  inset:auto 12px 12px 12px;
  display:grid;
  gap:8px;
}
.manga-place{
  justify-self:start;
  padding:4px 9px;
  border-radius:999px;
  background:#fff;
  border:1px solid rgba(26,10,0,.24);
  color:var(--ink2);
  font-size:12px;
  font-weight:800;
  font-family:var(--font-jp);
}
.manga-narrator{
  padding:9px 11px;
  border-radius:9px;
  background:rgba(26,10,0,.74);
  color:#fffaf2;
  font-size:13px;
  line-height:1.45;
}
.manga-bubble{
  position:relative;
  border:2px solid rgba(26,10,0,.84);
  border-radius:18px;
  background:rgba(255,255,255,.92);
  padding:13px 44px 12px 13px;
  box-shadow:4px 5px 0 rgba(26,10,0,.13);
}
.manga-bubble > span{
  display:block;
  color:var(--lacca);
  font-size:11px;
  font-weight:800;
  margin-bottom:4px;
  font-family:var(--font-jp);
}
.manga-audio-mini{
  position:absolute;
  right:10px;
  top:12px;
  width:28px;
  height:28px;
  border-radius:999px;
  border:1px solid rgba(139,26,26,.25);
  background:rgba(139,26,26,.08);
  color:var(--lacca);
  cursor:pointer;
  font-weight:800;
}
.manga-jp,
.manga-choice-jp{
  font-family:var(--font-jp);
  font-size:17px;
  line-height:1.65;
  color:var(--ink);
}
.manga-reading,
.manga-choice-reading{
  font-family:var(--font-jp);
  color:var(--ink3);
  font-size:12px;
  line-height:1.55;
}
.manga-it,
.manga-choice-it{
  color:var(--ink2);
  font-size:13px;
  line-height:1.5;
}
.manga-choice-card{
  margin-top:12px;
}
.manga-choice-card h3{
  color:var(--ink2);
  margin-bottom:9px;
}
.manga-choices{
  display:grid;
  gap:8px;
}
.manga-choice{
  width:100%;
  text-align:left;
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.64);
  padding:12px 13px;
  cursor:pointer;
  display:grid;
  gap:2px;
  font-family:var(--font);
  transition:all .18s;
}
.manga-choice:hover:not(:disabled){
  border-color:var(--indigo);
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(42,53,128,.12);
}
.manga-choice.correct{
  border-color:rgba(46,138,88,.45);
  background:var(--jade-bg);
}
.manga-choice.wrong{
  border-color:rgba(139,26,26,.42);
  background:var(--lacca-bg);
}
.manga-feedback,
.manga-ending-lines{
  margin-top:12px;
  border:1px solid var(--bd);
  border-left:4px solid var(--jade);
  border-radius:var(--rm);
  background:rgba(255,255,255,.7);
  padding:12px;
  color:var(--ink2);
  font-size:13px;
  line-height:1.6;
}
.manga-feedback-title{
  color:var(--jade);
  font-weight:800;
  margin-bottom:4px;
}
.manga-feedback .manga-start-btn{
  margin-top:10px;
  background:var(--jade);
}
.manga-ending-card{
  padding:24px 18px;
  text-align:center;
}
.manga-ending-card.failed{
  border-left:5px solid var(--lacca);
}
.manga-ending-card.success{
  border-left:5px solid var(--jade);
}
.manga-ending-mark{
  width:74px;
  height:74px;
  margin:0 auto 12px;
  border-radius:50%;
  border:2px solid rgba(26,10,0,.18);
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--lacca);
  background:#fff;
  font-family:var(--font-jp);
  font-size:38px;
  font-weight:800;
}
.manga-ending-card.success .manga-ending-mark{
  color:var(--jade);
}
.manga-ending-card h2{
  font-family:var(--font-jp);
  color:var(--ink);
  font-size:25px;
  margin-bottom:8px;
}
.manga-ending-card p{
  color:var(--ink2);
  line-height:1.65;
  margin-bottom:12px;
}
.manga-ending-lines{
  text-align:left;
  border-left-color:var(--gold);
}
.manga-ending-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:14px;
}
.manga-ending-actions button{
  min-height:42px;
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.76);
  color:var(--ink2);
  cursor:pointer;
  font-family:var(--font);
  font-weight:800;
}
.manga-ending-actions button.pri{
  background:var(--indigo);
  color:#fff;
  border-color:transparent;
}

@media (max-width:640px){
  .app-header{
    align-items:flex-start;
    gap:12px;
  }
  .header-kanji{
    font-size:28px;
  }
  .header-icon-btn{
    width:46px;
    height:42px;
  }
  .header-menu-wrap{
    margin-top:7px;
  }
  .header-menu-icon{
    width:32px;
    height:32px;
  }
  .home-menu-panel{
    min-width:206px;
  }
  .header-print-favorites img{
    width:38px;
    height:38px;
    transform:translateY(3px);
  }
  .header-search-icon{
    width:32px;
    height:32px;
  }
  .pass-celebration{
    border-radius:18px;
    padding:12px;
  }
  .pass-copy h2{
    font-size:28px;
  }
  .pass-copy p{
    font-size:13px;
  }
  .pass-image{
    border-radius:14px;
  }
  .pass-actions{
    grid-template-columns:1fr;
  }
  .manga-hero-card,
  .manga-episode-card{
    grid-template-columns:1fr;
  }
  .practice-card{
    grid-template-columns:1fr;
  }
  .practice-card-icon{
    min-height:76px;
  }
  .manga-hero-card{
    align-items:flex-start;
  }
  .manga-hero-mark{
    width:56px;
    height:56px;
    font-size:29px;
  }
  .manga-panel{
    min-height:390px;
  }
  .manga-level-tabs{
    grid-template-columns:repeat(3,1fr);
  }
  .manga-library{
    padding:16px;
  }
  .manga-library-title-row{
    justify-content:flex-start;
    text-align:left;
    align-items:flex-start;
  }
  .manga-library-tools{
    grid-template-columns:1fr;
  }
  .manga-filter-tabs{
    justify-content:flex-start;
    flex-wrap:nowrap;
    overflow:auto;
    padding-bottom:2px;
  }
  .manga-filter-chip{
    flex:0 0 auto;
  }
  .manga-newsstand{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
  }
  .manga-ending-actions{
    grid-template-columns:1fr;
  }
}


/* ═══════════════════════════════════════════════════════
   TEMA: RILIEVO — Effetto profondità scultorea
   Copertura completa: Lobby · Kana · Esame · Risultati
   Manga · Quiz · Giochi · Dizionario · Preferiti · Modali
   ═══════════════════════════════════════════════════════ */

/* ── Sfondo ── */
body.theme-rilievo{
  background:var(--parchment2);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(184,134,11,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(139,26,26,0.06) 0%, transparent 55%);
}

/* ── Shorthand ombre riutilizzabili ── */
body.theme-rilievo{
  --ri-up:
    inset 1px 1px 0 rgba(255,255,255,0.82),
    inset -1px -1px 0 rgba(92,61,46,0.15),
    4px 6px 18px rgba(92,61,46,0.13),
    -2px -3px 10px rgba(255,255,255,0.68);
  --ri-up-hover:
    inset 1px 1px 0 rgba(255,255,255,0.90),
    inset -1px -1px 0 rgba(92,61,46,0.12),
    6px 9px 24px rgba(92,61,46,0.16),
    -3px -4px 14px rgba(255,255,255,0.76);
  --ri-pressed:
    inset 2px 2px 5px rgba(92,61,46,0.18),
    inset -1px -1px 3px rgba(255,255,255,0.55),
    1px 2px 4px rgba(92,61,46,0.08);
  --ri-color-sel:
    inset 1px 1px 0 rgba(255,255,255,0.22),
    inset -1px -2px 0 rgba(0,0,0,0.28),
    3px 5px 16px rgba(139,26,26,0.38),
    -1px -2px 8px rgba(255,255,255,0.16);
  --ri-sm:
    inset 1px 1px 0 rgba(255,255,255,0.78),
    inset -1px -1px 0 rgba(92,61,46,0.14),
    3px 4px 12px rgba(92,61,46,0.10),
    -1px -2px 7px rgba(255,255,255,0.64);
}

/* ══════════════ HEADER ══════════════ */
body.theme-rilievo .app-header{
  border-bottom-color:transparent;
  box-shadow:0 1px 0 rgba(255,255,255,0.75), 0 2px 0 rgba(92,61,46,0.10);
}

/* ══════════════ LOBBY / HOME ══════════════ */
body.theme-rilievo .home-card,
body.theme-rilievo .home-favorites-card{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-up);
  backdrop-filter:blur(8px);
  transition:box-shadow .2s ease, transform .2s ease;
}
body.theme-rilievo .home-card:hover,
body.theme-rilievo .home-favorites-card:hover{
  box-shadow:var(--ri-up-hover);
  transform:translateY(-2px);
}
body.theme-rilievo .reading-grid div{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .home-fav-row{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .home-fav-empty{
  background:var(--parchment2);
  border-color:rgba(92,61,46,0.12);
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .home-favorites-toggle{
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .home-favorites-toggle:hover:not(:disabled){
  box-shadow:var(--ri-up);
  border-color:transparent;
}
body.theme-rilievo .phrase-output,
body.theme-rilievo .phrase-mini{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}

/* Menu pannello (hamburger) */
body.theme-rilievo .header-menu-btn{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .header-menu-btn:hover,
body.theme-rilievo .header-menu-btn[aria-expanded="true"]{
  border-color:transparent;
  box-shadow:var(--ri-up);
}
body.theme-rilievo .home-menu-panel{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.82),
    inset -1px -1px 0 rgba(92,61,46,0.15),
    0 20px 48px rgba(92,61,46,0.18);
}
body.theme-rilievo .theme-option{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .theme-option:hover,
body.theme-rilievo .theme-option.active{
  border-color:var(--gold);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.88),
    inset -1px -1px 0 rgba(92,61,46,0.12),
    3px 4px 12px rgba(184,134,11,0.14);
}

/* ══════════════ KANA ══════════════ */
body.theme-rilievo .kana-tab-card,
body.theme-rilievo .kana-intro-card,
body.theme-rilievo .kana-board{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-up);
}
body.theme-rilievo .kana-tab-card:hover,
body.theme-rilievo .kana-board:hover{
  box-shadow:var(--ri-up-hover);
  transform:translateY(-3px);
  border-color:transparent;
}
body.theme-rilievo .kana-cell:not(.empty){
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
  transition:box-shadow .18s ease, transform .18s ease;
}
body.theme-rilievo .kana-cell:not(.empty):hover{
  box-shadow:var(--ri-up);
  transform:translateY(-2px);
}
body.theme-rilievo .kana-row-label{
  background:var(--parchment3);
  box-shadow:var(--ri-sm);
}

/* ══════════════ LOBBY SETUP (Livelli · Modalità · Opzioni) ══════════════ */
body.theme-rilievo .lvl-btn{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
  transition:all .18s ease;
}
body.theme-rilievo .lvl-btn:hover{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.88),
    inset -1px -1px 0 rgba(92,61,46,0.12),
    5px 7px 18px rgba(139,26,26,0.14),
    -2px -3px 10px rgba(255,255,255,0.72);
  transform:translateY(-2px);
  border-color:transparent;
}
body.theme-rilievo .lvl-btn.sel{
  background:var(--lvl-bg-strong);
  border-color:var(--lvl-border-strong);
  color:var(--lvl-accent);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.82),
    inset -1px -1px 0 rgba(92,61,46,0.1),
    4px 6px 16px var(--lvl-shadow-strong),
    -2px -3px 10px rgba(255,255,255,0.72);
  transform:translateY(-1px);
}
body.theme-rilievo .lvl-btn.sel .lvl-sub{
  color:var(--lvl-sub-strong);
}
body.theme-rilievo .mode-card{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-up);
  transition:all .2s ease;
}
body.theme-rilievo .mode-card::before{
  display:none;
}
body.theme-rilievo .mode-card:hover{
  box-shadow:var(--ri-up-hover);
  transform:translateY(-3px);
  border-color:transparent;
}
body.theme-rilievo .mode-card.sel{
  border-color:var(--lacca);
  background:linear-gradient(135deg,rgba(139,26,26,0.06) 0%,var(--parchment) 100%);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.22),
    inset -1px -1px 0 rgba(139,26,26,0.28),
    4px 6px 18px rgba(139,26,26,0.20),
    0 0 0 2px rgba(139,26,26,0.10);
}
body.theme-rilievo .manga-mode-card{
  background:linear-gradient(135deg,rgba(236,239,254,.42),var(--parchment));
}
body.theme-rilievo .quiz-mode-card{
  background:linear-gradient(135deg,rgba(245,235,245,.42),var(--parchment));
}
body.theme-rilievo .games-mode-card{
  background:linear-gradient(135deg,rgba(251,244,224,.48),var(--parchment));
}
body.theme-rilievo .grammar-mode-btn{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .grammar-mode-btn:hover{
  box-shadow:var(--ri-up);
  transform:translateY(-1px);
  border-color:transparent;
}
body.theme-rilievo .grammar-mode-btn.sel{
  background:linear-gradient(135deg,rgba(139,26,26,.07),var(--parchment));
  border-color:var(--lacca);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.20),
    inset -1px -2px 0 rgba(139,26,26,0.22),
    3px 5px 14px rgba(139,26,26,0.22);
}
body.theme-rilievo .opt-box{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .opt-box select{
  background:transparent;
  border-bottom-color:rgba(92,61,46,0.16);
}
body.theme-rilievo .pool-info{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .start-btn{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.24),
    inset -1px -2px 0 rgba(0,0,0,0.28),
    0 6px 24px rgba(139,26,26,0.40),
    0 2px 6px rgba(139,26,26,0.22);
}
body.theme-rilievo .start-btn:hover{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.26),
    inset -1px -2px 0 rgba(0,0,0,0.26),
    0 10px 32px rgba(139,26,26,0.46),
    0 4px 12px rgba(139,26,26,0.28);
  transform:translateY(-2px);
}

/* ══════════════ EXAM HEADER (condiviso) ══════════════ */
body.theme-rilievo .exam-header{
  border-bottom-color:transparent;
  box-shadow:0 1px 0 rgba(255,255,255,0.75), 0 2px 0 rgba(92,61,46,0.10);
}
body.theme-rilievo .back-btn{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .back-btn:hover{
  background:var(--lacca-bg);
  border-color:var(--lacca);
  box-shadow:var(--ri-up);
}
body.theme-rilievo .fav-top-btn{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .fav-top-btn:hover{
  box-shadow:var(--ri-up);
  border-color:var(--gold);
  transform:translateY(-1px);
}
body.theme-rilievo .timer-box{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .timer-box.warn{
  background:var(--amber-bg);
}
body.theme-rilievo .timer-box.danger{
  background:var(--lacca-bg);
}
body.theme-rilievo .exam-title-pill{
  box-shadow:var(--ri-sm);
  border-color:rgba(48,205,212,.50);
}
body.theme-rilievo .badge{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.55),
    inset -1px -1px 0 rgba(0,0,0,0.06);
}

/* ══════════════ ESAME — DOMANDA ══════════════ */
body.theme-rilievo .q-bar-wrap{
  background:var(--parchment3);
  box-shadow:var(--ri-pressed);
  border-radius:4px;
}
body.theme-rilievo .q-card{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-up);
  backdrop-filter:blur(10px);
}
body.theme-rilievo .q-passage{
  background:var(--parchment2);
  box-shadow:var(--ri-pressed);
}
body.theme-rilievo .audio-panel{
  background:rgba(236,239,254,0.55);
  border-color:rgba(42,53,128,.12);
  box-shadow:var(--ri-sm);
}

/* Choices */
body.theme-rilievo .ch{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
  transition:all .18s ease;
}
body.theme-rilievo .ch:hover:not(:disabled){
  box-shadow:var(--ri-up);
  transform:translateX(4px) translateY(-1px);
  border-color:transparent;
}
body.theme-rilievo .ch.correct{
  border-color:var(--jade-lt) !important;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.30),
    inset -1px -1px 0 rgba(26,92,58,0.22),
    4px 6px 16px rgba(26,92,58,0.14),
    0 0 0 3px rgba(127,174,146,0.12) !important;
}
body.theme-rilievo .ch.wrong{
  border-color:var(--lacca) !important;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.22),
    inset -1px -1px 0 rgba(139,26,26,0.22),
    4px 6px 16px rgba(139,26,26,0.14),
    0 0 0 3px rgba(211,154,154,0.12) !important;
}
body.theme-rilievo .ch-letter{
  background:var(--parchment3);
  box-shadow:var(--ri-pressed);
}
body.theme-rilievo .ch:hover:not(:disabled) .ch-letter{
  background:var(--lacca);
}

/* Sentence builder */
body.theme-rilievo .builder-selected{
  background:rgba(249,236,236,.38);
  border-color:rgba(139,26,26,.16);
  box-shadow:var(--ri-pressed);
}
body.theme-rilievo .builder-bank{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-pressed);
}
body.theme-rilievo .builder-token{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .builder-token:hover:not(:disabled){
  box-shadow:var(--ri-up);
  transform:translateY(-2px);
  border-color:transparent;
}
body.theme-rilievo .builder-token.selected{
  background:var(--parchment2);
  border-color:rgba(184,134,11,.38);
  box-shadow:var(--ri-pressed);
}
body.theme-rilievo .builder-clear{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .builder-clear:not(:disabled):hover{
  box-shadow:var(--ri-up);
  transform:translateY(-1px);
}
body.theme-rilievo .builder-check{
  box-shadow:var(--ri-color-sel);
}
body.theme-rilievo .builder-check:not(:disabled):hover{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.26),
    inset -1px -2px 0 rgba(0,0,0,0.26),
    0 8px 24px rgba(139,26,26,0.40);
  transform:translateY(-1px);
}

/* Feedback / explanation */
body.theme-rilievo .explain{
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .furigana-line,
body.theme-rilievo .translation-line{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .more-examples-wrap{
  border-color:rgba(107,43,107,0.15);
  background:rgba(245,235,245,0.38);
  box-shadow:var(--ri-sm);
}

/* Nav buttons */
body.theme-rilievo .nbtn{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .nbtn:hover{
  box-shadow:var(--ri-up);
  border-color:transparent;
}
body.theme-rilievo .nbtn.pri{
  box-shadow:var(--ri-color-sel);
}
body.theme-rilievo .nbtn.pri:hover{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.26),
    inset -1px -2px 0 rgba(0,0,0,0.26),
    0 8px 26px rgba(139,26,26,0.44);
  transform:translateY(-2px);
}

/* ══════════════ PREFERITI (pannello esame) ══════════════ */
body.theme-rilievo .favorites-panel{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-up);
}
body.theme-rilievo .favorites-head{
  background:var(--parchment2);
  border-bottom-color:rgba(92,61,46,0.12);
}
body.theme-rilievo .favorites-head button{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .fav-item{
  border-bottom-color:rgba(184,134,11,0.12);
}
body.theme-rilievo .fav-user-note{
  background:rgba(184,134,11,0.06);
  border-color:rgba(184,134,11,0.14);
  box-shadow:var(--ri-sm);
}

/* ══════════════ RISULTATI ══════════════ */
body.theme-rilievo .pass-celebration{
  background:
    radial-gradient(circle at 24% 12%,rgba(255,244,210,.8),transparent 32%),
    linear-gradient(180deg,var(--parchment) 0%,var(--parchment2) 100%);
  border-color:rgba(184,134,11,0.26);
  box-shadow:var(--ri-up);
}
body.theme-rilievo .pass-actions button{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .pass-actions button:hover{
  box-shadow:var(--ri-up);
  transform:translateY(-2px);
}
body.theme-rilievo .pass-actions button.pri{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.22),
    inset -1px -2px 0 rgba(0,0,0,0.24),
    0 8px 24px rgba(46,138,88,0.32);
  border-color:transparent;
}
body.theme-rilievo .score-ring{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.50),
    inset -1px -1px 0 rgba(26,92,58,0.20),
    0 0 0 8px rgba(46,138,88,0.08),
    0 10px 32px rgba(26,10,0,0.10);
}
body.theme-rilievo .score-ring.fail{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.50),
    inset -1px -1px 0 rgba(139,26,26,0.20),
    0 0 0 8px rgba(139,26,26,0.06),
    0 10px 32px rgba(26,10,0,0.10);
}
body.theme-rilievo .rstat{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .rev-item{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .rev-item.ok{ border-left-color:var(--jade-lt); }
body.theme-rilievo .rev-item.err{ border-left-color:var(--lacca); }
body.theme-rilievo .r-actions button{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .r-actions button:hover{
  box-shadow:var(--ri-up);
}
body.theme-rilievo .r-actions button.pri{
  background:linear-gradient(135deg,var(--lacca) 0%,var(--lacca-dk) 100%);
  border-color:transparent;
  color:#fffaf4;
  box-shadow:var(--ri-color-sel);
  opacity:1;
  filter:none;
}
body.theme-rilievo .r-actions button.pri:hover{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.26),
    inset -1px -2px 0 rgba(0,0,0,0.26),
    0 8px 24px rgba(139,26,26,0.44);
  transform:translateY(-1px);
}

/* ══════════════ MANGA / QUIZ / GIOCHI ══════════════ */
body.theme-rilievo .manga-hero-card,
body.theme-rilievo .manga-episode-card,
body.theme-rilievo .manga-reader,
body.theme-rilievo .manga-ending-card,
body.theme-rilievo .manga-standalone-shell{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-up);
  backdrop-filter:blur(8px);
}
body.theme-rilievo .manga-hero-mark,
body.theme-rilievo .quiz-hero-mark,
body.theme-rilievo .games-hero-mark{
  border-color:transparent;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.82),
    inset -1px -1px 0 rgba(92,61,46,0.15),
    4px 5px 14px rgba(92,61,46,0.12);
}
body.theme-rilievo .manga-level-tab{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
  transition:all .18s ease;
}
body.theme-rilievo .manga-level-tab:hover{
  box-shadow:var(--ri-up);
  transform:translateY(-2px);
  border-color:transparent;
}
body.theme-rilievo .manga-level-tab.sel{
  background:var(--indigo);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.18),
    inset -1px -2px 0 rgba(0,0,0,0.26),
    4px 6px 18px rgba(42,53,128,0.28);
  border-color:transparent;
}
body.theme-rilievo .manga-start-btn{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.20),
    inset -1px -2px 0 rgba(0,0,0,0.26),
    0 6px 20px rgba(42,53,128,0.28);
}
body.theme-rilievo .manga-start-btn:hover{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.24),
    inset -1px -2px 0 rgba(0,0,0,0.24),
    0 10px 28px rgba(42,53,128,0.34);
  transform:translateY(-2px);
}
body.theme-rilievo .practice-card-icon{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .quiz-practice-card .practice-card-icon{
  background:rgba(245,235,245,0.78);
}
body.theme-rilievo .games-practice-card .practice-card-icon{
  background:rgba(251,244,224,0.78);
}
body.theme-rilievo .manga-ending-actions button{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .manga-ending-actions button:hover{
  box-shadow:var(--ri-up);
  transform:translateY(-1px);
}
body.theme-rilievo .manga-ending-actions button.pri{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.18),
    inset -1px -2px 0 rgba(0,0,0,0.24),
    4px 6px 18px rgba(42,53,128,0.28);
  border-color:transparent;
}
body.theme-rilievo .manga-standalone-back{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}

/* ══════════════ PREFERITI STAMPABILI ══════════════ */
body.theme-rilievo .print-fav-hero{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-up);
}
body.theme-rilievo .print-fav-card{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .print-fav-empty{
  background:var(--parchment2);
  box-shadow:var(--ri-sm);
}

/* ══════════════ MODAL DIZIONARIO / TERMINE ══════════════ */
body.theme-rilievo .term-modal,
body.theme-rilievo .dictionary-search-modal{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.82),
    inset -1px -1px 0 rgba(92,61,46,0.15),
    0 36px 80px rgba(92,61,46,0.26),
    0 10px 28px rgba(92,61,46,0.16);
}
body.theme-rilievo .term-modal-head{
  border-bottom-color:rgba(92,61,46,0.12);
}
body.theme-rilievo .term-modal-head button{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .term-meaning{
  background:var(--parchment2);
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .term-row{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .term-example-card{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .term-note-input{
  background:var(--parchment2);
  border-color:rgba(92,61,46,0.14);
  box-shadow:var(--ri-pressed);
}
body.theme-rilievo .term-note-input:focus{
  border-color:var(--gold);
  box-shadow:var(--ri-pressed), 0 0 0 3px rgba(184,134,11,.12);
}
body.theme-rilievo .term-fav-btn{
  background:var(--parchment2);
  border-color:rgba(184,134,11,.28);
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .term-fav-btn:hover{
  box-shadow:var(--ri-up);
  transform:translateY(-1px);
}
body.theme-rilievo .dictionary-search-input{
  background:var(--parchment2);
  border-color:rgba(92,61,46,0.14);
  box-shadow:var(--ri-pressed);
}
body.theme-rilievo .dictionary-search-input:focus{
  border-color:var(--gold);
  box-shadow:var(--ri-pressed), 0 0 0 3px rgba(184,134,11,.12);
}
body.theme-rilievo .dictionary-result{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-sm);
}
body.theme-rilievo .dictionary-result:hover{
  box-shadow:var(--ri-up);
  transform:translateY(-2px);
  border-color:transparent;
}
body.theme-rilievo .dictionary-empty{
  background:var(--parchment2);
  border-color:rgba(92,61,46,0.14);
}

/* ══════════════ MODAL QR ══════════════ */
body.theme-rilievo .qr-modal{
  background:var(--parchment);
  border-color:transparent;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.82),
    inset -1px -1px 0 rgba(92,61,46,0.15),
    0 28px 72px rgba(92,61,46,0.26);
}
body.theme-rilievo .qr-canvas-wrap{
  background:var(--parchment2);
  border-color:transparent;
  box-shadow:var(--ri-pressed);
}

/* ══════════════ SWATCH ══════════════ */
.theme-swatch-rilievo{
  background:
    radial-gradient(circle at 32% 28%,rgba(255,255,255,.96) 0 18%,transparent 19%),
    radial-gradient(circle at 68% 72%,rgba(223,128,154,.88) 0 20%,transparent 21%),
    linear-gradient(135deg,#fff9fb 0%,#f3d8df 46%,#d890a2 100%);
  border-color:rgba(194,105,128,.42);
  box-shadow:
    inset 2px 2px 3px rgba(255,255,255,0.90),
    inset -2px -2px 3px rgba(158,78,102,0.24),
    1px 2px 7px rgba(158,78,102,0.18);
}

/* ═══════════════════════════════════════════════════════
   TEMA: CARBON FIRE — carbonio satinato · rilievo nero · rosso vivo
   Copia test: non modifica la versione Gold
   ═══════════════════════════════════════════════════════ */
body.theme-carbon-fire{
  --ink:#F4E8E2;
  --ink2:#D8C5BD;
  --ink3:#FF3046;
  --parchment:#171719;
  --parchment2:#101113;
  --parchment3:#090A0C;
  --lacca:#FF3046;
  --lacca-lt:#FF5264;
  --lacca-dk:#B90E20;
  --lacca-bg:rgba(255,48,70,.10);
  --gold:#FF3046;
  --gold-lt:#FF6B78;
  --gold-bg:rgba(255,48,70,.08);
  --jade:#FF3046;
  --jade-bg:rgba(255,48,70,.08);
  --jade-lt:#FF5264;
  --aqua:#FF3046;
  --aqua-dk:#B90E20;
  --aqua-bg:rgba(255,48,70,.10);
  --bd:rgba(255,255,255,.09);
  --bd2:rgba(255,48,70,.45);
  --carbon-up:
    inset 1px 1px 0 rgba(255,255,255,.10),
    inset -2px -2px 3px rgba(0,0,0,.78),
    0 14px 32px rgba(0,0,0,.42),
    -2px -2px 10px rgba(255,255,255,.035);
  --carbon-pressed:
    inset 3px 3px 9px rgba(0,0,0,.76),
    inset -1px -1px 2px rgba(255,255,255,.08),
    0 1px 0 rgba(255,255,255,.035);
  --carbon-glow:
    inset 1px 1px 0 rgba(255,255,255,.10),
    inset -2px -2px 4px rgba(0,0,0,.72),
    0 0 0 1px rgba(255,48,70,.82),
    0 0 14px rgba(255,48,70,.45),
    0 12px 34px rgba(0,0,0,.48);
  background:#171719;
  color:var(--ink);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(255,255,255,.10) 0%, transparent 36%),
    radial-gradient(ellipse at 16% 18%, rgba(255,48,70,.09) 0%, transparent 28%),
    radial-gradient(ellipse at 84% 88%, rgba(255,48,70,.07) 0%, transparent 30%),
    linear-gradient(135deg,#222326 0%,#151618 42%,#0B0C0E 100%),
    url("data:image/svg+xml,%3Csvg width='280' height='280' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='280' height='280' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

body.theme-carbon-fire #wrap{
  filter:drop-shadow(0 24px 42px rgba(0,0,0,.34));
}

body.theme-carbon-fire h1,
body.theme-carbon-fire h2{
  color:#F7EFEA;
  text-shadow:0 2px 12px rgba(0,0,0,.55);
}

body.theme-carbon-fire h3,
body.theme-carbon-fire .home-kicker,
body.theme-carbon-fire .section-title,
body.theme-carbon-fire .opt-box label{
  color:var(--lacca);
  letter-spacing:.18em;
  text-shadow:0 0 12px rgba(255,48,70,.18);
}

body.theme-carbon-fire .app-header,
body.theme-carbon-fire .exam-header{
  border-bottom-color:rgba(255,255,255,.10);
  box-shadow:0 1px 0 rgba(255,255,255,.04), 0 2px 0 rgba(0,0,0,.55);
}

body.theme-carbon-fire .app-subtitle,
body.theme-carbon-fire .lvl-sub,
body.theme-carbon-fire .mc-desc{
  color:#FF5264;
}

body.theme-carbon-fire .header-kanji,
body.theme-carbon-fire .mc-kanji,
body.theme-carbon-fire .kana-tab-mark,
body.theme-carbon-fire .daily-kanji-char,
body.theme-carbon-fire .mode-card .jp-mark{
  color:var(--lacca);
  text-shadow:0 0 18px rgba(255,48,70,.28), 0 3px 12px rgba(0,0,0,.55);
}

body.theme-carbon-fire .header-menu-icon path,
body.theme-carbon-fire .header-search-icon .lens-stroke,
body.theme-carbon-fire .header-search-icon .lens-shine{
  stroke:var(--lacca);
}

body.theme-carbon-fire .lens-fill{
  fill:rgba(255,48,70,.08);
}

body.theme-carbon-fire .header-menu-btn{
  background:
    radial-gradient(circle at 48% 0%,rgba(255,255,255,.055),transparent 44%),
    linear-gradient(145deg,#1a1b1d 0%,#101113 62%,#08090b 100%) !important;
  border:1px solid rgba(255,48,70,.28) !important;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,.07),
    inset -1px -1px 0 rgba(0,0,0,.78),
    0 10px 24px rgba(0,0,0,.34) !important;
}
body.theme-carbon-fire .header-menu-btn:hover,
body.theme-carbon-fire .header-menu-btn[aria-expanded="true"]{
  background:
    radial-gradient(circle at 48% 0%,rgba(255,255,255,.075),transparent 46%),
    linear-gradient(145deg,#202124 0%,#111214 62%,#090a0c 100%) !important;
  border-color:rgba(255,48,70,.42) !important;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,.08),
    inset -1px -1px 0 rgba(0,0,0,.78),
    0 12px 28px rgba(0,0,0,.40),
    0 0 0 1px rgba(255,48,70,.08) !important;
}

body.theme-carbon-fire.theme-carbon-flat .header-menu-btn{
  background:linear-gradient(145deg,#191a1c,#090a0c) !important;
}
body.theme-carbon-fire.theme-carbon-flat .header-menu-btn:hover,
body.theme-carbon-fire.theme-carbon-flat .header-menu-btn[aria-expanded="true"]{
  background:linear-gradient(145deg,#202124,#0b0c0e) !important;
}

body.theme-carbon-fire .home-card,
body.theme-carbon-fire .home-favorites-card,
body.theme-carbon-fire .kana-tab-card,
body.theme-carbon-fire .kana-intro-card,
body.theme-carbon-fire .kana-board,
body.theme-carbon-fire .q-card,
body.theme-carbon-fire .favorites-panel,
body.theme-carbon-fire .print-fav-hero,
body.theme-carbon-fire .print-fav-card,
body.theme-carbon-fire .manga-hero-card,
body.theme-carbon-fire .manga-episode-card,
body.theme-carbon-fire .manga-reader,
body.theme-carbon-fire .manga-ending-card,
body.theme-carbon-fire .manga-standalone-shell,
body.theme-carbon-fire .term-modal,
body.theme-carbon-fire .dictionary-search-modal,
body.theme-carbon-fire .qr-modal{
  background:
    linear-gradient(145deg,rgba(255,255,255,.055),rgba(255,255,255,.012)),
    var(--parchment);
  border-color:rgba(255,255,255,.08);
  box-shadow:var(--carbon-up);
  backdrop-filter:blur(10px);
}

body.theme-carbon-fire .home-card:hover,
body.theme-carbon-fire .kana-tab-card:hover,
body.theme-carbon-fire .mode-card:hover,
body.theme-carbon-fire .lvl-btn:hover,
body.theme-carbon-fire .theme-option:hover{
  transform:translateY(-2px);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,.12),
    inset -2px -2px 4px rgba(0,0,0,.78),
    0 16px 38px rgba(0,0,0,.48),
    0 0 0 1px rgba(255,48,70,.24);
}

body.theme-carbon-fire .home-menu-panel{
  background:linear-gradient(145deg,#1D1E20,#111214);
  border-color:rgba(255,48,70,.22);
  box-shadow:var(--carbon-up), 0 0 22px rgba(255,48,70,.12);
}

body.theme-carbon-fire .theme-option,
body.theme-carbon-fire .lvl-btn,
body.theme-carbon-fire .mode-card,
body.theme-carbon-fire .grammar-mode-btn,
body.theme-carbon-fire .opt-box,
body.theme-carbon-fire .pool-info,
body.theme-carbon-fire .ch,
body.theme-carbon-fire .builder-token,
body.theme-carbon-fire .builder-bank,
body.theme-carbon-fire .builder-selected,
body.theme-carbon-fire .nbtn,
body.theme-carbon-fire .fav-top-btn,
body.theme-carbon-fire .back-btn,
body.theme-carbon-fire .timer-box,
body.theme-carbon-fire .home-fav-row,
body.theme-carbon-fire .home-fav-empty,
body.theme-carbon-fire .home-favorites-toggle,
body.theme-carbon-fire .kana-cell:not(.empty),
body.theme-carbon-fire .dictionary-result,
body.theme-carbon-fire .term-row,
body.theme-carbon-fire .term-example-card,
body.theme-carbon-fire .term-meaning,
body.theme-carbon-fire .term-note-input,
body.theme-carbon-fire .dictionary-search-input,
body.theme-carbon-fire .qr-canvas-wrap{
  background:linear-gradient(145deg,#202124,#101113);
  border-color:rgba(255,255,255,.08);
  color:var(--ink);
  box-shadow:var(--carbon-up);
}

body.theme-carbon-fire .theme-option.active,
body.theme-carbon-fire .lvl-btn.sel,
body.theme-carbon-fire .mode-card.sel,
body.theme-carbon-fire .grammar-mode-btn.sel,
body.theme-carbon-fire .manga-level-tab.sel{
  color:#fff;
  background:
    radial-gradient(circle at 50% 20%,rgba(255,48,70,.16),transparent 58%),
    linear-gradient(145deg,#242326,#121315);
  border-color:rgba(255,48,70,.88);
  box-shadow:var(--carbon-glow);
}

body.theme-carbon-fire .mode-card.sel .mc-name,
body.theme-carbon-fire .lvl-btn.sel,
body.theme-carbon-fire .mode-card.sel .mc-kanji{
  color:var(--lacca);
}

body.theme-carbon-fire .mc-name,
body.theme-carbon-fire .home-favorites-title,
body.theme-carbon-fire .daily-kanji-title,
body.theme-carbon-fire .kana-tab-title{
  color:#EDE1DB;
}

body.theme-carbon-fire select,
body.theme-carbon-fire input,
body.theme-carbon-fire textarea{
  color:var(--ink);
  background:#101113;
  border-color:rgba(255,255,255,.10);
}

body.theme-carbon-fire select{
  color-scheme:dark;
}

body.theme-carbon-fire .start-btn,
body.theme-carbon-fire .nbtn.pri,
body.theme-carbon-fire .builder-check,
body.theme-carbon-fire .pass-actions button.pri,
body.theme-carbon-fire .r-actions button.pri,
body.theme-carbon-fire .manga-start-btn,
body.theme-carbon-fire .manga-ending-actions button.pri{
  background:linear-gradient(145deg,#FF3046,#9E0D1B);
  border-color:rgba(255,48,70,.55);
  color:#fff;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,.18),
    inset -2px -2px 5px rgba(0,0,0,.36),
    0 0 16px rgba(255,48,70,.32),
    0 12px 30px rgba(0,0,0,.46);
}

body.theme-carbon-fire .q-bar-wrap{
  background:#0B0C0E;
  box-shadow:var(--carbon-pressed);
}

body.theme-carbon-fire .q-bar{
  background:linear-gradient(90deg,#7E0A17,#FF3046);
  box-shadow:0 0 14px rgba(255,48,70,.32);
}

body.theme-carbon-fire .q-passage,
body.theme-carbon-fire .audio-panel,
body.theme-carbon-fire .furigana-line,
body.theme-carbon-fire .translation-line,
body.theme-carbon-fire .phrase-output,
body.theme-carbon-fire .phrase-mini,
body.theme-carbon-fire .more-examples-wrap{
  background:linear-gradient(145deg,#1F2022,#101113);
  border-color:rgba(255,255,255,.08);
  box-shadow:var(--carbon-pressed);
}

body.theme-carbon-fire .explain{
  background:rgba(255,48,70,.08);
  color:#F7E9E5;
  border-left-color:var(--lacca);
  box-shadow:var(--carbon-up);
}

body.theme-carbon-fire .ch.correct{
  border-color:#39B873 !important;
  background:rgba(57,184,115,.12);
  box-shadow:0 0 0 2px rgba(57,184,115,.18), var(--carbon-up) !important;
}

body.theme-carbon-fire .ch.wrong{
  border-color:var(--lacca) !important;
  background:rgba(255,48,70,.12);
  box-shadow:0 0 0 2px rgba(255,48,70,.18), var(--carbon-up) !important;
}

body.theme-carbon-fire .favorite-star,
body.theme-carbon-fire .fav-top-star,
body.theme-carbon-fire .daily-kanji-fav.saved{
  color:var(--lacca);
  text-shadow:0 0 12px rgba(255,48,70,.32);
}

body.theme-carbon-fire .home-favorites-toggle,
body.theme-carbon-fire .daily-kanji-next,
body.theme-carbon-fire .daily-kanji-back,
body.theme-carbon-fire .term-close-btn,
body.theme-carbon-fire .term-title-audio{
  border-color:rgba(255,48,70,.52);
  color:var(--lacca);
  background:transparent;
}

body.theme-carbon-fire .daily-refresh-icon path{
  stroke:var(--lacca);
}

body.theme-carbon-fire .daily-kanji-fav.unsaved{
  color:var(--ink3);
  text-shadow:none;
  filter:none;
}

body.theme-carbon-fire .daily-kanji-fav.unsaved + .daily-kanji-next .daily-refresh-icon,
body.theme-carbon-fire .daily-kanji-fav.unsaved + .daily-kanji-next .daily-refresh-icon path{
  color:var(--ink3);
  stroke:currentColor;
  filter:none;
}

body.theme-carbon-fire .inline-term,
body.theme-carbon-fire .clickable-term{
  color:#F8ECE8;
  border-color:rgba(255,48,70,.52);
  text-shadow:0 0 8px rgba(255,48,70,.12);
}

body.theme-carbon-fire .score-ring{
  background:#111214;
  border-color:rgba(255,48,70,.24);
  box-shadow:var(--carbon-up), 0 0 0 8px rgba(255,48,70,.08);
}

body.theme-carbon-fire .theme-swatch-carbon-fire{
  background:
    radial-gradient(circle at 62% 35%,#FF3046 0 18%,transparent 20%),
    linear-gradient(135deg,#2B2D31 0%,#0C0D0F 54%,#FF3046 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,.20),
    inset -2px -2px 3px rgba(0,0,0,.62),
    0 0 8px rgba(255,48,70,.28);
}

.theme-swatch-carbon-fire{
  background:
    radial-gradient(circle at 68% 30%,#ff3046 0 18%,transparent 20%),
    linear-gradient(135deg,#2c2d31 0%,#101113 54%,#750913 100%);
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,.18),
    inset -2px -2px 4px rgba(0,0,0,.76),
    0 0 8px rgba(255,48,70,.28);
}

body.theme-carbon-fire .home-menu-title,
body.theme-carbon-fire .kana-section-title,
body.theme-carbon-fire .exam-kicker,
body.theme-carbon-fire .print-fav-label{
  color:var(--lacca);
  text-shadow:0 0 12px rgba(255,48,70,.20);
}

body.theme-carbon-fire .section-title::after{
  background:linear-gradient(90deg,rgba(255,48,70,.40),rgba(255,255,255,.10));
  box-shadow:0 1px 0 rgba(0,0,0,.58);
}

body.theme-carbon-fire .home-favorites-title span,
body.theme-carbon-fire .pool-info span,
body.theme-carbon-fire .daily-kanji-meaning,
body.theme-carbon-fire .daily-kanji-vocab-count,
body.theme-carbon-fire .kanji-question-big,
body.theme-carbon-fire .kanji-result-title{
  color:var(--lacca);
}

body.theme-carbon-fire .lvl-btn small,
body.theme-carbon-fire .mode-card.sel .mc-desc,
body.theme-carbon-fire .mode-card:hover .mc-desc,
body.theme-carbon-fire .grammar-mode-btn.sel small{
  color:var(--lacca-lt);
}

body.theme-carbon-fire .lvl-btn:not(.sel) .lvl-main,
body.theme-carbon-fire .lvl-btn:not(.sel) .lvl-sub{
  opacity:.66;
}

body.theme-carbon-fire .mode-card,
body.theme-carbon-fire .lvl-btn{
  background:
    radial-gradient(circle at 45% 18%,rgba(255,255,255,.05),transparent 48%),
    linear-gradient(145deg,#232426,#0d0e10);
}

body.theme-carbon-fire .mode-card.sel,
body.theme-carbon-fire .lvl-btn.sel{
  background:
    radial-gradient(circle at 50% 26%,rgba(255,48,70,.20),transparent 62%),
    linear-gradient(145deg,#252629,#111214);
}

body.theme-carbon-fire .opt-box{
  background:
    linear-gradient(145deg,rgba(255,255,255,.045),rgba(255,255,255,.008)),
    #151618;
}

body.theme-carbon-fire .opt-box select{
  background:#0e0f11;
  color:#f8eee9;
  border-color:rgba(255,255,255,.14);
  box-shadow:inset 1px 1px 5px rgba(0,0,0,.70);
}

body.theme-carbon-fire .pool-info{
  color:#ff6b78;
  background:
    linear-gradient(145deg,rgba(255,255,255,.035),rgba(255,255,255,.008)),
    #151618;
  border-color:rgba(255,255,255,.08);
}

body.theme-carbon-fire .home-card,
body.theme-carbon-fire .home-favorites-card,
body.theme-carbon-fire .kana-tab-card{
  background:
    radial-gradient(circle at 50% 15%,rgba(255,255,255,.055),transparent 55%),
    linear-gradient(145deg,#202124,#101113 70%,#090a0c);
}

body.theme-carbon-fire .home-card::before,
body.theme-carbon-fire .mode-card::before{
  background:linear-gradient(135deg,rgba(255,255,255,.09),transparent 48%,rgba(255,48,70,.05));
}

body.theme-carbon-fire .start-btn:hover,
body.theme-carbon-fire .nbtn.pri:hover,
body.theme-carbon-fire .builder-check:not(:disabled):hover,
body.theme-carbon-fire .manga-start-btn:hover{
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,.20),
    inset -2px -2px 5px rgba(0,0,0,.40),
    0 0 22px rgba(255,48,70,.48),
    0 16px 38px rgba(0,0,0,.50);
}

body.theme-carbon-fire .header-print-favorites img{
  filter:drop-shadow(0 0 5px rgba(255,48,70,.22));
}

body.theme-carbon-fire .header-icon-btn:hover{
  filter:drop-shadow(0 0 8px rgba(255,48,70,.36));
}

/* ═══════════════════════════════════════════════════════
   TEMA: PURE CARBON — OLED premium · satin Apple · rosso Japan
   Test copy only: nessuna modifica ai suoni o alla logica app.
   ═══════════════════════════════════════════════════════ */
body.theme-dark-base{
  --pc-bg:#030406;
  --pc-bg-2:#07080b;
  --pc-card:
    linear-gradient(180deg,rgba(17,19,25,.92) 0%,rgba(7,8,11,.98) 100%);
  --pc-field:
    linear-gradient(180deg,rgba(22,24,30,.92) 0%,rgba(9,10,14,.98) 100%);
  --pc-border:rgba(255,255,255,.045);
  --pc-border-2:rgba(255,255,255,.075);
  --pc-accent:#ff375f;
  --pc-accent-soft:rgba(255,55,95,.16);
  --pc-burgundy:#8a1e2d;
  --pc-text:#f5f5f7;
  --pc-soft:#b5bac7;
  --pc-dim:#7e8594;
  --pc-shadow:
    0 10px 30px rgba(0,0,0,.45),
    0 2px 8px rgba(0,0,0,.32);
  --pc-shadow-soft:0 4px 14px rgba(0,0,0,.28);
  --pc-glow:
    0 0 12px rgba(255,55,95,.10),
    0 0 24px rgba(255,55,95,.06);

  --ink:var(--pc-text);
  --ink2:var(--pc-soft);
  --ink3:var(--pc-dim);
  --parchment:#07080b;
  --parchment2:#101218;
  --parchment3:#1b1e25;
  --bd:rgba(255,255,255,.058);
  --bd2:rgba(255,255,255,.10);
  --lacca:var(--pc-accent);
  --lacca-lt:#ff5b78;
  --lacca-dk:var(--pc-burgundy);
  --lacca-bg:rgba(255,55,95,.11);
  --gold:var(--pc-accent);
  --gold-lt:#ff6b86;
  --gold-bg:rgba(255,55,95,.10);
  --jade:#77d0a0;
  --jade-lt:#88d6aa;
  --jade-bg:rgba(46,138,88,.18);

  background:
    radial-gradient(circle at top left,rgba(255,55,95,.045),transparent 24%),
    radial-gradient(circle at bottom right,rgba(120,120,255,.025),transparent 28%),
    var(--pc-bg);
  color:var(--pc-text);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

body.theme-dark-base::after{
  content:"";
  position:fixed;
  inset:0;
  opacity:.018;
  pointer-events:none;
  mix-blend-mode:soft-light;
  background-image:
    repeating-radial-gradient(circle at 0 0,transparent 0,rgba(255,255,255,.15) 1px,transparent 2px);
  background-size:4px 4px;
  z-index:0;
}

body.theme-dark-base #wrap{
  position:relative;
  z-index:1;
}

body.theme-dark-base h1,
body.theme-dark-base h2,
body.theme-dark-base .title-japan{
  color:var(--pc-text);
  letter-spacing:-.02em;
  text-shadow:0 2px 10px rgba(0,0,0,.45);
}

body.theme-dark-base .app-subtitle,
body.theme-dark-base .lvl-sub,
body.theme-dark-base .mc-desc,
body.theme-dark-base .q-meta,
body.theme-dark-base .home-fav-empty,
body.theme-dark-base .dictionary-empty{
  color:var(--pc-soft);
}

body.theme-dark-base h3,
body.theme-dark-base .home-kicker,
body.theme-dark-base .section-title,
body.theme-dark-base .opt-box label,
body.theme-dark-base .home-menu-title,
body.theme-dark-base .kana-section-title,
body.theme-dark-base .exam-kicker,
body.theme-dark-base .print-fav-label{
  color:var(--pc-accent);
  letter-spacing:.18em;
  text-shadow:0 0 10px rgba(255,55,95,.18);
}

body.theme-dark-base .header-kanji,
body.theme-dark-base .mc-kanji,
body.theme-dark-base .kana-tab-mark,
body.theme-dark-base .daily-kanji-char,
body.theme-dark-base .mode-card .jp-mark,
body.theme-dark-base .kanji-question-big,
body.theme-dark-base .kanji-result-title{
  color:var(--pc-accent);
  text-shadow:0 0 18px rgba(255,55,95,.28);
}

body.theme-dark-base .app-header,
body.theme-dark-base .exam-header{
  border-bottom-color:rgba(255,255,255,.07);
}

body.theme-dark-base .home-card,
body.theme-dark-base .home-favorites-card,
body.theme-dark-base .kana-tab-card,
body.theme-dark-base .kana-intro-card,
body.theme-dark-base .kana-board,
body.theme-dark-base .q-card,
body.theme-dark-base .favorites-panel,
body.theme-dark-base .print-fav-hero,
body.theme-dark-base .print-fav-card,
body.theme-dark-base .manga-hero-card,
body.theme-dark-base .manga-episode-card,
body.theme-dark-base .manga-reader,
body.theme-dark-base .manga-ending-card,
body.theme-dark-base .manga-standalone-shell,
body.theme-dark-base .term-modal,
body.theme-dark-base .dictionary-search-modal,
body.theme-dark-base .qr-modal{
  background:var(--pc-card);
  border:1px solid var(--pc-border);
  box-shadow:var(--pc-shadow);
  backdrop-filter:blur(18px) saturate(140%);
  -webkit-backdrop-filter:blur(18px) saturate(140%);
  position:relative;
  overflow:hidden;
}

body.theme-dark-base .home-menu-panel{
  background:var(--pc-card);
  border:1px solid var(--pc-border-2);
  box-shadow:
    0 24px 56px rgba(0,0,0,.58),
    0 0 22px rgba(255,55,95,.08);
  backdrop-filter:blur(18px) saturate(140%);
  -webkit-backdrop-filter:blur(18px) saturate(140%);
}

body.theme-dark-base .home-card::before,
body.theme-dark-base .home-favorites-card::before,
body.theme-dark-base .kana-tab-card::before,
body.theme-dark-base .mode-card::before,
body.theme-dark-base .q-card::before,
body.theme-dark-base .term-modal::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(135deg,rgba(255,255,255,.045),transparent 22%,transparent 80%,rgba(255,255,255,.02));
  pointer-events:none;
}

body.theme-dark-base .home-card:hover,
body.theme-dark-base .home-favorites-card:hover,
body.theme-dark-base .kana-tab-card:hover,
body.theme-dark-base .mode-card:hover,
body.theme-dark-base .lvl-btn:hover,
body.theme-dark-base .theme-option:hover,
body.theme-dark-base .dictionary-result:hover{
  transform:translateY(-2px);
  border-color:rgba(255,55,95,.28);
  box-shadow:var(--pc-shadow), var(--pc-glow);
}

body.theme-dark-base .theme-option,
body.theme-dark-base .lvl-btn,
body.theme-dark-base .mode-card,
body.theme-dark-base .grammar-mode-btn,
body.theme-dark-base .opt-box,
body.theme-dark-base .pool-info,
body.theme-dark-base .ch,
body.theme-dark-base .builder-token,
body.theme-dark-base .builder-bank,
body.theme-dark-base .builder-selected,
body.theme-dark-base .nbtn,
body.theme-dark-base .fav-top-btn,
body.theme-dark-base .back-btn,
body.theme-dark-base .timer-box,
body.theme-dark-base .home-fav-row,
body.theme-dark-base .home-fav-empty,
body.theme-dark-base .home-favorites-toggle,
body.theme-dark-base .kana-cell:not(.empty),
body.theme-dark-base .dictionary-result,
body.theme-dark-base .term-row,
body.theme-dark-base .term-example-card,
body.theme-dark-base .term-meaning,
body.theme-dark-base .term-note-input,
body.theme-dark-base .dictionary-search-input,
body.theme-dark-base .qr-canvas-wrap,
body.theme-dark-base .phrase-output,
body.theme-dark-base .phrase-mini,
body.theme-dark-base .furigana-line,
body.theme-dark-base .translation-line,
body.theme-dark-base .more-examples-wrap,
body.theme-dark-base .audio-panel,
body.theme-dark-base .q-passage{
  background:var(--pc-field);
  border:1px solid rgba(255,255,255,.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    inset 0 -1px 0 rgba(0,0,0,.25),
    var(--pc-shadow-soft);
  color:var(--pc-text);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

body.theme-dark-base .reading-grid > div,
body.theme-dark-base .daily-note-link{
  background:var(--pc-field) !important;
  border-color:var(--pc-border-2);
  color:var(--pc-text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    inset 0 -1px 0 rgba(0,0,0,.28),
    0 4px 14px rgba(0,0,0,.30);
}

body.theme-dark-base .daily-note-link:hover{
  background:
    linear-gradient(180deg,rgba(25,27,34,.95),rgba(8,9,12,.98)) !important;
  border-color:rgba(255,55,95,.24);
  box-shadow:none;
}

body.theme-dark-base .theme-option.active,
body.theme-dark-base .lvl-btn.sel,
body.theme-dark-base .mode-card.sel,
body.theme-dark-base .grammar-mode-btn.sel,
body.theme-dark-base .manga-level-tab.sel{
  background:
    linear-gradient(180deg,rgba(255,55,95,.16),rgba(255,55,95,.08)),
    var(--pc-field);
  border-color:rgba(255,55,95,.46);
  box-shadow:var(--pc-glow), var(--pc-shadow-soft);
  color:var(--pc-accent);
}

body.theme-dark-base .lvl-btn:not(.sel) .lvl-main,
body.theme-dark-base .lvl-btn:not(.sel) .lvl-sub,
body.theme-dark-base .mode-card:not(.sel) .mc-kanji{
  color:rgba(255,255,255,.58);
}

body.theme-dark-base .mode-card.sel .mc-name,
body.theme-dark-base .mode-card.sel .mc-kanji,
body.theme-dark-base .lvl-btn.sel,
body.theme-dark-base .pool-info span,
body.theme-dark-base .home-favorites-title span,
body.theme-dark-base .daily-kanji-meaning,
body.theme-dark-base .daily-kanji-vocab-count{
  color:var(--pc-accent);
}

body.theme-dark-base select,
body.theme-dark-base input,
body.theme-dark-base textarea{
  color:var(--pc-text);
  background:rgba(255,255,255,.02);
  border-color:rgba(255,255,255,.08);
}

body.theme-dark-base .start-btn,
body.theme-dark-base .nbtn.pri,
body.theme-dark-base .builder-check,
body.theme-dark-base .pass-actions button.pri,
body.theme-dark-base .r-actions button.pri,
body.theme-dark-base .manga-start-btn,
body.theme-dark-base .manga-ending-actions button.pri{
  background:
    linear-gradient(180deg,rgba(255,55,95,.92),rgba(138,30,45,.92));
  border-color:rgba(255,55,95,.42);
  color:#fff;
  box-shadow:
    0 0 18px rgba(255,55,95,.22),
    0 14px 34px rgba(0,0,0,.44);
}

body.theme-dark-base .home-favorites-toggle,
body.theme-dark-base .daily-kanji-next,
body.theme-dark-base .daily-kanji-back,
body.theme-dark-base .term-close-btn,
body.theme-dark-base .term-title-audio,
body.theme-dark-base .header-icon-btn,
body.theme-dark-base .button{
  background:
    linear-gradient(180deg,rgba(255,55,95,.16),rgba(255,55,95,.08));
  border-color:rgba(255,55,95,.30);
  color:var(--pc-accent);
  box-shadow:var(--pc-glow);
}

body.theme-dark-base .header-icon-btn,
body.theme-dark-base .daily-kanji-next,
body.theme-dark-base .daily-kanji-back{
  background:transparent;
  border-color:transparent;
  box-shadow:none;
}

body.theme-dark-base .header-menu-btn{
  background:linear-gradient(180deg,rgba(255,55,95,.13),rgba(255,255,255,.025));
  border:1px solid rgba(255,55,95,.30);
  box-shadow:0 0 0 1px rgba(255,255,255,.035),0 10px 24px rgba(0,0,0,.34);
}

body.theme-dark-base .header-icon-btn:hover,
body.theme-dark-base .daily-kanji-next:hover,
body.theme-dark-base .daily-kanji-back:hover{
  background:rgba(255,55,95,.04);
  border-color:rgba(255,55,95,.12);
  box-shadow:none;
}

body.theme-dark-base .header-menu-btn:hover,
body.theme-dark-base .header-menu-btn[aria-expanded="true"]{
  background:linear-gradient(180deg,rgba(255,55,95,.20),rgba(255,255,255,.04));
  border-color:rgba(255,55,95,.46);
  box-shadow:0 0 0 1px rgba(255,255,255,.04),0 12px 28px rgba(0,0,0,.40),0 0 18px rgba(255,55,95,.12);
}

body.theme-dark-base .header-menu-icon path,
body.theme-dark-base .header-search-icon .lens-stroke,
body.theme-dark-base .header-search-icon .lens-shine,
body.theme-dark-base .daily-refresh-icon path{
  stroke:var(--pc-accent);
  filter:none;
}

body.theme-dark-base .lens-fill{
  fill:rgba(255,255,255,.02);
}

body.theme-dark-base .favorite-star,
body.theme-dark-base .fav-top-star,
body.theme-dark-base .daily-kanji-fav.saved{
  color:var(--pc-accent);
  filter:drop-shadow(0 0 8px rgba(255,55,95,.25));
}

body.theme-dark-base .daily-kanji-fav.unsaved{
  color:var(--pc-soft);
  filter:none;
}

body.theme-dark-base .daily-kanji-fav.unsaved + .daily-kanji-next .daily-refresh-icon,
body.theme-dark-base .daily-kanji-fav.unsaved + .daily-kanji-next .daily-refresh-icon path{
  color:var(--pc-soft);
  stroke:currentColor;
  filter:none;
}

body.theme-dark-base .inline-term,
body.theme-dark-base .clickable-term{
  background:rgba(255,255,255,.035);
  color:var(--pc-text);
  border-bottom-color:rgba(255,55,95,.82);
}

body.theme-dark-base .q-bar-wrap{
  background:rgba(255,255,255,.07);
  box-shadow:inset 0 1px 3px rgba(0,0,0,.55);
}

body.theme-dark-base .q-bar{
  background:linear-gradient(90deg,var(--pc-accent),var(--pc-burgundy));
  box-shadow:0 0 14px rgba(255,55,95,.24);
}

body.theme-dark-base .ch-letter{
  background:rgba(255,255,255,.08);
  color:var(--pc-soft);
}

body.theme-dark-base .ch.correct{
  background:linear-gradient(180deg,rgba(45,110,76,.28),rgba(23,52,39,.46)) !important;
  border-color:rgba(127,174,146,.58) !important;
}

body.theme-dark-base .ch.wrong{
  background:linear-gradient(180deg,rgba(255,55,95,.17),rgba(138,30,45,.18)) !important;
  border-color:rgba(255,55,95,.46) !important;
}

body.theme-dark-base .explain{
  box-shadow:var(--pc-shadow-soft);
}

body.theme-dark-base .explain.ok{
  background:linear-gradient(180deg,rgba(46,138,88,.18),rgba(15,17,23,.94));
  border-color:rgba(127,174,146,.42);
}

body.theme-dark-base .explain.err{
  background:linear-gradient(180deg,rgba(255,55,95,.13),rgba(15,17,23,.94));
  border-color:rgba(255,55,95,.35);
}

body.theme-dark-base .score-ring{
  background:var(--pc-field);
  color:var(--pc-accent);
  border-color:rgba(255,55,95,.40);
  box-shadow:var(--pc-glow), var(--pc-shadow-soft);
}

body.theme-dark-base .header-print-favorites img{
  filter:
    saturate(1.2)
    contrast(1.05)
    drop-shadow(0 0 8px rgba(255,55,95,.18));
}

body.theme-rilievo .repeat-top-btn{
  background:var(--parchment2);
  border-color:transparent;
  color:var(--lacca-dk);
  box-shadow:var(--ri-sm);
}

body.theme-rilievo .repeat-top-btn:hover{
  box-shadow:var(--ri-up);
  border-color:var(--lacca);
}

body.theme-carbon-fire .repeat-top-btn,
body.theme-carbon-fire .grammar-repeat-btn{
  color:var(--lacca);
}

body.theme-carbon-fire .repeat-top-btn{
  background:linear-gradient(145deg,rgba(255,48,70,.12),rgba(255,255,255,.02));
  border-color:rgba(255,48,70,.28);
  box-shadow:var(--carbon-up);
}

body.theme-carbon-fire .repeat-count-badge{
  background:var(--lacca);
  color:#141416;
}

body.theme-carbon-fire .grammar-repeat-btn.saved,
body.theme-carbon-fire .repeat-grammar-title{
  color:var(--lacca);
  filter:drop-shadow(0 0 10px rgba(255,48,70,.25));
}

body.theme-dark-base .repeat-top-btn,
body.theme-dark-base .grammar-repeat-btn{
  color:var(--pc-accent);
}

body.theme-dark-base .repeat-top-btn{
  background:var(--pc-field);
  border:1px solid var(--pc-border);
  box-shadow:var(--pc-shadow-soft);
}

body.theme-dark-base .repeat-count-badge{
  background:var(--pc-accent);
  color:#08090c;
  border-color:rgba(255,255,255,.18);
}

body.theme-dark-base .grammar-repeat-btn.saved,
body.theme-dark-base .repeat-grammar-title{
  color:var(--pc-accent);
  filter:drop-shadow(0 0 8px rgba(255,55,95,.22));
}

body.theme-dark-base .repeat-practice-btn,
body.theme-carbon-fire .repeat-practice-btn{
  background:rgba(255,55,95,.10);
  border-color:rgba(255,55,95,.32);
  color:inherit;
}

/* ═══════════════════════════════════════════════════════ */
@media print{
  body{
    background:#fff;
    color:#000;
  }
  #wrap{
    max-width:none;
    padding:0;
  }
  .screen{
    display:none !important;
  }
  #sc-print-favorites{
    display:block !important;
    animation:none;
  }
  .print-favorites-header .back-btn,
  .print-favorites-header .exam-actions{
    display:none !important;
  }
  .qr-modal-backdrop{
    display:none !important;
  }
  .print-favorites-header{
    border:none;
    margin-bottom:14px;
    padding:0;
  }
  .print-fav-filter-row{
    display:none;
  }
  .print-fav-hero,
  .print-fav-card,
  .print-fav-empty{
    box-shadow:none;
    background:#fff;
  }
  .print-fav-card{
    border-color:#d5c7b3;
  }
}

/* ═══════════════════════════════════════════════════════
   QUIZ FEEDBACK FX — Correct / Wrong · Sakura · Motion
   Aggiunto in fondo al file style.css
   ═══════════════════════════════════════════════════════ */

.ch{
  position:relative;
  overflow:visible;
}

/* CORRETTO — verde salvia */
.ch.correct{
  border-color:#7fae92 !important;
  background:#f3fbf6 !important;
  color:#1f5b3c !important;
  transform:none !important;
  box-shadow:
    0 0 0 4px rgba(127,174,146,.14),
    0 10px 24px rgba(80,120,100,.12) !important;
}

.ch.correct .ch-letter{
  background:#7fae92 !important;
  color:#fffaf6 !important;
}

/* SBAGLIATO — rosa soft */
.ch.wrong{
  border-color:#d39a9a !important;
  background:#fff4f4 !important;
  color:#8b3f3f !important;
  transform:none !important;
  box-shadow:
    0 0 0 4px rgba(211,154,154,.13),
    0 10px 24px rgba(120,80,80,.10) !important;
}

.ch.wrong .ch-letter{
  background:#d39a9a !important;
  color:#fffaf6 !important;
}

/* Animazioni bottone */
.ch.jiggle-correct,
.manga-choice.jiggle-correct{
  animation:jiggleCorrect .45s ease;
  transform-origin:center;
  will-change:scale, rotate;
}

.ch.shake-wrong,
.manga-choice.shake-wrong{
  animation:shakeWrong .42s ease;
  transform-origin:center;
  will-change:translate;
}

.builder-selected.jiggle-correct{
  animation:jiggleCorrect .45s ease;
}

.builder-selected.shake-wrong{
  animation:shakeWrong .42s ease;
}

/* Dark theme contrast fixes: keep quiz feedback and note panels in the OLED palette. */
body.theme-dark-base .ch.correct{
  border-color:rgba(127,174,146,.58) !important;
  background:linear-gradient(180deg,rgba(45,110,76,.30),rgba(9,24,18,.78)) !important;
  color:#7fe0a5 !important;
  transform:none !important;
  box-shadow:
    0 0 0 1px rgba(127,174,146,.22),
    inset 0 1px 0 rgba(255,255,255,.035) !important;
}

body.theme-dark-base .ch.correct .ch-letter{
  background:#7fae92 !important;
  color:#07100c !important;
}

body.theme-dark-base .ch.wrong{
  border-color:rgba(255,55,95,.52) !important;
  background:linear-gradient(180deg,rgba(255,55,95,.18),rgba(45,8,17,.78)) !important;
  color:#ff7b95 !important;
  transform:none !important;
  box-shadow:
    0 0 0 1px rgba(255,55,95,.24),
    inset 0 1px 0 rgba(255,255,255,.035) !important;
}

body.theme-dark-base .ch.wrong .ch-letter{
  background:var(--pc-accent) !important;
  color:#08090c !important;
}

body.theme-dark-base .more-examples-wrap,
body.theme-dark-base .grammar-note-card{
  background:var(--pc-card) !important;
  border-color:var(--pc-border) !important;
  box-shadow:var(--pc-shadow-soft);
}

body.theme-dark-base .examples-panel,
body.theme-dark-base .grammar-note-card{
  border-top-color:rgba(255,55,95,.12) !important;
}

body.theme-dark-base .grammar-note-input{
  background:var(--pc-field) !important;
  border-color:var(--pc-border-2) !important;
  color:var(--pc-text) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    inset 0 -1px 0 rgba(0,0,0,.32) !important;
}

body.theme-dark-base .grammar-note-input::placeholder{
  color:rgba(181,186,199,.62);
}

body.theme-dark-base .more-ex-btn{
  color:var(--pc-accent);
}

body.theme-dark-base .more-ex-btn:hover:not(:disabled){
  background:rgba(255,55,95,.045);
}

/* Dark theme grey-block sweep: remove remaining light fallback surfaces. */
body.theme-dark-base .choices .ch,
body.theme-dark-base #choices .ch,
body.theme-dark-base .manga-choice,
body.theme-dark-base .builder-token,
body.theme-dark-base .builder-clear,
body.theme-dark-base .builder-check,
body.theme-dark-base .nbtn,
body.theme-dark-base .r-actions button,
body.theme-dark-base .audio-btn.ghost,
body.theme-dark-base .manga-level-tab,
body.theme-dark-base .manga-start-btn.disabled,
body.theme-dark-base .manga-start-btn:disabled,
body.theme-dark-base .print-fav-empty,
body.theme-dark-base .fav-empty,
body.theme-dark-base .dictionary-empty{
  background:var(--pc-field) !important;
  border-color:var(--pc-border) !important;
  color:var(--pc-soft) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    inset 0 -1px 0 rgba(0,0,0,.34),
    0 6px 18px rgba(0,0,0,.26) !important;
}

body.theme-dark-base .choices .ch:hover:not(:disabled),
body.theme-dark-base #choices .ch:hover:not(:disabled),
body.theme-dark-base .manga-choice:hover:not(:disabled),
body.theme-dark-base .builder-token:hover:not(:disabled),
body.theme-dark-base .builder-clear:hover:not(:disabled),
body.theme-dark-base .nbtn:hover:not(:disabled),
body.theme-dark-base .r-actions button:hover:not(:disabled),
body.theme-dark-base .audio-btn.ghost:hover,
body.theme-dark-base .manga-level-tab:hover{
  background:
    linear-gradient(180deg,rgba(22,24,30,.96),rgba(8,9,12,.98)) !important;
  border-color:rgba(255,55,95,.22) !important;
  color:var(--pc-text) !important;
  box-shadow:none !important;
}

body.theme-dark-base .choices .ch.wrong,
body.theme-dark-base #choices .ch.wrong,
body.theme-dark-base .ch.wrong,
body.theme-dark-base .manga-choice.wrong{
  border-color:rgba(255,55,95,.56) !important;
  background:
    linear-gradient(180deg,rgba(255,55,95,.20),rgba(41,6,15,.88)) !important;
  color:#ff8aa0 !important;
  box-shadow:
    0 0 0 1px rgba(255,55,95,.24),
    inset 0 1px 0 rgba(255,255,255,.035) !important;
}

body.theme-dark-base .choices .ch.wrong span:not(.ch-letter),
body.theme-dark-base #choices .ch.wrong span:not(.ch-letter),
body.theme-dark-base .ch.wrong span:not(.ch-letter),
body.theme-dark-base .manga-choice.wrong span{
  color:#ff8aa0 !important;
}

body.theme-dark-base .choices .ch.correct,
body.theme-dark-base #choices .ch.correct,
body.theme-dark-base .ch.correct,
body.theme-dark-base .manga-choice.correct{
  border-color:rgba(127,224,165,.52) !important;
  background:
    linear-gradient(180deg,rgba(45,110,76,.30),rgba(7,26,18,.88)) !important;
  color:#7fe0a5 !important;
  box-shadow:
    0 0 0 1px rgba(127,224,165,.20),
    inset 0 1px 0 rgba(255,255,255,.035) !important;
}

body.theme-dark-base .choices .ch.correct span:not(.ch-letter),
body.theme-dark-base #choices .ch.correct span:not(.ch-letter),
body.theme-dark-base .ch.correct span:not(.ch-letter),
body.theme-dark-base .manga-choice.correct span{
  color:#7fe0a5 !important;
}

body.theme-dark-base .ch-letter,
body.theme-dark-base .choices .ch .ch-letter,
body.theme-dark-base #choices .ch .ch-letter{
  background:rgba(255,255,255,.08) !important;
  color:var(--pc-soft) !important;
}

body.theme-dark-base .ch.wrong .ch-letter,
body.theme-dark-base .choices .ch.wrong .ch-letter,
body.theme-dark-base #choices .ch.wrong .ch-letter{
  background:var(--pc-accent) !important;
  color:#08090c !important;
}

body.theme-dark-base .ch.correct .ch-letter,
body.theme-dark-base .choices .ch.correct .ch-letter,
body.theme-dark-base #choices .ch.correct .ch-letter{
  background:#7fe0a5 !important;
  color:#07100c !important;
}

body.theme-dark-base .manga-level-tab:not(.sel){
  opacity:.82;
}

body.theme-dark-base .manga-level-tab:not(.sel) strong,
body.theme-dark-base .manga-level-tab:not(.sel) span,
body.theme-dark-base .manga-level-tab:not(.sel) em{
  color:rgba(181,186,199,.72) !important;
}

body.theme-dark-base .manga-level-tab.sel{
  background:
    linear-gradient(180deg,rgba(255,55,95,.22),rgba(41,6,15,.86)) !important;
  border-color:rgba(255,55,95,.44) !important;
  color:var(--pc-accent) !important;
}

body.theme-dark-base .manga-level-tab.sel strong,
body.theme-dark-base .manga-level-tab.sel span,
body.theme-dark-base .manga-level-tab.sel em{
  color:var(--pc-accent) !important;
}

body.theme-dark-base .audio-btn.ghost{
  color:var(--pc-soft) !important;
}

body.theme-dark-base .nbtn.pri:disabled,
body.theme-dark-base .builder-check:disabled,
body.theme-dark-base .builder-clear:disabled{
  background:
    linear-gradient(180deg,rgba(70,18,30,.54),rgba(22,8,13,.86)) !important;
  border-color:rgba(255,55,95,.20) !important;
  color:rgba(245,245,247,.52) !important;
  box-shadow:none !important;
}

body.theme-dark-base #btn-next.nbtn.pri{
  opacity:1 !important;
  background:
    linear-gradient(180deg,#ff375f 0%, #d61f45 54%, #8a1e2d 100%) !important;
  border-color:rgba(255,55,95,.52) !important;
  color:#fffaf6 !important;
  box-shadow:
    0 0 0 1px rgba(255,55,95,.20),
    0 0 22px rgba(255,55,95,.34),
    0 14px 34px rgba(0,0,0,.46),
    inset 0 1px 0 rgba(255,255,255,.20) !important;
}

body.theme-dark-base #btn-next.nbtn.pri:disabled{
  opacity:1 !important;
  background:
    linear-gradient(180deg,rgba(138,30,45,.74),rgba(70,18,30,.78)) !important;
  border-color:rgba(255,55,95,.30) !important;
  color:rgba(245,245,247,.46) !important;
  box-shadow:
    0 0 0 1px rgba(255,55,95,.10),
    inset 0 1px 0 rgba(255,255,255,.08) !important;
  filter:none !important;
}

body.theme-dark-base #btn-next.nbtn.pri:not(:disabled):hover{
  box-shadow:
    0 0 0 1px rgba(255,55,95,.24),
    0 0 26px rgba(255,55,95,.42),
    0 16px 38px rgba(0,0,0,.50),
    inset 0 1px 0 rgba(255,255,255,.22) !important;
}

body.theme-dark-base .print-fav-empty,
body.theme-dark-base .fav-empty,
body.theme-dark-base .dictionary-empty{
  text-align:center;
  color:rgba(181,186,199,.70) !important;
}

body.theme-dark-base .builder-bank,
body.theme-dark-base .builder-selected,
body.theme-dark-base .builder-selected.drag-active,
body.theme-dark-base .builder-selected.drag-end-target,
body.theme-dark-base .builder-token.selected,
body.theme-dark-base .builder-token.used,
body.theme-dark-base .audio-btn,
body.theme-dark-base .more-ex-btn{
  background:var(--pc-field) !important;
  border-color:var(--pc-border-2) !important;
  color:var(--pc-text) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    inset 0 -1px 0 rgba(0,0,0,.32),
    0 6px 18px rgba(0,0,0,.24) !important;
}

body.theme-dark-base .builder-token.used{
  opacity:.36;
  color:rgba(181,186,199,.62) !important;
}

body.theme-dark-base .builder-selected.builder-wrong{
  background:
    linear-gradient(180deg,rgba(255,55,95,.16),rgba(41,6,15,.82)) !important;
  border-color:rgba(255,55,95,.42) !important;
  box-shadow:
    0 0 0 1px rgba(255,55,95,.18),
    inset 0 1px 0 rgba(255,255,255,.035) !important;
}

body.theme-dark-base .builder-selected.builder-correct{
  background:
    linear-gradient(180deg,rgba(45,110,76,.24),rgba(7,26,18,.84)) !important;
  border-color:rgba(127,224,165,.38) !important;
  box-shadow:
    0 0 0 1px rgba(127,224,165,.16),
    inset 0 1px 0 rgba(255,255,255,.035) !important;
}

body.theme-dark-base .audio-btn:not(.ghost){
  background:
    linear-gradient(180deg,rgba(255,55,95,.22),rgba(41,6,15,.88)) !important;
  border-color:rgba(255,55,95,.36) !important;
  color:var(--pc-text) !important;
}

/* Dark theme: badge risposta in stile CarbonFire, leggibile su ogni balloon */
body.theme-dark-base .feedback-label,
body.theme-dark-base .correct .feedback-label,
body.theme-dark-base .wrong .feedback-label,
body.theme-dark-base .builder-selected .feedback-label,
body.theme-dark-base .manga-choice .feedback-label{
  background:
    linear-gradient(180deg,#ff5274 0%, #ff375f 46%, #d61f45 100%) !important;
  color:#fffaf6 !important;
  -webkit-text-fill-color:#fffaf6 !important;
  border:1px solid rgba(255,255,255,.28) !important;
  box-shadow:
    0 10px 22px rgba(255,55,95,.38),
    0 0 0 1px rgba(255,55,95,.30),
    0 0 18px rgba(255,55,95,.26),
    inset 0 1px 0 rgba(255,255,255,.26) !important;
  text-shadow:0 1px 2px rgba(0,0,0,.40) !important;
  font-weight:900 !important;
  letter-spacing:.01em !important;
  z-index:20 !important;
}

body.theme-dark-base .ch.correct .feedback-label,
body.theme-dark-base .choices .ch.correct .feedback-label,
body.theme-dark-base #choices .ch.correct .feedback-label,
body.theme-dark-base .ch.wrong .feedback-label,
body.theme-dark-base .choices .ch.wrong .feedback-label,
body.theme-dark-base #choices .ch.wrong .feedback-label,
body.theme-dark-base .manga-choice.correct .feedback-label,
body.theme-dark-base .manga-choice.wrong .feedback-label{
  color:#fffaf6 !important;
  -webkit-text-fill-color:#fffaf6 !important;
  opacity:1 !important;
}

body.theme-dark-base .wrong .feedback-label,
body.theme-dark-base .ch.wrong .feedback-label,
body.theme-dark-base .choices .ch.wrong .feedback-label,
body.theme-dark-base #choices .ch.wrong .feedback-label,
body.theme-dark-base .manga-choice.wrong .feedback-label{
  background:
    linear-gradient(180deg,#ff5274 0%, #ff375f 46%, #d61f45 100%) !important;
  color:#fffaf6 !important;
  -webkit-text-fill-color:#fffaf6 !important;
  border-color:rgba(255,255,255,.28) !important;
  box-shadow:
    0 10px 22px rgba(255,55,95,.38),
    0 0 0 1px rgba(255,55,95,.30),
    0 0 18px rgba(255,55,95,.26),
    inset 0 1px 0 rgba(255,255,255,.26) !important;
}

@keyframes jiggleCorrect{
  0%{scale:1;rotate:0deg;translate:0 0}
  25%{scale:1.02;rotate:-.7deg;translate:0 0}
  50%{scale:1.03;rotate:.7deg;translate:0 0}
  75%{scale:1.02;rotate:-.4deg;translate:0 0}
  100%{scale:1;rotate:0deg;translate:0 0}
}

@keyframes shakeWrong{
  0%{translate:0 0;scale:1;rotate:0deg}
  18%{translate:-7px 0;scale:1;rotate:0deg}
  36%{translate:6px 0;scale:1;rotate:0deg}
  54%{translate:-4px 0;scale:1;rotate:0deg}
  72%{translate:3px 0;scale:1;rotate:0deg}
  100%{translate:0 0;scale:1;rotate:0deg}
}

/* Sakura realistici */
.sakura{
  position:absolute;
  width:var(--flower-size);
  height:var(--flower-size);
  opacity:0;
  pointer-events:none;
  z-index:5;
  animation:sakuraFloat 2.35s cubic-bezier(.22,.8,.25,1) forwards;
}

/* Mantiene i sakura davanti al badge 正解!/seikai senza alterare suono o animazione. */
.correct .sakura,
.builder-correct .sakura,
.manga-choice.correct .sakura{
  z-index:60 !important;
}

.sakura .petal{
  position:absolute;
  left:50%;
  top:50%;
  width:42%;
  height:58%;
  background:linear-gradient(180deg,#fff7f8 0%,var(--flower-color) 85%);
  border-radius:60% 60% 70% 70%;
  transform-origin:50% 95%;
}

.sakura .petal::after{
  content:"";
  position:absolute;
  left:50%;
  top:-1px;
  width:28%;
  height:22%;
  background:var(--parchment);
  border-radius:0 0 999px 999px;
  transform:translateX(-50%);
}

.sakura .p1{transform:translate(-50%,-92%) rotate(0deg)}
.sakura .p2{transform:translate(-50%,-92%) rotate(72deg)}
.sakura .p3{transform:translate(-50%,-92%) rotate(144deg)}
.sakura .p4{transform:translate(-50%,-92%) rotate(216deg)}
.sakura .p5{transform:translate(-50%,-92%) rotate(288deg)}

.sakura .center{
  position:absolute;
  left:50%;
  top:50%;
  width:18%;
  height:18%;
  background:#d995a3;
  border-radius:50%;
  transform:translate(-50%,-50%);
}

@keyframes sakuraFloat{
  0%{
    opacity:0;
    transform:translate(0,0) rotate(0deg) scale(.45);
  }
  18%{
    opacity:1;
  }
  58%{
    transform:
      translate(calc(var(--x) * .5), -32px)
      rotate(var(--rotate-mid))
      scale(.9);
  }
  100%{
    opacity:0;
    transform:
      translate(var(--x), -74px)
      rotate(var(--rotate-end))
      scale(1.05);
  }
}

/* Accessibilità: riduce movimento se richiesto dal sistema */
@media (prefers-reduced-motion: reduce){
  .ch.jiggle-correct,
  .ch.shake-wrong,
  .manga-choice.jiggle-correct,
  .manga-choice.shake-wrong,
  .ch::before,
  .manga-choice::before,
  .repeat-top-btn.repeat-added,
  .repeat-top-btn.repeat-added .repeat-top-icon,
  .print-fav-star.favorite-added,
  .builder-selected.jiggle-correct,
  .builder-selected.shake-wrong,
  .sakura{
    animation:none !important;
  }

  .sakura{
    display:none !important;
  }
}

/* Mobile polish */
@media (max-width:520px){
  .sakura{
    transform-origin:center;
  }
}

@media (max-width:700px){
  .manga-standalone-shell{
    position:fixed;
    inset:0;
    z-index:9999;
    display:flex;
    flex-direction:column;
    width:100vw;
    height:100dvh;
    border:0;
    border-radius:0;
    padding:0;
    background:#070707;
    box-shadow:none;
    backdrop-filter:none;
    overflow:hidden;
  }

  .manga-standalone-topline{
    position:relative;
    flex:0 0 auto;
    z-index:2;
    margin:0;
    padding:calc(env(safe-area-inset-top, 0px) + 12px) 14px 10px;
    background:#070707;
    pointer-events:auto;
  }

  .manga-standalone-back{
    pointer-events:auto;
    background:rgba(255,255,255,.92);
    box-shadow:0 8px 22px rgba(0,0,0,.18);
  }

  .manga-standalone-frame{
    flex:1 1 auto;
    width:100vw;
    height:auto;
    min-height:0;
    border-radius:0;
    box-shadow:none;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-y;
    overscroll-behavior-y:contain;
  }
}

/* Donut Chart final overrides: keep the widget isolated from header/theme buttons. */
.header-actions .progress-widget .progress-ring-btn,
body.theme-dark-base .header-actions .progress-widget .progress-ring-btn,
body.theme-carbon-fire .header-actions .progress-widget .progress-ring-btn,
body.theme-shinjuku .header-actions .progress-widget .progress-ring-btn {
  width: 64px;
  height: 58px;
  border: 0;
  border-radius: 28px;
  background: #1a1a2e;
  color: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  transform: none;
}

.header-actions .progress-widget .progress-ring-btn:hover,
body.theme-dark-base .header-actions .progress-widget .progress-ring-btn:hover,
body.theme-carbon-fire .header-actions .progress-widget .progress-ring-btn:hover,
body.theme-shinjuku .header-actions .progress-widget .progress-ring-btn:hover {
  background: #1a1a2e;
  border-color: transparent;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transform: scale(1.05);
}

body.theme-dark-base .header-actions .progress-widget .progress-card,
body.theme-carbon-fire .header-actions .progress-widget .progress-card,
body.theme-shinjuku .header-actions .progress-widget .progress-card {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
}

body.theme-dark-base .header-actions .progress-widget .progress-card::before,
body.theme-carbon-fire .header-actions .progress-widget .progress-card::before,
body.theme-shinjuku .header-actions .progress-widget .progress-card::before {
  background: #1a1a2e;
}

@media (max-width: 640px) {
  .header-actions .progress-widget .progress-ring-btn,
  body.theme-dark-base .header-actions .progress-widget .progress-ring-btn,
  body.theme-carbon-fire .header-actions .progress-widget .progress-ring-btn,
  body.theme-shinjuku .header-actions .progress-widget .progress-ring-btn {
    width: 48px;
    height: 44px;
    border-radius: 20px;
  }
}

/* Donut fallback: visible even if the main app script stops before running. */
#jlpt-progress-widget #seg-grammar {
  stroke-dasharray: 74.36 252.37;
  stroke-dashoffset: 0;
}

#jlpt-progress-widget #seg-reading {
  stroke-dasharray: 61.97 264.76;
  stroke-dashoffset: -79.26;
}

#jlpt-progress-widget #seg-listen {
  stroke-dasharray: 51.49 275.24;
  stroke-dashoffset: -146.13;
}

#jlpt-progress-widget #seg-vocab {
  stroke-dasharray: 68.65 258.08;
  stroke-dashoffset: -202.52;
}

#jlpt-progress-widget #seg-kanji {
  stroke-dasharray: 45.76 280.97;
  stroke-dashoffset: -276.07;
}

#jlpt-progress-widget .progress-card.open #d-grammar {
  stroke-dasharray: 80.08 271.78;
  stroke-dashoffset: 0;
}

#jlpt-progress-widget .progress-card.open #d-reading {
  stroke-dasharray: 66.73 285.13;
  stroke-dashoffset: -85.36;
}

#jlpt-progress-widget .progress-card.open #d-listen {
  stroke-dasharray: 55.45 296.41;
  stroke-dashoffset: -157.37;
}

#jlpt-progress-widget .progress-card.open #d-vocab {
  stroke-dasharray: 73.93 277.93;
  stroke-dashoffset: -218.09;
}

#jlpt-progress-widget .progress-card.open #d-kanji {
  stroke-dasharray: 49.29 302.57;
  stroke-dashoffset: -297.30;
}

/* Donut visual polish: remove the external theme shadow and keep only a small filled core. */
.header-actions .progress-widget .progress-ring-btn,
body.theme-classic .header-actions .progress-widget .progress-ring-btn,
body.theme-rilievo .header-actions .progress-widget .progress-ring-btn,
body.theme-carbon-fire .header-actions .progress-widget .progress-ring-btn,
body.theme-dark-base .header-actions .progress-widget .progress-ring-btn,
body.theme-shinjuku .header-actions .progress-widget .progress-ring-btn {
  width: 58px !important;
  height: 52px !important;
  min-width: 58px !important;
  border: 0 !important;
  border-radius: 26px !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  overflow: visible !important;
}

.header-actions .progress-widget .progress-ring-btn:hover,
body.theme-classic .header-actions .progress-widget .progress-ring-btn:hover,
body.theme-rilievo .header-actions .progress-widget .progress-ring-btn:hover,
body.theme-carbon-fire .header-actions .progress-widget .progress-ring-btn:hover,
body.theme-dark-base .header-actions .progress-widget .progress-ring-btn:hover,
body.theme-shinjuku .header-actions .progress-widget .progress-ring-btn:hover {
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  transform: scale(1.025);
}

#jlpt-progress-widget .ring-svg {
  width: 48px !important;
  height: 48px !important;
  filter: none !important;
}

#jlpt-progress-widget .ring-svg g {
  filter: none !important;
}

#jlpt-progress-widget .ring-center {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(14, 15, 24, 0.94);
  box-shadow: inset 0 1px 6px rgba(255, 255, 255, 0.08);
}

#jlpt-progress-widget .ring-pct {
  font-size: 12px;
  line-height: 1;
}

body.theme-classic #jlpt-progress-widget .ring-center,
body.theme-rilievo #jlpt-progress-widget .ring-center {
  background: rgba(35, 30, 43, 0.92);
}

body.theme-carbon-fire #jlpt-progress-widget .ring-center,
body.theme-dark-base #jlpt-progress-widget .ring-center,
body.theme-shinjuku #jlpt-progress-widget .ring-center {
  background: rgba(5, 6, 10, 0.96);
}

@media (max-width: 640px) {
  .header-actions .progress-widget .progress-ring-btn,
  body.theme-classic .header-actions .progress-widget .progress-ring-btn,
  body.theme-rilievo .header-actions .progress-widget .progress-ring-btn,
  body.theme-carbon-fire .header-actions .progress-widget .progress-ring-btn,
  body.theme-dark-base .header-actions .progress-widget .progress-ring-btn,
  body.theme-shinjuku .header-actions .progress-widget .progress-ring-btn {
    width: 44px !important;
    height: 42px !important;
    min-width: 44px !important;
  }

  #jlpt-progress-widget .ring-svg {
    width: 40px !important;
    height: 40px !important;
  }

  #jlpt-progress-widget .ring-center {
    width: 24px;
    height: 24px;
  }

  #jlpt-progress-widget .ring-pct {
    font-size: 10px;
  }
}

/* Progress card theme skins - visual only, no audio or logic changes */
.progress-widget {
  --progress-card-bg:
    linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(239, 229, 205, 0.98));
  --progress-card-arrow-bg: rgba(255, 252, 244, 0.98);
  --progress-card-border: rgba(154, 126, 102, 0.22);
  --progress-card-shadow:
    0 22px 46px rgba(92, 61, 46, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.72) inset;
  --progress-card-title: #2b160e;
  --progress-card-text: #3d2a22;
  --progress-card-muted: rgba(96, 73, 62, 0.74);
  --progress-card-line: rgba(127, 96, 77, 0.22);
  --progress-card-track: rgba(118, 94, 73, 0.16);
  --progress-card-center-bg:
    linear-gradient(180deg, rgba(252, 244, 225, 0.98), rgba(226, 211, 182, 0.96));
  --progress-card-center-shadow:
    inset 0 1px 7px rgba(255, 255, 255, 0.65),
    0 8px 20px rgba(92, 61, 46, 0.14);
  --progress-card-action-bg: rgba(255, 255, 255, 0.28);
  --progress-card-action-hover: #9f1f1f;
  --progress-card-action: #9f1f1f;
}

body.theme-rilievo .progress-widget {
  --progress-card-bg:
    linear-gradient(180deg, rgba(251, 246, 234, 0.98), rgba(235, 225, 202, 0.98));
  --progress-card-arrow-bg: rgba(248, 240, 220, 0.98);
  --progress-card-border: rgba(92, 61, 46, 0.10);
  --progress-card-shadow: var(--ri-up);
  --progress-card-title: #2d1a11;
  --progress-card-text: #4b3124;
  --progress-card-muted: rgba(106, 78, 63, 0.74);
  --progress-card-line: rgba(92, 61, 46, 0.16);
  --progress-card-track: rgba(92, 61, 46, 0.13);
  --progress-card-center-bg:
    linear-gradient(180deg, rgba(250, 243, 224, 0.98), rgba(230, 216, 186, 0.96));
  --progress-card-center-shadow: var(--ri-sm);
  --progress-card-action-bg: rgba(255, 255, 255, 0.24);
  --progress-card-action-hover: #9f1f1f;
  --progress-card-action: #9f1f1f;
}

body.theme-carbon-fire .progress-widget {
  --progress-card-bg:
    radial-gradient(circle at 16% 0%, rgba(255, 48, 64, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(30, 30, 31, 0.98), rgba(10, 10, 11, 0.99));
  --progress-card-arrow-bg: #161618;
  --progress-card-border: rgba(255, 48, 64, 0.28);
  --progress-card-shadow:
    0 24px 58px rgba(0, 0, 0, 0.62),
    0 0 30px rgba(255, 48, 64, 0.10);
  --progress-card-title: #fff7f8;
  --progress-card-text: #f3eff0;
  --progress-card-muted: rgba(235, 225, 228, 0.68);
  --progress-card-line: rgba(255, 48, 64, 0.22);
  --progress-card-track: rgba(255, 255, 255, 0.10);
  --progress-card-center-bg:
    linear-gradient(180deg, rgba(13, 14, 18, 0.98), rgba(3, 4, 6, 0.99));
  --progress-card-center-shadow:
    inset 0 1px 8px rgba(255, 255, 255, 0.07),
    0 0 18px rgba(255, 48, 64, 0.12);
  --progress-card-action-bg: rgba(255, 48, 64, 0.08);
  --progress-card-action-hover: #ff3047;
  --progress-card-action: #ff3047;
}

body.theme-dark-base .progress-widget {
  --progress-card-bg:
    radial-gradient(circle at 14% 0%, rgba(255, 55, 95, 0.11), transparent 34%),
    radial-gradient(circle at 94% 8%, rgba(53, 161, 255, 0.07), transparent 30%),
    linear-gradient(180deg, rgba(16, 18, 25, 0.985), rgba(4, 5, 8, 0.995));
  --progress-card-arrow-bg: #0f1118;
  --progress-card-border: rgba(255, 255, 255, 0.075);
  --progress-card-shadow:
    0 26px 62px rgba(0, 0, 0, 0.68),
    0 0 34px rgba(255, 55, 95, 0.08);
  --progress-card-title: #f5f5f7;
  --progress-card-text: #f0f1f5;
  --progress-card-muted: rgba(181, 186, 199, 0.72);
  --progress-card-line: rgba(255, 255, 255, 0.08);
  --progress-card-track: rgba(255, 255, 255, 0.11);
  --progress-card-center-bg:
    linear-gradient(180deg, rgba(12, 13, 19, 0.99), rgba(2, 3, 5, 0.99));
  --progress-card-center-shadow:
    inset 0 1px 8px rgba(255, 255, 255, 0.07),
    0 0 18px rgba(255, 55, 95, 0.10);
  --progress-card-action-bg: rgba(255, 55, 95, 0.08);
  --progress-card-action-hover: #ff375f;
  --progress-card-action: #ff375f;
}

body.theme-shinjuku .progress-widget {
  --progress-card-bg:
    radial-gradient(circle at 12% 0%, rgba(255, 55, 95, 0.15), transparent 34%),
    radial-gradient(circle at 88% 0%, rgba(0, 225, 255, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(14, 16, 25, 0.985), rgba(3, 4, 9, 0.995));
  --progress-card-arrow-bg: #0d1018;
  --progress-card-border: rgba(0, 225, 255, 0.14);
  --progress-card-shadow:
    0 26px 62px rgba(0, 0, 0, 0.68),
    0 0 28px rgba(0, 225, 255, 0.08),
    0 0 22px rgba(255, 55, 95, 0.07);
  --progress-card-title: #f7fbff;
  --progress-card-text: #f0f5ff;
  --progress-card-muted: rgba(190, 202, 215, 0.72);
  --progress-card-line: rgba(0, 225, 255, 0.10);
  --progress-card-track: rgba(255, 255, 255, 0.12);
  --progress-card-center-bg:
    linear-gradient(180deg, rgba(12, 14, 22, 0.99), rgba(2, 3, 7, 0.99));
  --progress-card-center-shadow:
    inset 0 1px 8px rgba(255, 255, 255, 0.07),
    0 0 18px rgba(0, 225, 255, 0.10);
  --progress-card-action-bg: rgba(0, 225, 255, 0.07);
  --progress-card-action-hover: #ff375f;
  --progress-card-action: #ff375f;
}

#jlpt-progress-widget .progress-card,
.header-actions #jlpt-progress-widget .progress-card,
body.theme-rilievo .header-actions #jlpt-progress-widget .progress-card,
body.theme-carbon-fire .header-actions #jlpt-progress-widget .progress-card,
body.theme-dark-base .header-actions #jlpt-progress-widget .progress-card,
body.theme-shinjuku .header-actions #jlpt-progress-widget .progress-card {
  background: var(--progress-card-bg) !important;
  border: 1px solid var(--progress-card-border) !important;
  box-shadow: var(--progress-card-shadow) !important;
  color: var(--progress-card-text) !important;
}

#jlpt-progress-widget .progress-card::before,
.header-actions #jlpt-progress-widget .progress-card::before,
body.theme-rilievo .header-actions #jlpt-progress-widget .progress-card::before,
body.theme-carbon-fire .header-actions #jlpt-progress-widget .progress-card::before,
body.theme-dark-base .header-actions #jlpt-progress-widget .progress-card::before,
body.theme-shinjuku .header-actions #jlpt-progress-widget .progress-card::before {
  background: var(--progress-card-arrow-bg) !important;
  border-left-color: var(--progress-card-border) !important;
  border-top-color: var(--progress-card-border) !important;
}

#jlpt-progress-widget .progress-card-title {
  color: var(--progress-card-title) !important;
}

#jlpt-progress-widget .progress-card-subtitle,
#jlpt-progress-widget .footer-item,
#jlpt-progress-widget .progress-sensei-summary,
#jlpt-progress-widget .bar-completion,
#jlpt-progress-widget .donut-lbl {
  color: var(--progress-card-muted) !important;
}

#jlpt-progress-widget .bar-meta,
#jlpt-progress-widget .progress-card-footer {
  color: var(--progress-card-text) !important;
}

#jlpt-progress-widget .progress-card-footer {
  border-top-color: var(--progress-card-line) !important;
}

#jlpt-progress-widget .bar-track {
  background: var(--progress-card-track) !important;
}

#jlpt-progress-widget .donut-center {
  background: var(--progress-card-center-bg) !important;
  box-shadow: var(--progress-card-center-shadow) !important;
}

#jlpt-progress-widget .donut-pct {
  color: var(--progress-card-title) !important;
}

#jlpt-progress-widget .dettagli-btn {
  background: var(--progress-card-action-bg) !important;
  border-color: var(--progress-card-action) !important;
  color: var(--progress-card-action) !important;
}

#jlpt-progress-widget .dettagli-btn:hover {
  background: var(--progress-card-action-hover) !important;
  border-color: var(--progress-card-action-hover) !important;
  color: #fff !important;
}

/* V2 visual refinements - no audio or app logic changes */

/* Header actions: sit a touch lower in the right-side title area. */
.header-side .header-actions {
  margin-top: 12px;
}

@media (max-width: 640px) {
  .header-side .header-actions {
    margin-top: 8px;
  }
}

/* Progress panel: the compact card is already the details view, so remove the duplicate CTA. */
#jlpt-progress-widget .dettagli-btn {
  display: none !important;
}

#jlpt-progress-widget .progress-level-selector{
  display:flex;
  align-items:center;
  gap:4px;
}
#jlpt-progress-widget .progress-level-selector button{
  position:relative;
  flex:0 0 34px !important;
  width:34px;
  min-width:34px;
  min-height:30px;
  padding:5px 4px;
  border:1px solid var(--progress-card-action);
  border-radius:8px;
  background:var(--progress-card-action-bg);
  color:var(--progress-card-action);
  font:700 11px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  cursor:pointer;
}
#jlpt-progress-widget .progress-level-selector button::after{
  content:"";
  position:absolute;
  top:3px;
  right:3px;
  width:4px;
  height:4px;
  border-radius:50%;
  background:#808080;
  opacity:.35;
}
#jlpt-progress-widget .progress-level-selector button.active{
  border-color:var(--progress-card-action-hover);
  background:var(--progress-card-action-hover);
  color:#fff;
}
#jlpt-progress-widget .progress-level-selector button.active::after{
  background:#30c97d;
  opacity:1;
}

#jlpt-progress-widget .progress-card-header {
  justify-content: flex-start !important;
}

/* Carbon Fire: replace leftover pale/grey fields with coherent satin-black surfaces. */
body.theme-carbon-fire .reading-grid > div,
body.theme-carbon-fire .daily-note-link,
body.theme-carbon-fire .daily-note-meaning,
body.theme-carbon-fire .phrase-output,
body.theme-carbon-fire .phrase-mini,
body.theme-carbon-fire .more-examples-wrap,
body.theme-carbon-fire .examples-panel,
body.theme-carbon-fire .grammar-note-card,
body.theme-carbon-fire .grammar-note-input,
body.theme-carbon-fire .print-fav-empty,
body.theme-carbon-fire .fav-empty,
body.theme-carbon-fire .dictionary-empty,
body.theme-carbon-fire .dictionary-result,
body.theme-carbon-fire .term-row,
body.theme-carbon-fire .term-example-card,
body.theme-carbon-fire .term-meaning,
body.theme-carbon-fire .term-note-input,
body.theme-carbon-fire .dictionary-search-input,
body.theme-carbon-fire .qr-canvas-wrap,
body.theme-carbon-fire .audio-panel,
body.theme-carbon-fire .q-passage {
  background:
    linear-gradient(180deg, rgba(31, 32, 35, 0.96), rgba(12, 13, 15, 0.98)) !important;
  border-color: rgba(255, 48, 64, 0.22) !important;
  color: #f4eded !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 0 -1px 0 rgba(0, 0, 0, 0.44),
    0 10px 26px rgba(0, 0, 0, 0.28) !important;
}

body.theme-carbon-fire .reading-grid span,
body.theme-carbon-fire .daily-note-meaning,
body.theme-carbon-fire .grammar-note-input::placeholder,
body.theme-carbon-fire .dictionary-empty,
body.theme-carbon-fire .fav-empty,
body.theme-carbon-fire .print-fav-empty {
  color: rgba(244, 237, 237, 0.72) !important;
}

body.theme-carbon-fire .reading-grid strong,
body.theme-carbon-fire .daily-note-link,
body.theme-carbon-fire .dictionary-result-jp,
body.theme-carbon-fire .term-row {
  color: #fff6f7 !important;
}

body.theme-carbon-fire .daily-note-link:hover,
body.theme-carbon-fire .dictionary-result:hover {
  background:
    linear-gradient(180deg, rgba(51, 34, 36, 0.98), rgba(18, 14, 16, 0.99)) !important;
  border-color: rgba(255, 48, 64, 0.42) !important;
}

/* Rilievo: keep the next button in the same red language, faded before answer and full after answer. */
body.theme-rilievo #btn-next.nbtn.pri,
body.theme-rilievo .nbtn.pri {
  background: linear-gradient(135deg, var(--lacca) 0%, var(--lacca-dk) 100%) !important;
  border-color: transparent !important;
  color: #fffaf4 !important;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.26),
    inset -1px -2px 0 rgba(0, 0, 0, 0.25),
    0 10px 24px rgba(139, 26, 26, 0.30) !important;
  opacity: 1 !important;
  filter: none !important;
}

body.theme-rilievo #btn-next.nbtn.pri:disabled,
body.theme-rilievo .nbtn.pri:disabled {
  background:
    linear-gradient(135deg, rgba(159, 31, 31, 0.13), rgba(111, 22, 22, 0.08)) !important;
  border-color: rgba(92, 61, 46, 0.12) !important;
  color: rgba(92, 61, 46, 0.28) !important;
  box-shadow:
    inset 2px 2px 5px rgba(190, 164, 128, 0.28),
    inset -2px -2px 6px rgba(255, 255, 255, 0.50),
    0 3px 8px rgba(92, 61, 46, 0.08) !important;
  cursor: not-allowed !important;
}

body.theme-rilievo #btn-next.nbtn.pri:not(:disabled):hover,
body.theme-rilievo .nbtn.pri:not(:disabled):hover {
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.28),
    inset -1px -2px 0 rgba(0, 0, 0, 0.28),
    0 13px 28px rgba(139, 26, 26, 0.42) !important;
  transform: translateY(-2px);
}

@media (max-width:520px){
  .exam-actions{
    gap:6px;
  }
  .repeat-top-btn{
    width:34px;
    min-width:34px;
    height:34px;
  }
  .repeat-top-icon{
    width:20px;
    height:20px;
  }
  .builder-heading{
    align-items:flex-start;
  }
  .builder-grammar-description{
    flex-basis:100%;
    font-size:15px;
  }
  .builder-heading-actions{
    gap:6px;
  }
}

/* Mobile header hardening: keep search, progress and favorites inside the viewport. */
@media (max-width:520px){
  html,
  body{
    width:100%;
    max-width:100%;
    overflow-x:hidden !important;
  }

  #wrap{
    width:100% !important;
    max-width:100% !important;
    padding-left:20px !important;
    padding-right:20px !important;
    box-sizing:border-box;
    overflow-x:hidden !important;
  }

  .app-header{
    position:relative;
    display:block !important;
    min-height:140px;
    padding-right:134px;
  }

  .header-main{
    max-width:100% !important;
    min-width:0 !important;
  }

  .header-main h1{
    max-width:100%;
  }

  .app-subtitle{
    max-width:100%;
    line-height:1.35;
  }

  .header-side{
    position:absolute;
    top:0;
    right:0;
    width:126px !important;
    max-width:126px !important;
    min-width:0 !important;
    align-items:flex-end;
    gap:8px;
  }

  .header-kanji{
    font-size:27px !important;
    max-width:126px;
    white-space:nowrap;
  }

  .header-side .header-actions,
  .header-actions{
    width:126px !important;
    max-width:126px !important;
    display:flex !important;
    flex-wrap:nowrap !important;
    justify-content:flex-end !important;
    align-items:center !important;
    gap:3px !important;
    margin-top:8px !important;
  }

  .header-icon-btn{
    width:36px !important;
    min-width:36px !important;
    max-width:36px !important;
    height:38px !important;
    flex:0 0 36px !important;
    padding:0 !important;
  }

  .header-search-icon{
    width:29px !important;
    height:29px !important;
  }

  .header-print-favorites img{
    width:33px !important;
    height:33px !important;
    transform:translateY(2px) !important;
  }

  .header-print-favorites{
    overflow:visible !important;
  }

  .header-favorites-count{
    right:-11px !important;
    bottom:1px !important;
  }

  .header-actions .progress-widget .progress-ring-btn,
  body.theme-classic .header-actions .progress-widget .progress-ring-btn,
  body.theme-rilievo .header-actions .progress-widget .progress-ring-btn,
  body.theme-carbon-fire .header-actions .progress-widget .progress-ring-btn,
  body.theme-dark-base .header-actions .progress-widget .progress-ring-btn,
  body.theme-shinjuku .header-actions .progress-widget .progress-ring-btn{
    width:36px !important;
    min-width:36px !important;
    max-width:36px !important;
    height:36px !important;
    flex:0 0 36px !important;
    border-radius:18px !important;
  }

  #jlpt-progress-widget .ring-svg{
    width:34px !important;
    height:34px !important;
  }

  #jlpt-progress-widget .ring-center{
    width:22px !important;
    height:22px !important;
  }

  #jlpt-progress-widget .ring-pct{
    font-size:9px !important;
  }
}

/* Mobile header final layout: compact two-column grid, no horizontal spill. */
@media (max-width:520px){
  .app-header{
    display:grid !important;
    grid-template-columns:minmax(0, 1fr) 126px !important;
    column-gap:8px !important;
    align-items:start !important;
    width:100% !important;
    max-width:100% !important;
    min-height:140px !important;
    box-sizing:border-box !important;
    padding-right:0 !important;
    overflow:visible !important;
  }

  .header-main{
    grid-column:1 !important;
    min-width:0 !important;
    max-width:100% !important;
  }

  .header-side{
    position:static !important;
    grid-column:2 !important;
    width:126px !important;
    max-width:126px !important;
    min-width:0 !important;
    justify-self:end !important;
    align-self:start !important;
  }

  .header-side .header-actions{
    width:126px !important;
    max-width:126px !important;
    min-width:0 !important;
    overflow:visible !important;
  }
}

/* =========================================
   CARBON FLAT
   Nuovo tema extra: eredita Carbon Fire, ma usa le card livello/modalita'
   piu piatte dalla versione carbon-fire-flat-buttons-final.
========================================= */
.theme-swatch-carbon-flat{
  background:
    radial-gradient(circle at 66% 32%, rgba(255,48,70,.95) 0 16%, transparent 18%),
    linear-gradient(135deg,#2b2d31 0%,#111214 46%,#070808 72%,#ff3046 100%);
  border-color:rgba(255,48,70,.44);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.08),
    0 0 8px rgba(255,48,70,.24);
}

body.theme-carbon-fire.theme-carbon-flat .mode-card,
body.theme-carbon-fire.theme-carbon-flat .lvl-btn{
  position:relative !important;
  overflow:hidden !important;
  background:
    linear-gradient(180deg, rgba(38,40,42,.78) 0%, rgba(23,24,25,.82) 34%, rgba(9,10,11,.96) 100%) !important;
  border-top-color:rgba(255,255,255,.115) !important;
  border-left-color:rgba(255,255,255,.072) !important;
  border-right-color:rgba(0,0,0,.88) !important;
  border-bottom-color:rgba(0,0,0,.94) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    inset 1px 0 0 rgba(255,255,255,.025),
    inset -1px 0 0 rgba(0,0,0,.76),
    inset 0 -1px 0 rgba(0,0,0,.86),
    0 10px 20px rgba(0,0,0,.56),
    0 2px 0 rgba(0,0,0,.66) !important;
}

body.theme-carbon-fire.theme-carbon-flat .mode-card.sel,
body.theme-carbon-fire.theme-carbon-flat .lvl-btn.sel{
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255,48,70,.13), transparent 60%),
    linear-gradient(180deg, rgba(39,40,42,.78) 0%, rgba(21,22,24,.84) 42%, rgba(8,9,10,.97) 100%) !important;
  border-color:rgba(255,48,70,.82) !important;
  border-right-color:rgba(98,10,18,.72) !important;
  border-bottom-color:rgba(49,0,7,.88) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.065),
    inset -1px 0 0 rgba(50,0,7,.68),
    inset 0 -1px 0 rgba(39,0,6,.78),
    0 0 0 1px rgba(255,48,70,.22),
    0 0 10px rgba(255,48,70,.20),
    0 10px 20px rgba(0,0,0,.60),
    0 2px 0 rgba(0,0,0,.68) !important;
}

body.theme-carbon-fire.theme-carbon-flat .mode-card::before,
body.theme-carbon-fire.theme-carbon-flat .mode-card:hover::before{
  display:none !important;
  opacity:0 !important;
}

body.theme-carbon-fire.theme-carbon-flat .mode-card::after,
body.theme-carbon-fire.theme-carbon-flat .lvl-btn::after{
  content:"" !important;
  position:absolute !important;
  inset:2px !important;
  pointer-events:none !important;
  border-radius:calc(var(--r) - 2px) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    inset 0 -1px 0 rgba(0,0,0,.50) !important;
}

body.theme-carbon-fire.theme-carbon-flat .lvl-btn::after{
  border-radius:calc(var(--rm) - 2px) !important;
}

body.theme-carbon-fire.theme-carbon-flat .mode-card:hover,
body.theme-carbon-fire.theme-carbon-flat .lvl-btn:hover{
  transform:translateY(-1px) !important;
  background:
    linear-gradient(180deg, rgba(42,44,46,.82) 0%, rgba(24,25,27,.84) 36%, rgba(9,10,11,.97) 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 1px 0 0 rgba(255,255,255,.028),
    inset -1px 0 0 rgba(0,0,0,.78),
    inset 0 -1px 0 rgba(0,0,0,.88),
    0 12px 22px rgba(0,0,0,.60),
    0 2px 0 rgba(0,0,0,.68) !important;
}

body.theme-carbon-fire.theme-carbon-flat .mode-card > *,
body.theme-carbon-fire.theme-carbon-flat .lvl-btn > *{
  position:relative !important;
  z-index:1 !important;
}

/* =========================================
   SHINJUKU NEON
   Tema sostitutivo solo per Shinjuku. Gli altri temi non vengono toccati.
========================================= */
body.theme-shinjuku{
  --sh-bg:#02030a;
  --sh-panel:rgba(4,8,22,.74);
  --sh-panel-strong:rgba(5,10,28,.88);
  --sh-pink:#ff2f86;
  --sh-pink-soft:rgba(255,47,134,.22);
  --sh-cyan:#00e8ff;
  --sh-blue:#2d86ff;
  --sh-violet:#b65cff;
  --sh-white:#f6f3f8;
  --sh-muted:#a5b4d0;
  background:
    radial-gradient(circle at 50% -14%, rgba(255,47,134,.22), transparent 30%),
    radial-gradient(circle at 15% 18%, rgba(0,232,255,.16), transparent 28%),
    radial-gradient(circle at 85% 16%, rgba(182,92,255,.16), transparent 30%),
    linear-gradient(90deg, rgba(0,0,0,.92) 0%, rgba(3,6,20,.95) 17%, rgba(2,3,10,.96) 50%, rgba(3,6,20,.95) 83%, rgba(0,0,0,.92) 100%) !important;
  color:var(--sh-white) !important;
}

body.theme-shinjuku::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.88) 0 9%, transparent 22% 78%, rgba(0,0,0,.88) 91% 100%),
    radial-gradient(ellipse at 4% 43%, rgba(255,47,134,.40), transparent 18%),
    radial-gradient(ellipse at 95% 42%, rgba(0,232,255,.34), transparent 18%),
    repeating-linear-gradient(90deg, rgba(255,47,134,.12) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(0,232,255,.09) 0 1px, transparent 1px 42px);
  opacity:.74;
  mix-blend-mode:screen;
}

body.theme-shinjuku::after{
  content:"ホテル\A 24H\A 東京";
  white-space:pre-line;
  position:fixed;
  left:18px;
  top:18%;
  z-index:0;
  pointer-events:none;
  color:var(--sh-pink);
  font-family:var(--font);
  font-weight:900;
  font-size:22px;
  line-height:1.28;
  letter-spacing:.12em;
  text-align:center;
  text-shadow:
    0 0 8px rgba(255,47,134,.95),
    0 0 24px rgba(255,47,134,.72),
    0 0 46px rgba(255,47,134,.38);
  border:1px solid rgba(255,47,134,.42);
  border-radius:10px;
  padding:14px 8px;
  background:rgba(255,47,134,.065);
  box-shadow:
    0 0 18px rgba(255,47,134,.30),
    inset 0 0 16px rgba(255,47,134,.15);
}

body.theme-shinjuku #wrap{
  position:relative;
  z-index:1;
}

body.theme-shinjuku h1,
body.theme-shinjuku h2,
body.theme-shinjuku .mc-name,
body.theme-shinjuku .lvl-main{
  color:var(--sh-white) !important;
  text-shadow:0 0 16px rgba(255,255,255,.15) !important;
}

body.theme-shinjuku .app-subtitle,
body.theme-shinjuku .mc-desc,
body.theme-shinjuku .lvl-sub{
  color:var(--sh-cyan) !important;
  text-shadow:0 0 12px rgba(0,232,255,.45) !important;
}

body.theme-shinjuku .header-kanji,
body.theme-shinjuku .mc-kanji,
body.theme-shinjuku .kana-tab-mark,
body.theme-shinjuku .daily-kanji-char{
  color:var(--sh-pink) !important;
  text-shadow:
    0 0 10px rgba(255,47,134,.72),
    0 0 28px rgba(255,47,134,.35) !important;
}

body.theme-shinjuku .section-title,
body.theme-shinjuku .home-kicker,
body.theme-shinjuku .opt-box label,
body.theme-shinjuku .home-menu-title{
  color:var(--sh-cyan) !important;
  text-shadow:0 0 14px rgba(0,232,255,.45) !important;
}

body.theme-shinjuku .section-title::after{
  background:linear-gradient(90deg, rgba(0,232,255,.76), rgba(255,47,134,.44), transparent) !important;
  box-shadow:0 0 14px rgba(0,232,255,.22) !important;
}

body.theme-shinjuku .app-header,
body.theme-shinjuku .exam-header{
  border-color:rgba(0,232,255,.16) !important;
}

body.theme-shinjuku .header-menu-btn,
body.theme-shinjuku .header-icon-btn,
body.theme-shinjuku .home-menu-panel,
body.theme-shinjuku .home-card,
body.theme-shinjuku .home-favorites-card,
body.theme-shinjuku .kana-tab-card,
body.theme-shinjuku .kana-intro-card,
body.theme-shinjuku .kana-board,
body.theme-shinjuku .q-card,
body.theme-shinjuku .favorites-panel,
body.theme-shinjuku .print-fav-hero,
body.theme-shinjuku .print-fav-card,
body.theme-shinjuku .manga-hero-card,
body.theme-shinjuku .manga-episode-card,
body.theme-shinjuku .manga-reader,
body.theme-shinjuku .term-modal,
body.theme-shinjuku .dictionary-search-modal,
body.theme-shinjuku .qr-modal{
  background:
    radial-gradient(circle at 18% 0%, rgba(255,47,134,.11), transparent 34%),
    radial-gradient(circle at 90% 0%, rgba(0,232,255,.12), transparent 36%),
    linear-gradient(180deg, rgba(6,11,30,.86), rgba(3,5,16,.93)) !important;
  border:1px solid rgba(0,232,255,.25) !important;
  box-shadow:
    0 0 0 1px rgba(255,47,134,.12),
    0 0 22px rgba(0,232,255,.12),
    0 0 26px rgba(255,47,134,.10),
    0 20px 42px rgba(0,0,0,.54) !important;
}

body.theme-shinjuku .home-favorites-card,
body.theme-shinjuku .kana-tab-card{
  border-color:rgba(255,47,134,.48) !important;
  box-shadow:
    0 0 0 1px rgba(0,232,255,.22),
    0 0 28px rgba(255,47,134,.24),
    inset 0 0 28px rgba(0,232,255,.045) !important;
}

body.theme-shinjuku .theme-option,
body.theme-shinjuku .lvl-btn,
body.theme-shinjuku .mode-card,
body.theme-shinjuku .grammar-mode-btn,
body.theme-shinjuku .opt-box,
body.theme-shinjuku .pool-info,
body.theme-shinjuku .ch,
body.theme-shinjuku .builder-token,
body.theme-shinjuku .builder-bank,
body.theme-shinjuku .builder-selected,
body.theme-shinjuku .nbtn,
body.theme-shinjuku .fav-top-btn,
body.theme-shinjuku .back-btn,
body.theme-shinjuku .timer-box,
body.theme-shinjuku .home-fav-row,
body.theme-shinjuku .home-fav-empty,
body.theme-shinjuku .home-favorites-toggle,
body.theme-shinjuku .kana-cell:not(.empty),
body.theme-shinjuku .dictionary-result,
body.theme-shinjuku .term-row,
body.theme-shinjuku .term-example-card,
body.theme-shinjuku .term-meaning,
body.theme-shinjuku .term-note-input,
body.theme-shinjuku .dictionary-search-input,
body.theme-shinjuku .qr-canvas-wrap{
  background:
    linear-gradient(180deg, rgba(8,16,38,.82), rgba(3,6,18,.90)) !important;
  border-color:rgba(0,232,255,.28) !important;
  color:var(--sh-white) !important;
  box-shadow:
    inset 0 0 18px rgba(0,232,255,.030),
    0 0 18px rgba(0,232,255,.09),
    0 0 20px rgba(255,47,134,.055) !important;
}

body.theme-shinjuku .mode-card::before,
body.theme-shinjuku .mode-card:hover::before{
  display:none !important;
  opacity:0 !important;
}

body.theme-shinjuku .mode-card,
body.theme-shinjuku .lvl-btn{
  border-color:rgba(0,232,255,.38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(0,0,0,.60),
    0 0 15px rgba(0,232,255,.14),
    0 0 22px rgba(255,47,134,.08),
    0 14px 28px rgba(0,0,0,.45) !important;
}

body.theme-shinjuku .mode-card.sel,
body.theme-shinjuku .lvl-btn.sel,
body.theme-shinjuku .theme-option.active{
  border-color:rgba(255,47,134,.92) !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,47,134,.17), transparent 56%),
    linear-gradient(180deg, rgba(14,13,34,.88), rgba(5,6,18,.96)) !important;
  color:var(--sh-white) !important;
  box-shadow:
    0 0 0 1px rgba(255,47,134,.38),
    0 0 18px rgba(255,47,134,.38),
    0 0 34px rgba(255,47,134,.16),
    inset 0 0 22px rgba(255,47,134,.10) !important;
}

body.theme-shinjuku .mode-card:hover,
body.theme-shinjuku .lvl-btn:hover,
body.theme-shinjuku .theme-option:hover{
  transform:translateY(-1px) !important;
  border-color:rgba(255,47,134,.70) !important;
  box-shadow:
    0 0 18px rgba(255,47,134,.26),
    0 0 24px rgba(0,232,255,.13),
    0 16px 30px rgba(0,0,0,.52) !important;
}

body.theme-shinjuku .opt-box select,
body.theme-shinjuku .dictionary-search-input,
body.theme-shinjuku textarea,
body.theme-shinjuku input{
  background:rgba(1,3,12,.72) !important;
  color:var(--sh-white) !important;
  border-color:rgba(0,232,255,.26) !important;
}

body.theme-shinjuku .primary,
body.theme-shinjuku .start-btn,
body.theme-shinjuku .nbtn:not(:disabled){
  background:
    linear-gradient(180deg, rgba(255,47,134,.96), rgba(165,10,78,.92)) !important;
  border-color:rgba(255,47,134,.9) !important;
  color:#fff !important;
  box-shadow:
    0 0 18px rgba(255,47,134,.30),
    0 12px 26px rgba(0,0,0,.46) !important;
}

body.theme-shinjuku .pool-info strong,
body.theme-shinjuku .home-favorites-count,
body.theme-shinjuku .available-count,
body.theme-shinjuku .grammar-repeat-title,
body.theme-shinjuku .q-card .star-btn.saved{
  color:var(--sh-pink) !important;
  text-shadow:0 0 12px rgba(255,47,134,.42) !important;
}

body.theme-shinjuku .header-menu-icon path,
body.theme-shinjuku .header-search-icon .lens-stroke,
body.theme-shinjuku .header-search-icon .lens-shine{
  stroke:var(--sh-pink) !important;
  filter:drop-shadow(0 0 8px rgba(255,47,134,.52));
}

body.theme-shinjuku .lens-fill{
  fill:rgba(0,232,255,.08) !important;
}

body.theme-shinjuku .theme-swatch-shinjuku{
  background:
    radial-gradient(circle at 32% 25%, rgba(0,232,255,.98) 0 15%, transparent 17%),
    radial-gradient(circle at 72% 72%, rgba(255,47,134,.98) 0 20%, transparent 22%),
    linear-gradient(135deg,#030713 0%,#0a0e24 42%,#ff2f86 68%,#00e8ff 100%) !important;
  border-color:rgba(0,232,255,.60) !important;
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,.08),
    0 0 12px rgba(255,47,134,.32),
    0 0 18px rgba(0,232,255,.22) !important;
}

body.theme-shinjuku .pool-info{
  color:var(--sh-pink) !important;
  border-color:rgba(0,232,255,.30) !important;
}

@media (min-width:1180px){
  body.theme-shinjuku #wrap::before,
  body.theme-shinjuku #wrap::after{
    position:fixed;
    z-index:0;
    pointer-events:none;
    writing-mode:vertical-rl;
    text-orientation:upright;
    font-family:var(--font);
    font-weight:900;
    font-size:26px;
    letter-spacing:.16em;
    padding:18px 10px;
    border-radius:10px;
  }

  body.theme-shinjuku #wrap::before{
    content:"";
    right:24px;
    top:18%;
    color:var(--sh-pink);
    border:1px solid rgba(255,47,134,.46);
    background:rgba(255,47,134,.07);
    box-shadow:
      0 0 18px rgba(255,47,134,.34),
      inset 0 0 16px rgba(255,47,134,.15);
    text-shadow:0 0 12px rgba(255,47,134,.95), 0 0 28px rgba(255,47,134,.50);
  }

  body.theme-shinjuku #wrap::after{
    content:"";
    right:42px;
    top:48%;
    color:var(--sh-cyan);
    border:1px solid rgba(0,232,255,.46);
    background:rgba(0,232,255,.06);
    box-shadow:
      0 0 18px rgba(0,232,255,.30),
      inset 0 0 16px rgba(0,232,255,.14);
    text-shadow:0 0 12px rgba(0,232,255,.88), 0 0 28px rgba(0,232,255,.44);
  }
}

@media (max-width:760px){
  body.theme-shinjuku::after,
  body.theme-shinjuku #wrap::before,
  body.theme-shinjuku #wrap::after{
    display:none !important;
  }
}

/* =========================================
   SHINJUKU NEON GRADIENT RIMS
   Rifinitura solo Shinjuku: bordi neon sfumati e niente insegne laterali.
========================================= */

body.theme-shinjuku #wrap::before,
body.theme-shinjuku #wrap::after{
  content:none !important;
  display:none !important;
}

body.theme-shinjuku .home-favorites-card,
body.theme-shinjuku .kana-tab-card,
body.theme-shinjuku .kana-intro-card,
body.theme-shinjuku .kana-board,
body.theme-shinjuku .lvl-btn,
body.theme-shinjuku .mode-card,
body.theme-shinjuku .grammar-mode-btn,
body.theme-shinjuku .opt-box,
body.theme-shinjuku .pool-info,
body.theme-shinjuku .home-favorites-toggle,
body.theme-shinjuku .q-card,
body.theme-shinjuku .favorites-panel,
body.theme-shinjuku .print-fav-hero,
body.theme-shinjuku .print-fav-card,
body.theme-shinjuku .manga-hero-card,
body.theme-shinjuku .manga-episode-card{
  border:1px solid transparent !important;
  background:
    linear-gradient(180deg, rgba(5,9,26,.95) 0%, rgba(3,5,16,.96) 58%, rgba(2,3,10,.98) 100%) padding-box,
    conic-gradient(
      from 220deg,
      rgba(0,232,255,.86) 0deg,
      rgba(72,111,255,.66) 58deg,
      rgba(255,63,174,.92) 130deg,
      rgba(255,47,134,.90) 205deg,
      rgba(148,69,255,.54) 280deg,
      rgba(0,232,255,.78) 340deg,
      rgba(0,232,255,.86) 360deg
    ) border-box !important;
  box-shadow:
    0 -2px 18px rgba(255,63,174,.22),
    0 0 22px rgba(0,232,255,.14),
    0 16px 30px rgba(0,0,0,.54),
    inset 0 1px 0 rgba(255,255,255,.07),
    inset 0 -22px 32px rgba(0,0,0,.18) !important;
}

body.theme-shinjuku .home-favorites-card,
body.theme-shinjuku .kana-tab-card{
  background:
    radial-gradient(circle at 50% 0%, rgba(255,47,134,.13), transparent 44%) padding-box,
    linear-gradient(180deg, rgba(5,9,26,.95), rgba(2,3,12,.98)) padding-box,
    conic-gradient(
      from 230deg,
      rgba(255,63,174,.88),
      rgba(0,232,255,.78),
      rgba(60,102,255,.42),
      rgba(255,63,174,.82)
    ) border-box !important;
  box-shadow:
    0 -2px 24px rgba(255,63,174,.25),
    0 0 24px rgba(0,232,255,.16),
    0 18px 36px rgba(0,0,0,.58),
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -26px 34px rgba(0,0,0,.20) !important;
}

body.theme-shinjuku .mode-card,
body.theme-shinjuku .lvl-btn{
  background:
    radial-gradient(circle at 50% 0%, rgba(0,232,255,.12), transparent 42%) padding-box,
    linear-gradient(180deg, rgba(6,12,30,.92) 0%, rgba(3,5,15,.95) 62%, rgba(2,3,10,.98) 100%) padding-box,
    conic-gradient(
      from 210deg,
      rgba(0,232,255,.78),
      rgba(68,111,255,.58),
      rgba(255,63,174,.58),
      rgba(20,33,86,.22),
      rgba(0,232,255,.72)
    ) border-box !important;
}

body.theme-shinjuku .mode-card.sel,
body.theme-shinjuku .lvl-btn.sel,
body.theme-shinjuku .theme-option.active{
  background:
    radial-gradient(circle at 50% 20%, rgba(255,47,134,.24), transparent 56%) padding-box,
    linear-gradient(180deg, rgba(18,12,34,.94) 0%, rgba(6,5,18,.97) 66%, rgba(2,3,10,.98) 100%) padding-box,
    conic-gradient(
      from 225deg,
      rgba(255,63,174,.98),
      rgba(0,232,255,.72),
      rgba(127,80,255,.70),
      rgba(255,47,134,.98)
    ) border-box !important;
  box-shadow:
    0 -2px 22px rgba(255,63,174,.42),
    0 0 30px rgba(255,47,134,.26),
    0 0 22px rgba(0,232,255,.18),
    0 18px 36px rgba(0,0,0,.58),
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -24px 36px rgba(0,0,0,.18) !important;
}

body.theme-shinjuku .mode-card:hover,
body.theme-shinjuku .lvl-btn:hover,
body.theme-shinjuku .theme-option:hover{
  box-shadow:
    0 -2px 22px rgba(255,63,174,.34),
    0 0 28px rgba(0,232,255,.22),
    0 18px 34px rgba(0,0,0,.58),
    inset 0 1px 0 rgba(255,255,255,.08) !important;
}

body.theme-shinjuku .section-title::after{
  background:
    linear-gradient(90deg, rgba(0,232,255,.72), rgba(255,63,174,.52), rgba(0,232,255,.22)) !important;
  box-shadow:
    0 0 10px rgba(0,232,255,.18),
    0 0 14px rgba(255,63,174,.13) !important;
}

/* =========================================
   SHINJUKU RAIN GLASS FINISH
   Solo Shinjuku: testo kana cyan, riflessi alto-sinistra e luci pioggia.
========================================= */

body.theme-shinjuku{
  background:
    radial-gradient(circle at 14% 20%, rgba(255,47,134,.16), transparent 26%),
    radial-gradient(circle at 88% 22%, rgba(0,232,255,.13), transparent 25%),
    radial-gradient(ellipse at 18% 92%, rgba(255,47,134,.18), transparent 34%),
    radial-gradient(ellipse at 78% 88%, rgba(0,232,255,.16), transparent 36%),
    linear-gradient(180deg, #01030a 0%, #02030a 48%, #05020a 100%) !important;
}

body.theme-shinjuku::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 11% 34%, rgba(255,47,134,.20), transparent 15%),
    radial-gradient(circle at 92% 30%, rgba(0,232,255,.18), transparent 18%),
    radial-gradient(ellipse at 30% 78%, rgba(255,47,134,.18), transparent 22%),
    radial-gradient(ellipse at 73% 74%, rgba(0,232,255,.16), transparent 24%),
    repeating-linear-gradient(112deg, rgba(255,255,255,.050) 0 1px, transparent 1px 18px),
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(0,0,0,.24));
  opacity:.58;
  mix-blend-mode:screen;
  filter:blur(.35px) saturate(122%);
}

body.theme-shinjuku::after{
  content:"";
  position:fixed;
  inset:-5%;
  z-index:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,47,134,.12), transparent 18%),
    radial-gradient(circle at 79% 16%, rgba(0,232,255,.12), transparent 19%),
    linear-gradient(105deg, transparent 0 44%, rgba(255,255,255,.045) 44.4% 44.8%, transparent 45.3%),
    repeating-linear-gradient(102deg, transparent 0 22px, rgba(255,255,255,.036) 23px, transparent 25px),
    linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.38));
  opacity:.42;
  backdrop-filter:blur(1.6px) saturate(128%);
  -webkit-backdrop-filter:blur(1.6px) saturate(128%);
}

body.theme-shinjuku #wrap::before,
body.theme-shinjuku #wrap::after{
  content:none !important;
  display:none !important;
}

body.theme-shinjuku .kana-tab-card .mc-name{
  color:var(--sh-cyan) !important;
  text-shadow:
    0 0 10px rgba(0,232,255,.45),
    0 0 18px rgba(0,232,255,.22) !important;
}

body.theme-shinjuku .home-favorites-card,
body.theme-shinjuku .kana-tab-card,
body.theme-shinjuku .kana-intro-card,
body.theme-shinjuku .kana-board,
body.theme-shinjuku .lvl-btn,
body.theme-shinjuku .mode-card,
body.theme-shinjuku .grammar-mode-btn,
body.theme-shinjuku .opt-box,
body.theme-shinjuku .pool-info,
body.theme-shinjuku .home-favorites-toggle,
body.theme-shinjuku .q-card,
body.theme-shinjuku .favorites-panel,
body.theme-shinjuku .print-fav-hero,
body.theme-shinjuku .print-fav-card,
body.theme-shinjuku .manga-hero-card,
body.theme-shinjuku .manga-episode-card{
  position:relative;
  overflow:hidden;
}

body.theme-shinjuku .home-favorites-card::before,
body.theme-shinjuku .kana-tab-card::before,
body.theme-shinjuku .kana-intro-card::before,
body.theme-shinjuku .kana-board::before,
body.theme-shinjuku .lvl-btn::before,
body.theme-shinjuku .mode-card::before,
body.theme-shinjuku .grammar-mode-btn::before,
body.theme-shinjuku .opt-box::before,
body.theme-shinjuku .q-card::before,
body.theme-shinjuku .manga-hero-card::before,
body.theme-shinjuku .manga-episode-card::before{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  inset:0 !important;
  pointer-events:none;
  opacity:.24 !important;
  border-radius:inherit;
  background:
    radial-gradient(ellipse at 19% 7%, rgba(0,232,255,.24), transparent 27%),
    radial-gradient(ellipse at 10% 13%, rgba(255,47,134,.13), transparent 25%),
    linear-gradient(132deg, rgba(255,255,255,.075) 0%, rgba(255,255,255,.018) 18%, transparent 37%) !important;
  transform:skewX(-8deg);
  transition:opacity .2s ease;
}

body.theme-shinjuku .mode-card:hover::before,
body.theme-shinjuku .lvl-btn:hover::before,
body.theme-shinjuku .kana-tab-card:hover::before{
  opacity:.31 !important;
}

body.theme-shinjuku .mode-card.sel::before,
body.theme-shinjuku .lvl-btn.sel::before{
  opacity:.20 !important;
}

@media (max-width:760px){
  body.theme-shinjuku::after{
    display:block !important;
    opacity:.28;
  }
}

/* =========================================
   SHINJUKU HEADER ICON CLEANUP
   Rimuove solo i riquadri luminosi dei pulsanti header, icone intatte.
========================================= */

body.theme-shinjuku .header-icon-btn,
body.theme-shinjuku .header-menu-btn,
body.theme-shinjuku .header-search-btn,
body.theme-shinjuku .header-print-favorites{
  background:transparent !important;
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  filter:none !important;
}

body.theme-shinjuku .header-icon-btn::before,
body.theme-shinjuku .header-icon-btn::after,
body.theme-shinjuku .header-menu-btn::before,
body.theme-shinjuku .header-menu-btn::after,
body.theme-shinjuku .header-search-btn::before,
body.theme-shinjuku .header-search-btn::after,
body.theme-shinjuku .header-print-favorites::before,
body.theme-shinjuku .header-print-favorites::after{
  content:none !important;
  display:none !important;
  opacity:0 !important;
  box-shadow:none !important;
}

body.theme-shinjuku .header-icon-btn:hover,
body.theme-shinjuku .header-menu-btn:hover,
body.theme-shinjuku .header-search-btn:hover,
body.theme-shinjuku .header-print-favorites:hover{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  filter:none !important;
}

body.theme-shinjuku .header-menu-btn{
  background:linear-gradient(145deg,rgba(0,232,255,.10),rgba(255,47,134,.08)) !important;
  border:1px solid rgba(0,232,255,.32) !important;
  border-radius:14px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 10px 24px rgba(0,0,0,.36),
    0 0 14px rgba(0,232,255,.08) !important;
}
body.theme-shinjuku .header-menu-btn:hover,
body.theme-shinjuku .header-menu-btn[aria-expanded="true"]{
  background:linear-gradient(145deg,rgba(0,232,255,.16),rgba(255,47,134,.13)) !important;
  border-color:rgba(255,47,134,.44) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 12px 30px rgba(0,0,0,.42),
    0 0 18px rgba(0,232,255,.13),
    0 0 18px rgba(255,47,134,.08) !important;
}


/* AUTH GATE PROGRESS LOGIN */
.auth-gate{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  padding:24px;
  overflow:auto;
  background:rgba(18,13,8,.55);
  backdrop-filter:blur(14px) saturate(120%);
  -webkit-backdrop-filter:blur(14px) saturate(120%);
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.auth-card{
  width:min(520px,100%);
  max-height:calc(100dvh - 48px);
  padding:30px;
  border-radius:24px;
  background:linear-gradient(145deg,rgba(255,252,244,.96),rgba(245,235,214,.92));
  border:1px solid rgba(120,86,58,.22);
  box-shadow:0 24px 70px rgba(38,24,10,.24);
  color:#2b170f;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.auth-card h2{margin:8px 0 10px;font-size:clamp(30px,6vw,44px);line-height:1.02}
.auth-card p{margin:0 0 22px;color:#7a5c4c;line-height:1.55}
.auth-field{display:grid;gap:8px;margin:14px 0;font-weight:700;color:#8f231f}
.auth-field span{font-size:12px;letter-spacing:.16em;text-transform:uppercase}
.auth-field input{
  width:100%;
  border:1px solid rgba(143,35,31,.22);
  border-radius:16px;
  padding:14px 16px;
  font:inherit;
  color:inherit;
  background:rgba(255,255,255,.72);
  outline:none;
}
.auth-field input:focus{border-color:#9d1d1d;box-shadow:0 0 0 4px rgba(157,29,29,.10)}

.auth-password-wrap{
  position:relative;
  display:flex;
  align-items:center;
}
.auth-password-wrap input{
  width:100%;
  padding-right:56px;
}
.auth-password-toggle{
  position:absolute;
  right:8px;
  width:40px;
  height:40px;
  border:0;
  border-radius:999px;
  background:rgba(143,35,31,.08);
  color:#8f231f;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition:transform .16s ease,background .16s ease,color .16s ease;
}
.auth-password-toggle:hover{
  background:rgba(143,35,31,.14);
  transform:translateY(-1px);
}
.auth-password-toggle:active{transform:scale(.96)}
.auth-password-toggle svg{
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.auth-password-toggle .eye-slash{display:none}
.auth-password-toggle.is-visible .eye-open{display:none}
.auth-password-toggle.is-visible .eye-slash{display:block}
body.theme-carbon-fire .auth-password-toggle,
body.theme-dark-base .auth-password-toggle,
body.theme-carbon-flat .auth-password-toggle,
body.theme-shinjuku .auth-password-toggle{
  background:rgba(255,55,95,.10);
  color:#ff375f;
}
body.theme-carbon-fire .auth-password-toggle:hover,
body.theme-dark-base .auth-password-toggle:hover,
body.theme-carbon-flat .auth-password-toggle:hover,
body.theme-shinjuku .auth-password-toggle:hover{
  background:rgba(255,55,95,.18);
}

.auth-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:18px}
.auth-actions button,.auth-offline,.auth-reset{
  border-radius:999px;
  min-height:48px;
  padding:0 18px;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}
.auth-actions button:first-child{border:0;background:#931918;color:#fff;box-shadow:0 14px 30px rgba(147,25,24,.22)}
.auth-actions button:last-child,.auth-offline,.auth-reset{border:1px solid rgba(147,25,24,.35);background:transparent;color:#931918}
.auth-actions button:disabled,.auth-reset:disabled{
  opacity:.58;
  cursor:progress;
}
.auth-reset{width:100%;margin-top:12px}
.auth-offline{width:100%;margin-top:12px}
.auth-status,.auth-menu-status{margin-top:14px;color:#7a5c4c;font-size:14px;line-height:1.35}
.auth-status.error{color:#b3261e}
.account-toggle-option{
  justify-content:flex-start;
  gap:10px;
}
.account-toggle-label{flex:1}
.account-toggle-state{
  color:#7a5c4c;
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.audio-swatch{background:linear-gradient(135deg,#5b6f8f,#9d1d1d)}
.sensei-swatch{background:linear-gradient(135deg,#263d70 0%,#c58f21 52%,#9f1d1d 100%)}
.effects-toggle-control{
  position:relative;
  width:42px;
  height:24px;
  flex:0 0 auto;
}
.effects-toggle-control input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
  z-index:2;
}
.effects-toggle-control span{
  position:absolute;
  inset:0;
  pointer-events:none;
  border-radius:999px;
  background:rgba(92,61,46,.18);
  border:1px solid rgba(92,61,46,.18);
  transition:background .18s ease,border-color .18s ease;
}
.effects-toggle-control span::after{
  content:"";
  position:absolute;
  width:18px;
  height:18px;
  left:2px;
  top:2px;
  border-radius:50%;
  background:#fff8ec;
  box-shadow:0 2px 6px rgba(38,24,10,.22);
  transition:transform .18s ease,background .18s ease;
}
.effects-toggle-control input:checked + span{
  background:rgba(147,25,24,.22);
  border-color:rgba(147,25,24,.38);
}
.effects-toggle-control input:checked + span::after{
  transform:translateX(18px);
  background:#931918;
}
.account-toggle-option.is-on .effects-toggle-control span{
  background:rgba(147,25,24,.22);
  border-color:rgba(147,25,24,.38);
}
.account-toggle-option.is-on .effects-toggle-control span::after{
  transform:translateX(18px);
  background:#931918;
}
.profile-card{
  width:min(640px,100%);
  max-height:calc(100dvh - 48px);
}
.profile-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin:18px 0 4px;
}
.profile-stat{
  min-height:96px;
  border:1px solid rgba(147,25,24,.20);
  border-radius:16px;
  padding:14px 16px;
  background:rgba(255,255,255,.48);
}
.profile-stat span{
  display:block;
  margin-bottom:8px;
  color:#8f231f;
  font-size:12px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.profile-stat strong{
  display:block;
  color:#2b170f;
  font-size:20px;
  line-height:1.15;
  word-break:break-word;
}
.profile-section{
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid rgba(147,25,24,.16);
}
.profile-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
  color:#6f3b2a;
  font-size:13px;
  font-weight:900;
}
.profile-section-head strong{
  color:#2b170f;
  font-size:14px;
  text-align:right;
}
.sensei-profile-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.sensei-profile-field{
  display:grid;
  gap:6px;
  padding:10px;
  border:1px solid rgba(147,25,24,.16);
  border-radius:12px;
  background:rgba(255,255,255,.56);
}
.sensei-profile-field span{
  color:#8b2d27;
  font-size:11px;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.sensei-profile-field select{
  width:100%;
  min-width:0;
  border:0;
  background:transparent;
  color:#2b170f;
  font:700 13px/1.2 var(--font);
  outline:none;
}
.sensei-onboarding-card{width:min(760px,100%)}
.sensei-onboarding-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin:16px 0 12px;
}
.sensei-goal-options{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}
.sensei-goal-choice{
  display:grid;
  align-content:start;
  gap:6px;
  min-height:132px;
  padding:11px;
  border:1px solid rgba(147,25,24,.16);
  border-radius:14px;
  background:rgba(255,255,255,.44);
  color:#2b170f;
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.sensei-goal-choice.active{
  border-color:rgba(147,25,24,.42);
  background:rgba(255,250,239,.72);
  box-shadow:0 10px 24px rgba(147,25,24,.10);
}
.sensei-goal-choice strong{
  color:#2b170f;
  font-size:13px;
  line-height:1.15;
}
.sensei-goal-choice em{
  color:#7a5c4c;
  font-size:11px;
  font-style:normal;
  font-weight:800;
  line-height:1.3;
}
.sensei-goal-focus{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
}
.sensei-goal-focus span{
  padding:3px 6px;
  border-radius:999px;
  background:rgba(147,25,24,.08);
  color:#8f231f;
  font-size:10px;
  font-weight:900;
}
.sensei-plan-card{
  display:grid;
  gap:10px;
  margin-top:12px;
  padding:12px;
  border:1px solid rgba(147,25,24,.18);
  border-radius:16px;
  background:rgba(255,255,255,.42);
}
.sensei-plan-top{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:6px;
}
.sensei-plan-top span,
.sensei-plan-primary span{
  display:block;
  color:#8f231f;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.sensei-plan-top strong{
  display:block;
  color:#2b170f;
  font-size:16px;
  line-height:1.2;
}
.sensei-plan-top em{
  color:#7a5c4c;
  font-size:12px;
  font-style:normal;
  line-height:1.35;
}
.sensei-direction-card{
  display:grid;
  gap:6px;
  padding:10px;
  border:1px solid rgba(147,25,24,.16);
  border-radius:14px;
  background:rgba(255,250,239,.54);
}
.sensei-direction-card span{
  color:#8f231f;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.sensei-direction-card strong{
  color:#2b170f;
  font-size:15px;
  line-height:1.25;
}
.sensei-direction-card div{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.sensei-direction-card div span{
  padding:5px 8px;
  border-radius:999px;
  background:rgba(147,25,24,.08);
  letter-spacing:0;
  text-transform:none;
}
.sensei-base-advice{
  display:grid;
  gap:7px;
  padding:12px;
  border:1px solid rgba(147,25,24,.20);
  border-radius:16px;
  background:
    linear-gradient(135deg,rgba(255,252,245,.74),rgba(255,246,226,.54)),
    radial-gradient(circle at 8% 20%,rgba(197,143,33,.12),transparent 34%);
}
.sensei-base-advice > span,
.sensei-exercise-block > span{
  color:#8f231f;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.sensei-base-advice strong{
  color:#2b170f;
  font-size:14px;
  line-height:1.38;
}
.sensei-base-advice div{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.sensei-base-advice div span{
  padding:5px 8px;
  border-radius:999px;
  background:rgba(147,25,24,.08);
  color:#8f231f;
  font-size:11px;
  font-weight:900;
}
.sensei-exercise-block{
  display:grid;
  gap:8px;
}
.sensei-exercise-block ol{
  display:grid;
  gap:7px;
  margin:0;
  padding:0;
  list-style:none;
}
.sensei-exercise-block button{
  width:100%;
  display:grid;
  gap:4px;
  padding:10px 12px;
  border:1px solid rgba(147,25,24,.16);
  border-radius:14px;
  background:rgba(255,255,255,.48);
  color:#2b170f;
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.sensei-exercise-block button:hover{
  border-color:rgba(147,25,24,.34);
  background:rgba(255,250,239,.74);
}
.sensei-exercise-block button strong{
  color:#2b170f;
  font-size:13px;
  line-height:1.22;
}
.sensei-exercise-block button span{
  color:#7a5c4c;
  font-size:12px;
  font-weight:800;
  line-height:1.35;
}
.zero-path-card{
  display:grid;
  gap:10px;
  padding:12px;
  border:1px solid rgba(147,25,24,.18);
  border-radius:16px;
  background:rgba(255,255,255,.42);
}
.zero-path-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.zero-path-head span{
  display:block;
  color:#8f231f;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.zero-path-head strong{
  display:block;
  color:#2b170f;
  font-size:15px;
  line-height:1.2;
}
.zero-path-head button{
  min-height:36px;
  padding:0 14px;
  border:0;
  border-radius:999px;
  background:#931918;
  color:#fff8ec;
  font:inherit;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}
.zero-path-track{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.zero-day-card{
  display:grid;
  gap:4px;
  min-height:88px;
  padding:10px;
  border:1px solid rgba(147,25,24,.14);
  border-radius:14px;
  background:rgba(255,255,255,.48);
  color:#2b170f;
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.zero-day-card.active{
  border-color:rgba(147,25,24,.42);
  background:rgba(255,250,239,.74);
}
.zero-day-card.done{
  border-color:rgba(46,138,88,.28);
  background:rgba(230,248,236,.48);
}
.zero-day-card span{
  color:#8f231f;
  font-size:11px;
  font-weight:900;
}
.zero-day-card strong{
  color:#2b170f;
  font-size:13px;
  line-height:1.2;
}
.zero-day-card em{
  color:#7a5c4c;
  font-size:11px;
  font-style:normal;
  font-weight:800;
}
.zero-start-card{width:min(640px,100%)}
.sensei-level-guard-card{width:min(560px,100%)}
.sensei-level-guard-detail{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.sensei-level-guard-detail span{
  padding:7px 10px;
  border:1px solid rgba(147,25,24,.16);
  border-radius:999px;
  background:rgba(255,255,255,.52);
  color:#8f231f;
  font-size:12px;
  font-weight:900;
}
.zero-start-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.zero-close{
  width:38px;
  height:38px;
  border:1px solid rgba(147,25,24,.18);
  border-radius:999px;
  background:rgba(255,255,255,.46);
  color:#931918;
  font:900 24px/1 var(--font);
  cursor:pointer;
}
.zero-step{
  display:grid;
  gap:7px;
  margin-top:12px;
  padding:12px;
  border:1px solid rgba(147,25,24,.16);
  border-radius:16px;
  background:rgba(255,255,255,.42);
}
.zero-step span{
  color:#8f231f;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.zero-step p{
  margin:0;
  color:#7a5c4c;
  font-size:14px;
  line-height:1.45;
}
.zero-step strong{
  color:#2b170f;
  font-size:24px;
  line-height:1.2;
}
.zero-choice-list{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.zero-choice-list button{
  min-height:48px;
  border:1px solid rgba(147,25,24,.16);
  border-radius:14px;
  background:rgba(255,255,255,.58);
  color:#2b170f;
  font:900 18px/1.2 var(--font-jp);
  cursor:pointer;
}
.zero-choice-list button.correct{
  border-color:rgba(46,138,88,.48);
  background:rgba(230,248,236,.72);
}
.zero-choice-list button.wrong{
  border-color:rgba(147,25,24,.44);
  background:rgba(255,232,232,.66);
}
.zero-feedback{
  margin-top:12px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(46,138,88,.24);
  background:rgba(230,248,236,.54);
  color:#2e8a58;
  font-size:14px;
  font-weight:900;
  line-height:1.45;
}
.zero-feedback.wrong{
  border-color:rgba(147,25,24,.24);
  background:rgba(255,232,232,.56);
  color:#931918;
}
.sensei-priority-strip{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:6px;
}
.sensei-priority-chip{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-height:30px;
  padding:5px 7px;
  border:1px solid rgba(147,25,24,.14);
  border-radius:999px;
  background:rgba(255,255,255,.52);
  color:#6f3b2a;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sensei-priority-chip strong{
  color:#931918;
  font-size:10px;
}
.sensei-plan-primary{
  border:1px solid rgba(147,25,24,.16);
  border-radius:14px;
  padding:10px;
  background:rgba(255,250,239,.62);
}
.sensei-plan-primary strong{
  display:block;
  margin-top:4px;
  color:#2b170f;
  font-size:16px;
  line-height:1.2;
}
.sensei-plan-primary p{
  margin:5px 0 0;
  color:#7a5c4c;
  font-size:12px;
  line-height:1.35;
}
.sensei-plan-list{
  display:grid;
  gap:7px;
  margin:0;
  padding-left:22px;
}
.sensei-plan-list li{
  color:#931918;
  font-weight:900;
}
.sensei-plan-list strong{
  color:#2b170f;
}
.sensei-plan-list span{
  display:block;
  color:#7a5c4c;
  font-size:12px;
  font-weight:700;
  line-height:1.35;
}
.sensei-setup-link{
  width:100%;
  min-height:42px;
  margin-top:10px;
  border:1px solid rgba(147,25,24,.24);
  border-radius:999px;
  background:transparent;
  color:#931918;
  font:inherit;
  font-weight:900;
  cursor:pointer;
}
.profile-news-toggle{
  width:100%;
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid rgba(147,25,24,.22);
  border-radius:16px;
  padding:12px 14px;
  background:rgba(255,255,255,.46);
  color:#931918;
  font:inherit;
  font-weight:800;
  cursor:pointer;
  text-align:left;
}
.profile-news-toggle strong{
  color:#7a5c4c;
  font-size:13px;
}
.profile-news-list{display:grid;gap:10px;margin-top:10px}
.profile-news-list[hidden]{display:none}
.profile-news-item{
  border:1px solid rgba(147,25,24,.18);
  border-radius:16px;
  padding:14px;
  background:rgba(255,255,255,.38);
}
.profile-news-item span{
  display:block;
  margin-bottom:6px;
  color:#8f231f;
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.profile-news-item strong{display:block;color:#2b170f;font-size:18px}
.profile-news-item p{margin:6px 0 0}
.profile-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:18px;
}
.profile-actions button{
  border-radius:999px;
  min-height:48px;
  padding:0 18px;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}
.profile-actions button:first-child{border:0;background:#931918;color:#fff;box-shadow:0 14px 30px rgba(147,25,24,.22)}
.profile-actions button:last-child{border:1px solid rgba(147,25,24,.35);background:transparent;color:#931918}
.account-menu-btn{justify-content:flex-start}
.account-swatch{background:linear-gradient(135deg,#9d1d1d,#e0b65b)}
.account-swatch.logout{background:linear-gradient(135deg,#33251e,#9d1d1d)}
body.theme-carbon-fire .auth-gate,body.theme-dark-base .auth-gate,body.theme-carbon-flat .auth-gate,body.theme-shinjuku .auth-gate{background:rgba(0,0,0,.76)}
body.theme-carbon-fire .auth-card,body.theme-dark-base .auth-card,body.theme-carbon-flat .auth-card,body.theme-shinjuku .auth-card{
  background:linear-gradient(145deg,rgba(22,24,30,.98),rgba(6,7,10,.96));
  border-color:rgba(255,55,95,.30);
  color:#f6f6f8;
  box-shadow:0 24px 80px rgba(0,0,0,.55),0 0 26px rgba(255,55,95,.12);
}
body.theme-carbon-fire .auth-card p,body.theme-dark-base .auth-card p,body.theme-carbon-flat .auth-card p,body.theme-shinjuku .auth-card p,body.theme-carbon-fire .auth-status,body.theme-dark-base .auth-status,body.theme-carbon-flat .auth-status,body.theme-shinjuku .auth-status{color:#aeb3c0}
body.theme-carbon-fire .auth-field input,body.theme-dark-base .auth-field input,body.theme-carbon-flat .auth-field input,body.theme-shinjuku .auth-field input{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.12);color:#fff}
body.theme-carbon-fire .auth-actions button:first-child,body.theme-dark-base .auth-actions button:first-child,body.theme-carbon-flat .auth-actions button:first-child,body.theme-shinjuku .auth-actions button:first-child{background:#ff375f;color:#fff}
body.theme-carbon-fire .auth-actions button:last-child,body.theme-dark-base .auth-actions button:last-child,body.theme-carbon-flat .auth-actions button:last-child,body.theme-shinjuku .auth-actions button:last-child,body.theme-carbon-fire .auth-offline,body.theme-dark-base .auth-offline,body.theme-carbon-flat .auth-offline,body.theme-shinjuku .auth-offline,body.theme-carbon-fire .auth-reset,body.theme-dark-base .auth-reset,body.theme-carbon-flat .auth-reset,body.theme-shinjuku .auth-reset{border-color:rgba(255,55,95,.46);color:#ff5a78}
body.theme-carbon-fire .effects-toggle-control span,body.theme-dark-base .effects-toggle-control span,body.theme-carbon-flat .effects-toggle-control span,body.theme-shinjuku .effects-toggle-control span{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.12)}
body.theme-carbon-fire .effects-toggle-control span::after,body.theme-dark-base .effects-toggle-control span::after,body.theme-carbon-flat .effects-toggle-control span::after,body.theme-shinjuku .effects-toggle-control span::after{background:#aeb3c0}
body.theme-carbon-fire .effects-toggle-control input:checked + span,body.theme-dark-base .effects-toggle-control input:checked + span,body.theme-carbon-flat .effects-toggle-control input:checked + span,body.theme-shinjuku .effects-toggle-control input:checked + span{background:rgba(255,55,95,.20);border-color:rgba(255,55,95,.44)}
body.theme-carbon-fire .effects-toggle-control input:checked + span::after,body.theme-dark-base .effects-toggle-control input:checked + span::after,body.theme-carbon-flat .effects-toggle-control input:checked + span::after,body.theme-shinjuku .effects-toggle-control input:checked + span::after{background:#ff5a78}
body.theme-carbon-fire .account-toggle-state,body.theme-dark-base .account-toggle-state,body.theme-carbon-flat .account-toggle-state,body.theme-shinjuku .account-toggle-state{color:#aeb3c0}
body.theme-carbon-fire .profile-stat,body.theme-dark-base .profile-stat,body.theme-carbon-flat .profile-stat,body.theme-shinjuku .profile-stat{background:rgba(255,255,255,.05);border-color:rgba(255,55,95,.24)}
body.theme-carbon-fire .profile-stat span,body.theme-dark-base .profile-stat span,body.theme-carbon-flat .profile-stat span,body.theme-shinjuku .profile-stat span{color:#ff5a78}
body.theme-carbon-fire .profile-stat strong,body.theme-dark-base .profile-stat strong,body.theme-carbon-flat .profile-stat strong,body.theme-shinjuku .profile-stat strong{color:#fff}
body.theme-carbon-fire .profile-section,body.theme-dark-base .profile-section,body.theme-carbon-flat .profile-section,body.theme-shinjuku .profile-section{border-top-color:rgba(255,55,95,.20)}
body.theme-carbon-fire .profile-section-head,body.theme-dark-base .profile-section-head,body.theme-carbon-flat .profile-section-head,body.theme-shinjuku .profile-section-head{color:#ff5a78}
body.theme-carbon-fire .profile-section-head strong,body.theme-dark-base .profile-section-head strong,body.theme-carbon-flat .profile-section-head strong,body.theme-shinjuku .profile-section-head strong{color:#fff}
body.theme-carbon-fire .sensei-profile-field,body.theme-dark-base .sensei-profile-field,body.theme-carbon-flat .sensei-profile-field,body.theme-shinjuku .sensei-profile-field{background:rgba(255,255,255,.05);border-color:rgba(255,55,95,.24)}
body.theme-carbon-fire .sensei-profile-field span,body.theme-dark-base .sensei-profile-field span,body.theme-carbon-flat .sensei-profile-field span,body.theme-shinjuku .sensei-profile-field span{color:#ff5a78}
body.theme-carbon-fire .sensei-profile-field select,body.theme-dark-base .sensei-profile-field select,body.theme-carbon-flat .sensei-profile-field select,body.theme-shinjuku .sensei-profile-field select{color:#fff}
body.theme-carbon-fire .sensei-goal-choice,body.theme-dark-base .sensei-goal-choice,body.theme-carbon-flat .sensei-goal-choice,body.theme-shinjuku .sensei-goal-choice,body.theme-carbon-fire .sensei-plan-card,body.theme-dark-base .sensei-plan-card,body.theme-carbon-flat .sensei-plan-card,body.theme-shinjuku .sensei-plan-card{background:rgba(255,255,255,.05);border-color:rgba(255,55,95,.24)}
body.theme-carbon-fire .sensei-goal-choice.active,body.theme-dark-base .sensei-goal-choice.active,body.theme-carbon-flat .sensei-goal-choice.active,body.theme-shinjuku .sensei-goal-choice.active{background:rgba(255,55,95,.10);border-color:rgba(255,55,95,.46)}
body.theme-carbon-fire .sensei-goal-choice strong,body.theme-dark-base .sensei-goal-choice strong,body.theme-carbon-flat .sensei-goal-choice strong,body.theme-shinjuku .sensei-goal-choice strong{color:#fff}
body.theme-carbon-fire .sensei-goal-choice em,body.theme-dark-base .sensei-goal-choice em,body.theme-carbon-flat .sensei-goal-choice em,body.theme-shinjuku .sensei-goal-choice em{color:#aeb3c0}
body.theme-carbon-fire .sensei-goal-focus span,body.theme-dark-base .sensei-goal-focus span,body.theme-carbon-flat .sensei-goal-focus span,body.theme-shinjuku .sensei-goal-focus span{background:rgba(255,55,95,.14);color:#ff5a78}
body.theme-carbon-fire .sensei-plan-top span,body.theme-dark-base .sensei-plan-top span,body.theme-carbon-flat .sensei-plan-top span,body.theme-shinjuku .sensei-plan-top span,body.theme-carbon-fire .sensei-plan-primary span,body.theme-dark-base .sensei-plan-primary span,body.theme-carbon-flat .sensei-plan-primary span,body.theme-shinjuku .sensei-plan-primary span{color:#ff5a78}
body.theme-carbon-fire .sensei-plan-top strong,body.theme-dark-base .sensei-plan-top strong,body.theme-carbon-flat .sensei-plan-top strong,body.theme-shinjuku .sensei-plan-top strong,body.theme-carbon-fire .sensei-plan-primary strong,body.theme-dark-base .sensei-plan-primary strong,body.theme-carbon-flat .sensei-plan-primary strong,body.theme-shinjuku .sensei-plan-primary strong,body.theme-carbon-fire .sensei-plan-list strong,body.theme-dark-base .sensei-plan-list strong,body.theme-carbon-flat .sensei-plan-list strong,body.theme-shinjuku .sensei-plan-list strong{color:#fff}
body.theme-carbon-fire .sensei-plan-top em,body.theme-dark-base .sensei-plan-top em,body.theme-carbon-flat .sensei-plan-top em,body.theme-shinjuku .sensei-plan-top em,body.theme-carbon-fire .sensei-plan-primary p,body.theme-dark-base .sensei-plan-primary p,body.theme-carbon-flat .sensei-plan-primary p,body.theme-shinjuku .sensei-plan-primary p,body.theme-carbon-fire .sensei-plan-list span,body.theme-dark-base .sensei-plan-list span,body.theme-carbon-flat .sensei-plan-list span,body.theme-shinjuku .sensei-plan-list span{color:#aeb3c0}
body.theme-carbon-fire .sensei-direction-card,body.theme-dark-base .sensei-direction-card,body.theme-carbon-flat .sensei-direction-card,body.theme-shinjuku .sensei-direction-card,body.theme-carbon-fire .sensei-priority-chip,body.theme-dark-base .sensei-priority-chip,body.theme-carbon-flat .sensei-priority-chip,body.theme-shinjuku .sensei-priority-chip,body.theme-carbon-fire .sensei-plan-primary,body.theme-dark-base .sensei-plan-primary,body.theme-carbon-flat .sensei-plan-primary,body.theme-shinjuku .sensei-plan-primary{background:rgba(255,255,255,.06);border-color:rgba(255,55,95,.18);color:#d8dbe6}
body.theme-carbon-fire .sensei-direction-card span,body.theme-dark-base .sensei-direction-card span,body.theme-carbon-flat .sensei-direction-card span,body.theme-shinjuku .sensei-direction-card span,body.theme-carbon-fire .sensei-direction-card div span,body.theme-dark-base .sensei-direction-card div span,body.theme-carbon-flat .sensei-direction-card div span,body.theme-shinjuku .sensei-direction-card div span{color:#ff5a78}
body.theme-carbon-fire .sensei-direction-card strong,body.theme-dark-base .sensei-direction-card strong,body.theme-carbon-flat .sensei-direction-card strong,body.theme-shinjuku .sensei-direction-card strong{color:#fff}
body.theme-carbon-fire .sensei-base-advice,body.theme-dark-base .sensei-base-advice,body.theme-carbon-flat .sensei-base-advice,body.theme-shinjuku .sensei-base-advice,body.theme-carbon-fire .sensei-exercise-block button,body.theme-dark-base .sensei-exercise-block button,body.theme-carbon-flat .sensei-exercise-block button,body.theme-shinjuku .sensei-exercise-block button{background:rgba(255,255,255,.06);border-color:rgba(255,55,95,.20)}
body.theme-carbon-fire .sensei-base-advice > span,body.theme-dark-base .sensei-base-advice > span,body.theme-carbon-flat .sensei-base-advice > span,body.theme-shinjuku .sensei-base-advice > span,body.theme-carbon-fire .sensei-exercise-block > span,body.theme-dark-base .sensei-exercise-block > span,body.theme-carbon-flat .sensei-exercise-block > span,body.theme-shinjuku .sensei-exercise-block > span{color:#ff5a78}
body.theme-carbon-fire .sensei-base-advice strong,body.theme-dark-base .sensei-base-advice strong,body.theme-carbon-flat .sensei-base-advice strong,body.theme-shinjuku .sensei-base-advice strong,body.theme-carbon-fire .sensei-exercise-block button strong,body.theme-dark-base .sensei-exercise-block button strong,body.theme-carbon-flat .sensei-exercise-block button strong,body.theme-shinjuku .sensei-exercise-block button strong{color:#fff}
body.theme-carbon-fire .sensei-base-advice div span,body.theme-dark-base .sensei-base-advice div span,body.theme-carbon-flat .sensei-base-advice div span,body.theme-shinjuku .sensei-base-advice div span{background:rgba(255,55,95,.14);color:#ff5a78}
body.theme-carbon-fire .sensei-exercise-block button span,body.theme-dark-base .sensei-exercise-block button span,body.theme-carbon-flat .sensei-exercise-block button span,body.theme-shinjuku .sensei-exercise-block button span{color:#aeb3c0}
body.theme-carbon-fire .zero-path-card,body.theme-dark-base .zero-path-card,body.theme-carbon-flat .zero-path-card,body.theme-shinjuku .zero-path-card,body.theme-carbon-fire .zero-day-card,body.theme-dark-base .zero-day-card,body.theme-carbon-flat .zero-day-card,body.theme-shinjuku .zero-day-card,body.theme-carbon-fire .zero-step,body.theme-dark-base .zero-step,body.theme-carbon-flat .zero-step,body.theme-shinjuku .zero-step,body.theme-carbon-fire .zero-choice-list button,body.theme-dark-base .zero-choice-list button,body.theme-carbon-flat .zero-choice-list button,body.theme-shinjuku .zero-choice-list button{background:rgba(255,255,255,.06);border-color:rgba(255,55,95,.18)}
body.theme-carbon-fire .zero-path-head span,body.theme-dark-base .zero-path-head span,body.theme-carbon-flat .zero-path-head span,body.theme-shinjuku .zero-path-head span,body.theme-carbon-fire .zero-day-card span,body.theme-dark-base .zero-day-card span,body.theme-carbon-flat .zero-day-card span,body.theme-shinjuku .zero-day-card span,body.theme-carbon-fire .zero-step span,body.theme-dark-base .zero-step span,body.theme-carbon-flat .zero-step span,body.theme-shinjuku .zero-step span{color:#ff5a78}
body.theme-carbon-fire .zero-path-head strong,body.theme-dark-base .zero-path-head strong,body.theme-carbon-flat .zero-path-head strong,body.theme-shinjuku .zero-path-head strong,body.theme-carbon-fire .zero-day-card strong,body.theme-dark-base .zero-day-card strong,body.theme-carbon-flat .zero-day-card strong,body.theme-shinjuku .zero-day-card strong,body.theme-carbon-fire .zero-step strong,body.theme-dark-base .zero-step strong,body.theme-carbon-flat .zero-step strong,body.theme-shinjuku .zero-step strong,body.theme-carbon-fire .zero-choice-list button,body.theme-dark-base .zero-choice-list button,body.theme-carbon-flat .zero-choice-list button,body.theme-shinjuku .zero-choice-list button{color:#fff}
body.theme-carbon-fire .zero-day-card em,body.theme-dark-base .zero-day-card em,body.theme-carbon-flat .zero-day-card em,body.theme-shinjuku .zero-day-card em,body.theme-carbon-fire .zero-step p,body.theme-dark-base .zero-step p,body.theme-carbon-flat .zero-step p,body.theme-shinjuku .zero-step p{color:#aeb3c0}
body.theme-carbon-fire .zero-close,body.theme-dark-base .zero-close,body.theme-carbon-flat .zero-close,body.theme-shinjuku .zero-close{background:rgba(255,255,255,.08);border-color:rgba(255,55,95,.28);color:#ff5a78}
body.theme-carbon-fire .sensei-level-guard-detail span,body.theme-dark-base .sensei-level-guard-detail span,body.theme-carbon-flat .sensei-level-guard-detail span,body.theme-shinjuku .sensei-level-guard-detail span{background:rgba(255,255,255,.06);border-color:rgba(255,55,95,.20);color:#ff5a78}
body.theme-carbon-fire .sensei-priority-chip strong,body.theme-dark-base .sensei-priority-chip strong,body.theme-carbon-flat .sensei-priority-chip strong,body.theme-shinjuku .sensei-priority-chip strong,body.theme-carbon-fire .sensei-plan-list li,body.theme-dark-base .sensei-plan-list li,body.theme-carbon-flat .sensei-plan-list li,body.theme-shinjuku .sensei-plan-list li,body.theme-carbon-fire .sensei-setup-link,body.theme-dark-base .sensei-setup-link,body.theme-carbon-flat .sensei-setup-link,body.theme-shinjuku .sensei-setup-link{color:#ff5a78}
body.theme-carbon-fire .sensei-setup-link,body.theme-dark-base .sensei-setup-link,body.theme-carbon-flat .sensei-setup-link,body.theme-shinjuku .sensei-setup-link{border-color:rgba(255,55,95,.46);background:transparent}
body.theme-carbon-fire .profile-news-toggle,body.theme-dark-base .profile-news-toggle,body.theme-carbon-flat .profile-news-toggle,body.theme-shinjuku .profile-news-toggle,body.theme-carbon-fire .profile-news-item,body.theme-dark-base .profile-news-item,body.theme-carbon-flat .profile-news-item,body.theme-shinjuku .profile-news-item{background:rgba(255,255,255,.05);border-color:rgba(255,55,95,.24);color:#ff5a78}
body.theme-carbon-fire .profile-news-toggle strong,body.theme-dark-base .profile-news-toggle strong,body.theme-carbon-flat .profile-news-toggle strong,body.theme-shinjuku .profile-news-toggle strong{color:#aeb3c0}
body.theme-carbon-fire .profile-news-item span,body.theme-dark-base .profile-news-item span,body.theme-carbon-flat .profile-news-item span,body.theme-shinjuku .profile-news-item span{color:#ff5a78}
body.theme-carbon-fire .profile-news-item strong,body.theme-dark-base .profile-news-item strong,body.theme-carbon-flat .profile-news-item strong,body.theme-shinjuku .profile-news-item strong{color:#fff}
body.theme-carbon-fire .profile-actions button:first-child,body.theme-dark-base .profile-actions button:first-child,body.theme-carbon-flat .profile-actions button:first-child,body.theme-shinjuku .profile-actions button:first-child{background:#ff375f;color:#fff}
body.theme-carbon-fire .profile-actions button:last-child,body.theme-dark-base .profile-actions button:last-child,body.theme-carbon-flat .profile-actions button:last-child,body.theme-shinjuku .profile-actions button:last-child{border-color:rgba(255,55,95,.46);color:#ff5a78;background:transparent}
@media(max-width:860px){.sensei-goal-options,.zero-path-track{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.auth-card{padding:24px 20px}.auth-actions,.profile-grid,.profile-actions,.sensei-profile-grid,.sensei-onboarding-grid,.sensei-goal-options,.zero-path-track,.zero-choice-list{grid-template-columns:1fr}.sensei-priority-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-section-head,.zero-path-head{align-items:flex-start;flex-direction:column}}

.journey-a11y-text{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}
.journey-widget .journey-trigger{
  width:170px;
  height:75px;
  min-height:75px;
  display:block;
  padding:0;
  border:0;
  border-radius:18px;
  background:transparent;
  box-shadow:none;
  overflow:visible;
}
.journey-widget .journey-trigger:hover,
.journey-widget .journey-trigger[aria-expanded="true"]{
  transform:translateY(-1px);
  box-shadow:none;
}
.journey-trigger-image{
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  pointer-events:none;
  filter:drop-shadow(0 7px 10px rgba(92,61,46,.14));
}
.journey-widget .journey-card{
  position:fixed;
  z-index:70;
  top:92px;
  left:50%;
  width:min(94vw,1632px);
  max-height:calc(100vh - 112px);
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  overflow:auto;
  overscroll-behavior:contain;
  touch-action:pan-x pan-y;
  -webkit-overflow-scrolling:touch;
}
.journey-panel-bitmap{
  position:relative;
  width:100%;
}
.journey-panel-image{
  width:100%;
  height:auto;
  display:block;
  pointer-events:none;
  user-select:none;
}
.journey-panel-continue-hit{
  position:absolute;
  left:74.6%;
  top:78.2%;
  width:22.8%;
  height:15.5%;
  border:0;
  border-radius:18px;
  background:transparent;
  cursor:pointer;
}
.journey-panel-continue-hit:focus-visible{
  outline:3px solid rgba(139,26,26,.72);
  outline-offset:3px;
}

@media (max-width:760px){
  .journey-card{
    top:92px;
    width:calc(100vw - 24px);
    max-height:calc(100vh - 108px);
    padding:14px;
    border-radius:18px;
  }
  .journey-card-main{
    grid-template-columns:1fr;
    gap:14px;
  }
  .journey-map-panel{
    min-height:250px;
  }
  .journey-map-art{
    min-height:240px;
  }
  .journey-japan-shape{
    left:50%;
    top:18px;
    transform:translateX(-50%) scale(.9);
    transform-origin:center top;
  }
  .journey-fuji{
    left:28px;
    top:34px;
    width:104px;
    height:74px;
  }
}

@media (max-width:520px){
  .app-header{
    grid-template-columns:minmax(0,1fr) 168px !important;
    min-height:142px !important;
  }
  .header-side{
    width:168px !important;
    max-width:168px !important;
  }
  .header-kanji{
    max-width:168px !important;
  }
  .header-side .header-actions,
  .header-actions{
    width:168px !important;
    max-width:168px !important;
    gap:4px !important;
  }
  .journey-trigger{
    width:52px;
    min-width:52px;
    min-height:38px;
    height:38px;
    grid-template-columns:34px 8px;
    gap:2px;
    padding:3px 4px;
    border-radius:14px;
  }
  .journey-trigger-copy{
    display:none;
  }
  .journey-trigger-map{
    width:34px;
    height:28px;
    border-radius:9px;
  }
  .journey-map-island{
    left:8px;
    top:3px;
    width:17px;
    height:21px;
  }
  .journey-map-route{
    left:10px;
    top:8px;
    width:17px;
    height:13px;
    border-width:2px;
  }
  .journey-map-pin{
    left:17px;
    top:11px;
    width:9px;
    height:9px;
  }
  .journey-map-pin::after{
    inset:3px;
  }
  .journey-trigger-arrow{
    font-size:24px;
  }
  .journey-title{
    font-size:32px;
  }
  .journey-card{
    top:86px;
  }
}

@media (max-width:760px){
  .journey-widget .journey-card{
    width:calc(100vw - 18px);
    top:86px;
    max-height:calc(100vh - 98px);
    overflow:auto;
  }
}

@media (max-width:520px){
  .journey-widget .journey-trigger{
    width:52px;
    height:38px;
    min-height:38px;
    border-radius:11px;
    overflow:hidden;
  }
  .journey-trigger-image{
    width:86px;
    max-width:none;
    height:38px;
    object-fit:cover;
    object-position:left center;
    filter:drop-shadow(0 3px 6px rgba(92,61,46,.12));
  }
}
.daily-kanji-fav.unsaved,
body.theme-carbon-fire .daily-kanji-fav.unsaved,
body.theme-dark-base .daily-kanji-fav.unsaved,
body.theme-shinjuku .daily-kanji-fav.unsaved{
  color:var(--ink3) !important;
  text-shadow:none !important;
  filter:none !important;
}
.daily-kanji-next.unsaved .daily-refresh-icon,
.daily-kanji-next.unsaved .daily-refresh-icon path,
body.theme-carbon-fire .daily-kanji-next.unsaved .daily-refresh-icon,
body.theme-carbon-fire .daily-kanji-next.unsaved .daily-refresh-icon path,
body.theme-dark-base .daily-kanji-next.unsaved .daily-refresh-icon,
body.theme-dark-base .daily-kanji-next.unsaved .daily-refresh-icon path,
body.theme-shinjuku .daily-kanji-next.unsaved .daily-refresh-icon,
body.theme-shinjuku .daily-kanji-next.unsaved .daily-refresh-icon path{
  color:var(--ink3) !important;
  stroke:currentColor !important;
  filter:none !important;
}

/* Yokai archive: overlay indipendente dalla bitmap della mappa. */
.journey-panel-yokai-hit{
  position:absolute;
  left:3.55%;
  top:38.35%;
  width:18.75%;
  height:6.75%;
  display:block;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:transparent;
  font-family:inherit;
  font-size:clamp(10px, .9vw, 19px);
  font-weight:700;
  line-height:1;
  text-align:left;
  box-shadow:none;
  cursor:pointer;
  backdrop-filter:none;
}
.journey-panel-yokai-hit:hover{
  background:transparent;
}
.journey-panel-yokai-hit:focus-visible{
  outline:3px solid rgba(139,26,26,.72);
  outline-offset:3px;
}
.journey-panel-yokai-hit span{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}
.journey-panel-yokai-star{
  color:transparent;
  text-shadow:none;
}
.journey-panel-yokai-hit strong{
  position:absolute;
  right:8.5%;
  top:50%;
  transform:translateY(-50%);
  white-space:nowrap;
  color:#6e2f25;
  font-size:clamp(11px, 1vw, 20px);
  font-weight:800;
}
.yokai-archive-backdrop{
  position:fixed;
  inset:0;
  z-index:120;
  display:grid;
  place-items:center;
  padding:28px;
  background:rgba(17,12,9,.46);
  backdrop-filter:blur(8px);
}
.yokai-archive-modal{
  width:min(1180px, calc(100vw - 48px));
  max-height:calc(100vh - 56px);
  overflow:auto;
  display:block;
  border:1px solid rgba(131,101,63,.36);
  border-radius:24px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,244,213,.65), transparent 34%),
    linear-gradient(135deg, #fbf1d7 0%, #efe0bd 52%, #e7d3a8 100%);
  color:#211913;
  box-shadow:0 28px 70px rgba(32,20,12,.36), inset 0 1px 0 rgba(255,255,255,.55);
}
.yokai-archive-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:28px 30px 18px;
  border-bottom:1px solid rgba(122,88,52,.2);
}
.yokai-archive-head h2{
  margin:0;
  font-size:clamp(30px, 4vw, 58px);
  letter-spacing:0;
}
.yokai-archive-head p{
  margin:6px 0 0;
  color:#6d5446;
  font-weight:700;
}
.yokai-archive-summary{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
  padding:18px 30px;
}
.yokai-archive-summary > div{
  min-height:70px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  padding:14px 16px;
  border:1px solid rgba(133,99,58,.28);
  border-radius:14px;
  background:rgba(255,248,229,.58);
}
.yokai-archive-summary span{
  color:#9b7157;
  font-size:12px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.yokai-archive-summary strong{
  font-size:18px;
}
.yokai-archive-scroll{
  overflow:visible;
  padding:0 30px 30px;
}
.yokai-rank-section{
  padding:22px 0 4px;
}
.yokai-rank-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.yokai-rank-head h3{
  margin:0;
  font-size:24px;
  letter-spacing:0;
}
.yokai-rank-head span{
  color:#7b5c4a;
  font-weight:900;
}
.yokai-archive-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(148px, 1fr));
  gap:16px;
}
.yokai-card-tile{
  position:relative;
  width:100%;
  min-height:250px;
  padding:10px;
  border:1px solid rgba(112,82,50,.25);
  border-radius:16px;
  background:rgba(255,248,232,.64);
  color:inherit;
  font:inherit;
  text-align:left;
  box-shadow:0 10px 22px rgba(82,55,32,.13);
}
.yokai-card-tile.discovered{
  cursor:pointer;
}
.yokai-card-tile.discovered:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 28px rgba(82,55,32,.18);
}
.yokai-card-tile img{
  width:100%;
  aspect-ratio:2 / 3;
  display:block;
  object-fit:cover;
  border-radius:10px;
  box-shadow:0 8px 16px rgba(39,25,15,.2);
}
.yokai-card-name{
  margin-top:10px;
  font-weight:900;
  font-size:15px;
}
.yokai-card-meta{
  margin-top:2px;
  color:#7b5c4a;
  font-size:12px;
  font-weight:800;
}
.yokai-card-tile.locked{
  min-height:250px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.yokai-card-silhouette{
  aspect-ratio:2 / 3;
  border-radius:10px;
  background:
    linear-gradient(145deg, rgba(56,47,42,.22), rgba(56,47,42,.06)),
    radial-gradient(circle at 50% 37%, rgba(38,31,28,.28) 0 16%, transparent 17%),
    radial-gradient(ellipse at 50% 58%, rgba(38,31,28,.28) 0 25%, transparent 26%),
    rgba(233,218,187,.65);
  box-shadow:inset 0 0 0 1px rgba(79,59,42,.18), inset 0 -26px 34px rgba(82,64,48,.12);
  filter:saturate(.75);
}
.yokai-card-lock{
  margin-top:10px;
  color:#8d705d;
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.yokai-card-viewer{
  position:fixed;
  inset:0;
  z-index:140;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(17,12,9,.62);
}
.yokai-card-viewer-inner{
  position:relative;
  width:min(560px, calc(100vw - 48px));
  max-height:calc(100vh - 48px);
  cursor:default;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.yokai-card-zoom-stage{
  max-height:calc(100vh - 112px);
  overflow:auto;
  border-radius:14px;
  background:rgba(18,13,10,.22);
  box-shadow:0 24px 70px rgba(0,0,0,.42);
  overscroll-behavior:contain;
  touch-action:pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling:touch;
}
.yokai-card-zoom-stage img{
  width:100%;
  max-width:none;
  max-height:none;
  display:block;
  border-radius:14px;
  transform-origin:top center;
}
.yokai-card-zoom-controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.yokai-card-zoom-controls button{
  min-width:42px;
  height:34px;
  border:1px solid rgba(235,220,184,.42);
  border-radius:999px;
  background:rgba(32,23,16,.72);
  color:#fff8e8;
  font:900 14px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(0,0,0,.22);
}
.yokai-card-zoom-controls button:hover{
  background:rgba(47,34,24,.86);
}
.yokai-card-viewer-close{
  position:absolute;
  top:10px;
  right:10px;
  width:42px;
  height:42px;
  border:0;
  border-radius:999px;
  background:rgba(28,19,14,.78);
  color:#fff;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  opacity:0;
  pointer-events:none;
  transition:opacity .16s ease, transform .16s ease;
}
.yokai-card-viewer-inner:hover .yokai-card-viewer-close,
.yokai-card-viewer-inner:focus-within .yokai-card-viewer-close{
  opacity:1;
  pointer-events:auto;
}
.yokai-card-viewer-close:hover{
  transform:scale(1.04);
}
@media (max-width:760px){
  .journey-widget .journey-card{
    left:10px;
    right:10px;
    width:auto;
    max-width:none;
    bottom:14px;
    max-height:none;
    transform:none;
    overflow:auto;
  }
  .journey-card.open{
    transform:none;
  }
  .journey-panel-bitmap{
    width:max(760px, 100%);
  }
  .journey-panel-yokai-hit{
    left:3.55%;
    top:38.35%;
    width:18.75%;
    height:6.75%;
  }
  .journey-panel-yokai-hit strong{
    right:6.5%;
    font-size:13px;
  }
  .yokai-archive-backdrop{
    padding:12px;
  }
  .yokai-archive-modal{
    width:calc(100vw - 24px);
    max-height:calc(100vh - 24px);
    border-radius:18px;
  }
  .yokai-archive-head{
    padding:22px 18px 14px;
  }
  .yokai-archive-summary{
    grid-template-columns:1fr;
    padding:14px 18px;
  }
  .yokai-archive-scroll{
    padding:0 18px 22px;
  }
  .yokai-archive-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px;
  }
  .yokai-card-tile,
  .yokai-card-tile.locked{
    min-height:214px;
  }
}
@media (max-width:520px){
  html,
  body,
  #wrap{
    width:100% !important;
    max-width:100% !important;
    overflow-x:hidden !important;
    overscroll-behavior-x:none;
    touch-action:pan-y;
  }
  body{
    position:relative;
  }
  #wrap{
    width:100vw !important;
    max-width:100vw !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:20px !important;
    padding-right:20px !important;
    box-sizing:border-box !important;
  }
  .app-header{
    min-height:204px !important;
    width:100% !important;
    max-width:100% !important;
    overflow:visible;
  }
  .app-header > .header-main,
  .app-header > .header-side{
    position:relative !important;
    top:32px !important;
    transform:none !important;
  }
  .header-main > .header-menu-wrap{
    transform:translateY(13px) !important;
  }
  .header-side .header-actions,
  .header-actions{
    margin-top:64px !important;
  }
  .header-side .header-actions{
    width:168px !important;
    max-width:168px !important;
    margin-left:0 !important;
    margin-right:14px !important;
    flex-wrap:nowrap !important;
    justify-content:flex-end !important;
    align-items:center !important;
    gap:4px !important;
  }
  .header-print-favorites{
    margin-right:4px !important;
  }
  .header-favorites-count{
    right:-5px !important;
    bottom:0 !important;
    min-width:19px !important;
    height:19px !important;
    padding:0 5px !important;
    font-size:10px !important;
  }
  .journey-widget .journey-trigger{
    width:54px !important;
    min-width:54px !important;
    height:38px !important;
    min-height:38px !important;
    border-radius:10px !important;
    overflow:hidden !important;
  }
  .journey-trigger-image{
    width:54px !important;
    max-width:none !important;
    height:38px !important;
    object-fit:contain !important;
    object-position:center center !important;
  }
  .lvl-picker,
  .mode-grid,
  .home-briefing-row,
  .kana-tab-wrap,
  .home-card{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow:hidden;
  }
  .lvl-picker{
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    gap:8px !important;
  }
  .lvl-btn{
    min-width:0 !important;
  }
  .mode-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:10px !important;
  }
  .mode-card{
    min-width:0 !important;
    width:auto !important;
  }
}

body.theme-carbon-fire .sensei-banner,
body.theme-carbon-flat .sensei-banner,
body.theme-dark-base .sensei-banner,
body.theme-shinjuku .sensei-banner{
  border-color:rgba(255,255,255,.10);
  background:
    linear-gradient(135deg,rgba(18,22,31,.86),rgba(32,24,20,.76)),
    radial-gradient(circle at 12% 16%,rgba(255,55,95,.14),transparent 34%);
  box-shadow:0 18px 42px rgba(0,0,0,.26);
}
body.theme-carbon-fire .sensei-copy h2,
body.theme-carbon-flat .sensei-copy h2,
body.theme-dark-base .sensei-copy h2,
body.theme-shinjuku .sensei-copy h2{
  color:#fff8ec;
}
body.theme-carbon-fire .sensei-copy p,
body.theme-carbon-flat .sensei-copy p,
body.theme-dark-base .sensei-copy p,
body.theme-shinjuku .sensei-copy p{
  color:#d8dbe6;
}
body.theme-carbon-fire .sensei-chip,
body.theme-carbon-flat .sensei-chip,
body.theme-dark-base .sensei-chip,
body.theme-shinjuku .sensei-chip{
  border-color:rgba(255,255,255,.12);
  background:rgba(255,255,255,.07);
  color:#d8dbe6;
}
body.theme-carbon-fire .sensei-secondary,
body.theme-carbon-flat .sensei-secondary,
body.theme-dark-base .sensei-secondary,
body.theme-shinjuku .sensei-secondary{
  border-color:rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:#f1d7b6;
}
body.theme-carbon-fire .sensei-restore,
body.theme-carbon-flat .sensei-restore,
body.theme-dark-base .sensei-restore,
body.theme-shinjuku .sensei-restore{
  border-color:rgba(255,255,255,.12);
  background:rgba(255,255,255,.07);
  color:#d8dbe6;
}
body.theme-carbon-fire .sensei-restore-open,
body.theme-carbon-flat .sensei-restore-open,
body.theme-dark-base .sensei-restore-open,
body.theme-shinjuku .sensei-restore-open{
  color:#ff5a78;
}

/* Mobile home viewport lock: keep the classic home centered on iPhone Safari.
   Avoid 100vw on #wrap because Safari can measure it wider than the visible page
   while the browser chrome is present. */
@media (max-width:520px){
  html,
  body{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow-x:hidden !important;
    overscroll-behavior-x:none;
  }

  body{
    position:relative;
  }

  #wrap{
    width:100% !important;
    max-width:430px !important;
    min-width:0 !important;
    margin-left:auto !important;
    margin-right:auto !important;
    padding-left:20px !important;
    padding-right:20px !important;
    box-sizing:border-box !important;
    overflow-x:hidden !important;
    zoom:1 !important;
  }

  .screen,
  .screen.active,
  .app-header,
  .home-briefing-row,
  .home-grid,
  .home-card,
  .daily-kanji,
  .kana-tab-wrap,
  .kana-tab-card,
  .section-label,
  .lvl-picker,
  .mode-grid,
  .mode-card{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  .app-header{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 182px !important;
    column-gap:6px !important;
    align-items:start !important;
    min-height:190px !important;
    padding-right:0 !important;
    overflow:hidden !important;
  }

  .header-main,
  .header-side{
    min-width:0 !important;
    max-width:100% !important;
  }

  .header-main h1,
  .app-subtitle{
    max-width:100% !important;
    overflow-wrap:anywhere;
  }

  .header-side{
    width:182px !important;
    justify-self:end !important;
    align-items:flex-end !important;
  }

  .header-kanji{
    max-width:182px !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:clip !important;
    font-size:30px !important;
  }

  .header-side .header-actions,
  .header-actions{
    width:182px !important;
    max-width:182px !important;
    min-width:0 !important;
    display:flex !important;
    flex-wrap:nowrap !important;
    justify-content:flex-end !important;
    align-items:center !important;
    gap:3px !important;
    margin-top:62px !important;
    overflow:visible !important;
  }

  .header-icon-btn{
    width:34px !important;
    min-width:34px !important;
    max-width:34px !important;
    height:38px !important;
    flex:0 0 34px !important;
    padding:0 !important;
  }

  .header-search-icon{
    width:29px !important;
    height:29px !important;
  }

  .header-actions .progress-widget .progress-ring-btn,
  body.theme-classic .header-actions .progress-widget .progress-ring-btn,
  body.theme-rilievo .header-actions .progress-widget .progress-ring-btn,
  body.theme-carbon-fire .header-actions .progress-widget .progress-ring-btn,
  body.theme-dark-base .header-actions .progress-widget .progress-ring-btn,
  body.theme-shinjuku .header-actions .progress-widget .progress-ring-btn{
    width:36px !important;
    min-width:36px !important;
    max-width:36px !important;
    height:36px !important;
    flex:0 0 36px !important;
    border-radius:18px !important;
  }

  #jlpt-progress-widget .ring-svg{
    width:34px !important;
    height:34px !important;
  }

  #jlpt-progress-widget .ring-center{
    width:22px !important;
    height:22px !important;
  }

  #jlpt-progress-widget .ring-pct{
    font-size:9px !important;
  }

  .header-print-favorites img{
    width:33px !important;
    height:33px !important;
    transform:translateY(2px) !important;
  }

  .header-favorites-count{
    right:-7px !important;
    bottom:1px !important;
    min-width:19px !important;
    height:19px !important;
    padding:0 5px !important;
    font-size:10px !important;
  }

  .journey-widget{
    width:68px !important;
    max-width:68px !important;
    min-width:0 !important;
    flex:0 0 68px !important;
  }

  .journey-widget .journey-trigger{
    width:68px !important;
    min-width:68px !important;
    max-width:68px !important;
    height:46px !important;
    min-height:46px !important;
    grid-template-columns:1fr !important;
    padding:4px !important;
    border-radius:12px !important;
    overflow:hidden !important;
  }

  .journey-trigger-copy,
  .journey-trigger-arrow{
    display:none !important;
  }

  .journey-trigger-map,
  .journey-trigger-image{
    width:60px !important;
    max-width:60px !important;
    height:38px !important;
  }

  .journey-trigger-image{
    display:block !important;
    object-fit:contain !important;
    object-position:center center !important;
  }

  .home-briefing-row{
    grid-template-columns:1fr !important;
    gap:10px !important;
  }

  .home-briefing-row.sensei-hidden .daily-kanji,
  .daily-kanji{
    overflow:hidden !important;
  }

  .daily-kanji,
  .daily-kanji *,
  .reading-grid,
  .reading-grid *,
  .home-note,
  .daily-note-entry,
  .daily-note-link,
  .daily-note-text{
    min-width:0 !important;
    max-width:100% !important;
    box-sizing:border-box !important;
  }

  .daily-kanji .reading-grid{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    width:100% !important;
    overflow:hidden !important;
  }

  .daily-kanji .reading-grid div,
  .daily-kanji .reading-grid strong,
  .daily-kanji .home-note,
  .daily-kanji .daily-note-entry,
  .daily-kanji .daily-note-link,
  .daily-kanji .daily-note-text{
    white-space:normal !important;
    overflow-wrap:anywhere !important;
    word-break:normal !important;
  }

  .daily-kanji .daily-note-link{
    display:inline !important;
  }

  .lvl-picker{
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    gap:8px !important;
    overflow:hidden !important;
  }

  .lvl-btn,
  .mode-card{
    min-width:0 !important;
    max-width:100% !important;
  }

  .mode-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:10px !important;
    padding-top:8px !important;
    overflow:visible !important;
  }
}

/* Mobile menu overlay: the header must clip horizontal layout, but the menu
   panel itself has to escape vertically and stay above the home cards. */
@media (max-width:520px){
  .app-header{
    position:relative !important;
    z-index:90 !important;
    overflow:visible !important;
  }

  .header-menu-wrap{
    position:relative !important;
    z-index:110 !important;
    overflow:visible !important;
  }

  .home-menu-panel{
    z-index:120 !important;
    max-width:calc(100vw - 40px) !important;
    max-height:calc(100dvh - 160px) !important;
    overflow:auto !important;
    -webkit-overflow-scrolling:touch;
  }
}

/* iOS Safari anti-zoom for personal notes in printable favorites. */
@media (max-width:520px){
  .print-fav-note-panel textarea{
    font-size:16px !important;
    line-height:1.45 !important;
    transform:none !important;
    -webkit-text-size-adjust:100% !important;
    text-size-adjust:100% !important;
    touch-action:manipulation !important;
  }

  .print-fav-note-panel textarea:focus{
    font-size:16px !important;
    transform:none !important;
  }
}

/* Kana practice bookmark state. */
.kana-cell.kana-practiced:not(.empty){
  border-color:rgba(159,77,66,.42) !important;
  background:linear-gradient(135deg,rgba(246,211,202,.9),rgba(255,255,255,.76)) !important;
  box-shadow:0 5px 16px rgba(159,77,66,.18) !important;
}
.kana-cell.kana-practiced:not(.empty) .kana-romaji{
  color:#8f3f36 !important;
}

/* iPhone: present JLPT progress as a viewport modal, independent from its
   trigger position in the scaled header layout. */
.progress-card-close{
  display:none;
}

@media (max-width:520px){
  html:has(#progressCard.open),
  body:has(#progressCard.open){
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }

  body:has(#progressCard.open) .header-menu-wrap{
    visibility:hidden !important;
    pointer-events:none !important;
  }

  html.progress-panel-open{
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }

  body.progress-panel-open{
    position:fixed !important;
    top:var(--progress-lock-offset, 0px) !important;
    right:0 !important;
    left:0 !important;
    width:100% !important;
    height:100dvh !important;
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }

  body.progress-panel-open #jlpt-progress-widget{
    z-index:2000 !important;
  }

  body.progress-panel-open .header-menu-wrap{
    z-index:1 !important;
    pointer-events:none !important;
    visibility:hidden !important;
  }

  /* The panel is promoted to body by progress-donut.js, leaving the header
     entirely below it and preventing any control from leaking above it. */
  body.progress-panel-open .app-header{
    visibility:hidden !important;
    pointer-events:none !important;
  }

  #jlpt-progress-widget .progress-card{
    position:fixed !important;
    top:calc(env(safe-area-inset-top, 0px) + 8px) !important;
    right:12px !important;
    bottom:calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
    left:12px !important;
    width:auto !important;
    max-width:none !important;
    height:auto !important;
    padding:20px !important;
    border-radius:22px !important;
    box-sizing:border-box !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    z-index:1000 !important;
  }

  #jlpt-progress-widget .progress-card.open{
    max-height:none !important;
    opacity:1 !important;
    pointer-events:auto !important;
    transform:none !important;
  }

  #jlpt-progress-widget .progress-card::before{
    display:none !important;
  }

  #jlpt-progress-widget .progress-card-header{
    position:relative;
    padding-right:42px;
  }

  #jlpt-progress-widget .progress-card-close{
    position:absolute;
    top:-6px;
    right:-4px;
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    padding:0;
    border:1px solid var(--progress-card-border);
    border-radius:999px;
    background:var(--progress-card-action-bg);
    color:var(--progress-card-title);
    font:400 30px/1 system-ui,-apple-system,sans-serif;
    cursor:pointer;
  }
}
.kihon-lesson-manga{display:block;width:100%;height:100%;min-height:300px;object-fit:contain;background:var(--parchment2)}
.kihon-mini-hero.is-past{background:linear-gradient(135deg,#edf1f5,#fff6e7)}.kihon-time-line{display:flex;align-items:center;justify-content:center;gap:14px;margin:22px 0}.kihon-time-line span,.kihon-time-line b{display:grid;place-items:center;width:86px;height:86px;border-radius:50%;background:#344c65;color:white;font:700 25px var(--font-jp)}.kihon-time-line b{background:#efc271;color:#684719}.kihon-time-line small{font:700 10px var(--font)}.kihon-time-line i{color:var(--kihon-coral);font-size:25px}.kihon-past-transform{display:grid;gap:9px;text-align:center}.kihon-past-transform span{padding:12px;border:1px solid var(--bd);border-radius:11px;background:var(--parchment);font:600 17px var(--font-jp)}.kihon-past-transform span:last-child{background:#f9dfdb;color:#8d2c24}.kihon-past-transform small{display:block;color:var(--ink3);font:700 11px var(--font)}.kihon-negative-past-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,.8fr);gap:25px;align-items:center;padding:clamp(24px,4vw,40px);border-radius:20px;background:linear-gradient(135deg,#eef2f6,#fffaf0)}.kihon-negative-past-card h2{margin:8px 0 12px;color:var(--lacca-dk);font:400 clamp(27px,4vw,39px) var(--font-display)}.kihon-negative-past-examples{display:grid;gap:10px}.kihon-negative-past-examples span{padding:13px;border-radius:11px;background:white;font:600 17px var(--font-jp)}.kihon-negative-past-examples small{display:block;color:var(--ink3);font:700 11px var(--font)}.kihon-past-visual p{margin:18px auto 0;max-width:740px;color:rgba(255,255,255,.72)}.kihon-past-practice{width:100%;box-sizing:border-box}.kihon-past-practice .kihon-exercise-sentence{margin:18px 0 3px;color:var(--ink);font:600 clamp(21px,4vw,34px) var(--font-jp);text-align:center}.kihon-past-practice .kihon-choice-row{max-width:760px;margin:18px auto}.kihon-past-practice .kihon-choice-row button{font-size:16px}@media(max-width:700px){.kihon-negative-past-card{grid-template-columns:1fr}}
.kihon-desu-practice .kihon-exercise-sentence{margin:18px 0 3px;color:var(--ink);font:600 clamp(22px,3vw,32px) var(--font-jp);text-align:center}.kihon-desu-practice .kihon-exercise-translation{display:block;color:var(--ink3);font-size:15px;text-align:center}.kihon-desu-practice .kihon-choice-row button{min-width:72px;font-size:21px}.kihon-desu-practice .kihon-choice-row button:disabled{opacity:.58}.kihon-desu-practice .kihon-choice-row button.is-correct{opacity:1}
.kihon-deep-dive{width:100%;margin-top:8px}.kihon-deep-dive-toggle{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;padding:18px 20px;border:1px solid rgba(40,123,119,.3);border-radius:18px;background:linear-gradient(135deg,#173f3d,#235e59);color:#fff;box-shadow:0 12px 28px rgba(22,72,68,.16);text-align:left;cursor:pointer}.kihon-deep-dive-toggle span{display:grid;gap:2px}.kihon-deep-dive-toggle small{color:#f1cb75;font:800 10px var(--font);letter-spacing:.08em;text-transform:uppercase}.kihon-deep-dive-toggle strong{font:700 clamp(25px,7vw,34px) var(--font-jp)}.kihon-deep-dive-toggle em{color:rgba(255,255,255,.72);font:600 12px var(--font);font-style:normal}.kihon-deep-dive-toggle>b{display:grid;place-items:center;flex:none;width:42px;height:42px;border:1px solid rgba(255,255,255,.3);border-radius:50%;background:rgba(255,255,255,.1);font:300 28px/1 sans-serif}.kihon-deep-dive-body{overflow:hidden;margin-top:12px;border:1px solid rgba(40,123,119,.22);border-radius:22px;background:linear-gradient(180deg,#fffdf7,#f7f1e5)}.kihon-deep-dive-body[hidden]{display:none}.kihon-deep-dive-body>header{padding:28px 22px;background:#fffaf0}.kihon-deep-dive-body>header h2{margin:7px 0 10px;color:var(--lacca-dk);font:400 clamp(31px,9vw,44px)/1.05 var(--font-display)}.kihon-deep-dive-body>header p,.kihon-deep-block p{color:var(--ink2);line-height:1.65}.kihon-deep-block{display:grid;gap:14px;padding:26px 22px;border-top:1px solid rgba(78,60,35,.12)}.kihon-deep-number{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#e1f0ec;color:var(--kihon-teal);font:700 17px var(--font-jp)}.kihon-deep-block h3,.kihon-deep-sensei h3{margin:0 0 12px;color:var(--ink);font:400 clamp(24px,7vw,31px) var(--font-display)}.kihon-deep-example{display:flex;align-items:center;justify-content:center;gap:4px;flex-wrap:wrap;margin:20px 0 6px!important}.kihon-deep-example span{padding:8px;border-radius:9px;background:#e3f0ed;color:#195b57;font:700 18px var(--font-jp)}.kihon-deep-example span.is-desu{background:#f7d9d4;color:#8d2c24}.kihon-deep-example i{color:#ad9b7e;font-style:normal}.kihon-deep-gloss{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin:0 auto 22px;color:var(--ink3);font:700 8px var(--font);text-align:center}.kihon-deep-examples,.kihon-register-compare{display:grid;gap:9px;margin:18px 0}.kihon-deep-examples p,.kihon-register-compare p{margin:0;padding:15px;border:1px solid var(--bd);border-radius:13px;background:white}.kihon-deep-examples b,.kihon-deep-examples small,.kihon-deep-examples span,.kihon-register-compare span,.kihon-register-compare b{display:block}.kihon-deep-examples b,.kihon-register-compare b{font:700 18px var(--font-jp)}.kihon-deep-examples small{margin:3px 0 8px;color:var(--ink3);font-size:10px}.kihon-deep-block aside{padding:13px;border-left:4px solid var(--kihon-coral);background:#f9e7e3;color:#713b35;line-height:1.5}.kihon-desu-table{display:grid;margin:18px 0;border:1px solid var(--bd);border-radius:14px;background:#fff;overflow-x:auto}.kihon-desu-table>div{display:grid;grid-template-columns:90px 150px 150px;min-width:390px}.kihon-desu-table>div+div{border-top:1px solid var(--bd)}.kihon-desu-table span,.kihon-desu-table strong,.kihon-desu-table b{padding:10px 8px;font-size:11px}.kihon-desu-table b{background:#e3f0ed;color:#195b57}.kihon-desu-table strong{border-inline:1px solid var(--bd);font-family:var(--font-jp)}.kihon-register-compare span{color:var(--kihon-teal);font-size:10px;font-weight:800;text-transform:uppercase}.kihon-deep-sensei{display:grid;gap:14px;margin:0 18px 26px;padding:20px;border-radius:17px;background:#173f3d;color:white}.kihon-deep-sensei h3{color:#fff8e9}.kihon-deep-sensei p{margin:0;color:rgba(255,255,255,.78);line-height:1.6}.kihon-deep-sensei .kihon-eyebrow{color:#efc76b}.kihon-deep-next{display:grid;gap:5px;padding:19px 22px;background:#ead7ae;color:#624d24}.kihon-deep-next span{font-weight:800}.kihon-deep-next p{margin:0;line-height:1.5}
.kihon-negative-deep-dive .kihon-desu-table{width:100%;max-width:100%;overflow:hidden}.kihon-negative-deep-dive .kihon-desu-table>div{min-width:0;grid-template-columns:minmax(72px,.72fr) minmax(0,1.08fr) minmax(0,1.35fr)}.kihon-negative-deep-dive .kihon-desu-table span,.kihon-negative-deep-dive .kihon-desu-table strong,.kihon-negative-deep-dive .kihon-desu-table b{min-width:0;line-height:1.35;overflow-wrap:anywhere;word-break:break-word}.kihon-negative-deep-dive .kihon-desu-table strong{word-break:break-all}@media(max-width:430px){.kihon-negative-deep-dive .kihon-desu-table>div{grid-template-columns:66px minmax(0,1fr) minmax(0,1.16fr)}.kihon-negative-deep-dive .kihon-desu-table span,.kihon-negative-deep-dive .kihon-desu-table strong,.kihon-negative-deep-dive .kihon-desu-table b{padding:9px 5px;font-size:10px}.kihon-negative-deep-dive .kihon-desu-table b{font-size:9px}}
.kihon-generic-deep-dive .kihon-deep-rule-grid,.kihon-generic-deep-dive .kihon-deep-forms{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:18px 0}.kihon-generic-deep-dive .kihon-deep-rule-grid p,.kihon-generic-deep-dive .kihon-deep-forms p,.kihon-generic-deep-dive .kihon-deep-example-list p,.kihon-generic-deep-dive .kihon-deep-checklist p{display:grid;gap:4px;margin:0;padding:15px;border:1px solid var(--bd);border-radius:13px;background:#fff}.kihon-generic-deep-dive .kihon-deep-rule-grid b,.kihon-generic-deep-dive .kihon-deep-forms b,.kihon-generic-deep-dive .kihon-deep-example-list b{color:var(--ink);font:700 18px/1.35 var(--font-jp);overflow-wrap:anywhere}.kihon-generic-deep-dive .kihon-deep-rule-grid small,.kihon-generic-deep-dive .kihon-deep-forms small,.kihon-generic-deep-dive .kihon-deep-example-list small{color:var(--ink3);font-size:11px}.kihon-generic-deep-dive .kihon-deep-rule-grid span,.kihon-generic-deep-dive .kihon-deep-forms span,.kihon-generic-deep-dive .kihon-deep-example-list span,.kihon-generic-deep-dive .kihon-deep-checklist span{color:var(--ink2);font-size:13px;line-height:1.45}.kihon-generic-deep-dive .kihon-deep-example-list,.kihon-generic-deep-dive .kihon-deep-checklist{display:grid;gap:9px;margin:18px 0}.kihon-generic-deep-dive .kihon-deep-forms p>span{color:var(--kihon-teal);font:800 10px var(--font);letter-spacing:.07em;text-transform:uppercase}.kihon-generic-deep-dive .kihon-deep-formula-line{display:flex;align-items:stretch;justify-content:center;gap:7px;flex-wrap:wrap;margin:20px 0}.kihon-generic-deep-dive .kihon-deep-formula-line>span,.kihon-generic-deep-dive .kihon-deep-formula-line>strong{display:grid;place-items:center;min-width:95px;padding:11px 10px;border-radius:11px;background:#e5f2ef;color:#175c56;font:700 18px var(--font-jp);text-align:center}.kihon-generic-deep-dive .kihon-deep-formula-line>strong{background:#f7ded9;color:#8d2c24}.kihon-generic-deep-dive .kihon-deep-formula-line small{display:block;color:var(--ink3);font:700 9px var(--font);text-transform:uppercase}.kihon-generic-deep-dive .kihon-deep-formula-line i{align-self:center;color:var(--ink3);font-style:normal}.kihon-generic-deep-dive mark{padding:0 2px;background:#f2cc75;color:#613f0b}.kihon-generic-deep-dive+.kihon-next-lesson{margin-top:0}@media(max-width:600px){.kihon-generic-deep-dive .kihon-deep-rule-grid,.kihon-generic-deep-dive .kihon-deep-forms{grid-template-columns:1fr}.kihon-generic-deep-dive .kihon-deep-formula-line{display:grid;grid-template-columns:1fr}.kihon-generic-deep-dive .kihon-deep-formula-line i{display:none}.kihon-generic-deep-dive .kihon-deep-formula-line>span,.kihon-generic-deep-dive .kihon-deep-formula-line>strong{min-width:0}.kihon-generic-deep-dive .kihon-deep-rule-grid b,.kihon-generic-deep-dive .kihon-deep-forms b,.kihon-generic-deep-dive .kihon-deep-example-list b{font-size:17px}}
.kihon-success-banner>.sakura{display:block;grid-row:auto;width:var(--flower-size);height:var(--flower-size);border-radius:0;background:transparent;color:inherit;font:inherit}
.kihon-negative-practice .kihon-exercise-sentence{margin:18px 0 3px;color:var(--ink);font:600 clamp(20px,3vw,30px) var(--font-jp);text-align:center}.kihon-negative-practice .kihon-exercise-translation{display:block;color:var(--ink3);font-size:15px;text-align:center}.kihon-next-lesson,.kihon-test-complete{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 20px;border:1px solid rgba(40,123,119,.24);border-radius:17px;background:linear-gradient(135deg,#e6f3ef,#fffaf0);color:#174f4c}.kihon-next-lesson span,.kihon-test-complete span{font-weight:700}.kihon-next-lesson button,.kihon-test-complete button{border:0;border-radius:999px;padding:12px 17px;background:var(--kihon-teal);color:white;font:800 13px sans-serif}.kihon-test-complete{margin-top:20px;flex-wrap:wrap}.kihon-test-complete strong{color:var(--kihon-coral)}@media(max-width:560px){.kihon-next-lesson,.kihon-test-complete{align-items:stretch;flex-direction:column}.kihon-next-lesson button,.kihon-test-complete button{width:100%}}
.kihon-exercise-sentence{position:relative;overflow:visible}.kihon-inline-seikai{position:absolute;z-index:70;left:50%;bottom:calc(100% + 3px);padding:4px 9px;border:1px solid rgba(32,123,103,.24);border-radius:999px;background:#e1f5ec;color:#207b67;font:800 10px sans-serif;letter-spacing:.04em;white-space:nowrap;opacity:0;transform:translate(-50%,8px) scale(.82);transition:opacity .2s ease,transform .38s cubic-bezier(.2,.9,.25,1.3)}.kihon-inline-seikai.is-visible{opacity:1;transform:translate(-50%,0) scale(1)}.kihon-exercise-sentence>.sakura{z-index:60}
.kihon-particle-copy{flex:1;min-width:0!important;text-align:left!important}.kihon-particle-copy h3{margin:0 0 7px;color:#174f4c;font:400 clamp(23px,3vw,31px) var(--font-display)}.kihon-particle-copy p{margin:0;font-size:16px;line-height:1.5}.kihon-particle-copy aside{margin:12px 0;padding:10px 12px;border-left:3px solid var(--kihon-teal);background:rgba(255,255,255,.58);color:#27615d;font-size:13px}.kihon-particle-copy em{padding-top:9px;border-top:1px solid rgba(40,123,119,.18);color:var(--ink);font-style:normal}.kihon-particle-copy em small{display:block;color:var(--ink3);font:700 12px var(--font)}@media(max-width:560px){.kihon-particle-detail{flex-direction:column}.kihon-particle-copy{width:100%}}

.kihon-particle-example-lead{display:grid;grid-template-columns:minmax(0,1fr) 32px;align-items:start;gap:12px;padding-top:11px;border-top:1px solid rgba(40,123,119,.18)}
.kihon-particle-example-lead em{min-width:0;padding:0;border:0;font:600 clamp(19px,3vw,25px)/1.35 var(--font-jp)}
.kihon-particle-example-lead em small{margin-top:2px;font:700 12px/1.35 var(--font);overflow-wrap:anywhere}
.kihon-particle-examples-toggle{position:static;right:auto;bottom:auto;align-self:start;flex:0 0 32px}
.kihon-particle-examples-toggle:focus-visible{outline:2px solid var(--kihon-teal);outline-offset:3px}
.kihon-particle-examples{grid-column:1/-1;margin-top:15px;padding-top:15px;border-top:1px solid rgba(40,123,119,.2)}
.kihon-particle-examples[hidden]{display:none!important}
.kihon-particle-examples>header{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:11px}
.kihon-particle-examples>header span{color:var(--kihon-teal);font:800 10px var(--font);letter-spacing:.1em;text-transform:uppercase}
.kihon-particle-examples>header strong{color:#174f4c;font:700 15px var(--font-jp)}
.kihon-particle-examples ol{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0;padding:0;list-style:none}
.kihon-particle-examples li{display:grid;grid-template-columns:28px minmax(0,1fr);gap:8px;align-items:start;min-width:0;padding:10px;border:1px solid rgba(40,123,119,.16);border-radius:11px;background:rgba(255,255,255,.62)}
.kihon-particle-examples li>span{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#dcefeb;color:#17645e;font:800 9px var(--font)}
.kihon-particle-examples li div{min-width:0}
.kihon-particle-examples li b,.kihon-particle-examples li small{display:block;overflow-wrap:anywhere}
.kihon-particle-examples li b{color:var(--ink);font:700 16px/1.4 var(--font-jp)}
.kihon-particle-examples li small{margin-top:3px;color:var(--ink3);font:600 11px/1.4 var(--font)}
.kihon-particle-examples mark{padding:0 2px;border-radius:4px;background:#f2cc75;color:#693e0b}
@media(max-width:600px){.kihon-particle-examples ol{grid-template-columns:1fr}.kihon-particle-example-lead{grid-template-columns:minmax(0,1fr) 32px}.kihon-particle-examples-toggle{align-self:start}}

/* Kihon reading support: contextual furigana plus an optional full-hiragana line. */
.kihon-reading-tools{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:14px 0 2px;padding:12px 14px;border:1px solid rgba(40,123,119,.2);border-radius:15px;background:linear-gradient(135deg,rgba(232,246,242,.96),rgba(255,250,240,.96));box-sizing:border-box}
.kihon-reading-tools>div{display:flex;align-items:center;gap:10px;min-width:0}.kihon-reading-tools>div>span{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;border-radius:50%;background:var(--kihon-teal);color:#fff;font:800 20px/1 var(--font-jp)}
.kihon-reading-tools p{display:grid;gap:2px;margin:0}.kihon-reading-tools b{color:#174f4c;font:800 12px/1.2 var(--font);text-transform:uppercase;letter-spacing:.07em}.kihon-reading-tools small{color:var(--ink3);font:600 12px/1.35 var(--font)}
.kihon-furigana-toggle{display:flex;align-items:center;gap:8px;flex:0 0 auto;min-height:40px;padding:7px 9px 7px 13px;border:1px solid rgba(40,123,119,.28);border-radius:999px;background:#fffaf0;color:#174f4c;font:800 12px/1 var(--font);cursor:pointer;-webkit-tap-highlight-color:transparent}
.kihon-furigana-toggle strong{display:grid;place-items:center;min-width:34px;height:26px;border-radius:999px;background:var(--kihon-teal);color:white;font:900 10px/1 var(--font)}
.kihon-course.is-furigana-off .kihon-furigana-toggle strong{background:var(--ink3)}
.kihon-course ruby.kihon-ruby{ruby-align:center;ruby-position:over}.kihon-course ruby.kihon-ruby rt{color:#287b77;font-family:var(--font-jp);font-size:.46em;font-weight:700;line-height:1.1;letter-spacing:0}
.kihon-course.is-furigana-off ruby.kihon-ruby rt{display:none}
.kihon-readable-sentence{cursor:pointer;text-decoration:underline;text-decoration-color:rgba(40,123,119,.24);text-decoration-style:dotted;text-underline-offset:5px;-webkit-tap-highlight-color:transparent}
.kihon-readable-sentence:focus-visible{outline:2px solid var(--kihon-teal);outline-offset:4px;border-radius:5px}
.kihon-full-reading{display:block;width:fit-content;max-width:100%;margin:6px 0 4px;padding:6px 10px;border-radius:9px;background:#e2f2ee;color:#155d59;font:700 13px/1.45 var(--font-jp);overflow-wrap:anywhere;box-sizing:border-box}
.kihon-exercise-sentence+.kihon-full-reading,.kihon-zero-jp+.kihon-full-reading{margin-left:auto;margin-right:auto}
@media(max-width:560px){.kihon-reading-tools{align-items:stretch}.kihon-reading-tools small{max-width:185px}.kihon-furigana-toggle{align-self:center}.kihon-course ruby.kihon-ruby rt{font-size:.5em}}

/* iPad Pro 12.9/13-inch: preserve the same single-column Kihon flow as iPhone. */
@media (min-width:768px) and (max-width:1366px) and (min-height:900px){
  #sc-kihon .kihon-area{padding-inline:max(24px,env(safe-area-inset-left)) max(24px,env(safe-area-inset-right))}
  #sc-kihon .kihon-intro-card,#sc-kihon .kihon-course{width:100%;max-width:760px;margin-left:auto;margin-right:auto;box-sizing:border-box}
  #sc-kihon .kihon-story-card,#sc-kihon .kihon-mini-hero{grid-template-columns:1fr}
  #sc-kihon .kihon-story-copy{order:2;padding:34px 28px}
  #sc-kihon .kihon-story-copy h1{font-size:clamp(43px,7vw,62px)}
  #sc-kihon .kihon-hero-figure{order:1;width:100%;aspect-ratio:16/9}
  #sc-kihon .kihon-hero-figure img{object-fit:contain}
  #sc-kihon .kihon-mini-hero>div:first-child{order:2;padding:34px 28px}
  #sc-kihon .kihon-mini-hero>img,#sc-kihon .kihon-mini-hero>.kihon-hero-type,#sc-kihon .kihon-mini-hero>.kihon-particle-cloud{order:1;width:100%;min-height:0;max-height:390px;object-fit:contain}
  #sc-kihon .kihon-chapter{grid-template-columns:1fr}
  #sc-kihon .kihon-chapter-num{display:none}
  #sc-kihon .kihon-chapter-body{padding:32px 27px}
  #sc-kihon .kihon-panels,#sc-kihon .kihon-lesson-grid{grid-template-columns:1fr}
  #sc-kihon .kihon-panel{min-height:132px;display:grid;grid-template-columns:52px 1fr;align-items:center;text-align:left;padding:18px 20px}
  #sc-kihon .kihon-panel:after{content:'↓';top:auto;right:48%;bottom:-28px}
  #sc-kihon .kihon-panel-icon{grid-row:1/4;margin:0;font-size:40px}
  #sc-kihon .kihon-panel small,#sc-kihon .kihon-panel strong,#sc-kihon .kihon-panel em{grid-column:2}
  #sc-kihon .kihon-order-row{grid-template-columns:38px repeat(3,minmax(0,1fr))}
  #sc-kihon .kihon-order-row>strong{grid-column:2/5}
  #sc-kihon .kihon-particle-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  #sc-kihon .kihon-particle-detail{align-items:flex-start}
  #sc-kihon .kihon-summary{grid-template-columns:1fr}
  #sc-kihon .kihon-lesson-rail{max-width:100%}
}
.kihon-inline-seikai.is-visible{animation:kihonSeikaiStamp 1.38s cubic-bezier(.2,.9,.25,1.2) forwards}@keyframes kihonSeikaiStamp{0%{opacity:0;transform:translate(-50%,10px) rotate(-25deg) scale(.62)}18%{opacity:1;transform:translate(-50%,0) rotate(-25deg) scale(1.08)}32%,72%{opacity:1;transform:translate(-50%,0) rotate(-25deg) scale(1)}100%{opacity:0;transform:translate(-50%,-10px) rotate(-25deg) scale(.94)}}
@media(prefers-reduced-motion:reduce){.kihon-inline-seikai.is-visible{animation:none;opacity:1;transform:translate(-50%,0) rotate(-25deg)}}
.kihon-mini-hero.is-verb{background:linear-gradient(135deg,#fff8e9,#f7ded9)}.kihon-verb-hero{display:grid!important;grid-template-columns:repeat(3,auto);place-content:center;gap:10px;padding:34px!important}.kihon-verb-hero span,.kihon-verb-hero b{padding:13px 15px;border-radius:12px;background:#e6f2f0;color:#155d59;font:700 clamp(20px,3vw,30px) var(--font-jp)}.kihon-verb-hero span:nth-child(2){background:#fff1cc;color:#795a08}.kihon-verb-hero b{background:#f9dfdb;color:#8d2c24}.kihon-verb-hero small{grid-column:1/4;color:var(--ink3);font:700 11px sans-serif;text-align:center}.kihon-verb-build{display:grid;place-items:center;margin:20px 0;padding:24px;border-radius:15px;background:#f9dfdb}.kihon-verb-build b{color:#8d2c24;font:700 34px var(--font-jp)}.kihon-verb-build small,.kihon-verb-stack small,.kihon-time-compare small{display:block;color:var(--ink3);font:700 12px var(--font)}.kihon-verb-stack,.kihon-time-compare{display:grid;gap:9px}.kihon-verb-stack span,.kihon-time-compare span{padding:11px 13px;border:1px solid var(--bd);border-radius:11px;background:var(--parchment);font:600 18px var(--font-jp)}.kihon-visual-builder{padding:clamp(24px,4vw,40px);border-radius:20px;background:var(--ink);color:#fff8e9;text-align:center}.kihon-visual-builder h2{margin:7px 0 22px;font:400 clamp(27px,4vw,42px) var(--font-display)}.kihon-visual-builder>div:last-child{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap}.kihon-visual-builder span{padding:13px 17px;border-radius:12px;font:700 23px var(--font-jp)}.kihon-visual-builder span.subject{background:#dcefeb;color:#155d59}.kihon-visual-builder span.object{background:#fff1cc;color:#795a08}.kihon-visual-builder span.verb{background:#f7d7d2;color:#8d2c24}.kihon-visual-builder small{display:block;font:800 9px sans-serif}.kihon-visual-builder i{font-style:normal;color:rgba(255,255,255,.45)}.kihon-verb-practice{width:100%;box-sizing:border-box}.kihon-verb-practice .kihon-exercise-sentence{margin:18px 0 3px;color:var(--ink);font:600 clamp(23px,4vw,36px) var(--font-jp);text-align:center}.kihon-verb-practice .kihon-choice-row{max-width:660px;margin:18px auto}.kihon-verb-practice .kihon-choice-row button{min-width:120px;font-size:19px}@media(max-width:560px){.kihon-verb-hero{grid-template-columns:1fr}.kihon-verb-hero small{grid-column:1}.kihon-visual-builder>div:last-child{flex-direction:column}.kihon-visual-builder i{transform:rotate(90deg)}}

/* Kihon 05: a beginner-friendly verb anatomy lab. */
.kihon-verb-anatomy{display:grid;gap:20px;padding:clamp(24px,4vw,40px);border:1px solid var(--bd);border-radius:20px;background:linear-gradient(145deg,#fffaf0,#eef7f4);box-sizing:border-box;overflow:hidden}
.kihon-verb-anatomy>header h2{margin:7px 0 10px;color:var(--lacca-dk);font:400 clamp(29px,4vw,43px)/1.06 var(--font-display)}
.kihon-verb-anatomy>header p,.kihon-verb-moving p{max-width:760px;margin:0;color:var(--ink2);font:500 clamp(15px,2vw,18px)/1.65 var(--font)}
.kihon-verb-anatomy-lab{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:16px;align-items:stretch}
.kihon-verb-anatomy-result{display:grid;place-items:center;align-content:center;gap:12px;padding:22px;border:1px solid rgba(21,93,89,.16);border-radius:16px;background:rgba(255,255,255,.72);text-align:center;box-sizing:border-box}
.kihon-verb-split{display:flex;align-items:stretch;justify-content:center;gap:8px;max-width:100%}
.kihon-verb-split>span{display:grid;place-items:center;min-width:104px;padding:14px 13px;border-radius:13px;font:700 clamp(30px,5vw,46px)/1 var(--font-jp);box-sizing:border-box}
.kihon-verb-split .action{background:#dcefeb;color:#155d59}
.kihon-verb-split .ending{background:#f7d7d2;color:#8d2c24}
.kihon-verb-split small{display:block;margin-top:8px;font:800 9px/1.25 var(--font);letter-spacing:.02em}
.kihon-verb-split i{align-self:center;color:var(--ink3);font:700 20px/1 var(--font);font-style:normal}
.kihon-verb-structure-word{color:var(--ink);font:700 clamp(34px,6vw,54px)/1.2 var(--font-jp)}
.kihon-verb-structure-meaning{min-height:24px;margin:0;color:var(--ink2);font:700 15px/1.5 var(--font)}
.kihon-verb-structure-tags{display:flex;justify-content:center;gap:6px;flex-wrap:wrap}
.kihon-verb-structure-tags span{padding:6px 9px;border:1px solid rgba(21,93,89,.18);border-radius:999px;background:#eaf5f3;color:#155d59;font:800 10px/1 var(--font);text-transform:uppercase;letter-spacing:.04em}
.kihon-verb-anatomy-controls{display:grid;gap:10px}
.kihon-verb-anatomy-controls>div{display:grid;grid-template-columns:minmax(112px,.8fr) repeat(2,minmax(92px,1fr));gap:8px;align-items:center;padding:10px;border:1px solid var(--bd);border-radius:13px;background:rgba(255,255,255,.66)}
.kihon-verb-anatomy-controls strong{padding-left:4px;color:var(--ink2);font:800 12px/1.3 var(--font)}
.kihon-verb-anatomy-controls button{min-height:44px;padding:9px 11px;border:1px solid rgba(141,44,36,.24);border-radius:10px;background:#fffaf0;color:var(--ink2);font:800 12px/1.25 var(--font);cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
.kihon-verb-anatomy-controls button.is-selected{border-color:#8d2c24;background:#8d2c24;color:#fffaf0;box-shadow:0 3px 0 rgba(67,24,20,.16)}
.kihon-verb-anatomy-note{padding:16px 18px;border-left:4px solid #b33930;border-radius:0 12px 12px 0;background:rgba(247,215,210,.54)}
.kihon-verb-anatomy-note strong{display:block;margin-bottom:4px;color:#8d2c24;font:800 12px/1.3 var(--font);text-transform:uppercase;letter-spacing:.07em}
.kihon-verb-anatomy-note p{margin:0;color:var(--ink2);font:600 14px/1.6 var(--font)}
.kihon-verb-moving{display:grid;gap:14px;padding-top:2px}
.kihon-verb-moving h3{margin:5px 0 8px;color:var(--ink);font:400 clamp(25px,3.5vw,36px)/1.12 var(--font-display)}
.kihon-verb-picker{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(190px,.75fr);gap:12px;align-items:end;padding:14px;border:1px solid rgba(21,93,89,.18);border-radius:14px;background:rgba(255,255,255,.58)}
.kihon-verb-picker label{display:grid;gap:7px;min-width:0}.kihon-verb-picker label>span{color:#174f4c;font:800 11px/1.2 var(--font);letter-spacing:.07em;text-transform:uppercase}
.kihon-verb-picker select{width:100%;min-height:48px;padding:10px 42px 10px 13px;border:1px solid rgba(21,93,89,.32);border-radius:11px;background:#fffaf0;color:var(--ink);font:700 16px/1.3 var(--font-jp);cursor:pointer}
.kihon-verb-picker select:focus-visible{outline:3px solid rgba(40,123,119,.24);outline-offset:2px}
.kihon-verb-picker-meta{display:flex!important;align-items:center;justify-content:flex-end;gap:6px!important;min-height:48px;margin:0!important;flex-wrap:wrap;text-align:right}
.kihon-verb-picker-meta b,.kihon-verb-picker-meta span,.kihon-verb-picker-meta em{padding:6px 8px;border-radius:999px;font:800 10px/1.15 var(--font);font-style:normal;white-space:nowrap}
.kihon-verb-picker-meta b{background:#e3f0ed;color:#155d59;font-family:var(--font-jp)}.kihon-verb-picker-meta span{background:#fff1cc;color:#674f16}.kihon-verb-picker-meta em{background:#f7d7d2;color:#8d2c24}
.kihon-verb-moving-forms{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.kihon-verb-moving-forms span{display:grid;gap:4px;padding:13px 10px;border:1px solid var(--bd);border-radius:12px;background:rgba(255,255,255,.7);text-align:center}
.kihon-verb-moving-forms b{color:var(--ink);font:700 clamp(20px,3vw,27px)/1.25 var(--font-jp)}
.kihon-verb-moving-forms small{color:var(--ink3);font:700 10px/1.35 var(--font)}
.kihon-verb-moving-forms mark{padding:0;background:transparent;color:#b33930}
.kihon-verb-road-ruby{ruby-align:center}.kihon-verb-road-ruby>span{display:inline!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important}
.kihon-verb-moving>aside{padding:13px 15px;border-radius:11px;background:#fff1cc;color:#674f16;font:700 13px/1.55 var(--font)}
@media(max-width:760px){.kihon-verb-anatomy-lab{grid-template-columns:1fr}.kihon-verb-moving-forms{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.kihon-verb-anatomy{padding:22px 17px}.kihon-verb-anatomy-controls>div{grid-template-columns:1fr 1fr}.kihon-verb-anatomy-controls strong{grid-column:1/-1}.kihon-verb-split{width:100%}.kihon-verb-split>span{flex:1;min-width:0}.kihon-verb-picker{grid-template-columns:1fr}.kihon-verb-picker-meta{justify-content:flex-start;text-align:left}.kihon-verb-moving-forms{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* iPhone safe-area breathing room for every study flow. Five visual
   millimetres correspond to roughly 31 CSS px at the app's mobile scale. */
@media (max-width:520px){
  #sc-exam.active,
  #sc-manga.active,
  #sc-quiz.active,
  #sc-print-favorites.active{
    padding-top:31px !important;
    box-sizing:border-box !important;
  }
}

/* Header home: icone ingrandite senza alterare la griglia o le posizioni. */
.release-feature-hidden{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

/* iPad: approfondimento degli esempi senza modificare la card su iPhone. */
.daily-kanji-example-summary{grid-area:note;min-width:0}
.daily-kanji-meta{display:contents}
.daily-kanji-detail-trigger{display:none}
@media(min-width:768px){
  body.daily-kanji-detail-open{overflow:hidden}
  .daily-kanji{position:relative;height:214px;min-height:214px;padding-bottom:86px}
  .daily-kanji-example-summary{
    position:absolute;grid-area:auto;left:14px;right:14px;bottom:9px;z-index:3;
    display:block;min-height:68px
  }
  .daily-kanji-example-summary .home-note{
    display:grid;align-content:start;justify-items:stretch;gap:3px;min-width:0;width:100%;
    padding-right:0;padding-bottom:29px;overflow:visible;white-space:normal
  }
  .daily-kanji-example-summary .daily-note-entry,
  .daily-kanji-example-summary .daily-note-text{
    display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box
  }
  .daily-kanji-example-summary .daily-note-link{
    display:flex !important;flex-flow:row wrap !important;align-items:baseline;
    width:100% !important;max-width:100%;min-width:0;min-height:18px;box-sizing:border-box;
    padding:2px 6px;border:1px solid rgba(139,26,26,.18);border-radius:7px;
    background:rgba(249,236,236,.72);box-shadow:0 2px 6px rgba(92,61,46,.07);
    color:var(--ink);font-size:10px;line-height:1.25;text-align:left;white-space:normal
  }
  .daily-kanji-example-summary .daily-note-link > span{
    display:inline !important;width:auto !important;max-width:100%;min-width:0
  }
  .daily-kanji-example-summary .daily-note-link .daily-note-meaning{
    margin-left:3px
  }
  .daily-kanji-example-summary .daily-note-link:active{
    border-color:rgba(139,26,26,.42);background:rgba(249,225,225,.9)
  }
  .daily-kanji-detail-trigger{
    position:absolute;right:0;bottom:0;display:inline-flex;align-items:center;gap:4px;min-height:27px;
    padding:5px 9px;border:1px solid rgba(139,26,26,.28);border-radius:999px;
    background:rgba(255,249,237,.94);color:var(--lacca);font:800 10px/1.15 var(--font);
    cursor:pointer;box-shadow:0 3px 10px rgba(92,61,46,.10);white-space:nowrap
  }
  .daily-kanji-detail-trigger strong{color:var(--ink3);font-size:9px;font-weight:700}
  .daily-kanji-detail-trigger:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
  .daily-kanji-detail-trigger:disabled{display:none}
  .daily-kanji-detail-backdrop{z-index:3000}
  .daily-kanji-detail-modal{
    width:min(620px,calc(100vw - 44px));max-height:calc(100dvh - 44px);
    padding:22px;outline:0;overflow:auto;-webkit-overflow-scrolling:touch
  }
  .daily-kanji-detail-head h2{margin-top:2px;font-size:54px;line-height:1}
  .daily-kanji-detail-head p{margin:5px 0 0;color:var(--ink2);font-size:15px;font-weight:700}
  .daily-kanji-detail-readings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .daily-kanji-detail-readings div{
    display:grid;gap:5px;min-width:0;padding:12px 14px;border:1px solid var(--bd);
    border-radius:12px;background:rgba(255,255,255,.52)
  }
  .daily-kanji-detail-readings span,.daily-kanji-detail-examples-head span{
    color:var(--ink3);font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase
  }
  .daily-kanji-detail-readings strong{color:var(--ink);font:700 15px/1.35 var(--font-jp);overflow-wrap:anywhere}
  .daily-kanji-detail-examples-head{display:flex;align-items:center;gap:8px;margin:20px 0 9px}
  .daily-kanji-detail-examples-head strong{
    display:grid;place-items:center;min-width:22px;height:22px;border-radius:999px;
    background:var(--gold-bg);color:var(--amber);font-size:11px
  }
  .daily-kanji-detail-examples{display:grid;gap:9px;margin:0;padding:0;list-style:none}
  .daily-kanji-detail-examples li{
    position:relative;display:grid;gap:4px;padding:13px 14px;border:1px solid var(--bd);
    border-radius:12px;background:rgba(255,255,255,.62)
  }
  .daily-kanji-detail-example-main{display:flex;align-items:baseline;flex-wrap:wrap;gap:3px;padding-right:118px;font-family:var(--font-jp)}
  .daily-kanji-detail-example-main strong{color:var(--ink);font-size:18px}
  .daily-kanji-detail-example-main span{color:var(--ink3);font-size:13px}
  .daily-kanji-detail-examples p{margin:0;color:var(--ink2);font-size:13px;line-height:1.45}
  .daily-kanji-detail-examples button{
    position:absolute;top:13px;right:13px;border:0;background:transparent;
    color:var(--lacca);font:800 10px var(--font);cursor:pointer
  }
}

/* iPad: nuovo layout compatto della card web, valido sia in portrait sia in
   landscape. Il wrapper meta conserva il vecchio flusso su iPhone. */
@media(min-width:768px){
  .daily-kanji{
    grid-template-columns:62px minmax(0,1fr);
    grid-template-areas:
      "head head"
      "kanji title"
      "kanji strokes"
      "kanji readings"
      "note note";
    column-gap:10px;
    row-gap:1px;
  }
  .daily-kanji .home-card-head{min-width:0;gap:8px}
  .daily-kanji .home-kicker{
    min-width:0;color:var(--ink);font-size:17px;line-height:1;letter-spacing:0;
    text-transform:none;white-space:nowrap
  }
  .daily-kanji-actions{gap:3px}
  .daily-kanji-fav,.daily-kanji-back,.daily-kanji-next{width:25px;height:25px}
  .daily-kanji-fav{font-size:20px}
  .daily-kanji-back{font-size:15px}
  .daily-refresh-icon{width:19px;height:19px}
  .daily-kanji .home-kanji{font-size:45px}
  .daily-kanji .daily-kanji-practice-link:not(.is-disabled){
    display:grid;place-items:center;width:56px;height:52px;padding:0;
    border:1px solid rgba(92,61,46,.24);border-radius:13px;
    background:linear-gradient(145deg,rgba(255,252,245,.94),rgba(237,228,208,.76));
    box-shadow:inset 0 1px 0 rgba(255,255,255,.86),inset 0 -2px 5px rgba(92,61,46,.08),0 7px 16px rgba(92,61,46,.12)
  }
  .daily-kanji.daily-term-reference .home-kanji{font-size:31px}
  .daily-kanji .home-title{font-size:14px;line-height:1.15}
  .daily-kanji .daily-kanji-meta{
    grid-area:strokes;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:start;gap:10px;min-width:0
  }
  .daily-kanji .daily-kanji-level,.daily-kanji .daily-kanji-strokes{
    grid-area:auto;display:flex;align-items:baseline;gap:5px;min-width:0;
    color:var(--ink3);font-size:9px;font-weight:800;line-height:1.15;
    letter-spacing:.05em;text-transform:uppercase
  }
  .daily-kanji .daily-kanji-level strong,.daily-kanji .daily-kanji-strokes strong{
    flex:0 0 auto;color:var(--lacca);font-size:12px;letter-spacing:0
  }
  .daily-kanji .reading-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:5px 0 0
  }
  .daily-kanji .reading-grid div{
    display:grid;align-content:start;gap:3px;min-width:0;padding:0 !important;
    border:0 !important;border-radius:0 !important;background:none !important;
    box-shadow:none !important
  }
  .daily-kanji .reading-grid span{
    display:block;margin:0;font-size:9px;line-height:1.25;letter-spacing:.05em
  }
  .daily-kanji .reading-grid strong{
    display:block;min-width:0;overflow:hidden;color:var(--lacca) !important;font-size:12px;
    line-height:1.25;text-overflow:ellipsis;white-space:nowrap
  }
}
.header-side .header-actions.release-v1-actions{
  justify-content:flex-end !important;
  margin-left:auto !important;
  margin-right:0 !important;
}
.header-search-icon{
  /* Cresce verso sinistra: il margine con l'indicatore JLPT resta invariato. */
  scale:1.21;
  transform-origin:right center;
}
.header-print-favorites img,
.journey-trigger-image{
  scale:1.1;
  transform-origin:center;
}
.header-actions .progress-widget{
  scale:1;
}
/* Do not transform the progress button itself: its full-screen card is a
   descendant, and transformed ancestors turn a fixed card into a tiny local
   card.  Only the visual ring grows. */
.header-actions .progress-widget .progress-ring-btn,
.header-actions .progress-widget .progress-ring-btn:hover,
.header-actions .progress-widget .progress-ring-btn:active{
  scale:none !important;
  transform:none !important;
}
.header-actions .progress-widget .ring-svg,
.header-actions .progress-widget .ring-center{
  scale:1.1;
  transform-origin:center;
}

/* iPhone only: lower the JLPT progress visual by 1 mm in total. */
@media (max-width:520px){
  .header-actions .progress-widget .ring-svg,
  .header-actions .progress-widget .ring-center{
    transform:translateY(1mm);
  }
}

/* iPad only: lower the JLPT visual by 2 mm. */
html.ios-ipad .header-actions .progress-widget .ring-svg,
html.ios-ipad .header-actions .progress-widget .ring-center{
  transform:translateY(2mm);
}

/* iPad portrait only: align the hamburger center with the three action icons. */
@media (orientation:portrait) and (min-width:521px){
  html.ios-ipad #sc-lobby .header-main > .header-menu-wrap{
    transform:translateY(calc(23px - 2mm)) !important;
  }
}

/* iPad only: the translated hamburger creates its own stacking context.
   Keep the options panel above the Sensei and dictionary cards without
   changing the header geometry or the other platform layouts. */
html.ios-ipad #sc-lobby .app-header{
  position:relative;
  z-index:100;
}
html.ios-ipad #sc-lobby .header-main > .header-menu-wrap{
  z-index:101;
}

/* While dictionary search is open, leave no header control above the dimmed
   page.  The close button in the modal is the only visible control. */
body.dictionary-search-open .app-header{
  visibility:hidden !important;
  pointer-events:none !important;
}

/* Keep the five independent level selectors compact and readable on phones. */
@media (max-width:520px){
  #jlpt-progress-widget .progress-card-actions{
    width:100% !important;
    justify-content:center !important;
    flex-wrap:wrap;
    transform:none !important;
  }
  #jlpt-progress-widget .progress-card-header{
    padding-right:0 !important;
  }
  #jlpt-progress-widget .progress-card-header > :first-child{
    padding-right:42px;
  }
  #jlpt-progress-widget .progress-level-selector{
    flex:0 0 auto;
  }
}

/* iPad and larger: opening the indicator promotes its widget out of the
   header.  On these widths the original card was still absolutely positioned
   relative to that promoted widget, placing it at the end of the page.
   Present it as the same viewport-level modal used on iPhone instead. */
@media (min-width:521px){
  /* iPad only: lower only the four action icons by 5 mm (about 26 CSS px).
     The title, Japanese label, hamburger and every other header element stay
     exactly where they are. */
  .header-side .header-actions{
    transform:translateY(26px);
  }

  html.progress-panel-open{
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.progress-panel-open{
    position:fixed !important;
    top:var(--progress-lock-offset, 0px) !important;
    right:0 !important;
    left:0 !important;
    width:100% !important;
    height:100dvh !important;
    overflow:hidden !important;
    overscroll-behavior:none !important;
  }
  body.progress-panel-open .app-header{
    visibility:hidden !important;
    pointer-events:none !important;
  }
  body.progress-panel-open #jlpt-progress-widget{
    z-index:3000 !important;
  }
  body.progress-panel-open #jlpt-progress-widget .progress-ring-btn{
    display:none !important;
  }
  body.progress-panel-open #jlpt-progress-widget .progress-card,
  body.progress-panel-open #jlpt-progress-widget .progress-card.open{
    position:fixed !important;
    top:calc(env(safe-area-inset-top, 0px) + 24px) !important;
    right:auto !important;
    bottom:calc(env(safe-area-inset-bottom, 0px) + 24px) !important;
    left:50% !important;
    width:min(720px, calc(100vw - 64px)) !important;
    max-width:none !important;
    max-height:none !important;
    padding:28px !important;
    box-sizing:border-box !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    opacity:1 !important;
    pointer-events:auto !important;
    transform:translateX(-50%) !important;
    z-index:3001 !important;
  }
  body.progress-panel-open #jlpt-progress-widget .progress-card::before{
    display:none !important;
  }
  body.progress-panel-open #jlpt-progress-widget .progress-card-close{
    display:grid;
    position:absolute;
    top:16px;
    right:16px;
    width:38px;
    height:38px;
    place-items:center;
    padding:0;
    border:1px solid var(--progress-card-border);
    border-radius:999px;
    background:var(--progress-card-action-bg);
    color:var(--progress-card-title);
    font:400 30px/1 system-ui,-apple-system,sans-serif;
    cursor:pointer;
  }
}

/* Motto Kuwashiku: containment and readable scale on iPhone. */
.kihon-negative-path{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;margin:20px 0}.kihon-negative-path p{display:grid;gap:4px;margin:0;padding:17px;border:1px solid var(--bd);border-radius:13px;background:#fff}.kihon-negative-path>i{color:var(--kihon-coral);font-size:24px;font-style:normal}.kihon-negative-path span,.kihon-register-ladder span,.kihon-negative-use span{color:var(--kihon-teal);font:800 10px var(--font);letter-spacing:.05em;text-transform:uppercase}.kihon-negative-path b{font:700 18px var(--font-jp)}.kihon-negative-path small{color:var(--ink3);font-size:10px}.kihon-negative-path em{color:var(--ink2);font-size:13px;font-style:normal}.kihon-register-ladder{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:20px 0}.kihon-register-ladder p{display:grid;align-content:start;gap:7px;margin:0;padding:16px;border:1px solid var(--bd);border-radius:13px;background:#fff}.kihon-register-ladder p.is-everyday{border:2px solid var(--kihon-teal);background:#e4f2ee}.kihon-register-ladder b{font:700 17px var(--font-jp)}.kihon-register-ladder small{color:var(--ink3);line-height:1.4}.kihon-negative-use{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0}.kihon-negative-use p{display:grid;gap:6px;margin:0;padding:16px;border:1px solid var(--bd);border-radius:13px;background:#fff}.kihon-negative-use p.is-warning{border-color:#d9aa59;background:#fff7df}.kihon-negative-use b{font:700 18px var(--font-jp)}.kihon-negative-use small{color:var(--ink3)}@media(max-width:700px){.kihon-negative-path{grid-template-columns:1fr}.kihon-negative-path>i{transform:rotate(90deg);text-align:center}.kihon-register-ladder,.kihon-negative-use{grid-template-columns:1fr}}
@media(max-width:520px){
  #sc-kihon .kihon-deep-dive,#sc-kihon .kihon-deep-dive-toggle,#sc-kihon .kihon-deep-dive-body,#sc-kihon .kihon-deep-block,#sc-kihon .kihon-deep-sensei,#sc-kihon .kihon-deep-next{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
  #sc-kihon .kihon-deep-dive{overflow:hidden}
  #sc-kihon .kihon-deep-dive-toggle{padding:16px;gap:10px}
  #sc-kihon .kihon-deep-dive-toggle strong{font-size:26px}
  #sc-kihon .kihon-deep-dive-toggle em{font-size:11px}
  #sc-kihon .kihon-deep-dive-toggle>b{width:36px;height:36px;font-size:24px}
  #sc-kihon .kihon-deep-dive-body>header,#sc-kihon .kihon-deep-block{padding:22px 17px}
  #sc-kihon .kihon-deep-dive-body>header h2{font-size:34px}
  #sc-kihon .kihon-deep-block h3,#sc-kihon .kihon-deep-sensei h3{font-size:26px}
  #sc-kihon .kihon-deep-sensei{width:auto;max-width:calc(100% - 28px);margin:0 14px 22px;padding:17px}
  #sc-kihon .kihon-deep-example span{font-size:16px;padding:7px 6px}
  #sc-kihon .kihon-desu-table{width:100%;max-width:100%;box-sizing:border-box;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  #sc-kihon .kihon-deep-block p,#sc-kihon .kihon-deep-next p{overflow-wrap:anywhere}
}

/* The dictionary card uses the complete Sensei surface in landscape and on
   iPad portrait. iPhone portrait keeps its existing soft bottom treatment. */
@media (orientation:landscape),
       (orientation:portrait) and (min-width:521px){
  body.theme-rilievo .daily-kanji{
    border-color:rgba(156,104,74,.24);
    background:
      linear-gradient(135deg,rgba(255,252,245,.88),rgba(255,246,226,.66)),
      radial-gradient(circle at 8% 20%,rgba(197,143,33,.16),transparent 30%);
    box-shadow:0 10px 28px rgba(92,61,46,.10);
    backdrop-filter:blur(8px);
  }
  body.theme-rilievo .daily-kanji::before{
    -webkit-mask-image:none;
    mask-image:none;
  }
}

/* Landscape only: align the hamburger with the three header actions. */
@media (orientation:landscape){
  #sc-lobby .header-main > .header-menu-wrap{
    margin-top:31px;
  }
}

/* iPad only: compact the tappable dictionary ideogram by 30% so the
   readings and example row retain their full vertical space. */
@media (min-width:521px) and (min-height:700px){
  .daily-kanji .daily-kanji-actions{
    transform:translate(2mm,-3mm);
  }
  .daily-kanji-practice-link:not(.is-disabled){
    width:52px;
    height:52px;
    border-radius:11px;
    font-size:35px;
  }
}

/* iPad Pro 12.9/13-inch only: give both home briefing cards 1 cm more
   vertical room. Because they share one grid row, every section below is
   displaced downward by the same amount without changing its own layout. */
@media (min-width:1000px) and (min-height:1000px){
  .home-briefing-row:not(.sensei-hidden) .sensei-banner,
  .home-briefing-row:not(.sensei-hidden) .daily-kanji{
    height:calc(176px + 10mm);
  }
}

/* iPhone portrait and landscape: keep the ninja in normal flex flow with an
   exact 2 mm gap after “Sensei nascosto”, independent of viewport width. */
@media (max-width:520px),
       (orientation:landscape) and (max-height:520px){
  .sensei-restore{
    justify-content:flex-start;
    gap:0;
  }
  .sensei-hidden-ninja{
    transform:none;
    margin-left:2mm;
  }
  .sensei-restore-open{
    margin-left:auto;
  }
}

/* Center only N5-N1 between the LIVELLO and MODALITÀ separators on iOS. */
#sc-lobby > .lvl-picker{
  transform:translateY(9px);
}

/* ══════════════ ATLANTE DEI VERBI ══════════════ */
.dictionary-result-wrap{
  overflow:hidden;
  border:1px solid var(--bd);
  border-radius:var(--rm);
  background:rgba(255,255,255,.58);
}
.dictionary-result-wrap .dictionary-result{
  border:0;
  border-radius:0;
  background:transparent;
}
.dictionary-result-wrap .dictionary-result:hover{
  transform:none;
}
.dictionary-verb-atlas-btn{
  width:100%;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:9px;
  padding:10px 12px;
  border:0;
  border-top:1px solid var(--bd);
  background:var(--gold-bg);
  color:var(--ink2);
  cursor:pointer;
  text-align:left;
  font-family:var(--font);
}
.dictionary-verb-atlas-btn span{
  color:var(--lacca);
  font:800 10px var(--font-jp);
  letter-spacing:.08em;
}
.dictionary-verb-atlas-btn strong{font-size:12px}.dictionary-verb-atlas-btn b{color:var(--lacca);font-size:18px}
.dictionary-verb-atlas-btn:hover{background:rgba(184,134,11,.16)}
.verb-atlas-backdrop{z-index:3100;padding:0;background:rgba(26,10,0,.48)}
html.verb-atlas-open,body.verb-atlas-open{overflow:hidden!important;overscroll-behavior:none!important}
body.verb-atlas-open .app-header{visibility:hidden!important;pointer-events:none!important}
.verb-atlas-modal{
  width:min(100%,980px);
  height:min(100dvh,960px);
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  overflow:hidden;
  border:1px solid var(--bd2);
  border-radius:var(--r);
  background:var(--parchment);
  color:var(--ink);
  box-shadow:0 22px 70px rgba(26,10,0,.3);
}
.verb-atlas-head{
  display:grid;
  grid-template-columns:minmax(100px,1fr) auto minmax(100px,1fr);
  align-items:center;
  gap:12px;
  padding:14px 18px;
  border-bottom:1px solid var(--bd);
  background:var(--parchment);
}
.verb-atlas-head>div{text-align:center}.verb-atlas-head h2{margin:2px 0 0;color:var(--ink);font:700 20px var(--font)}
.verb-atlas-back,.verb-atlas-head .term-close-btn{
  justify-self:start;
  border:1px solid var(--bd);
  border-radius:999px;
  background:var(--parchment2);
  color:var(--lacca);
  padding:9px 12px;
  cursor:pointer;
  font:700 12px var(--font);
}
.verb-atlas-head .term-close-btn{justify-self:end;width:38px;height:38px;padding:0;font-size:22px}
.verb-atlas-scroll{overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:22px}
.verb-atlas-hero{
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(220px,.7fr);
  gap:18px;
  align-items:end;
  padding:25px;
  border:1px solid var(--bd);
  border-radius:var(--r);
  background:linear-gradient(135deg,var(--parchment2),var(--parchment));
}
.verb-atlas-kicker{color:var(--lacca);font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
.verb-atlas-hero h1{margin:7px 0 1px;color:var(--ink);font:700 clamp(46px,8vw,76px)/1.05 var(--font-jp)}
.verb-atlas-hero>div>p{margin:0;color:var(--ink3);font:500 14px var(--font-jp)}
.verb-atlas-meaning{display:grid;gap:5px;padding:16px;border-left:3px solid var(--gold);background:rgba(255,255,255,.48)}
.verb-atlas-meaning strong{color:var(--ink2);font-size:18px}.verb-atlas-meaning span,.verb-atlas-meaning em{color:var(--ink3);font-size:11px;font-style:normal}
.verb-atlas-principle{display:flex;flex-wrap:wrap;gap:7px 14px;margin:14px 0 24px;padding:13px 15px;border-radius:var(--rm);background:var(--jade-bg);color:var(--ink2);font-size:12px}
.verb-atlas-principle b{color:var(--jade)}
.verb-atlas-section{margin:24px 0}.verb-atlas-section>header{display:flex;justify-content:space-between;align-items:end;gap:14px;margin-bottom:10px;padding:0 3px}
.verb-atlas-section>header div{display:grid;gap:2px}.verb-atlas-section>header span{color:var(--ink);font-size:18px;font-weight:800}.verb-atlas-section>header small{color:var(--ink3);font-size:11px}.verb-atlas-section>header>b{color:var(--gold);font:500 18px var(--font-mono)}
.verb-atlas-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.verb-atlas-form{min-width:0;padding:15px;border:1px solid var(--bd);border-radius:var(--rm);background:rgba(255,255,255,.55)}
.verb-atlas-form>div{display:flex;justify-content:space-between;align-items:center;gap:8px}.verb-atlas-form>div>span{color:var(--ink3);font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.verb-atlas-form button,.verb-atlas-examples button{width:29px;height:29px;border:1px solid var(--bd);border-radius:50%;background:var(--parchment2);color:var(--lacca);cursor:pointer;font-size:10px}
.verb-atlas-form>strong{display:block;overflow-wrap:anywhere;margin:8px 0 2px;font:700 25px/1.25 var(--font-jp)}
.verb-atlas-form>strong i{color:var(--jade);font-style:normal}.verb-atlas-form>strong mark{padding:0;background:transparent;color:var(--kihon-coral,#c65f4c)}
.verb-atlas-form>em{color:var(--ink3);font:400 11px var(--font-jp);font-style:normal}.verb-atlas-form>p{margin:8px 0 0;color:var(--ink2);font-size:11px;line-height:1.45}
.verb-atlas-examples>div{display:grid;gap:8px}.verb-atlas-examples article{position:relative;display:grid;gap:3px;padding:14px 48px 14px 15px;border:1px solid var(--bd);border-radius:var(--rm);background:rgba(255,255,255,.55)}
.verb-atlas-examples article>b{font:700 18px var(--font-jp)}.verb-atlas-examples article>small{color:var(--ink3);font:400 11px var(--font-jp)}.verb-atlas-examples article>p{margin:3px 0 0;color:var(--ink2);font-size:12px}.verb-atlas-examples article>button{position:absolute;right:13px;top:13px}
.verb-atlas-source{margin:30px 0 5px;padding-top:14px;border-top:1px solid var(--bd);color:var(--ink3);font-size:10px;line-height:1.5}
body.theme-rilievo .dictionary-result-wrap,body.theme-rilievo .verb-atlas-modal,body.theme-rilievo .verb-atlas-hero,body.theme-rilievo .verb-atlas-form,body.theme-rilievo .verb-atlas-examples article{border-color:transparent;box-shadow:var(--ri-sm)}
body.theme-rilievo .verb-atlas-modal{box-shadow:0 36px 80px rgba(92,61,46,.26),0 10px 28px rgba(92,61,46,.16)}
body.theme-rilievo .verb-atlas-form,body.theme-rilievo .verb-atlas-examples article{background:var(--parchment2)}
body.theme-carbon-fire .verb-atlas-modal,body.theme-dark-base .verb-atlas-modal,body.theme-shinjuku .verb-atlas-modal{background:var(--parchment);border-color:rgba(255,255,255,.1)}
@media(max-width:520px){
  .verb-atlas-modal{width:100%;height:100dvh;border:0;border-radius:0}
  .verb-atlas-head{grid-template-columns:82px 1fr 38px;padding:calc(10px + env(safe-area-inset-top,0px)) 12px 10px}
  .verb-atlas-head h2{font-size:16px}.verb-atlas-back span{display:none}.verb-atlas-scroll{padding:14px 13px calc(24px + env(safe-area-inset-bottom,0px))}
  .verb-atlas-hero{grid-template-columns:1fr;gap:13px;padding:19px}.verb-atlas-hero h1{font-size:54px}.verb-atlas-meaning{border-left:0;border-top:3px solid var(--gold)}
  .verb-atlas-grid{grid-template-columns:1fr}.verb-atlas-form>strong{font-size:24px}
}

/* WKWebView su iPad può esporre una viewport CSS stretta. L'override iPad
   riguarda soltanto gli esempi: dimensioni, padding e griglia della card
   restano quelli originali del layout portrait. */
html.ios-ipad .daily-kanji{
  position:relative !important;
}
html.ios-ipad .daily-kanji-example-summary{
  position:static !important;
  grid-area:note !important;
  align-self:start !important;
  width:100% !important;
  max-width:100% !important;
  min-height:0 !important;
  display:block !important;
}
html.ios-ipad .daily-kanji-example-summary .home-note{
  display:grid !important;
  grid-template-columns:1fr !important;
  justify-items:stretch !important;
  gap:4px !important;
  width:100% !important;
  max-width:none !important;
  padding:0 !important;
  overflow:visible !important;
}
html.ios-ipad .daily-kanji-example-summary .daily-note-entry,
html.ios-ipad .daily-kanji-example-summary .daily-note-text{
  display:block !important;
  width:100% !important;
  max-width:none !important;
}
html.ios-ipad .daily-kanji-example-summary .daily-note-link{
  display:flex !important;
  flex-flow:row wrap !important;
  align-items:baseline !important;
  width:100% !important;
  max-width:none !important;
  min-height:22px !important;
  padding:3px 8px !important;
  border:1px solid rgba(139,26,26,.2) !important;
  border-radius:8px !important;
  background:rgba(249,236,236,.78) !important;
  box-shadow:0 2px 7px rgba(92,61,46,.08) !important;
  color:var(--ink) !important;
  font-size:11px !important;
  line-height:1.3 !important;
  text-align:left !important;
  white-space:normal !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
}
html.ios-ipad .daily-kanji-example-summary .daily-note-link > span{
  display:inline !important;
  width:auto !important;
  max-width:100% !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
}
html.ios-ipad .daily-kanji-example-summary .daily-note-meaning{
  margin-left:4px !important;
}
html.ios-ipad .daily-kanji-detail-trigger{
  position:absolute !important;
  right:9px !important;
  bottom:9px !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:4px !important;
  width:auto !important;
  max-width:none !important;
  min-height:27px !important;
  padding:5px 9px !important;
  border:1px solid rgba(139,26,26,.28) !important;
  border-radius:999px !important;
  background:rgba(255,249,237,.94) !important;
  color:var(--lacca) !important;
  font:800 10px/1.15 var(--font) !important;
  box-shadow:0 3px 10px rgba(92,61,46,.10) !important;
  white-space:nowrap !important;
}

/* iPhone: gli esempi della card conservano le dimensioni originali della
   dashboard, ma diventano righe evidenziate e cliccabili a larghezza piena. */
@media(max-width:520px){
  html:not(.ios-ipad) .daily-kanji-example-summary{
    grid-area:note !important;
    align-self:start !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }
  html:not(.ios-ipad) .daily-kanji-example-summary .home-note{
    display:grid !important;
    grid-template-columns:1fr !important;
    justify-items:stretch !important;
    gap:4px !important;
    width:100% !important;
    max-width:100% !important;
    overflow:visible !important;
  }
  html:not(.ios-ipad) .daily-kanji-example-summary .daily-note-entry,
  html:not(.ios-ipad) .daily-kanji-example-summary .daily-note-text{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
  }
  html:not(.ios-ipad) .daily-kanji-example-summary .daily-note-link{
    display:flex !important;
    flex-flow:row wrap !important;
    align-items:baseline !important;
    width:100% !important;
    max-width:100% !important;
    min-height:22px !important;
    padding:3px 8px !important;
    border:1px solid rgba(139,26,26,.2) !important;
    border-radius:8px !important;
    background:rgba(249,236,236,.78) !important;
    box-shadow:0 2px 7px rgba(92,61,46,.08) !important;
    color:var(--ink) !important;
    font-size:11px !important;
    line-height:1.3 !important;
    text-align:left !important;
    white-space:normal !important;
    overflow-wrap:normal !important;
    word-break:normal !important;
    -webkit-tap-highlight-color:transparent;
  }
  html:not(.ios-ipad) .daily-kanji-example-summary .daily-note-link > span{
    display:inline !important;
    width:auto !important;
    max-width:100% !important;
  }
  html:not(.ios-ipad) .daily-kanji-example-summary .daily-note-link:active{
    border-color:rgba(139,26,26,.42) !important;
    background:rgba(249,225,225,.92) !important;
  }
}
