/* Book theme (Speak English site): warm paper, serif headings, pages with a spine shadow, speech bubbles with portraits.
   Everything is scoped to html.theme-book, so the other sites are not affected. */
html.theme-book{--paper:#f1e8d3;--page:#fffdf6;--ink:#2a2118;--muted:#7a6a58;--line:#e6dcc4;--bookbrown:#3b2e22}
.theme-book body{background:var(--paper);background-image:radial-gradient(rgba(120,90,50,.07) 1px,transparent 1px);background-size:6px 6px;color:var(--ink);font-family:"Nunito",system-ui,sans-serif}
.theme-book h1,.theme-book h2,.theme-book h3,.theme-book .opnum,.theme-book .brand{font-family:"Lora",Georgia,serif}
.theme-book .topbar{background:var(--bookbrown);border-bottom:3px solid #c9a96a;color:#f6ecd6}
.theme-book .brand,.theme-book .brand a{color:#f6ecd6}
.theme-book .brand span,.theme-book .brandsub{color:#f2c36b!important}
.theme-book .mainnav a{color:#eadfc6}
.theme-book .mainnav a.on{color:#fff;border-bottom-color:#f2c36b}
.theme-book .mainnav a:hover{color:#fff}
.theme-book .userbox,.theme-book .userbox span{color:#eadfc6}
.theme-book .userbox .btn.ghost{color:#f6ecd6;border-color:#8a7656}
.theme-book .coursebar{background:#fbf5e6;border-bottom:3px solid var(--course,#0f766e)}
.theme-book .cb-title{color:var(--course,#0f766e);font-family:"Lora",serif}
.theme-book .cb-in a.on{border-bottom-color:var(--course,#0f766e)}
.theme-book .btn{background:var(--course,#0f766e);border-radius:999px;padding:10px 20px}
.theme-book .btn:hover{filter:brightness(.92);background:var(--course,#0f766e)}
.theme-book .btn.ghost{background:transparent;color:var(--ink);border:1px solid #cdbd9c;filter:none}
.theme-book .btn.ghost:hover{background:#f7efdc}
.theme-book .btn.small{padding:5px 12px;font-size:.85rem}

/* Course/volume page and home: cards look like book covers */
.theme-book .card{background:var(--page);border:1px solid #d9cba9;border-left:8px solid var(--course,#0f766e);border-radius:6px 14px 14px 6px;box-shadow:3px 4px 0 rgba(90,65,30,.12)}
.theme-book .card h3{font-family:"Lora",serif}
.theme-book .herocard{background:var(--page);border:1px solid #d9cba9;box-shadow:3px 4px 0 rgba(90,65,30,.12)}
.theme-book .scard{background:var(--page);border:1px solid #d9cba9}
.theme-book .bar{background:#eadfc6}
.theme-book .bar i{background:var(--course,#0f766e)}

/* The unit as a book: the step list becomes a strip of page tabs; the content is a page */
.theme-book .layout{display:block;max-width:900px;margin:0 auto}
.theme-book .layout .side{position:static;max-height:none;overflow:visible;background:transparent;border:0;padding:0 0 10px}
.theme-book .side h3{font-size:.95rem;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.06em;margin-bottom:6px}
.theme-book .side .meta,.theme-book .side .bar,.theme-book .seqnote{display:none}
.theme-book .steps{display:flex;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:0}
.theme-book .steps li{margin:0}
.theme-book .steps a,.theme-book .steps .locked{display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:10px 10px 0 0;background:#e9dec2;color:#5a4a36;text-decoration:none;font-size:.82rem;border:1px solid #d6c8a4;border-bottom:0}
.theme-book .steps a.cur{background:var(--page);color:var(--course,#0f766e);font-weight:700;border-color:#d6c8a4;box-shadow:0 2px 0 var(--page)}
.theme-book .steps .tag{display:none}
.theme-book .steps .dot{width:16px;height:16px;border-radius:50%;border:2px solid #bfae88;font-size:.65rem;line-height:12px;text-align:center;color:#fff;flex:none}
.theme-book .steps .dot.done{background:var(--course,#0f766e);border-color:var(--course,#0f766e)}
.theme-book .layout .main{background:var(--page);border:1px solid #d6c8a4;border-radius:2px 14px 14px 2px;padding:38px 48px 30px;box-shadow:8px 10px 0 rgba(90,65,30,.10);position:relative}
.theme-book .layout .main::before{content:"";position:absolute;left:0;top:0;bottom:0;width:22px;background:linear-gradient(90deg,rgba(90,65,30,.12),transparent)}
.theme-book .main>h2{font-size:1.6rem;color:var(--course,#0f766e);margin:0 0 4px;padding-bottom:10px;border-bottom:2px solid #eadfc6}
.theme-book .content{font-size:1.04rem;line-height:1.75}
.theme-book .content h3{font-family:"Lora",serif;color:var(--course,#0f766e);margin-top:30px}
.theme-book .back{color:var(--muted)}
.theme-book .nav{margin-top:26px}
.theme-book .langbar{background:#f6efdc;border-radius:999px}
.theme-book .keywords{border-radius:8px;overflow:hidden}
.theme-book .keywords th{background:var(--course,#0f766e);color:#fff}
.theme-book .example{background:#fff8e6;border:1px solid #f0dca4;border-left:5px solid #d9a21b}
.theme-book .tip{background:#eef7f0;border:1px solid #c5e1cc;border-left:5px solid #2f9e5b}
.theme-book .test{background:#f4effa;border-color:#d9cbef;border-left-color:#7c3aed}
@media (max-width:700px){.theme-book .layout .main{padding:24px 18px}.theme-book .layout .main::before{width:10px}}

/* Portraits */
.portrait{position:relative;display:inline-block;width:56px;height:56px;border-radius:50%;overflow:hidden;background:var(--pb,#e2e8f0);border:3px solid var(--pc,#334155);flex:none;box-shadow:0 2px 5px rgba(0,0,0,.2)}
.portrait .pinit{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:"Lora",serif;font-weight:700;font-size:1.5rem;color:var(--pc,#334155)}
.portrait img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 20%;opacity:0}
.portrait img.ok{opacity:1}
.portrait.big{width:112px;height:140px;border-radius:14px}
.portrait.big .pinit{font-size:3rem}

/* Unit opener */
.opener{text-align:center}
.opkicker{margin:0;text-transform:uppercase;letter-spacing:.14em;font-size:.8rem;color:var(--muted)}
.opnum{margin:6px 0 0;font-size:1.1rem;color:var(--course,#0f766e);font-weight:700;letter-spacing:.2em;text-transform:uppercase}
.opname{font-size:2.6rem;line-height:1.15;margin:0 0 14px}
.opintro{max-width:620px;margin:0 auto 10px;font-size:1.1rem;font-style:italic;color:#4a3d2d}
.opener h3{text-align:center}
.opgoals{display:inline-block;text-align:left;list-style:none;padding:0;margin:0 0 6px}
.opgoals li{padding-left:28px;position:relative;margin:7px 0}
.opgoals li::before{content:"\2713";position:absolute;left:0;top:0;width:20px;height:20px;border-radius:50%;background:var(--course,#0f766e);color:#fff;font-size:.75rem;text-align:center;line-height:20px}
.castrow{display:flex;flex-wrap:wrap;justify-content:center;gap:18px;margin:10px 0 6px}
.castcard{display:flex;flex-direction:column;align-items:center;width:120px;gap:4px}
.castcard b{font-family:"Lora",serif}
.castcard span{font-size:.8rem;color:var(--muted)}
.opener .my{text-align:left}

/* Pictures */
.sceneimg{margin:0 0 16px;border-radius:12px;overflow:hidden;border:1px solid #d6c8a4;background:#efe4c8}
.sceneimg .bookpic{display:block;width:100%;height:auto;max-height:340px;object-fit:cover}
.sceneimg figcaption{padding:8px 14px;font-size:.92rem;font-style:italic;color:#5a4a36;background:#f6edd8}
.sceneimg.wide .bookpic{max-height:300px}
.setting{font-style:italic;color:#5a4a36;background:#f6edd8;border-radius:10px;padding:10px 16px;margin:0 0 14px}

/* Scene player */
.scenebar{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;margin:6px 0 4px;padding:10px 14px;background:#f6edd8;border-radius:12px;position:sticky;top:64px;z-index:3;border:1px solid #e6d8b4}
.scenebar label{font-size:.88rem;color:#5a4a36;display:flex;align-items:center;gap:6px}
.scenebar select{border:1px solid #cdbd9c;border-radius:8px;padding:5px 8px;background:#fffdf6;font:inherit;font-size:.88rem}
.scenehelp{min-height:28px;margin:6px 4px 10px;color:#7a5a1a}
.dialog{display:flex;flex-direction:column;gap:12px;margin:8px 0 6px}
.dline{display:flex;align-items:flex-start;gap:12px}
.dline .bubble{flex:1;min-width:0;background:var(--pb);border:2px solid transparent;border-left:5px solid var(--pc);border-radius:4px 16px 16px 16px;padding:8px 14px 9px}
.dline .who{display:block;font-size:.74rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--pc)}
.dline .en{display:block;font-size:1.12rem;line-height:1.5;color:#251d14}
.dline .lmy{display:none;margin-top:4px;padding-top:4px;border-top:1px dashed rgba(0,0,0,.18);font-family:"Noto Sans Myanmar","Myanmar Text","Padauk",sans-serif;font-size:.95rem;line-height:1.9;color:#7c2d12}
body.lang-my .dline .lmy{display:block}
.linebtn{flex:none;align-self:center;width:36px;height:36px;border-radius:50%;border:1px solid #cdbd9c;background:#fffdf6;cursor:pointer;font-size:1rem;padding:0}
.linebtn:hover{background:#f6edd8}
.dline.now .bubble{border-color:var(--pc);box-shadow:0 0 0 3px rgba(0,0,0,.05);background:#fff}
.dline.now .portrait{transform:scale(1.08);transition:transform .15s}
.dline.yours .bubble{outline:3px dashed var(--pc);outline-offset:2px;background:#fffbe6}
.dialog.hidewords .dline:not(.yours) .en{filter:blur(7px);user-select:none}
.dialog.hidewords .dline:not(.yours) .lmy{display:none}
@media (max-width:600px){.scenebar{top:56px}.portrait{width:44px;height:44px}.dline{gap:8px}}

/* Speaking tasks */
.tasks.speak{display:flex;flex-direction:column;gap:14px}
.stask{background:#fbf5e6;border:1px solid #e6d8b4;border-radius:12px;padding:14px 18px}
.shead{display:flex;align-items:center;gap:10px;font-family:"Lora",serif;font-size:1.05rem}
.snum{width:28px;height:28px;border-radius:50%;background:var(--course,#0f766e);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:.85rem;font-weight:700}
.sbody{margin:8px 0 6px}.sbody p{margin:.4em 0}
.smodel{background:#fff;border-left:4px solid var(--course,#0f766e);padding:6px 12px;border-radius:4px;margin:6px 0}
.smlabel{font-size:.74rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--course,#0f766e)}
.srow{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.srow .recplay{height:36px;max-width:260px}
.srow .tick{margin-left:auto;font-size:.9rem;cursor:pointer}

.theme-book .main>h2.hide-h2{display:none}
.sceneimg.nopic::before{content:"Picture to come";display:flex;align-items:center;justify-content:center;min-height:190px;color:#a8946f;font-style:italic;background:repeating-linear-gradient(45deg,#f3e9cf,#f3e9cf 12px,#efe3c4 12px,#efe3c4 24px)}

/* Key words page */
.vintro{font-size:1.05rem;color:#4a3d2d}
.vbar{position:static;margin:6px 0 14px}
.vgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px;margin:6px 0 10px}
.vcard{background:#fbf5e6;border:1px solid #e6d8b4;border-top:5px solid var(--course,#0f766e);border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:6px;cursor:default}
.vtop{display:flex;align-items:center;gap:10px}
.vicon{font-size:2rem;line-height:1;flex:none}
.vtop>div{flex:1;min-width:0}
.vword{font-family:"Lora",serif;font-size:1.15rem;color:#251d14}
.vpos{font-size:.72rem;color:var(--muted);font-style:italic;margin-left:4px}
.vmean{font-size:.97rem;line-height:1.5}
.vmean .lmy{display:none;margin-top:3px;font-family:"Noto Sans Myanmar","Myanmar Text","Padauk",sans-serif;line-height:1.9;color:#7c2d12}
body.lang-my .vmean .lmy{display:block}
.vex{margin:2px 0 0;font-style:italic;color:#5a4a36;font-size:.93rem}
.vphrases{display:flex;flex-direction:column;gap:8px;margin:6px 0}
.vph{background:#fff;border:1px solid #e6d8b4;border-left:5px solid var(--course,#0f766e);border-radius:6px;padding:8px 12px;display:flex;flex-wrap:wrap;gap:4px 14px;align-items:baseline}
.vph b{font-family:"Lora",serif;font-size:1.02rem}
.vhidden .vcard:not(.shown) .vmean,.vhidden .vcard:not(.shown) .vex{filter:blur(6px);user-select:none;cursor:pointer}
.vhidden .vcard{cursor:pointer}

.vph .linebtn.small{width:30px;height:30px;font-size:.85rem;align-self:center}
.vph{align-items:center}

.theme-book .sitefoot{border-top:1px solid #d6c8a4;color:#7a6a58}

/* Dark version of the book theme (Speak English site): warm dark paper; the speech bubbles, pictures and portraits stay light so their characters keep their colors */
html.theme-book[data-theme="dark"]{--paper:#17130f;--page:#211b15;--ink:#efe6d4;--muted:#b3a58f;--line:#3a3226;--bookbrown:#100c09}
.theme-book[data-theme="dark"] body{background-image:radial-gradient(rgba(255,255,255,.035) 1px,transparent 1px)}
.theme-book[data-theme="dark"] .coursebar{background:#2a231b}
.theme-book[data-theme="dark"] .btn.ghost{border-color:#5a4d3a;color:var(--ink)}
.theme-book[data-theme="dark"] .btn.ghost:hover{background:#3a3226}
.theme-book[data-theme="dark"] .card,.theme-book[data-theme="dark"] .herocard,.theme-book[data-theme="dark"] .scard{border-color:#4a3d2d;box-shadow:3px 4px 0 rgba(0,0,0,.35)}
.theme-book[data-theme="dark"] .card{border-left-color:var(--course,#0f766e)}
.theme-book[data-theme="dark"] .bar{background:#3a3226}
.theme-book[data-theme="dark"] .steps a,.theme-book[data-theme="dark"] .steps .locked{background:#2c251c;color:#d8c9ad;border-color:#4a3d2d}
.theme-book[data-theme="dark"] .steps a.cur{background:var(--page);color:var(--course,#5fd1c4);border-color:#4a3d2d;box-shadow:0 2px 0 var(--page)}
.theme-book[data-theme="dark"] .steps .dot{border-color:#7a6a4a}
.theme-book[data-theme="dark"] .layout .main{border-color:#4a3d2d;box-shadow:8px 10px 0 rgba(0,0,0,.35)}
.theme-book[data-theme="dark"] .layout .main::before{background:linear-gradient(90deg,rgba(0,0,0,.35),transparent)}
.theme-book[data-theme="dark"] .main>h2{border-bottom-color:#3a3226}
.theme-book[data-theme="dark"] .langbar{background:#2c251c}
.theme-book[data-theme="dark"] .example{background:#33290f;border-color:#6a5420;border-left-color:#d9a21b}
.theme-book[data-theme="dark"] .tip{background:#16291c;border-color:#2c5a3b;border-left-color:#2f9e5b}
.theme-book[data-theme="dark"] .test{background:#261d38;border-color:#4a3a78;border-left-color:#7c3aed}
.theme-book[data-theme="dark"] .opintro,.theme-book[data-theme="dark"] .vintro,.theme-book[data-theme="dark"] .vex{color:#d8c9ad}
.theme-book[data-theme="dark"] .sceneimg{border-color:#4a3d2d;background:#2c251c}
.theme-book[data-theme="dark"] .sceneimg figcaption,.theme-book[data-theme="dark"] .setting{color:#d8c9ad;background:#2c251c}
.theme-book[data-theme="dark"] .sceneimg.nopic::before{color:#8c7d62;background:repeating-linear-gradient(45deg,#2a231b,#2a231b 12px,#30281f 12px,#30281f 24px)}
.theme-book[data-theme="dark"] .scenebar{background:#2c251c;border-color:#4a3d2d}
.theme-book[data-theme="dark"] .scenebar label{color:#d8c9ad}
.theme-book[data-theme="dark"] .scenebar select{background:#211b15;color:var(--ink);border-color:#5a4d3a}
.theme-book[data-theme="dark"] .scenehelp{color:#e6c675}
.theme-book[data-theme="dark"] .linebtn{background:#2c251c;border-color:#5a4d3a;color:var(--ink)}
.theme-book[data-theme="dark"] .linebtn:hover{background:#3a3226}
.theme-book[data-theme="dark"] .stask,.theme-book[data-theme="dark"] .vcard{background:#2a231b;border-color:#4a3d2d}
.theme-book[data-theme="dark"] .vcard{border-top-color:var(--course,#0f766e)}
.theme-book[data-theme="dark"] .smodel,.theme-book[data-theme="dark"] .vph{background:#2c251c;border-color:#4a3d2d}
.theme-book[data-theme="dark"] .smodel{border-left-color:var(--course,#0f766e)}
.theme-book[data-theme="dark"] .vph{border-left-color:var(--course,#0f766e)}
.theme-book[data-theme="dark"] .vword{color:var(--ink)}
.theme-book[data-theme="dark"] .vmean .lmy{color:#f0b08a}
.theme-book[data-theme="dark"] .sitefoot{border-top-color:#4a3d2d;color:#b3a58f}
.theme-book[data-theme="dark"] .main>h2,.theme-book[data-theme="dark"] .content h3,.theme-book[data-theme="dark"] .cb-title,.theme-book[data-theme="dark"] .opnum,.theme-book[data-theme="dark"] .smlabel,.theme-book[data-theme="dark"] .steps a.cur{color:color-mix(in srgb,var(--course,#0f766e) 50%,#ffffff)}
