/* Tajseed isolated UI customization: all selectable styles are allowlisted in config.php. */
html.learner-ui[data-ui-palette="gold"],
.appearance-preview[data-ui-palette="gold"]{--gold:#c9a227;--gold2:#e9c96a;--gold-rgb:201,162,39;--gold2-rgb:233,201,106;--line:rgba(201,162,39,.22)}
html.learner-ui[data-ui-palette="blue"],
.appearance-preview[data-ui-palette="blue"]{--gold:#4b9dfc;--gold2:#9bc9ff;--gold-rgb:75,157,252;--gold2-rgb:155,201,255;--line:rgba(75,157,252,.25)}
html.learner-ui[data-ui-palette="emerald"],
.appearance-preview[data-ui-palette="emerald"]{--gold:#27ae83;--gold2:#75d8b5;--gold-rgb:39,174,131;--gold2-rgb:117,216,181;--line:rgba(39,174,131,.26)}
html.learner-ui[data-ui-palette="violet"],
.appearance-preview[data-ui-palette="violet"]{--gold:#9b77ed;--gold2:#c0aaff;--gold-rgb:155,119,237;--gold2-rgb:192,170,255;--line:rgba(155,119,237,.25)}
html.learner-ui[data-ui-palette="rose"],
.appearance-preview[data-ui-palette="rose"]{--gold:#dd718f;--gold2:#f1a2b5;--gold-rgb:221,113,143;--gold2-rgb:241,162,181;--line:rgba(221,113,143,.24)}

html.learner-ui[data-ui-font="cairo"] body,.appearance-preview[data-ui-font="cairo"]{font-family:'Cairo',system-ui,sans-serif}
html.learner-ui[data-ui-font="tajawal"] body,.appearance-preview[data-ui-font="tajawal"]{font-family:'Tajawal',system-ui,sans-serif}
html.learner-ui[data-ui-font="amiri"] body,.appearance-preview[data-ui-font="amiri"]{font-family:'Amiri',serif}
html.learner-ui[data-ui-size="90"]{--ui-size:0.9}html.learner-ui[data-ui-size="95"]{--ui-size:0.95}html.learner-ui[data-ui-size="100"]{--ui-size:1}html.learner-ui[data-ui-size="105"]{--ui-size:1.05}html.learner-ui[data-ui-size="110"]{--ui-size:1.1}html.learner-ui[data-ui-size="115"]{--ui-size:1.15}html.learner-ui[data-ui-size="120"]{--ui-size:1.2}
.appearance-preview[data-ui-size="90"]{--ui-size:0.9}.appearance-preview[data-ui-size="95"]{--ui-size:0.95}.appearance-preview[data-ui-size="100"]{--ui-size:1}.appearance-preview[data-ui-size="105"]{--ui-size:1.05}.appearance-preview[data-ui-size="110"]{--ui-size:1.1}.appearance-preview[data-ui-size="115"]{--ui-size:1.15}.appearance-preview[data-ui-size="120"]{--ui-size:1.2}
html.learner-ui body{font-size:calc(16px * var(--ui-size,1))}
html.learner-ui[data-ui-density="compact"]{--ui-gap:8px;--ui-card-pad:12px;--ui-verse-pad:14px}
html.learner-ui[data-ui-density="normal"]{--ui-gap:12px;--ui-card-pad:16px;--ui-verse-pad:18px}
html.learner-ui[data-ui-density="comfortable"]{--ui-gap:16px;--ui-card-pad:19px;--ui-verse-pad:22px}
.appearance-preview[data-ui-density="compact"]{--ui-gap:8px;--ui-card-pad:12px}.appearance-preview[data-ui-density="normal"]{--ui-gap:12px;--ui-card-pad:16px}.appearance-preview[data-ui-density="comfortable"]{--ui-gap:16px;--ui-card-pad:19px}

/* More breathing room for lessons and Quran verses. */
html.learner-ui .view{width:min(100%,1200px);max-width:1200px;margin-inline:auto;padding:clamp(18px,3vw,36px) clamp(12px,2.5vw,30px) 56px}
html.learner-ui .lesson-cards{gap:var(--ui-gap,16px);margin-block:18px}
html.learner-ui .lesson-card{align-items:center;flex-wrap:wrap;gap:var(--ui-gap,16px);padding:var(--ui-card-pad,19px);min-height:72px;border-radius:20px}
html.learner-ui .lesson-card .lc-body{flex:1 1 190px;min-width:0}
html.learner-ui .lesson-card .lc-body h3,html.learner-ui .lesson-card .lc-body p{overflow-wrap:anywhere}
html.learner-ui .lesson-card .btn{min-height:46px;padding-inline:16px}
html.learner-ui .mushaf{padding:clamp(15px,3vw,24px);border-radius:22px}
html.learner-ui .ayah{padding:var(--ui-verse-pad,22px) clamp(10px,2.5vw,20px) 15px;margin-bottom:12px;border-radius:18px}
html.learner-ui .ayah+.ayah{border-top-color:transparent}
html.learner-ui .ayah-text{line-height:2.55;padding-inline:4px;overflow-wrap:anywhere}
html.learner-ui .icon-btn{width:46px;height:46px;min-height:46px}
html.learner-ui .btn{min-height:44px}
html.learner-ui[data-ui-footer="0"] .shared-site-footer{display:none!important}
html.learner-ui[data-ui-footer-links="0"] .shared-site-footer section[aria-label="روابط الموقع"]{display:none!important}
html.learner-ui[data-ui-footer-apps="0"] .shared-site-footer section.shared-apps{display:none!important}
html.learner-ui[data-ui-footer-share="0"] .shared-site-footer section.shared-sharing{display:none!important}

@media (max-width:920px){
  html.learner-ui body{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  html.learner-ui .tabbar{gap:3px;padding:7px 5px calc(7px + env(safe-area-inset-bottom))}
  html.learner-ui .tabbar a{flex:1 1 0;min-width:0;min-height:58px;justify-content:center;gap:3px;padding:7px 3px;font-size:clamp(10px,1.3vw,12px);line-height:1.2;text-align:center;touch-action:manipulation}
  html.learner-ui .tabbar a i{font-size:20px;line-height:1}
  html.learner-ui .tabbar a span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
@media (min-width:921px){html.learner-ui .tabbar{display:none!important}}
@media (max-width:640px){
  html.learner-ui .top.site-head{gap:8px;padding-inline:12px}
  html.learner-ui .top.site-head .brand{gap:7px;min-width:0}
  html.learner-ui .top.site-head .brand svg{width:52px!important;height:52px!important}
  html.learner-ui .top.site-head .brand b{font-size:18px}
  html.learner-ui .top.site-head .tools{gap:4px}
  html.learner-ui .top.site-head .tools .icon-btn{width:42px;height:42px;min-height:42px}
  html.learner-ui .lesson-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center}
  html.learner-ui .lesson-card .lc-left{grid-row:1}
  html.learner-ui .lesson-card .lc-body{grid-column:2;grid-row:1;min-width:0}
  html.learner-ui .lesson-card>.btn,html.learner-ui .lesson-card>a.btn{grid-column:1/-1;width:100%;min-height:48px}
  html.learner-ui .ayah{padding:17px 10px 12px;margin-bottom:10px}
  html.learner-ui .ayah-text{line-height:2.35}
  html.learner-ui .mushaf{padding:12px 8px}
}
@media (max-width:380px){
  html.learner-ui .top.site-head .brand svg{width:46px!important;height:46px!important}
  html.learner-ui .top.site-head .brand b{font-size:16px}
  html.learner-ui .top.site-head .brand small{max-width:112px;font-size:10px}
  html.learner-ui .top.site-head .tools .icon-btn{width:38px;height:38px;min-height:38px}
  html.learner-ui .tabbar a{font-size:9px}
  html.learner-ui .tabbar a i{font-size:18px}
}

/* Admin-only live preview. */
.appearance-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(280px,.9fr);gap:16px;align-items:start}
.appearance-form,.appearance-preview-wrap{min-width:0}
.appearance-nav-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.appearance-nav-field{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:end;padding:10px;border:1px solid var(--line);border-radius:14px;background:rgba(var(--fg-rgb),.025)}
.appearance-nav-field .field{margin:0;min-width:0}
.appearance-visible{display:flex;align-items:center;gap:6px;white-space:nowrap;padding-bottom:10px;font-size:13px}
.appearance-footer-fields{display:flex;flex-wrap:wrap;gap:8px 16px}
.appearance-preview{--gold:#c9a227;--gold2:#e9c96a;--gold-rgb:201,162,39;--gold2-rgb:233,201,106;--line:rgba(201,162,39,.22);--bg:#070b18;--bg2:#0b1124;--card:#132044;--card2:#0e1630;--text:#e8ecf6;--muted:#98a2bf;--ink:#1a1405;--ui-size:1;background:var(--bg);color:var(--text);border:1px solid var(--line);border-radius:18px;padding:14px;font-size:calc(14px * var(--ui-size,1));overflow:hidden;transition:background .18s,color .18s,border-color .18s}
.appearance-preview[data-theme="dark"]{--bg:#0b0b0d;--bg2:#111113;--card:#1d1d21;--card2:#161619;--text:#ececee;--muted:#9a9aa2;--ink:#1a1405}
.appearance-preview[data-theme="light"]{--bg:#f7f3e8;--bg2:#efe8d6;--card:#fff;--card2:#fffbf2;--text:#1d2233;--muted:#6b7186;--ink:#fff}
.appearance-preview[data-theme="emerald"]{--bg:#04130f;--bg2:#071c16;--card:#0f3329;--card2:#0a2620;--text:#e7f3ee;--muted:#8fb3a6;--ink:#141003}
.appearance-preview[data-theme="violet"]{--bg:#0f0b1e;--bg2:#140f28;--card:#221a42;--card2:#1a1433;--text:#ece8f6;--muted:#a49cc0;--ink:#1a1405}
.appearance-preview[data-theme="kids"]{--bg:#e4f3ec;--bg2:#d3ece1;--card:#fff;--card2:#f3fbf7;--text:#183a33;--muted:#5f7f77;--ink:#fff}
.appearance-preview[data-theme="contrast"]{--bg:#000;--bg2:#000;--card:#000;--card2:#000;--text:#fff;--muted:#ddd;--ink:#000;border-width:2px}
.appearance-preview-header{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:8px 10px;border-bottom:1px solid var(--line);color:var(--gold2)}
.appearance-preview-header span{font-size:.84em;color:var(--muted)}
.appearance-preview-card{display:flex;align-items:center;gap:10px;padding:var(--ui-card-pad,19px);margin:12px 0;border:1px solid var(--line);border-radius:16px;background:var(--card)}
.appearance-preview-card>div{min-width:0;flex:1}.appearance-preview-card p{margin-top:3px;color:var(--muted);font-size:.88em;line-height:1.7}
.appearance-preview-icon{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:12px;background:rgba(var(--gold-rgb),.15);color:var(--gold2)}
.appearance-preview-button{padding:9px 12px;border-radius:11px;background:var(--gold);color:var(--ink);font-weight:800;white-space:nowrap}
.appearance-preview-nav{display:flex;justify-content:space-around;gap:4px;padding:7px 4px;border:1px solid var(--line);border-radius:12px;background:var(--bg2)}
.appearance-preview-nav span{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0;color:var(--gold2)}
.appearance-preview-nav small{max-width:62px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.72em}
.appearance-preview-footer{display:flex;justify-content:space-between;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid var(--line);color:var(--muted);font-size:.78em}
.appearance-reset-form{margin-top:10px}
@media (max-width:900px){.appearance-layout{grid-template-columns:1fr}.appearance-preview-wrap{order:-1}}
@media (max-width:560px){.appearance-nav-fields{grid-template-columns:1fr}.appearance-preview-card{flex-wrap:wrap}.appearance-preview-button{width:100%}.appearance-preview-footer{flex-wrap:wrap}}
