/* ═══════════════════════════════════════════════
   notime.help — style.css v3
   Clean White + Deep Teal + Warm Gold
   Fonts: Noto Naskh Arabic + Cairo
═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Cairo:wght@300;400;500;600;700;800&display=swap');

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}

:root{
  --teal:       #1A5F5A;
  --teal-l:     #217A73;
  --teal-d:     #134845;
  --teal-bg:    #EBF5F4;
  --teal-bg2:   #D4EDEB;
  --gold:       #A07020;
  --gold-l:     #C49030;
  --gold-bg:    #FDF6E8;
  --ok:         #166534;
  --ok-bg:      #DCFCE7;
  --err:        #991B1B;
  --err-bg:     #FEE2E2;
  --bg:         #F7F6F2;
  --surface:    #FFFFFF;
  --surface-2:  #F0EEE9;
  --surface-3:  #E8E5DE;
  --border:     #DDD9D0;
  --border-2:   #C8C3B8;
  --text:       #1C1917;
  --text-2:     #44403C;
  --text-3:     #78716C;
  --text-4:     #A8A29E;
  --sh-sm:  0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --sh-md:  0 4px 12px rgba(0,0,0,.08),0 2px 4px rgba(0,0,0,.04);
  --sh-lg:  0 12px 32px rgba(0,0,0,.10),0 4px 8px rgba(0,0,0,.05);
  --r-xs:6px;--r-sm:10px;--r-md:14px;--r-lg:20px;--r-xl:28px;--r-full:999px;
  --font-h:'Noto Naskh Arabic',Georgia,serif;
  --font-b:'Cairo',system-ui,sans-serif;
}

@keyframes up   {from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes pop  {from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}
@keyframes spin {to{transform:rotate(360deg)}}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}

body{font-family:var(--font-b);background:var(--bg);color:var(--text);direction:rtl;font-size:15px;line-height:1.65;-webkit-font-smoothing:antialiased;min-height:100vh}

/* Utility */
.hidden{display:none!important}
.tm{color:var(--text-3)}

/* ── Header ─────────────────────────────────── */
header{position:sticky;top:0;z-index:100;background:var(--teal);display:flex;align-items:center;justify-content:space-between;padding:0 24px;height:60px;box-shadow:0 2px 12px rgba(0,0,0,.2)}
.logo{display:flex;align-items:center;gap:11px}
.logo-icon{width:36px;height:36px;background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.25);border-radius:var(--r-sm);display:flex;align-items:center;justify-content:center;font-size:17px}
.logo-txt{font-family:var(--font-h);font-size:18px;font-weight:700;color:#fff}
.logo-sub{font-size:10px;color:rgba(255,255,255,.5);margin-top:1px}
.hdr-right{display:flex;align-items:center;gap:9px}
header>p{font-size:12px;color:rgba(255,255,255,.55);text-align:center;max-width:340px}

/* ── Stepper ────────────────────────────────── */
.stepper{background:var(--surface);border-bottom:1px solid var(--border);padding:13px 24px;display:flex;align-items:center;justify-content:center;gap:0;position:sticky;top:60px;z-index:200;box-shadow:var(--sh-sm)}
.si{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:52px}
.sc{width:34px;height:34px;border-radius:50%;border:2px solid var(--border);background:var(--surface-2);display:flex;align-items:center;justify-content:center;font-family:var(--font-b);font-size:13px;font-weight:700;color:var(--text-3);transition:all .3s}
.si.active .sc{border-color:var(--teal);background:var(--teal);color:#fff;box-shadow:0 0 0 4px rgba(26,95,90,.12)}
.si.done   .sc{border-color:var(--ok);background:var(--ok-bg);color:var(--ok)}
.sl{font-size:10px;font-weight:600;color:var(--text-4);white-space:nowrap;transition:color .3s}
.si.active .sl{color:var(--teal);font-weight:700}
.si.done   .sl{color:var(--ok)}
.sline{width:48px;height:2px;background:var(--border);margin-bottom:18px;flex-shrink:0;transition:background .3s}
.sline.done{background:var(--ok)}

/* ── Layout ─────────────────────────────────── */
.page-wrap{max-width:900px;margin:0 auto;padding:28px 24px 120px}
.step-sec{display:none;animation:up .3s ease}
.step-sec.active{display:block}

/* ── Cards ──────────────────────────────────── */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-xl);padding:24px;margin-bottom:14px;box-shadow:var(--sh-sm)}
.ct{display:flex;align-items:center;gap:10px;font-family:var(--font-h);font-size:17px;font-weight:600;color:var(--text);margin-bottom:5px}
.ci{width:34px;height:34px;border-radius:var(--r-sm);background:var(--teal-bg);display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0}
.cs{font-size:13px;color:var(--text-3);margin-bottom:18px;padding-right:44px;line-height:1.6}

