/* ===== 이야기 영어책장 · style ===== */
:root{
  --paper:#FAF6EE;
  --paper2:#FFFDF8;
  --ink:#4A3F35;
  --ink-soft:#7A6C5C;
  --line:#EADFCB;
  --accent:#C0763F;
  --accent-deep:#A45D2B;
  --sage:#8A9A5B;
  --butter:#F6E6C4;
  --hl:#F7E7C8;
  --shadow:0 8px 26px rgba(120,92,55,.10);
  --r:22px;
  /* Netlify 등 무료 배포 화면의 우측 하단 로고/배지가 가리는 자리 */
  --badge:68px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  background:
    radial-gradient(1200px 600px at 10% -10%, #FFF6E6 0%, rgba(255,246,230,0) 60%),
    radial-gradient(900px 500px at 110% 10%, #F3EFDF 0%, rgba(243,239,223,0) 55%),
    var(--paper);
  color:var(--ink);
  font-family:"Apple SD Gothic Neo","Malgun Gothic","Noto Sans KR",-apple-system,BlinkMacSystemFont,system-ui,sans-serif;
  font-size:16px;
  line-height:1.5;
  min-height:100vh;
  -webkit-text-size-adjust:100%;
  padding-bottom:calc(var(--badge) + 92px + env(safe-area-inset-bottom));
}
#grain{
  position:fixed;inset:0;pointer-events:none;z-index:0;opacity:.5;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.045'/></svg>");
}
.hidden{display:none !important}
button{font-family:inherit;color:inherit;border:0;background:none;cursor:pointer}
h1,h2,h3{margin:0;line-height:1.25}

/* ---------- 상단 바 ---------- */
.topbar{
  position:sticky;top:0;z-index:30;
  backdrop-filter:saturate(1.2) blur(10px);
  background:rgba(250,246,238,.975);
  border-bottom:1px solid rgba(234,223,203,.75);
}
.bar-in{
  max-width:940px;margin:0 auto;
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 16px;gap:10px;
}
.brand{display:flex;align-items:center;gap:9px;padding:2px}
.logo{font-size:22px;filter:saturate(.95)}
.brand-txt{display:flex;flex-direction:column;align-items:flex-start;line-height:1.1}
.brand-txt b{font-size:16px;letter-spacing:-.2px}
.brand-txt small{font-size:10.5px;color:var(--ink-soft);letter-spacing:.6px}
.who{
  display:flex;align-items:center;gap:8px;
  background:var(--paper2);border:1px solid var(--line);
  padding:6px 8px 6px 13px;border-radius:999px;box-shadow:0 2px 8px rgba(120,92,55,.06);
  max-width:52%;
}
.who-name{font-size:13.5px;color:var(--ink-soft);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.who-av{
  width:28px;height:28px;border-radius:50%;display:grid;place-items:center;
  background:var(--butter);font-size:15px;flex:0 0 auto;
}

/* 자동 동기화 상태 줄 */
.syncbar{
  max-width:940px;margin:0 auto;
  padding:0 16px 7px;
  font-size:11.5px;font-weight:700;letter-spacing:-.1px;
  color:#7C6A55;text-align:center;line-height:1.35;
}
.syncbar[data-st="error"]{color:#A6462B}
.syncbar[data-st="loading"],.syncbar[data-st="saving"]{color:#8A7658}

/* ---------- 공통 ---------- */
.view{max-width:940px;margin:0 auto;padding:18px 16px 40px;position:relative;z-index:1}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border-radius:999px;padding:10px 16px;font-size:14.5px;font-weight:600;
  background:var(--paper2);border:1px solid var(--line);
  transition:transform .12s ease, box-shadow .18s ease, background .18s;
  white-space:nowrap;
}
.btn:active{transform:scale(.97)}
.btn.primary{background:linear-gradient(180deg,#CE834B,#B96C34);color:#FFF9F1;border-color:#AC6129;box-shadow:0 6px 16px rgba(176,100,48,.24)}
.btn.ghost{background:rgba(255,253,248,.75)}
.btn.wide{width:100%;padding:13px 18px;font-size:15.5px}
.btn.danger{background:#FBEDE7;border-color:#E8C3B3;color:#A6462B}
.btn[disabled]{opacity:.45}
.mini{font-size:12.5px;color:var(--ink-soft);line-height:1.55;margin:6px 0 0}
.lbl{display:block;font-size:12.5px;color:var(--ink-soft);margin:14px 0 6px;font-weight:600}
.inp{
  width:100%;padding:13px 14px;border-radius:14px;border:1px solid var(--line);
  background:#FFFCF6;font-size:16px;color:var(--ink);outline:none;
  font-family:inherit;
}
.inp:focus{border-color:#D8B992;box-shadow:0 0 0 3px rgba(216,185,146,.22)}
.inp.area{resize:vertical;line-height:1.45;font-size:14px}
.card{
  background:var(--paper2);border:1px solid var(--line);border-radius:var(--r);
  padding:18px;margin:14px 0;box-shadow:var(--shadow);
}
.card h3{font-size:16px;margin-bottom:2px}
.page-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:6px 2px 12px}
.page-head h2{font-size:22px;letter-spacing:-.4px}

/* ---------- 프로필 게이트 ---------- */
.gate{
  position:fixed;inset:0;z-index:40;display:grid;place-items:center;
  padding:20px 20px calc(20px + var(--badge));overflow:auto;
  background:
    radial-gradient(700px 500px at 30% 0%, #FFF4E2 0%, rgba(255,244,226,0) 65%),
    var(--paper);
}
.gate-card{
  width:100%;max-width:430px;background:var(--paper2);border:1px solid var(--line);
  border-radius:28px;padding:26px 22px;box-shadow:0 20px 50px rgba(120,92,55,.14);
}
.gate-card.small{max-width:360px}
.gate-head{text-align:center;margin-bottom:16px}
.gate-emoji{font-size:34px;margin-bottom:6px}
.gate-head h1{font-size:25px;letter-spacing:-.6px}
.gate-head h2{font-size:21px}
.gate-head p{color:var(--ink-soft);font-size:13.5px;line-height:1.6;margin:8px 0 0}
.gate-chips{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:12px}
.gate-chips span{font-size:11.5px;font-weight:700;color:#8A7A64;background:#FBF3E4;border:1px solid #EFE0C6;border-radius:999px;padding:5px 10px}
.profile-list{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin:6px 0 14px}
.profile-chip{
  display:flex;flex-direction:column;align-items:center;gap:5px;
  padding:12px 14px;border-radius:18px;border:1px solid var(--line);
  background:#FFFCF5;min-width:84px;
}
.profile-chip:active{background:var(--butter)}
.profile-chip .av{font-size:26px}
.profile-chip .nm{font-size:13px;font-weight:700;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.newprofile{margin-top:6px}
.inp.pin{letter-spacing:10px;text-align:center;font-size:20px}
.dots{display:flex;gap:12px;justify-content:center;margin:8px 0 16px}
.dots i{width:14px;height:14px;border-radius:50%;background:#EFE4CF;border:1px solid #E2D3B7;transition:.15s}
.dots i.on{background:var(--accent);border-color:var(--accent-deep);transform:scale(1.08)}
.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
.keypad button{
  padding:15px 0;border-radius:16px;background:#FFFCF6;border:1px solid var(--line);
  font-size:19px;font-weight:600;
}
.keypad button:active{background:var(--butter)}
.keypad .k-fn{font-size:17px;color:var(--ink-soft)}
.keypad .k-ok{background:linear-gradient(180deg,#CE834B,#B96C34);color:#FFF9F1;border-color:#AC6129;font-size:16px}
.pin-err{color:#B04A2C;font-size:13px;text-align:center;min-height:18px;margin:10px 0 6px}

/* ---------- 책장 ---------- */
.shelf-tabs{
  display:flex;gap:8px;padding:4px;background:rgba(255,253,248,.7);
  border:1px solid var(--line);border-radius:999px;margin:4px 0 10px;
}
.shelf-tabs button{
  flex:1;padding:11px 8px;border-radius:999px;font-size:13.5px;font-weight:700;color:var(--ink-soft);
  white-space:nowrap;
}
.shelf-tabs button.on{background:linear-gradient(180deg,#FFF7E8,#F7E9D2);color:var(--accent-deep);box-shadow:0 2px 8px rgba(160,120,70,.12)}
.shelf-desc{font-size:12.8px;color:var(--ink-soft);margin:2px 4px 14px;line-height:1.6}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.book{
  background:var(--paper2);border:1px solid var(--line);border-radius:20px;overflow:hidden;
  box-shadow:var(--shadow);text-align:left;display:flex;flex-direction:column;
  transition:transform .14s ease;
}
.book:active{transform:translateY(-2px) scale(.995)}
.book .thumb{position:relative;aspect-ratio:5/4;overflow:hidden;background:#F1E8D6}
.book .thumb img{width:100%;height:100%;object-fit:cover;display:block}
.book .num{
  position:absolute;left:9px;top:9px;background:rgba(255,253,248,.9);
  border-radius:999px;font-size:11.5px;font-weight:800;color:var(--accent-deep);
  padding:3px 9px;letter-spacing:.3px;box-shadow:0 2px 6px rgba(0,0,0,.08);
}
.book .done{
  position:absolute;right:9px;top:9px;background:rgba(138,154,91,.94);color:#fff;
  font-size:11px;font-weight:700;padding:3px 8px;border-radius:999px;
}
.book .meta{padding:11px 12px 13px;display:flex;flex-direction:column;gap:4px;flex:1}
.book .lv{font-size:10.5px;color:var(--sage);font-weight:700;letter-spacing:.2px}
.book .t{font-size:14.5px;font-weight:800;line-height:1.28;letter-spacing:-.2px;
  font-family:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif}
.book .tko{font-size:12px;color:var(--ink-soft);line-height:1.35}
.book .bar{margin-top:auto;padding-top:8px}
.bar-track{height:6px;border-radius:99px;background:#EFE5D2;overflow:hidden}
.bar-track i{display:block;height:100%;background:linear-gradient(90deg,#D79A63,#C0763F);border-radius:99px}
.bar-txt{font-size:10.5px;color:var(--ink-soft);margin-top:4px}
.shelf-foot{text-align:center;margin:22px 0 4px}
.shelf-foot p{font-size:11.5px;color:#9C8E7C}

/* ---------- 읽기 ---------- */
.reader-head{display:flex;align-items:flex-start;gap:10px;margin:2px 0 12px}
.back{
  font-size:13.5px;font-weight:700;color:var(--accent-deep);
  background:rgba(255,253,248,.8);border:1px solid var(--line);border-radius:999px;padding:7px 13px;
  flex:0 0 auto;
}
.rh-txt{display:flex;flex-direction:column;gap:2px;min-width:0;padding-top:2px}
.rh-num{font-size:11px;font-weight:800;color:var(--sage);letter-spacing:.6px}
.rh-txt b{font-size:17.5px;line-height:1.25;letter-spacing:-.3px;
  font-family:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif}
.rh-txt small{font-size:12.5px;color:var(--ink-soft)}
.cover{
  margin:0 0 12px;border-radius:22px;overflow:hidden;position:relative;
  border:1px solid var(--line);box-shadow:var(--shadow);background:#F1E8D6;
}
.cover img{width:100%;display:block;aspect-ratio:5/4;object-fit:cover}
.cover figcaption{
  position:absolute;left:0;right:0;bottom:0;padding:26px 16px 11px;
  font-size:12px;color:#FFF8EC;
  background:linear-gradient(transparent,rgba(58,42,28,.62));
  line-height:1.45;
}
.legend{display:flex;flex-wrap:wrap;gap:7px;margin:0 2px 12px}
.legend span{
  font-size:11.5px;font-weight:700;padding:5px 10px;border-radius:999px;
  background:#FFFCF5;border:1px solid var(--line);color:var(--ink-soft);
}
.legend .sw{display:inline-block;width:22px;height:9px;border-radius:3px;margin-right:5px;vertical-align:middle}
.controls{
  position:sticky;top:var(--tb,57px);z-index:20;
  display:flex;flex-wrap:wrap;align-items:center;gap:7px;
  background:rgba(250,246,238,.985);backdrop-filter:blur(8px);
  padding:9px 0 10px;margin:0 0 2px;
  border-bottom:1px solid rgba(234,223,203,.8);
  box-shadow:0 6px 14px -10px rgba(120,92,55,.5);
}
.controls .ctl{display:flex;align-items:center;gap:6px}
.controls .btn{padding:8px 12px;font-size:13px}
.controls .play{background:linear-gradient(180deg,#CE834B,#B96C34);color:#FFF9F1;border-color:#AC6129}
.controls .play.on{background:linear-gradient(180deg,#8A9A5B,#6F7F45);border-color:#63713C}
.speed{display:flex;align-items:center;background:#FFFCF5;border:1px solid var(--line);border-radius:999px;padding:2px 3px}
.sp-lbl{font-size:10.5px;color:#A2937D;font-weight:700;padding:0 6px 0 5px;letter-spacing:.2px}
.speed button{font-size:11.5px;font-weight:700;color:var(--ink-soft);padding:6px 9px;border-radius:999px}
.speed button.on{background:var(--butter);color:var(--accent-deep)}
.tog.on{background:#F3F7E9;border-color:#CFDDB2;color:#5F6F3A}
.progress-line{height:4px;background:#EEE4D2;border-radius:99px;margin:10px 2px 4px;overflow:hidden}
.progress-line i{display:block;height:100%;width:0;background:linear-gradient(90deg,#D79A63,#C0763F);transition:width .3s}
.resume{font-size:12px;color:var(--accent-deep);background:#FBF0DC;border:1px dashed #E2C69B;
  padding:8px 12px;border-radius:12px;margin:10px 0 4px}
.sent-list{display:flex;flex-direction:column;gap:4px;margin:10px 0 0}
.sent{
  display:flex;gap:10px;padding:13px 12px;border-radius:18px;border:1px solid transparent;
  scroll-margin-top:120px;
  transition:background .2s, border-color .2s;
}
.sent + .sent{border-top:1px solid rgba(234,223,203,.55)}
.sent.active{background:#FDF3DF;border-color:#EFDCB8}
.sent.now{box-shadow:0 0 0 2px rgba(192,118,63,.18)}
.sent .si{
  flex:0 0 auto;width:24px;height:24px;border-radius:50%;background:#F4EAD8;color:#9C8464;
  font-size:11px;font-weight:800;display:grid;place-items:center;margin-top:3px;
}
.sent.active .si{background:var(--accent);color:#FFF9F1}
.sent .body{min-width:0;flex:1}
.en{
  font-family:"Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  font-size:19px;line-height:1.72;letter-spacing:.1px;color:#43372C;
  word-break:normal;overflow-wrap:break-word;
}
body.big .en{font-size:22px}
.en .w{cursor:pointer;border-radius:6px;padding:0 1px;transition:background .12s}
.en .w:hover{background:#F5EAD4}
.en .w:active{background:#EFD9B4}
.en .w.inwb{background:linear-gradient(transparent 66%, #F3D9A6 66%)}
.en mark{background:transparent;padding:0 1px;border-radius:4px;font-weight:700;color:#40342A}
.en mark.pa{background:linear-gradient(transparent 58%, #F8C9AE 58%)}
.en mark.pi{background:linear-gradient(transparent 58%, #BED8EC 58%)}
.en mark.po{background:linear-gradient(transparent 58%, #CBE2B4 58%)}
.en mark.pe{background:linear-gradient(transparent 58%, #E6C9E8 58%)}
.en mark.pu{background:linear-gradient(transparent 58%, #F3C7BC 58%)}
.en mark.poa{background:linear-gradient(transparent 58%, #BFE0D2 58%)}
.en mark.pai{background:linear-gradient(transparent 58%, #F5D9A0 58%)}
.en mark.pay{background:linear-gradient(transparent 58%, #D6D2F0 58%)}
.ko{
  font-size:14.5px;line-height:1.62;color:#77675A;margin-top:5px;
  padding-left:1px;
}
body.ko-hide .ko{display:none}
.sent .sp{
  flex:0 0 auto;width:30px;height:30px;border-radius:50%;background:#FFFDF8;border:1px solid var(--line);
  font-size:13px;display:grid;place-items:center;color:var(--ink-soft);margin-top:1px;
}
.sent.active .sp{background:var(--accent);color:#fff;border-color:var(--accent-deep)}
.reader-foot{display:flex;justify-content:space-between;gap:10px;margin:26px 0 6px}
.reader-foot .btn{flex:1}

/* ---------- 단어장 ---------- */
.wb-actions{display:flex;gap:8px;margin:0 0 14px;flex-wrap:wrap}
.wb-actions .btn{flex:1}
.word-list{display:flex;flex-direction:column;gap:10px}
.wb-item{
  background:var(--paper2);border:1px solid var(--line);border-radius:18px;padding:14px 15px;
  display:flex;gap:12px;align-items:flex-start;box-shadow:0 3px 12px rgba(120,92,55,.05);
}
.wb-item .wl{flex:1;min-width:0}
.wb-item .ww{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.wb-item .ww b{font-size:18px;font-family:"Iowan Old Style",Palatino,Georgia,serif;letter-spacing:.2px}
.wb-item .ww .pos{font-size:10.5px}
.wb-item .wk{font-size:14px;color:#5C4F43;margin-top:3px}
.wb-item .we{font-size:12.5px;color:var(--ink-soft);margin-top:5px;line-height:1.5}
.wb-item .we i{font-style:normal;font-family:"Iowan Old Style",Palatino,Georgia,serif;font-size:13px}
.wb-btns{display:flex;flex-direction:column;gap:6px;flex:0 0 auto}
.wb-btns button{
  width:34px;height:34px;border-radius:50%;border:1px solid var(--line);background:#FFFCF6;
  font-size:14px;display:grid;place-items:center;
}
.empty{
  text-align:center;padding:38px 20px;color:var(--ink-soft);font-size:13.5px;line-height:1.7;
  background:var(--paper2);border:1px dashed var(--line);border-radius:20px;
}
.pos{
  display:inline-block;font-size:11px;font-weight:700;color:#7E6A4F;
  background:#F6EBD8;border-radius:6px;padding:2px 7px;vertical-align:middle;
}

/* ---------- 내 정보 ---------- */
.me-row{display:flex;align-items:center;gap:13px}
.me-av{width:46px;height:46px;border-radius:50%;background:var(--butter);display:grid;place-items:center;font-size:22px}
.me-row b{font-size:17px}
.me-btns{display:flex;gap:8px;margin-top:13px;flex-wrap:wrap}
.me-btns .btn{flex:1;min-width:110px}
.code-box{
  background:#F7F0E2;border:1px dashed #DDC9A6;border-radius:12px;
  padding:11px 12px;font-family:ui-monospace,Menlo,monospace;font-size:11px;line-height:1.5;
  color:#6B5945;word-break:break-all;max-height:110px;overflow:auto;margin:10px 0 10px;
}
.card hr{border:0;border-top:1px solid var(--line);margin:18px 0 4px}
.foot-note{text-align:center;font-size:11px;color:#A0927E;line-height:1.7;margin:22px 0 0}

/* ---------- 하단 탭 ---------- */
/* 우측 하단 배지 자리를 비워 두려고 하단에서 띄워 떠 있는 메뉴로 둡니다 */
.tabbar{
  position:fixed;left:10px;right:10px;
  bottom:calc(var(--badge) + env(safe-area-inset-bottom));z-index:35;
  display:flex;justify-content:space-around;align-items:stretch;
  padding:5px 8px;
  background:rgba(255,253,248,.97);
  backdrop-filter:saturate(1.15) blur(12px);
  border:1px solid var(--line);border-radius:22px;
  box-shadow:0 10px 26px rgba(120,92,55,.16);
}
.tabbar button{
  flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:7px 4px 5px;border-radius:14px;font-size:11px;font-weight:700;color:#9A8A75;
}
.tabbar button span{font-size:19px;line-height:1;filter:saturate(.9)}
.tabbar button.on{color:var(--accent-deep);background:#FBF2E1}

/* ---------- 시트(팝업) ---------- */
.overlay{
  position:fixed;inset:0;background:rgba(58,44,30,.36);z-index:45;
  opacity:0;transition:opacity .22s;
}
.overlay.show{opacity:1}
.sheet{
  position:fixed;left:0;right:0;bottom:0;z-index:50;
  background:var(--paper2);border-radius:26px 26px 0 0;
  padding:10px 18px calc(20px + var(--badge) + env(safe-area-inset-bottom));
  box-shadow:0 -14px 44px rgba(80,58,34,.22);
  transform:translateY(104%);transition:transform .28s cubic-bezier(.2,.8,.2,1);
  max-height:88vh;overflow:auto;
}
.sheet.show{transform:translateY(0)}
.sheet-grip{width:42px;height:4px;border-radius:99px;background:#E6DAC5;margin:2px auto 12px}
.word-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.word-top h2{
  font-size:31px;letter-spacing:-.4px;
  font-family:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
}
.speak{
  width:46px;height:46px;border-radius:50%;flex:0 0 auto;
  background:linear-gradient(180deg,#F6E9D1,#F0DEBE);border:1px solid #E3CDA6;font-size:19px;
  display:grid;place-items:center;box-shadow:0 3px 10px rgba(160,120,60,.14);
}
.speak.small{width:auto;height:auto;border-radius:999px;font-size:12.5px;padding:6px 12px;font-weight:700;color:var(--ink-soft);box-shadow:none;background:#FFFCF6}
.w-ko{font-size:19px;font-weight:700;margin:10px 0 14px;line-height:1.45}
.w-ex{background:#FBF4E7;border-radius:14px;padding:12px 13px;margin-bottom:4px}
.w-ex-en{font-family:"Iowan Old Style",Palatino,Georgia,serif;font-size:15.5px;line-height:1.6;margin:0 0 5px}
.w-ex-ko{font-size:13px;color:#7A6A58;margin:0 0 8px;line-height:1.5}
.sheet-btns{display:flex;flex-direction:column;gap:8px;margin-top:14px}

/* ---------- 퀴즈 ---------- */
.quiz-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.q-num{font-size:12px;font-weight:800;color:var(--sage);letter-spacing:.4px}
.q-close{font-size:17px;color:var(--ink-soft);padding:4px 8px}
.q-ask{font-size:12.5px;color:var(--ink-soft);margin:2px 0 2px}
.q-word{font-size:34px;letter-spacing:-.4px;font-family:"Iowan Old Style",Palatino,Georgia,serif;margin:2px 0 10px}
.q-speak{font-size:12.5px;font-weight:700;color:var(--accent-deep);background:#FBF0DC;border:1px solid #EBD6B4;padding:6px 12px;border-radius:999px}
.q-opts{display:flex;flex-direction:column;gap:9px;margin:16px 0 10px}
.q-opt{
  text-align:left;padding:14px 15px;border-radius:15px;border:1px solid var(--line);
  background:#FFFCF6;font-size:15px;line-height:1.45;font-weight:600;
  display:flex;gap:10px;align-items:flex-start;
}
.q-opt .k{
  width:22px;height:22px;border-radius:50%;background:#F3E9D6;color:#8A7658;font-size:11px;
  display:grid;place-items:center;flex:0 0 auto;font-weight:800;margin-top:1px;
}
.q-opt.right{background:#EFF6E6;border-color:#B9CE94}
.q-opt.wrong{background:#FBEAE4;border-color:#E2B4A2}
.q-opt.dim{opacity:.55}
.q-opt:disabled{cursor:default}
.q-fb{min-height:20px;font-size:13.5px;font-weight:700;margin:2px 0 8px;color:#5F7B3C}
.q-fb.bad{color:#B04A2C}
.q-foot{display:flex;align-items:center;justify-content:space-between;gap:10px}

/* ---------- 토스트 ---------- */
.toast{
  position:fixed;left:50%;bottom:calc(var(--badge) + 88px + env(safe-area-inset-bottom));transform:translate(-50%,14px);
  background:rgba(74,58,42,.94);color:#FFF8EC;font-size:13.5px;font-weight:600;
  padding:11px 18px;border-radius:999px;z-index:60;opacity:0;pointer-events:none;
  transition:opacity .2s, transform .2s;max-width:86vw;text-align:center;line-height:1.4;
}
.toast.show{opacity:1;transform:translate(-50%,0)}

/* ---------- 태블릿/데스크톱 ---------- */
@media (min-width:700px){
  .view{padding:22px 24px 48px}
  .tabbar{max-width:520px;margin:0 auto;left:0;right:0;bottom:calc(var(--badge) + 14px);border-radius:22px;border:1px solid var(--line);box-shadow:0 8px 26px rgba(120,92,55,.14)}
  .grid{grid-template-columns:repeat(3,1fr);gap:18px}
  .en{font-size:20.5px}
  .cover img{aspect-ratio:16/9;object-position:center 58%}
  .cover img[src$=".svg"]{object-position:center 84%}
  .sheet{
    left:50%;right:auto;bottom:auto;top:50%;
    width:min(460px,92vw);border-radius:26px;
    transform:translate(-50%,-46%) scale(.96);opacity:0;
    transition:transform .24s ease, opacity .24s ease;
    padding:16px 22px 22px;
  }  .sheet.show{transform:translate(-50%,-50%) scale(1);opacity:1}
  .sheet-grip{display:none}
  .quiz{width:min(520px,92vw)}
}
@media (min-width:1000px){
  .grid{grid-template-columns:repeat(4,1fr)}
}
@media (max-width:380px){
  .en{font-size:17.5px}
  .brand-txt small{display:none}
  .controls .btn{padding:7px 10px;font-size:12.5px}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none !important;animation:none !important}
}
