/* DAQIQ Peers — same palette and type as daqiq.qa (deep HBKU blue + "in range" sea teal on cool pearl) */
:root {
  --bg: #F5F7F8; --card: #ffffff; --ink: #1B2433; --ink2: #2E3A4D; --muted: #5B6576; --line: #DDE2E7; --hover: #EEF2F6;
  --brand: #14467E; --brand-ink: #ffffff; --brand-soft: #E4ECF6; --brand-2: #2A72C5;
  --accent: #2E8C83; --accent-soft: #DDEFEC; --danger: #B3372E; --ok: #2E8C83;
  --shadow: 0 0 0 1px rgba(27,36,51,.06), 0 2px 4px rgba(27,36,51,.05);
  --shadow-lg: 0 8px 28px rgba(27,36,51,.16), 0 0 0 1px rgba(27,36,51,.05);
  --radius: 12px; --top: 60px;
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", "IBM Plex Sans Arabic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #10151E; --card: #171E2A; --ink: #E8ECF2; --ink2: #C9D1DD; --muted: #A3ADBD; --line: #2A3342; --hover: #1E2735;
    --brand: #7DB2F0; --brand-ink: #0B1A2E; --brand-soft: #16243A; --brand-2: #8FC0F5; --accent: #4FB8AC; --accent-soft: #14302D;
    --danger: #FF8A80; --ok: #4FB8AC; --shadow: 0 0 0 1px rgba(255,255,255,.06); --shadow-lg: 0 8px 28px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08);
    color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); background: var(--card); box-shadow: var(--shadow); }