/* ── Fields ─────────────────────────────────── */
.field{margin-bottom:16px}
.fl{display:block;font-size:11px;font-weight:700;color:var(--text-3);margin-bottom:8px;text-transform:uppercase;letter-spacing:.7px}

/* Radio */
.rg{display:flex;flex-wrap:wrap;gap:9px}
label.rl-wrap{cursor:pointer}
input.ri{display:none}
.rl{padding:10px 20px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:var(--r-full);font-size:14px;font-weight:600;color:var(--text-2);display:flex;align-items:center;gap:7px;transition:all .2s}
.rl:hover{border-color:var(--teal-l);color:var(--teal);background:var(--teal-bg)}
input.ri:checked~.rl{border-color:var(--teal);background:var(--teal-bg);color:var(--teal);box-shadow:0 0 0 3px rgba(26,95,90,.1)}
.em{font-size:16px}

/* Select */
.sel{
  width:100%;
  padding:14px 18px;
  background:var(--surface);
  border:1.5px solid var(--border);
  border-radius:var(--r-md);
  color:var(--text);
  font-family:var(--font-b);
  font-size:15px;
  font-weight:600;
  outline:none;
  direction:rtl;
  cursor:pointer;
  transition:border .2s,box-shadow .2s;
  appearance:none;
  -webkit-appearance:none;
  min-height:48px;
}
.sel:focus{border-color:var(--teal);box-shadow:0 0 0 3px rgba(26,95,90,.1)}

/* Text input */
.ti{width:100%;padding:11px 16px;background:var(--surface);border:1.5px solid var(--border);border-radius:var(--r-md);color:var(--text);font-family:var(--font-b);font-size:14px;outline:none;direction:rtl;transition:border .2s,box-shadow .2s}
.ti:focus{border-color:var(--teal);box-shadow:0 0 0 3px rgba(26,95,90,.1)}
.ti::placeholder{color:var(--text-4)}

/* ── Lesson grid ─────────────────────────────── */
#lessonGrid{display:flex;flex-direction:column;gap:5px;max-height:380px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--border) transparent}
.lb{background:var(--surface);border:1.5px solid var(--border);border-radius:var(--r-md);padding:11px 15px;cursor:pointer;font-family:var(--font-b);font-size:14px;font-weight:500;color:var(--text);display:flex;align-items:center;gap:9px;transition:all .18s;width:100%;text-align:right}
.lb:hover{border-color:var(--teal-l);background:var(--teal-bg)}
.lb.sel{border-color:var(--teal);background:var(--teal-bg);color:var(--teal);box-shadow:0 0 0 3px rgba(26,95,90,.08)}
.ln{width:24px;height:24px;border-radius:6px;background:var(--surface-3);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;color:var(--text-3);flex-shrink:0}
.lb.sel .ln{background:rgba(26,95,90,.15);color:var(--teal)}
.unit-hdr{font-family:var(--font-h);font-size:12px;font-weight:600;color:var(--teal);padding:9px 4px 4px;border-bottom:1.5px solid var(--teal-bg2);margin-bottom:4px}

