:root{
  --emerald:#144438;--forest:#0D3229;--ink:#173E33;--sub:#526B5E;
  --gold:#E8C98D;--deep-gold:#D4AA63;--focus:#C99D53;
  --paper:#F8F6EF;--canvas:#F3F5EF;--soft:#EDF5EE;--border:#DCE5DB;--cream:#FFF6E4;--danger:#B3261E;
  --bn:'Noto Sans Bengali','Hind Siliguri','SolaimanLipi',system-ui,sans-serif;
  --serif:'Noto Serif Bengali','Noto Serif',Georgia,serif;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--canvas);color:var(--ink);font-family:var(--bn)}
body{min-height:100dvh;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;background:var(--canvas);position:sticky;top:0;z-index:5}
.brand{display:flex;align-items:center;gap:8px;font-family:var(--serif);font-weight:700;color:var(--emerald);text-decoration:none;font-size:18px}
.mark{width:26px;height:26px;border-radius:9px;background:linear-gradient(145deg,var(--gold),var(--focus));display:grid;place-items:center;color:var(--forest);font-size:14px}
.top-actions{display:flex;gap:8px}
.chip{border:1px solid var(--border);background:#fff;color:var(--ink);border-radius:999px;padding:6px 12px;font-family:var(--bn);font-size:13px;font-weight:600;cursor:pointer}
main{flex:1;width:100%;max-width:520px;margin:0 auto;padding:8px 18px 110px}
h1{font-family:var(--serif);font-size:24px;line-height:1.5;margin:12px 0 6px;color:var(--emerald)}
h2{font-family:var(--serif);font-size:18px;margin:0 0 6px;color:var(--emerald)}
p.sub{color:var(--sub);font-size:15px;line-height:1.7;margin:0 0 14px}
p.hint{color:var(--sub);font-size:12.5px;line-height:1.7;margin:6px 0}
.card{background:#fff;border:1px solid var(--border);border-radius:18px;padding:16px;margin:12px 0}
.hero{background:linear-gradient(160deg,var(--emerald),var(--forest));border-radius:22px;padding:22px 20px;color:#fff;margin:16px 0}
.hero h1{color:#fff;margin:0 0 8px}
.hero p{color:#cfe4d8;margin:0;font-size:14px;line-height:1.7}
button.primary,button.ghost,button.danger{font-family:var(--bn);border-radius:14px;padding:13px 16px;font-size:15px;font-weight:700;cursor:pointer;border:0}
button.primary{background:var(--emerald);color:var(--cream)}
button.ghost{background:#fff;color:var(--emerald);border:1px solid var(--border)}
button.danger{background:#fff;color:var(--danger);border:1px solid #e7c4c0}
button:disabled{opacity:.55}
.row{display:flex;gap:10px;flex-wrap:wrap}
.row > *{flex:1;min-width:140px}
label{display:block;font-size:13px;color:var(--sub);margin:12px 0 5px}
input,select,textarea{width:100%;padding:12px 13px;border:1px solid var(--border);border-radius:12px;font-family:var(--bn);font-size:15px;background:#fff;color:var(--ink)}
textarea{min-height:70px;resize:vertical}
.opt{display:block;width:100%;text-align:right;background:#fff;border:1px solid var(--border);border-radius:14px;padding:13px 14px;font-family:var(--bn);font-size:15px;margin:8px 0;cursor:pointer}
.opt.on{border-color:var(--focus);background:var(--cream);font-weight:700}
.opt .n{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:8px;background:var(--soft);color:var(--emerald);font-size:12px;margin-left:10px;float:left}
.bar{height:6px;background:#e3ebe2;border-radius:999px;overflow:hidden;margin:10px 0 18px}
.bar i{display:block;height:100%;background:linear-gradient(90deg,var(--deep-gold),var(--gold))}
.tabs{position:fixed;left:0;right:0;bottom:0;display:flex;justify-content:space-around;background:#fff;border-top:1px solid var(--border);padding:10px 6px calc(10px + env(safe-area-inset-bottom));max-width:520px;margin:0 auto}
.tabs a{font-size:12.5px;color:var(--sub);text-decoration:none;padding:4px 6px;border-radius:8px}
.tabs a.on{color:var(--emerald);font-weight:700;background:var(--soft)}
.tabs[hidden]{display:none}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:86px;background:var(--emerald);color:var(--cream);padding:10px 16px;border-radius:12px;font-size:14px;max-width:92%;z-index:20}
.toast.err{background:var(--danger)}
.badge{display:inline-block;background:var(--soft);color:var(--emerald);border-radius:999px;padding:3px 10px;font-size:11.5px;font-weight:700;margin:2px 4px 2px 0}
.badge.warn{background:var(--cream);color:#7a5b1f}
.muted{color:var(--sub);font-size:12.5px}
.thread{display:flex;flex-direction:column;gap:8px;max-height:52vh;overflow:auto;padding:4px}
.msg{max-width:82%;padding:9px 12px;border-radius:14px;font-size:14.5px;line-height:1.6;background:var(--soft)}
.msg.mine{align-self:flex-start;background:var(--emerald);color:var(--cream)}
.msg.guard{align-self:center;background:var(--cream);color:#6b4f16;border:1px dashed var(--gold)}
.msg .who{display:block;font-size:10.5px;opacity:.75;margin-bottom:2px}
.compose{display:flex;gap:8px;margin-top:10px}
.compose input{flex:1}
svg.radar{display:block;width:100%;max-width:320px;margin:0 auto}
.list{display:grid;gap:10px}
.item{background:#fff;border:1px solid var(--border);border-radius:16px;padding:14px}
.item .head{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
.item .name{font-weight:700}
.row-actions{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.row-actions button{flex:1;min-width:110px}
.err{background:#fff2f1;border:1px solid #e7c4c0;color:#8c1d18;border-radius:12px;padding:10px 12px;font-size:13.5px;margin:10px 0}
.ok{background:var(--soft);border:1px solid var(--border);color:var(--emerald);border-radius:12px;padding:10px 12px;font-size:13.5px;margin:10px 0}
.progress-dots{display:flex;gap:4px;flex-wrap:wrap;margin:8px 0 14px}
.progress-dots i{width:8px;height:8px;border-radius:50%;background:#dbe6d9;display:block}
.progress-dots i.on{background:var(--focus)}
.photo{width:100%;max-width:280px;border-radius:16px;display:block;margin:10px auto;filter:blur(0)}
.photo.blurred{filter:blur(14px)}

/* the quiz header must not inherit the 140px min-width used by form rows */
.qhead-inline > *{min-width:0}