.topbar-in { max-width: 1128px; height: 100%; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -.2px; color: var(--brand); }
.logo-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 15px; }
.logo small { font-size: 10px; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0 4px; }
.search { flex: 0 1 280px; display: flex; align-items: center; gap: 8px; background: var(--hover); border-radius: 6px; padding: 0 10px; height: 36px; color: var(--muted); }
.search input { border: 0 !important; box-shadow: none !important; background: transparent; outline: none; width: 100%; color: var(--ink); padding: 0; }
.topnav { margin-left: auto; display: flex; height: 100%; }
.topnav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 76px; padding: 0 6px; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; }
.topnav a:hover { color: var(--ink); }
.topnav a.on { color: var(--ink); border-bottom-color: var(--ink); }
.dotcount { position: absolute; top: 5px; left: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.tabbar { display: none; }

/* ---------- layout ---------- */
.layout { max-width: 1128px; margin: 0 auto; padding: 24px 16px 40px; display: grid; gap: 24px;
  grid-template-columns: 225px minmax(0, 1fr) 300px; align-items: start; }
.layout.wide { grid-template-columns: 225px minmax(0, 1fr); }
.layout.single { grid-template-columns: minmax(0, 760px); justify-content: center; }
.side { position: sticky; top: calc(var(--top) + 24px); display: grid; gap: 8px; }
.main { display: grid; gap: 8px; min-width: 0; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pad { padding: 12px 16px; } .pad-lg { padding: 20px 24px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; } .b { font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; } .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; } .hr { height: 1px; background: var(--line); margin: 8px 0; }
.stack { display: grid; gap: 12px; }

/* profile mini card */
.cover { height: 56px; background: linear-gradient(120deg, hsl(var(--h,212) 62% 26%), hsl(calc(var(--h,212) - 22) 52% 38%)); }
.cover.lg { height: 160px; }
.mini { text-align: center; padding: 0 12px 14px; }
.mini .avatar { margin: -36px auto 8px; border: 2px solid var(--card); }
.mini h4 { margin: 0; font-size: 16px; }
.statline { display: flex; justify-content: space-between; padding: 8px 16px; font-size: 13px; color: var(--muted); }
.statline b { color: var(--brand); }
.navlist a { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 14px; color: var(--ink2); font-weight: 600; }
.navlist a:hover { background: var(--hover); }
.navlist .avatar { width: 28px; height: 28px; font-size: 12px; border-radius: 6px; }
.sect-title { padding: 12px 16px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* avatars */
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 18px;
  color: #fff; background: hsl(var(--h, 205) 52% 36%); user-select: none; }
.avatar.xs { width: 32px; height: 32px; font-size: 13px; } .avatar.s { width: 40px; height: 40px; font-size: 15px; }
.avatar.m { width: 72px; height: 72px; font-size: 28px; } .avatar.xl { width: 152px; height: 152px; font-size: 56px; border: 4px solid var(--card); }
.avatar.sq { border-radius: 10px; }

/* badges & chips */
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 1px 6px; vertical-align: 1px;
  background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.grey { background: var(--hover); color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 5px 12px; font-size: 14px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.chip:hover { background: var(--hover); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
label.chip { display: inline-flex; align-items: center; gap: 6px; }
label.chip input { display: none; }
label.chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* buttons */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 18px; padding: 7px 16px;
  font-weight: 600; font-size: 15px; cursor: pointer; background: var(--brand); color: var(--brand-ink); }
.btn:hover { background: var(--brand-2); }
.btn.outline { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.btn.outline:hover { background: var(--brand-soft); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.sm { padding: 4px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.iconbtn:hover { background: var(--hover); color: var(--ink); }

/* forms */
form.f { display: grid; gap: 12px; }
.f label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=url], input:not([type]), textarea, select {
  width: 100%; background: var(--card); border: 1px solid #8c8c8c88; border-radius: 6px; padding: 9px 11px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
textarea { resize: vertical; min-height: 90px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }

/* composer */
.composer { padding: 12px 16px 6px; }
.composer .start { flex: 1; text-align: left; border: 1px solid #8c8c8c88; border-radius: 28px; padding: 12px 16px; background: var(--card);
  color: var(--muted); font-weight: 600; cursor: pointer; }
.composer .start:hover { background: var(--hover); }
.composer .quick { display: flex; justify-content: space-around; padding-top: 6px; }
.composer .quick button { border: 0; background: none; display: flex; align-items: center; gap: 8px; padding: 10px 8px; border-radius: 6px;
  color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.composer .quick button:hover { background: var(--hover); }
.composer textarea.big { border: 0; box-shadow: none; padding: 4px 0; font-size: 17px; min-height: 120px; }

/* posts */
.post-head { display: flex; gap: 8px; padding: 12px 16px 0; }
.post-head .who { flex: 1; min-width: 0; line-height: 1.3; }
.post-head .name { font-weight: 600; font-size: 14px; }
.post-head .name:hover { color: var(--brand); text-decoration: underline; }
.post-body { padding: 8px 16px 4px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.more { border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 0 16px 6px; }
.more:hover { color: var(--brand); text-decoration: underline; }
.post.edu { box-shadow: var(--shadow), inset 3px 0 0 var(--accent); }
.edu-tag { margin: 8px 16px 0; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 4px; padding: 3px 8px; }
.counts { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; font-size: 13px; color: var(--muted); }
.counts button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.counts button:hover { color: var(--brand); text-decoration: underline; }
.emo { display: inline-flex; }
.emo span { width: 18px; height: 18px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 12px;
  margin-right: -4px; box-shadow: 0 0 0 1.5px var(--card); }
.actions { display: flex; margin: 0 12px; border-top: 1px solid var(--line); padding: 4px 0; }
.act { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; padding: 10px 4px; border-radius: 6px;
  color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.act:hover { background: var(--hover); color: var(--ink); }
.act.on { color: var(--brand); }
.react-wrap { position: relative; flex: 1; display: flex; }
.react-wrap .act { flex: 1; }
.picker { position: absolute; bottom: calc(100% - 4px); left: 0; display: none; gap: 2px; padding: 6px 8px; background: var(--card); border-radius: 28px;
  box-shadow: var(--shadow-lg); z-index: 20; }
.react-wrap:hover .picker, .picker.open { display: flex; }
.picker button { border: 0; background: none; font-size: 28px; line-height: 1; padding: 4px; border-radius: 50%; cursor: pointer; transition: transform .12s; }
.picker button:hover { transform: scale(1.3) translateY(-4px); }
.picker button[title]::after { content: none; }

.comments { padding: 4px 16px 12px; display: grid; gap: 8px; }
.cbox { display: flex; gap: 8px; align-items: flex-start; }
.cbox input { border-radius: 20px; padding: 9px 14px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.bubble { background: var(--hover); border-radius: 0 10px 10px 10px; padding: 8px 12px; flex: 1; min-width: 0; }
.bubble .ctext { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin-top: 2px; }

/* dropdown menu */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 100%; min-width: 200px; background: var(--card); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px 0; z-index: 30; display: none; }
.menu.open { display: block; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 16px; text-align: left; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink2); }
.menu button:hover, .menu a:hover { background: var(--hover); }
.menu .danger { color: var(--danger); }

/* group header */
.ghead .cover.lg { height: 180px; }
.ghead .info { padding: 16px 24px 0; }
.ghead h1 { margin: 0; font-size: 26px; }
.tabs { display: flex; gap: 4px; padding: 8px 16px 0; border-top: 1px solid var(--line); margin-top: 14px; overflow-x: auto; }
.tabs a { padding: 12px 12px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-size: 15px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* profile header */
.phead .avatar.xl { margin: -88px 0 0 24px; }
.phead .info { padding: 8px 24px 20px; }
.phead h1 { margin: 0; font-size: 24px; }

/* library */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tile .thumb { height: 104px; display: grid; place-items: center; font-size: 44px;
  background: linear-gradient(135deg, hsl(var(--h) 55% 92%), hsl(calc(var(--h) - 25) 45% 84%)); }
@media (prefers-color-scheme: dark) { .tile .thumb { background: linear-gradient(135deg, hsl(var(--h) 35% 20%), hsl(calc(var(--h) - 25) 30% 26%)); } }
.tile .tbody { padding: 10px 12px; flex: 1; display: grid; gap: 4px; align-content: start; }
.tile .title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.tile .sum { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .tfoot { padding: 8px 12px 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.libmini { display: flex; gap: 10px; padding: 8px 16px; align-items: center; }
.libmini:hover { background: var(--hover); }
.libmini .ic { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; font-size: 20px; flex: none;
  background: linear-gradient(135deg, hsl(var(--h) 55% 92%), hsl(calc(var(--h) - 25) 45% 84%)); }
.viewer { width: 100%; height: min(75vh, 720px); border: 0; background: var(--hover); display: block; }
.article { white-space: pre-wrap; font-size: 16px; line-height: 1.6; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat .n { font-size: 28px; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); font-weight: 600; }

/* lists */
.li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
a.li:hover { background: var(--hover); }
.notif.unread { background: var(--brand-soft); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--card); border-radius: 10px; box-shadow: var(--shadow-lg); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-h h2 { margin: 0; font-size: 19px; }
.modal-b { padding: 16px 24px 20px; }

/* misc */
.notice { background: var(--brand-soft); color: var(--ink2); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.empty .big { font-size: 40px; }
.auth { min-height: calc(100vh - var(--top)); display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: min(420px, 100%); }
.auth h1 { font-size: 30px; font-weight: 400; margin: 0 0 6px; }
#toast { position: fixed; left: 16px; bottom: 24px; background: var(--ink); color: var(--card); padding: 12px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; z-index: 200; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: none; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card), var(--hover), var(--card)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .layout { grid-template-columns: 225px minmax(0, 1fr); }
  .layout > .side.right { display: none; }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .layout, .layout.wide { grid-template-columns: minmax(0, 1fr); padding: 8px 0 24px; gap: 8px; }
  .layout > .side { display: none; }
  .card, .tile, .stat { border-radius: 0; }
  .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 8px; }
  .lib-grid .tile { border-radius: 10px; }
  .stats { padding: 0 8px; } .stats .stat { border-radius: 10px; }
  .topnav, .search { display: none; }
  .topbar-in .mob-right { display: flex; margin-left: auto; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--card); box-shadow: 0 -1px 0 var(--line);
    padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; color: var(--muted); position: relative; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--ink); }
  .ghead .cover.lg { height: 120px; } .ghead .info { padding: 12px 16px 0; } .ghead h1 { font-size: 22px; }
  .phead .avatar.xl { width: 112px; height: 112px; font-size: 42px; margin: -60px 0 0 16px; } .phead .info { padding: 8px 16px 16px; }
  .cover.lg { height: 110px; }
  .modal-bg { place-items: end stretch; padding: 0; }
  .modal { width: 100%; border-radius: 14px 14px 0 0; max-height: 92vh; }
  .modal-b { padding: 16px; }
  #toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .picker button { font-size: 26px; }
}
@media (min-width: 761px) { .mob-right { display: none !important; } }

/* ---------- v0.3: builders, players, trust, settings, admin ---------- */
.h1 { margin: 0; font-size: 22px; }
.link { color: var(--brand); }
.stack-8 { display: grid; gap: 8px; }
.pad-x { padding: 0 24px; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.badge.ok { background: var(--accent-soft); color: var(--ok); }
.badge.danger { background: var(--danger); color: #fff; }
.trust-auth { background: var(--brand); color: var(--brand-ink); }
.trust-end { background: var(--accent-soft); color: var(--accent); }
.badge svg.i { width: 12px; height: 12px; stroke-width: 2.4; }
.notice.ok { background: var(--accent-soft); } .notice.bad { background: #fdecea; }
@media (prefers-color-scheme: dark) { .notice.ok, .trust-end, .badge.ok { background: #183526; } .notice.bad { background: #3a1d1b; } }
.layout.single.wide-single { grid-template-columns: minmax(0, 1100px); }
.layout.single.editor { grid-template-columns: minmax(0, 1128px); }
.modal.wide { width: min(760px, 100%); }
.qlink { display: flex; align-items: center; gap: 8px; padding: 10px 8px; border-radius: 6px; color: var(--muted); font-weight: 600; font-size: 14px; }
.qlink:hover { background: var(--hover); }
.ellipsis2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* shared content card in the feed */
.share-card { display: flex; gap: 12px; margin: 6px 16px 4px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
a.share-card:hover { background: var(--hover); }
.share-card .thumb { width: 92px; min-height: 84px; flex: none; display: grid; place-items: center; font-size: 34px;
  background: linear-gradient(135deg, hsl(var(--h) 55% 92%), hsl(calc(var(--h) - 25) 45% 84%)); }
.share-card .sc-body { display: grid; gap: 3px; padding: 10px 12px 10px 0; align-content: center; min-width: 0; }
.share-card.static { margin: 0; }
.modnote { margin: 8px 16px 0; padding: 6px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--ink2); font-size: 12px; }
.modnote.bad { background: #fdecea; }
.bubble .modnote { margin: 4px 0; }
.avatar.bot { background: var(--brand-soft); font-size: 16px; }
.bubble.botb { background: var(--brand-soft); }

/* create & editor */
.type-grid, .tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.type-card { display: grid; gap: 6px; justify-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.type-card:hover { background: var(--hover); border-color: var(--brand); }
.type-card.off { opacity: .5; cursor: not-allowed; }
.type-card .ic, .libmini .ic { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, hsl(var(--h) 55% 92%), hsl(calc(var(--h) - 25) 45% 84%)); }
.tpl { display: grid; gap: 4px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.tpl:hover, .tpl:focus { border-color: var(--brand); background: var(--brand-soft); outline: none; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.preview-pane { position: sticky; top: calc(var(--top) + 16px); max-height: calc(100vh - var(--top) - 32px); overflow: auto; border-radius: var(--radius); }
.pv { border-top: 1px solid var(--line); }
.seg { display: none; background: var(--hover); border-radius: 18px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 16px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.blk { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; background: var(--card); }
.blk-h { display: flex; align-items: center; gap: 6px; }
.blk-h select { width: auto; padding: 4px 8px; }
.blk-h .iconbtn { width: 30px; height: 30px; }
.iconbtn:disabled { opacity: .3; }
.qn { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.block-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.block-grid .chip { font-size: 13px; padding: 4px 10px; }

/* page player */
.page-body { display: grid; gap: 14px; font-size: 16px; line-height: 1.6; }
.pb-h { font-size: 20px; margin: 8px 0 0; }
.pb-p { margin: 0; }
.pb-fig { margin: 0; } .pb-fig img { border-radius: 10px; display: block; width: 100%; }
.pb-fig figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pb-video { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; background: var(--hover); }
.pb-box { border-radius: 10px; padding: 12px 14px; background: var(--hover); }
.pb-box p { margin: 4px 0 0; }
.pb-box.tip { background: var(--accent-soft); } .pb-box.warn { background: #fdf0e1; } .pb-box.fact { background: var(--brand-soft); }
@media (prefers-color-scheme: dark) { .pb-box.tip { background: #183526; } .pb-box.warn { background: #3a2c18; } }
.pb-bt { font-weight: 700; }
.pb-list { display: grid; gap: 6px; }
.pb-check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.pb-check input { width: 18px; height: 18px; margin-top: 3px; }
.pb-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.pb-quote { margin: 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; font-style: italic; }
.pb-quote cite { display: block; font-style: normal; font-size: 13px; color: var(--muted); margin-top: 4px; }
.pb-hr { border: 0; border-top: 1px solid var(--line); width: 100%; }

/* quiz player */
.card-in { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 12px; margin-top: 16px; }
.quiz-h { font-weight: 800; font-size: 17px; }
.qq { border: 0; margin: 0; padding: 10px 0 0; display: grid; gap: 6px; border-top: 1px solid var(--line); }
.qq legend { font-weight: 600; display: flex; gap: 8px; align-items: center; padding: 0; margin-bottom: 4px; }
.opt { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 15px; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt input { width: 18px; height: 18px; }
.opt.is-right { border-color: var(--ok); background: var(--accent-soft); }
.qq.wrong .opt:has(input:checked):not(.is-right) { border-color: var(--danger); background: #fdecea; }
@media (prefers-color-scheme: dark) { .opt.is-right { background: #183526; } .qq.wrong .opt:has(input:checked):not(.is-right) { background: #3a1d1b; } }
.qres { font-size: 13px; color: var(--ink2); }
.scale { display: flex; gap: 6px; }
.scale label { flex: 1; } .scale input { display: none; }
.scale span { display: block; text-align: center; padding: 8px 0; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; cursor: pointer; }
.scale input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* games */
.flash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.flash { position: relative; min-height: 120px; border: 0; background: none; perspective: 800px; cursor: pointer; padding: 0; }
.flash span { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; border-radius: 12px; font-size: 15px; font-weight: 600;
  backface-visibility: hidden; transition: transform .45s; text-align: center; }
.flash .front { background: var(--brand); color: var(--brand-ink); }
.flash .back { background: var(--accent-soft); color: var(--ink); transform: rotateY(180deg); font-weight: 500; }
.flash.flipped .front { transform: rotateY(180deg); } .flash.flipped .back { transform: rotateY(360deg); }
.sort-list { display: grid; gap: 8px; }
.sort-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.sort-item.right { border-color: var(--ok); } .sort-item.wrong { border-color: var(--danger); }
.mf-card { border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 12px; text-align: center; }
.mf-st { font-size: 19px; font-weight: 600; margin: 0; }
.mf-card .big { font-size: 48px; }

/* content page */
.ic-lg { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-size: 30px; flex: none;
  background: linear-gradient(135deg, hsl(var(--h) 55% 92%), hsl(calc(var(--h) - 25) 45% 84%)); }
.trust-panel { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.feedback { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.stats.mini { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); padding: 0 !important; }
.stat.sm { box-shadow: none; border: 1px solid var(--line); padding: 10px 12px; }
.stat.sm .n { font-size: 22px; }
.qbar { display: grid; grid-template-columns: 1fr 120px 90px; gap: 10px; align-items: center; padding: 4px 0; }
.bar { height: 8px; border-radius: 4px; background: var(--hover); overflow: hidden; display: block; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.bar.hot span { background: var(--danger); }
.tile .thumb { position: relative; }
.draft-tag { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700; background: var(--ink); color: var(--card); border-radius: 4px; padding: 1px 6px; }
.tabs.flat { border-top: 0; padding: 0; margin-top: 12px; border-bottom: 1px solid var(--line); }
.tabs .badge { margin-left: 2px; }

/* settings */
.set-row { display: flex; gap: 16px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.set-ctl { display: flex; align-items: center; gap: 8px; flex: none; }
.set-ctl select { width: auto; max-width: 260px; } .set-ctl .num { width: 110px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #b9c0c3; border-radius: 13px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--brand); } .switch input:checked + span::after { transform: translateX(18px); }
.switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.lockbox { color: var(--muted); cursor: pointer; }
.sticky-save { position: sticky; bottom: 12px; z-index: 5; }

/* admin */
.meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin-top: 8px; }
.meter .bar { margin-top: 4px; }
.org-row { padding: 12px 16px; border-top: 1px solid var(--line); }
.org-row.inactive { opacity: .6; }
.org-row select { width: auto; padding: 4px 8px; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--hover); font-weight: 700; }
.mod-item.urgent { box-shadow: var(--shadow), inset 4px 0 0 var(--danger); }
.mod-quote { margin: 8px 0 0; padding: 8px 12px; background: var(--hover); border-radius: 8px; font-size: 14px; white-space: pre-wrap; }

@media (max-width: 900px) {
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .seg { display: inline-flex; }
  .editor-grid .preview-pane { display: none; position: static; max-height: none; }
  .editor-grid[data-pane="preview"] .preview-pane { display: block; }
  .editor-grid[data-pane="preview"] #ed { display: none; }
}
@media (max-width: 760px) {
  .set-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .qbar { grid-template-columns: 1fr; gap: 2px; }
  .share-card .thumb { width: 72px; font-size: 28px; }
  .pad-x { padding: 0 16px; }
}
.edu-tag.ann { background: var(--brand-soft); color: var(--brand); }
.sect-h { display: grid; gap: 2px; padding: 12px 4px 2px; } .sect-h h2 { margin: 0; font-size: 17px; }
@media (max-width: 760px) { .sect-h { padding: 12px 16px 2px; } }
.poll { display: grid; gap: 6px; padding: 8px 16px 2px; }
.poll-opt { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--card); cursor: pointer; font-weight: 600; }
.poll-opt:hover { border-color: var(--brand); }
.poll-opt.mine { border-color: var(--brand); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--brand-soft); z-index: 0; transition: width .3s; }
.poll-t, .poll-n { position: relative; z-index: 1; }
.set-ctl .txt { width: 240px; }

/* DAQIQ loop logo (same mark as daqiq.qa) */
.brand-logo { display: block; height: 46px; width: auto; overflow: visible; flex: none; }
.brand-logo .bl-word { font-family: "El Messiri", "Noto Sans Arabic", sans-serif; font-weight: 700; paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.brand-logo .bl-la { fill: #14467E; } .brand-logo .bl-ar { fill: #2E8C83; font-size: .92em; }
@media (prefers-color-scheme: dark) { .brand-logo .bl-la { fill: #7DB2F0; } .brand-logo .bl-ar { fill: #4FB8AC; } }
.logo { gap: 6px; }
.logo-sub { font-family: "El Messiri", var(--font, sans-serif); font-weight: 700; font-size: 21px; color: #2E8C83; letter-spacing: .2px; }
@media (prefers-color-scheme: dark) { .logo-sub { color: #4FB8AC; } }
@media (max-width: 760px) { .brand-logo { height: 34px; } .logo-sub { font-size: 18px; } }