/* ── Chips ──────────────────────────────────── */
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.chip{padding:9px 18px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:var(--r-full);font-size:13px;font-weight:600;color:var(--text-2);cursor:pointer;transition:all .18s;font-family:var(--font-b);user-select:none}
.chip:hover{border-color:var(--teal-l);color:var(--teal);background:var(--teal-bg)}
.chip.on{border-color:var(--teal);background:var(--teal-bg);color:var(--teal);font-weight:700}

/* ── Themes ──────────────────────────────────── */
.themes-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:11px;margin-top:8px}
.theme-item{border:2px solid var(--border);border-radius:var(--r-md);padding:11px;cursor:pointer;transition:all .22s;background:var(--surface);text-align:center}
.theme-item:hover{border-color:var(--teal-l);transform:translateY(-2px);box-shadow:var(--sh-md)}
.theme-item.selected{border-color:var(--teal);background:var(--teal-bg);box-shadow:0 0 0 3px rgba(26,95,90,.1)}
.theme-preview{height:42px;border-radius:9px;margin-bottom:8px;overflow:hidden}
.theme-name{font-size:12px;font-weight:700;color:var(--text);margin-bottom:2px}
.theme-desc{font-size:10px;color:var(--text-3)}

/* ── Upload ──────────────────────────────────── */
.uz{border:2px dashed var(--border);border-radius:var(--r-lg);padding:28px;text-align:center;cursor:pointer;transition:all .25s;background:var(--surface-2)}
.uz:hover{border-color:var(--teal-l);background:var(--teal-bg)}

/* ── Summary ─────────────────────────────────── */
.sr{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid var(--border);font-size:14px}
.sr:last-child{border:none}
.sk{color:var(--text-3);font-weight:500}
.sv{font-weight:700;color:var(--text)}

