:root{
  --bg:#f3e2cf; --card:#fff; --text:#1a1a1a; --muted:#6d6a6a; --border:#e9dccc;
  --purple:#6a35d0; --purple-2:#8d5cf6; --brown:#6a402f; --chip:#f2e6d9;
}
*{box-sizing:border-box} html,body{height:100%}
body{margin:0; background:var(--bg); color:var(--text); font-family:system-ui,-apple-system,'Segoe UI',Roboto,Arial,'Noto Kufi Arabic',sans-serif}
.wrap{max-width:1000px; margin:auto; padding:16px}
.grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:14px}
.card{background:var(--card); border:1px solid var(--border); border-radius:18px; padding:14px; box-shadow:0 8px 22px rgba(0,0,0,.08)}

.hero{background:var(--purple); color:#fff; padding:18px 16px; border-bottom-left-radius:22px; border-bottom-right-radius:22px; position:sticky; top:0; z-index:10}
.hero.small{padding:12px 16px}
.hero .brand{font-size:1.4rem; font-weight:800}
.hero .hero-inner{display:flex; flex-direction:column; gap:12px; max-width:1000px; margin:auto}
.search.big{padding:14px 16px; border-radius:16px; border:none; background:rgba(255,255,255,.15); color:#fff}
.search::placeholder{color:#eee}
.row{display:flex; align-items:center; gap:8px}
.row.space-between{justify-content:space-between}
.row.gap{gap:8px}
.muted{color:var(--muted)} .small{font-size:.85rem}

.btn, button{background:#005a9e; color:#fff; border:none; border-radius:14px; padding:10px 12px; cursor:pointer; font-weight:700}
.btn:hover, button:hover{opacity:.95}
button.link{background:transparent; color:inherit}
.chip{background:var(--chip); color:#563; border:none; border-radius:12px; padding:6px 10px}
.chip.danger{background:#ffdedb; color:#a00}

.fab{position:fixed; right:18px; bottom:18px; background:#6a35d0; color:#fff; border:none; border-radius:18px; padding:14px 18px; font-weight:800; box-shadow:0 10px 24px rgba(0,0,0,.2)}
.fab.purple{background:#6a35d0}

.subject-card{background:#6a402f; color:#fff; border-radius:20px; padding:16px; box-shadow:0 10px 20px rgba(0,0,0,.15)}
.subject-card .name{font-size:1.2rem; font-weight:800; text-align:end}
.subject-card .emoji{font-size:1.6rem}

.tabs{gap:8px; margin-bottom:8px}
.tab{background:#f0e5d6; border:none; border-radius:16px; padding:10px 12px; cursor:pointer; font-weight:800}
.tab.active{background:#6a35d0; color:#fff}
.tabpane{display:none} .tabpane.active{display:block}

.search.small{padding:8px 10px; border-radius:12px; border:1px solid var(--border); background:#fff; color:var(--text)}
.viewer-body iframe, .viewer-body embed{width:100%; height:70vh; border:none; background:#111}
.viewer-body img{max-width:100%; display:block; margin:auto}
.viewer-body audio{width:100%}
.asset-card{background:#fff; border:1px solid var(--border); border-radius:16px; padding:12px; box-shadow:0 4px 12px rgba(0,0,0,.05); display:flex; flex-direction:column; gap:8px}
.asset-card .name{font-weight:800}
.asset-card .meta{color:var(--muted); font-size:.85rem}
.badge{background:#eee; border-radius:12px; padding:2px 8px; display:inline-block; font-size:.8rem}