/* ── Buttons ─────────────────────────────────── */
.btn{padding:11px 22px;border-radius:var(--r-full);font-family:var(--font-b);font-size:14px;font-weight:700;cursor:pointer;border:none;transition:all .2s;display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.bp{background:var(--teal);color:#fff;box-shadow:0 4px 12px rgba(26,95,90,.3)}
.bp:hover{background:var(--teal-l);transform:translateY(-1px);box-shadow:0 6px 18px rgba(26,95,90,.38)}
.bp:active{transform:scale(.98)}
.bp:disabled{opacity:.4;cursor:not-allowed;transform:none!important;box-shadow:none}
.bg{background:var(--surface);border:1.5px solid var(--border);color:var(--text-2)}
.bg:hover{border-color:var(--teal);color:var(--teal);background:var(--teal-bg)}
.bs{background:var(--ok-bg);border:1.5px solid rgba(22,101,52,.2);color:var(--ok)}
.bs:hover{background:#bbf7d0}
.bgold{background:var(--gold-bg);border:1.5px solid rgba(160,112,32,.2);color:var(--gold)}
.bgold:hover{background:#fde9b0}
.btn-pdf{background:#fff1f0;border:1.5px solid rgba(153,27,27,.2);color:var(--err)}
.btn-pdf:hover{background:#fee2e2}
.btn-gdrive{background:var(--gold-bg);border:1.5px solid rgba(160,112,32,.2);color:var(--gold)}
.btn-gdrive:hover{background:#fde9b0}
.bsm{padding:7px 14px;font-size:12px}

/* ── Banners ─────────────────────────────────── */
.info-ok{padding:11px 16px;border-radius:var(--r-md);font-size:13px;font-weight:600;display:flex;align-items:center;gap:9px;margin-top:12px;background:var(--ok-bg);border:1px solid rgba(22,101,52,.2);color:var(--ok);animation:pop .25s ease}
.info-warn{padding:11px 16px;border-radius:var(--r-md);font-size:13px;display:flex;align-items:flex-start;gap:9px;margin-top:12px;background:var(--gold-bg);border:1px solid rgba(160,112,32,.2);color:var(--gold)}
#saveConf{padding:11px 16px;border-radius:var(--r-md);font-size:13px;font-weight:600;display:flex;align-items:center;gap:9px;margin-top:12px;background:var(--ok-bg);border:1px solid rgba(22,101,52,.2);color:var(--ok)}

/* ── Footer nav ──────────────────────────────── */
.fta{position:fixed;bottom:0;right:0;left:0;background:rgba(247,246,242,.96);border-top:1px solid var(--border);padding:12px 24px;display:flex;align-items:center;justify-content:space-between;z-index:100;backdrop-filter:blur(14px);box-shadow:0 -2px 12px rgba(0,0,0,.06)}
.fta-txt{font-size:13px;color:var(--text-3);font-weight:500}
.fta-txt strong{color:var(--text)}

/* ── Loading ─────────────────────────────────── */
#loadWrap{text-align:center;padding:32px 0}
.spinner{width:34px;height:34px;border:3px solid var(--border);border-top-color:var(--teal);border-radius:50%;animation:spin 1s linear infinite;margin:0 auto 18px}
.ps-wrap{display:flex;flex-direction:column;gap:7px;max-width:320px;margin:12px auto 0}
.ps{padding:9px 15px;border-radius:var(--r-md);font-size:13px;color:var(--text-3);background:var(--surface-2);border:1.5px solid var(--border);text-align:right;transition:all .3s}
.ps.ac{background:var(--teal-bg);border-color:var(--teal);color:var(--teal);font-weight:600;animation:pulse 1.5s infinite}
.ps.dn{background:var(--ok-bg);border-color:rgba(22,101,52,.3);color:var(--ok);animation:none}

/* ── Result view ─────────────────────────────── */
#resWrap{display:block;width:100%}
.rv-wrap{display:flex;border:1px solid var(--border);border-radius:var(--r-xl);overflow:hidden;background:var(--surface);box-shadow:var(--sh-md);min-height:420px}
.rv-sidebar{width:190px;flex-shrink:0;background:var(--surface-2);border-left:1px solid var(--border);display:flex;flex-direction:column}
.rv-sidebar-hdr{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid var(--border);font-size:11px;font-weight:700;color:var(--text-3);text-transform:uppercase;letter-spacing:.5px;background:var(--surface-3)}
.rv-tabs{overflow-y:auto;flex:1;padding:7px;display:flex;flex-direction:column;gap:3px}
.rv-tab{display:flex;align-items:center;gap:7px;padding:9px 10px;border-radius:var(--r-sm);cursor:pointer;transition:all .18s;border:1.5px solid transparent}
.rv-tab:hover{background:var(--surface-3)}
.rv-tab.active{background:var(--surface);border-color:var(--teal);box-shadow:var(--sh-sm)}
.rv-tab-num{width:22px;height:22px;border-radius:6px;background:var(--surface-3);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;color:var(--text-3);flex-shrink:0}
.rv-tab.active .rv-tab-num{background:var(--teal);color:#fff}
.rv-tab-title{font-size:12px;font-weight:600;color:var(--text-2);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rv-tab.active .rv-tab-title{color:var(--teal)}
.rv-tab-type{font-size:13px;flex-shrink:0}
.rv-content{flex:1;padding:22px;overflow-y:auto}
.rv-panel{display:none;animation:up .2s ease}
.rv-panel.active{display:block}
.rv-panel-header{display:flex;align-items:center;gap:10px;margin-bottom:16px;padding-bottom:14px;border-bottom:1.5px solid var(--border)}
.rv-panel-num{width:30px;height:30px;border-radius:9px;background:var(--teal);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:900;color:#fff;flex-shrink:0}
.rv-panel-title{font-family:var(--font-h);font-size:18px;font-weight:700;color:var(--text);flex:1;line-height:1.4}
.rv-panel-badge{font-size:11px;padding:3px 11px;border-radius:var(--r-full);font-weight:700;background:var(--teal-bg);color:var(--teal);white-space:nowrap;flex-shrink:0}
.rv-subtitle{font-size:14px;color:var(--text-3);margin-bottom:14px;padding:9px 13px;background:var(--surface-2);border-radius:var(--r-md);border-right:3px solid var(--gold-l)}
.rv-points{list-style:none;padding:0;display:flex;flex-direction:column;gap:7px;margin-bottom:14px}
.rv-points li{font-size:14px;color:var(--text-2);padding:10px 14px;background:var(--surface-2);border-radius:var(--r-md);border-right:3px solid var(--teal);line-height:1.6}
.rv-notes{font-size:12px;color:var(--gold);padding:9px 14px;background:var(--gold-bg);border-radius:var(--r-md);border:1px solid rgba(160,112,32,.2);margin-top:10px}

/* ── Action row ──────────────────────────────── */
.act-row{display:flex;flex-wrap:wrap;gap:9px;margin:16px 0 10px;padding:16px 18px;background:var(--surface-2);border-radius:var(--r-xl);border:1px solid var(--border)}

/* ── Download bar ────────────────────────────── */
.dl-bar{height:4px;background:var(--border);border-radius:4px;overflow:hidden;margin-top:10px}
.dl-fill{height:100%;background:linear-gradient(90deg,var(--teal),var(--teal-l));border-radius:4px;transition:width .5s}

/* ── Chat ────────────────────────────────────── */
#chatWrap{max-height:250px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;margin-bottom:11px}
.ma{padding:10px 14px;border-radius:var(--r-md);font-size:13px;max-width:88%;line-height:1.55;background:var(--surface-2);border:1px solid var(--border);color:var(--text);align-self:flex-start}
.mu{padding:10px 14px;border-radius:var(--r-md);font-size:13px;max-width:88%;line-height:1.55;background:var(--teal);color:#fff;align-self:flex-end}
.chat-row{display:flex;gap:8px;align-items:flex-end}
#chatIn{flex:1;padding:11px 15px;background:var(--surface);border:1.5px solid var(--border);border-radius:var(--r-md);color:var(--text);font-family:var(--font-b);font-size:13px;outline:none;resize:none;min-height:44px;max-height:100px;direction:rtl;transition:border .2s}
#chatIn:focus{border-color:var(--teal)}

/* ── Edit chips ──────────────────────────────── */
.ec{display:inline-flex;align-items:center;gap:5px;padding:8px 15px;border:1.5px solid var(--border);border-radius:var(--r-full);font-size:12px;font-weight:700;color:var(--text-3);cursor:pointer;transition:all .18s;font-family:var(--font-b);background:var(--surface)}
.ec:hover{border-color:var(--teal);color:var(--teal);background:var(--teal-bg)}

/* ── Image bank ──────────────────────────────── */
#imgBank{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:8px}
.img-thumb{position:relative;border:2px solid var(--border);border-radius:var(--r-sm);overflow:hidden;cursor:pointer;transition:all .2s;aspect-ratio:1}
.img-thumb:hover{border-color:var(--teal);transform:scale(1.04)}
.img-thumb.selected{border-color:var(--ok);box-shadow:0 0 0 3px rgba(22,101,52,.2)}
.img-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.img-del-btn{position:absolute;top:3px;left:3px;width:20px;height:20px;background:rgba(153,27,27,.9);border-radius:50%;border:none;color:#fff;font-size:10px;cursor:pointer;display:none;align-items:center;justify-content:center}
.img-thumb:hover .img-del-btn{display:flex}
.img-slide-tag{position:absolute;bottom:3px;right:3px;background:var(--teal);border-radius:4px;padding:1px 6px;font-size:9px;color:#fff}
.img-add-btn{border:2px dashed var(--border);border-radius:var(--r-sm);aspect-ratio:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;color:var(--text-3);font-size:10px;transition:all .2s}
.img-add-btn:hover{border-color:var(--teal);color:var(--teal)}

/* ── Projects ────────────────────────────────── */
.proj-card{background:var(--surface-2);border:1.5px solid var(--border);border-radius:var(--r-md);padding:12px 16px;cursor:pointer;transition:all .2s;margin-bottom:7px}
.proj-card:hover{border-color:var(--teal);background:var(--teal-bg)}
.proj-title{font-size:14px;font-weight:700;margin-bottom:3px;color:var(--text)}
.proj-meta{font-size:11px;color:var(--text-3)}

/* ── Misc ────────────────────────────────────── */
.badge{display:inline-block;padding:2px 9px;border-radius:var(--r-full);font-size:11px;font-weight:700}
.b-ok  {background:var(--ok-bg);  color:var(--ok)}
.b-warn{background:var(--gold-bg);color:var(--gold)}
.b-err {background:var(--err-bg); color:var(--err)}
.b-teal{background:var(--teal-bg);color:var(--teal)}
input[type=range]{width:100%;accent-color:var(--teal);margin:8px 0}

/* ── Responsive ──────────────────────────────── */
@media(max-width:640px){
  header{padding:0 14px;height:auto;min-height:54px;flex-wrap:wrap;gap:6px;padding-block:8px}
  header>p{display:none}
  .page-wrap{padding:16px 14px 110px}
  .stepper{padding:10px 8px;overflow-x:auto;top:54px}
  .sline{width:28px}
  .fta{padding:11px 16px}
  .act-row{flex-direction:column}
  .act-row .btn{width:100%;justify-content:center}
  .themes-grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}
  .card{padding:16px;border-radius:var(--r-lg)}
  .rv-wrap{flex-direction:column}
  .rv-sidebar{width:100%;border-left:none;border-bottom:1px solid var(--border)}
  .rv-tabs{flex-direction:row;flex-wrap:nowrap;overflow-x:auto;padding:7px;gap:5px}
  .rv-tab{flex-shrink:0}
  .rv-tab-title{display:none}
  .rv-content{min-height:280px}
}

.wrap{max-width:720px;margin:0 auto;padding:28px 20px 120px}

select.sel,select{-webkit-appearance:none;appearance:none}

/* ── Dashboard panels ── */
.dash-panel{padding:20px}
.dash-tabs{display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap}
.dtab{padding:8px 16px;border-radius:var(--r-full);border:1.5px solid var(--border);background:var(--surface);color:var(--text-3);font-size:13px;font-weight:600;cursor:pointer;transition:all .18s;font-family:var(--font-b)}
.dtab:hover,.dtab.active{border-color:var(--teal);color:var(--teal);background:var(--teal-bg)}

/* ── Chat wrap ── */
.chat-wrap{display:flex;flex-direction:column;gap:8px;max-height:250px;overflow-y:auto;margin-bottom:11px}

/* ── Image bank ── */
.img-bank{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:8px}

/* ── Stat grid ── */
.sgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-bottom:16px}

/* ── Project grid ── */
.projGrid{display:flex;flex-direction:column;gap:6px}

/* ── Table of contents styles ── */
.toh{font-family:var(--font-h);font-size:17px;font-weight:700;color:var(--text);margin-bottom:12px}
.tob{padding:9px 14px;border-radius:var(--r-md);background:var(--teal-bg);border:1.5px solid var(--teal-bg2);margin-bottom:5px;font-size:13px;color:var(--teal);font-weight:600;cursor:pointer;transition:all .18s}
.tob:hover{border-color:var(--teal)}
.tog{padding:8px 14px;border-radius:var(--r-md);background:var(--surface-2);border:1px solid var(--border);margin-bottom:4px;font-size:13px;color:var(--text-2)}

/* ── Edit status ── */
.edit-status{padding:9px 14px;border-radius:var(--r-md);font-size:13px;display:none;align-items:center;gap:8px}
.edit-status.show{display:flex}
.edit-status.processing{background:var(--teal-bg);border:1px solid var(--teal-bg2);color:var(--teal)}
.edit-status.done{background:var(--ok-bg);border:1px solid rgba(22,101,52,.2);color:var(--ok)}
.edit-status.error{background:var(--err-bg);border:1px solid rgba(153,27,27,.2);color:var(--err)}

/* ── Chat input row ── */
.ci-row{display:flex;gap:8px;align-items:flex-end}
.ci-input{flex:1;padding:11px 15px;background:var(--surface);border:1.5px solid var(--border);border-radius:var(--r-md);color:var(--text);font-family:var(--font-b);font-size:13px;outline:none;resize:none;min-height:44px;max-height:100px;direction:rtl;transition:border .2s}
.ci-input:focus{border-color:var(--teal)}

/* ── Message bubbles ── */
.msg{padding:10px 14px;border-radius:var(--r-md);font-size:13px;line-height:1.55;max-width:88%}
.msg.assistant{background:var(--surface-2);border:1px solid var(--border);color:var(--text);align-self:flex-start}
.msg.user{background:var(--teal);color:#fff;align-self:flex-end}

/* ── Modals ─────────────────────────────────────────────── */
.mo{display:none;position:fixed;inset:0;background:rgba(0,0,0,.6);
  z-index:1000;align-items:center;justify-content:center;
  backdrop-filter:blur(6px);padding:20px}
.mo.open{display:flex}
.modal{background:var(--surface);border-radius:var(--r-xl);
  padding:28px;width:100%;max-width:520px;
  max-height:90vh;overflow-y:auto;
  box-shadow:0 24px 60px rgba(0,0,0,.4);
  animation:up .25s ease}

.bg3{background:var(--surface-2);color:var(--text);border:1.5px solid var(--border)}
.bg3:hover{border-color:var(--teal);color:var(--teal)}

@media(min-width:900px){.page-wrap{padding:32px 32px 100px}.rv-wrap{flex-direction:row}.rv-sidebar{width:260px;flex-shrink:0}.act-row{flex-direction:row;flex-wrap:wrap}}

/* ── Lesson grid ─────────────────────────────────────────── */
.lg{display:flex;flex-direction:column;gap:5px;max-height:340px;overflow-y:auto;margin-bottom:10px}


/* ── Cross-device hardening pass ───────────────────────── */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, canvas, svg, iframe { max-width: 100%; height: auto; }
.card, .modal, .page-wrap, .rv-content, .rv-sidebar, .wrap { min-width: 0; }
.chips, .themes-grid, .dash-tabs, .act-row { align-items: stretch; }
textarea, input, select, button { max-width: 100%; }

@media (max-width: 900px){
  .page-wrap, .wrap { padding-inline: 14px; }
  .hero, .grid2, .two-col, .split, .fgrid2, .fgrid3 { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px){
  .stepper { gap: 8px; }
  .stepper .slab, .stepper .sbox, .stepper .step { min-width: max-content; }
  .fta { position: sticky; bottom: 10px; padding: 10px; backdrop-filter: blur(8px); }
  .fta .btn { flex: 1 1 0; justify-content: center; min-width: 0; }
  .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .chip { flex: 0 0 auto; }
  .themes-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .rv-panel-header { flex-wrap: wrap; }
  .rv-panel-title { font-size: 16px; }
  .rv-points li { font-size: 13px; }
}

@media (max-width: 480px){
  .page-wrap, .wrap { padding-inline: 10px; }
  .card { padding: 14px; }
  .themes-grid { grid-template-columns: 1fr 1fr; }
  .act-row .btn, .fta .btn { width: 100%; }
}


/* Main page mobile CTA + safe area fixes */
.fta{gap:10px;flex-wrap:wrap}
.fta>div:empty{display:none}
.fta [id$="QuotaHint"], .fta .fta-txt{flex:1 0 100%;order:3;text-align:center}

@media (max-width: 768px){
  .page-wrap, .wrap{padding-bottom:140px}
  .fta{position:sticky;bottom:max(10px, env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;padding:10px 12px calc(10px + env(safe-area-inset-bottom));border-radius:18px;gap:10px;margin-top:16px}
  .fta .btn{width:100%;min-height:48px;white-space:normal;text-align:center;justify-content:center;line-height:1.35}
  .fta [id$="QuotaHint"], .fta .fta-txt{grid-column:1 / -1;margin-top:2px}
}

@media (max-width: 480px){
  .fta{grid-template-columns:1fr 1fr}
}


.profile-menu-btn{transition:background-color .16s ease}
.profile-menu-btn:hover,.profile-menu-btn:focus-visible{background:#f5f5f5}
.profile-menu-btn-danger:hover,.profile-menu-btn-danger:focus-visible{background:#fff5f5}
