/* ============================================================
   مختبر التطبيقات — نظام تصميم فاتح مستوحى من سطح مكتب أندرويد
   ============================================================ */

:root{
  --bg:#FBF9F6;
  --card:#FFFFFF;
  --line:#EFE9F7;
  --ink:#3A3450;
  --ink-soft:#5B5474;
  --muted:#8B84A3;
  --lilac:#C9B6FF;
  --violet:#B9A6F2;
  --peach:#FFC9B0;
  --mint:#B7E4CE;
  --tint:#FBF7FF;
  --shadow:0 10px 18px rgba(58,52,80,.08);
  --shadow-lg:0 24px 44px rgba(58,52,80,.16);
  --r-lg:24px;
  --r-md:16px;
  --r-sm:12px;
  --t:180ms ease-out;
}

*,*::before,*::after{ box-sizing:border-box; }
[hidden]{ display:none !important; }

html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size:15px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  overflow-x:hidden;
}
body.sheet-open{ overflow:hidden; }

h1,h2,h3,h4{
  font-family:'Cairo','IBM Plex Sans Arabic',system-ui,sans-serif;
  font-weight:700;
  line-height:1.35;
  margin:0;
}

button{
  font-family:inherit;
  color:inherit;
  border:0;
  background:none;
  cursor:pointer;
  padding:0;
}
button, .pill, .home-item, .tab-btn, .swatch, .cat-chip, .stat,
.app-ico, .home-ico, .brand-mark, .icon-btn, .mini-btn{
  -webkit-user-select:none;
  user-select:none;
}
input,select,textarea{
  font-family:inherit;
  font-size:16px;
  color:var(--ink);
}
svg{ display:block; }

:where(button,[role="button"],input,select,textarea,a):focus-visible{
  outline:3px solid rgba(185,166,242,.9);
  outline-offset:2px;
  border-radius:12px;
}

/* حبيبات ورقية خفيفة جدًا */
.grain{
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  opacity:.42;
  mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.05'/></svg>");
}

/* ============================ التخطيط ============================ */
.app{
  position:relative;
  z-index:1;
  max-width:1240px;
  margin:0 auto;
  padding:16px 14px 104px;
}
@media (min-width:980px){
  .app{ padding:28px 28px 48px; }
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
  flex-wrap:wrap;
}
.brand{ display:flex; align-items:center; gap:12px; min-width:0; }
.brand-mark{
  width:46px; height:46px;
  flex:0 0 auto;
  border-radius:16px;
  display:grid; place-items:center;
  background:linear-gradient(145deg,#D8C9FF,#B9A6F2);
  box-shadow:0 8px 18px rgba(185,166,242,.45), inset 0 0 0 2px rgba(255,255,255,.55);
}
.brand-text{ min-width:0; }
.brand-text h1{ font-size:19px; }
.brand-text p{ margin:1px 0 0; font-size:12px; color:var(--muted); }

.saved-chip{
  display:inline-flex; align-items:center; gap:7px;
  min-height:34px; padding:0 13px;
  border-radius:999px;
  background:#F4FBF7;
  color:#2F6B4F;
  font-size:12px; font-weight:600;
  box-shadow:inset 0 0 0 1px #DDF1E6;
}
.saved-chip .dot{
  width:7px; height:7px; border-radius:50%;
  background:#5FBF8E;
  transition:transform .22s ease-out, box-shadow .22s ease-out;
}
.saved-chip.is-active .dot{
  transform:scale(1.7);
  box-shadow:0 0 0 5px rgba(95,191,142,.18);
}

/* شبكة عمودين على الشاشات العريضة: المكتبة يمينًا والمعاينة يسارًا */
.layout{ display:block; }

.panel{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  padding:16px;
  box-shadow:var(--shadow);
}
.panel + .panel{ margin-top:16px; }

@media (max-width:979px){
  .panel{ display:none; }
  .panel.is-active{ display:block; animation:rise .26s ease-out both; }
}
@media (min-width:980px){
  .layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 396px;
    gap:24px;
    align-items:start;
  }
  .panel{ display:block; padding:20px; }
  .panel + .panel{ margin-top:0; }
  .preview{ position:sticky; top:24px; }
}

@keyframes rise{
  from{ opacity:0; transform:translateY(10px); }
  to{ opacity:1; transform:none; }
}

/* ============================ رأس اللوحة ============================ */
.panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:16px;
}
.panel-head h2{ font-size:18px; }
.hint{ margin:2px 0 0; font-size:12.5px; color:var(--muted); }

/* ============================ الأزرار ============================ */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:0 16px;
  border-radius:14px;
  font-size:14px;
  font-weight:600;
  white-space:nowrap;
  transition:transform var(--t), background-color var(--t), box-shadow var(--t), color var(--t);
}
.btn:active{ transform:scale(.97); }
.btn.block{ width:100%; margin-top:10px; justify-content:center; }

.btn-primary{
  background:linear-gradient(145deg,#D3C2FF,#B9A6F2);
  color:#2C2344;
  box-shadow:0 8px 18px rgba(185,166,242,.42), inset 0 0 0 1px rgba(255,255,255,.55);
}
.btn-primary:hover{ box-shadow:0 10px 22px rgba(185,166,242,.55), inset 0 0 0 1px rgba(255,255,255,.7); }

.btn-ghost{
  background:#F6F2FF;
  color:var(--ink);
  box-shadow:inset 0 0 0 1px var(--line);
}
.btn-ghost:hover{ background:#F0EAFB; }

.btn-danger{
  background:#FFF1EC;
  color:#A2452F;
  box-shadow:inset 0 0 0 1px #FFD9CC;
}
.btn-danger:hover{ background:#FFE7DF; }

/* ============================ الإحصائيات ============================ */
.stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-bottom:14px;
}
.stat{
  background:var(--tint);
  border:1px solid var(--line);
  border-radius:var(--r-md);
  padding:9px 11px;
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:0;
}
.stat-num{
  font-family:'Cairo',sans-serif;
  font-size:22px;
  font-weight:700;
  line-height:1.2;
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum";
}
.stat-label{
  font-size:11px;
  color:var(--muted);
  line-height:1.4;
}

/* ============================ شريط الأدوات ============================ */
.toolbar{
  display:flex;
  gap:8px;
  margin-bottom:12px;
  flex-wrap:wrap;
}
.search{
  flex:1 1 170px;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:0 12px;
  background:var(--tint);
  border:1px solid var(--line);
  border-radius:14px;
  transition:border-color var(--t), background-color var(--t), box-shadow var(--t);
}
.search:focus-within{
  border-color:var(--lilac);
  background:#fff;
  box-shadow:0 0 0 3px rgba(201,182,255,.32);
}
.search input{
  flex:1 1 auto;
  min-width:0;
  border:0;
  background:transparent;
  outline:none;
  font-size:15px;
  padding:0;
}
.search input::placeholder{ color:#A9A2BE; }
.search input::-webkit-search-cancel-button{ -webkit-appearance:none; }

/* ============================ حبوب الفئات ============================ */
.pills{
  display:flex;
  gap:7px;
  overflow-x:auto;
  padding:2px 1px 10px;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.pills::-webkit-scrollbar{ display:none; }
.pill{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:40px;
  padding:0 14px;
  border-radius:999px;
  background:var(--tint);
  color:var(--ink-soft);
  border:1px solid var(--line);
  font-size:13px;
  font-weight:600;
  transition:background-color var(--t), color var(--t), box-shadow var(--t), transform var(--t);
}
.pill:active{ transform:scale(.96); }
.pill[aria-selected="true"]{
  background:var(--lilac);
  color:#2E2545;
  border-color:var(--lilac);
  box-shadow:0 6px 14px rgba(201,182,255,.5);
}
.pill-n{
  font-size:11px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  background:rgba(58,52,80,.08);
  padding:1px 6px;
  border-radius:999px;
}
.pill[aria-selected="true"] .pill-n{ background:rgba(58,52,80,.14); }

/* ============================ قائمة التطبيقات ============================ */
.applist{ display:flex; flex-direction:column; gap:8px; }

.app-row{
  display:flex;
  align-items:center;
  gap:11px;
  padding:9px;
  border-radius:18px;
  background:#fff;
  border:1px solid #F4EFFB;
  transition:background-color var(--t), border-color var(--t), box-shadow var(--t);
}
.app-row:hover{ background:#FDFBFF; border-color:var(--line); box-shadow:0 6px 14px rgba(58,52,80,.05); }

.app-ico{
  position:relative;
  width:48px; height:48px;
  flex:0 0 auto;
  border-radius:16px;
  display:grid;
  place-items:center;
  font-family:'Cairo',sans-serif;
  font-size:20px;
  font-weight:700;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.6), 0 6px 12px rgba(58,52,80,.08);
}
.ico-badge{
  position:absolute;
  bottom:-5px;
  inset-inline-start:-6px;
  background:var(--ink);
  color:#fff;
  font-size:9px;
  font-weight:700;
  line-height:1.5;
  padding:1px 6px;
  border-radius:999px;
  border:2px solid #fff;
  white-space:nowrap;
}

.app-main{
  flex:1 1 auto;
  min-width:0;
  cursor:pointer;
  border-radius:10px;
}
.app-main h3{
  font-size:15px;
  display:flex;
  align-items:center;
  gap:6px;
  margin:0;
  min-width:0;
}
.app-main h3 > span:first-child{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tag{
  flex:0 0 auto;
  font-family:'IBM Plex Sans Arabic',sans-serif;
  font-size:10.5px;
  font-weight:600;
  color:#6B5CA5;
  background:#F2ECFF;
  padding:1px 8px;
  border-radius:999px;
}
.app-note{
  margin:1px 0 0;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.row-actions{ display:flex; gap:2px; flex:0 0 auto; }
.icon-btn{
  width:40px; height:40px;
  display:grid;
  place-items:center;
  border-radius:12px;
  color:var(--muted);
  transition:background-color var(--t), color var(--t), transform var(--t);
}
.icon-btn:hover{ background:#F6F2FF; color:var(--ink); }
.icon-btn:active{ transform:scale(.92); }
.icon-btn[disabled]{ opacity:.3; pointer-events:none; }

.drag-handle{ cursor:grab; touch-action:none; }
.drag-handle:active{ cursor:grabbing; }

@media (max-width:979px){
  .drag-handle{ display:none; }
}

/* ============================ الحالة الفارغة ============================ */
.empty{
  text-align:center;
  padding:26px 16px;
  border-radius:20px;
  background:var(--tint);
  border:1px dashed #E4DAF6;
}
.empty-ico{
  width:56px; height:56px;
  border-radius:18px;
  background:#fff;
  display:grid; place-items:center;
  margin:0 auto 12px;
  color:var(--violet);
  box-shadow:0 6px 14px rgba(58,52,80,.07);
}
.empty h3{ font-size:16px; margin-bottom:4px; }
.empty p{
  margin:0 auto 14px;
  max-width:34ch;
  font-size:13px;
  color:var(--muted);
}

/* ============================ المعاينة ============================ */
.preview{ display:flex; flex-direction:column; }
.phone-wrap{
  display:flex;
  justify-content:center;
  padding:4px 0 10px;
}
.phone{
  width:min(334px,100%);
  padding:9px;
  border-radius:36px;
  background:linear-gradient(160deg,#F2ECFF,#FBF7FF 46%,#FFF1E9);
  box-shadow:var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,.85);
}
.screen{
  position:relative;
  border-radius:29px;
  height:clamp(430px,60vh,580px);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(120% 78% at 8% 0%, #E9DFFF 0%, rgba(233,223,255,0) 62%),
    radial-gradient(110% 70% at 100% 8%, #FFE4D7 0%, rgba(255,228,215,0) 58%),
    radial-gradient(120% 66% at 50% 102%, #D8F3E7 0%, rgba(216,243,231,0) 62%),
    #FBF8FF;
}
.screen::before{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.5;
  mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.06'/></svg>");
}

.statusbar{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:11px 18px 0;
  font-size:11px;
  font-weight:700;
  color:#4A4463;
  font-variant-numeric:tabular-nums;
}
.status-icons{ display:flex; align-items:center; gap:5px; }

.widget{
  position:relative;
  z-index:1;
  margin:10px 14px 14px;
  padding:11px 14px;
  border-radius:20px;
  background:rgba(255,255,255,.55);
  border:1px solid rgba(255,255,255,.8);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  box-shadow:0 6px 14px rgba(58,52,80,.06);
}
.widget-greet{
  margin:0;
  font-family:'Cairo',sans-serif;
  font-size:15px;
  font-weight:700;
}
.widget-sub{ margin:1px 0 0; font-size:11.5px; color:#6C658A; }

.home-grid{
  position:relative;
  z-index:1;
  flex:1 1 auto;
  overflow-y:auto;
  padding:2px 12px 14px;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px 6px;
  align-content:start;
  scrollbar-width:none;
}
.home-grid::-webkit-scrollbar{ width:0; height:0; }

.home-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  min-width:0;
  border-radius:18px;
}
.home-ico{
  position:relative;
  width:56px; height:56px;
  border-radius:20px;
  display:grid;
  place-items:center;
  font-family:'Cairo',sans-serif;
  font-size:23px;
  font-weight:700;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.6), 0 6px 12px rgba(58,52,80,.1);
  transition:transform var(--t), box-shadow var(--t);
}
.home-item:active .home-ico{
  transform:scale(1.05);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.78), 0 9px 18px rgba(58,52,80,.16);
}
.home-badge{
  position:absolute;
  top:-4px;
  inset-inline-start:-4px;
  width:16px; height:16px;
  border-radius:50%;
  background:var(--ink);
  border:2px solid #fff;
  display:grid; place-items:center;
  color:#fff;
}
.home-badge svg{ width:9px; height:9px; }

.home-label{
  font-size:10.5px;
  line-height:1.35;
  color:#3A3450;
  max-width:66px;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.folder-ico{
  background:rgba(255,255,255,.62);
  border:1px solid rgba(255,255,255,.9);
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  padding:8px;
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  transition:transform var(--t), outline-color var(--t);
}
.mini{
  width:16px; height:16px;
  border-radius:5px;
  display:grid;
  place-items:center;
  font-family:'Cairo',sans-serif;
  font-size:8px;
  font-weight:700;
  line-height:1;
}
.folder-empty{ grid-column:1/-1; justify-self:center; align-self:center; color:#8B84A3; }
.folder-empty svg{ width:22px; height:22px; }

.folder-tile.drop-target .folder-ico{
  outline:2px dashed var(--violet);
  outline-offset:2px;
  transform:scale(1.07);
}
body.dragging .folder-ico{ transform:scale(1.03); }

.home-empty{
  grid-column:1/-1;
  text-align:center;
  color:#6C658A;
  font-size:11.5px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:5px;
  padding:26px 8px;
}
.home-empty svg{ color:#B9A6F2; }
.home-empty em{ font-style:normal; font-size:10.5px; opacity:.8; }

.home-indicator{
  height:5px;
  width:104px;
  border-radius:999px;
  background:rgba(58,52,80,.16);
  margin:0 auto 9px;
  flex:0 0 auto;
}

/* نافذة المجلد داخل الشاشة */
.folder-overlay{
  position:absolute;
  inset:0;
  z-index:5;
  display:flex;
  flex-direction:column;
  padding:14px 14px 12px;
  background:rgba(251,247,255,.84);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  animation:overlayIn .2s ease-out both;
}
@keyframes overlayIn{
  from{ opacity:0; transform:scale(.98); }
  to{ opacity:1; transform:none; }
}
.folder-head{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}
.folder-head h3{ font-size:14px; flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.folder-count{
  font-size:11px;
  font-weight:700;
  color:#5B5474;
  background:rgba(58,52,80,.08);
  padding:1px 8px;
  border-radius:999px;
  font-variant-numeric:tabular-nums;
}
.mini-btn{
  width:32px; height:32px;
  min-height:32px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:rgba(255,255,255,.9);
  color:var(--ink);
  box-shadow:inset 0 0 0 1px var(--line);
  transition:transform var(--t), background-color var(--t);
}
.mini-btn:active{ transform:scale(.94); }
.mini-btn.wide{
  width:auto;
  flex:1 1 0;
  min-height:40px;
  padding:0 10px;
  font-size:11.5px;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:center;
}
.mini-btn.danger{ color:#A2452F; background:#FFF3EE; box-shadow:inset 0 0 0 1px #FFDDD1; }

.folder-grid{
  flex:1 1 auto;
  overflow-y:auto;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px 6px;
  align-content:start;
  padding:4px 0;
  scrollbar-width:none;
}
.folder-grid::-webkit-scrollbar{ width:0; }
.folder-empty-msg{
  grid-column:1/-1;
  margin:0;
  padding:20px 6px;
  text-align:center;
  font-size:11.5px;
  color:#6C658A;
  line-height:1.7;
}
.folder-actions{ display:flex; gap:7px; padding-top:10px; flex:0 0 auto; }

.preview-hint{
  margin:2px 0 0;
  text-align:center;
  font-size:11.5px;
  color:var(--muted);
}
.hint-desk{ display:none; }
@media (min-width:980px){
  .hint-desk{ display:inline; }
  .hint-mob{ display:none; }
}

/* شبح السحب */
.drag-ghost{
  position:fixed;
  z-index:9999;
  width:56px; height:56px;
  border-radius:18px;
  display:grid;
  place-items:center;
  font-family:'Cairo',sans-serif;
  font-size:22px;
  font-weight:700;
  pointer-events:none;
  transform:translate(-50%,-50%) scale(1.06);
  box-shadow:0 16px 28px rgba(58,52,80,.26), inset 0 0 0 2px rgba(255,255,255,.6);
  opacity:.95;
}

/* ============================ شريط التبويب ============================ */
.tabbar{
  position:fixed;
  bottom:0;
  inset-inline:0;
  z-index:50;
  display:flex;
  gap:6px;
  justify-content:center;
  padding:8px 12px 10px;
  background:rgba(251,249,246,.9);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border-top:1px solid var(--line);
}
.tab-btn{
  flex:1 1 0;
  max-width:220px;
  min-height:54px;
  border-radius:16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  font-size:11px;
  font-weight:600;
  color:var(--muted);
  transition:background-color var(--t), color var(--t), transform var(--t);
}
.tab-btn:active{ transform:scale(.97); }
.tab-btn[aria-selected="true"]{
  background:#F2ECFF;
  color:var(--ink);
  box-shadow:inset 0 0 0 1px var(--line);
}
@media (min-width:980px){
  .tabbar{ display:none; }
}

/* ============================ النوافذ المنبثقة ============================ */
.sheet-backdrop{
  position:fixed;
  inset:0;
  z-index:100;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  background:rgba(58,52,80,.34);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  animation:fade .18s ease-out both;
}
@keyframes fade{ from{ opacity:0; } to{ opacity:1; } }

.sheet{
  width:100%;
  max-width:480px;
  max-height:92vh;
  overflow-y:auto;
  background:#fff;
  border-radius:26px 26px 0 0;
  padding:14px 18px 18px;
  box-shadow:0 -18px 40px rgba(58,52,80,.18);
  animation:slideUp .26s cubic-bezier(.22,1,.36,1) both;
  overscroll-behavior:contain;
}
@keyframes slideUp{
  from{ transform:translateY(24px); opacity:.6; }
  to{ transform:none; opacity:1; }
}
@media (min-width:640px){
  .sheet-backdrop{ align-items:center; padding:24px; }
  .sheet{
    border-radius:26px;
    box-shadow:0 24px 60px rgba(58,52,80,.24);
  }
}
.sheet-small{ max-width:400px; }
.sheet-grip{
  width:42px; height:4px;
  border-radius:999px;
  background:#E7DFF5;
  margin:0 auto 12px;
}
@media (min-width:640px){ .sheet-grip{ display:none; } }

.sheet-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:14px;
}
.sheet-head h2{ font-size:17px; }

.field{ display:block; margin-bottom:14px; }
.field > span{
  display:block;
  font-size:13px;
  font-weight:600;
  color:var(--ink-soft);
  margin-bottom:6px;
}
.field-hint{
  display:block;
  font-style:normal;
  font-size:11.5px;
  color:var(--muted);
  line-height:1.6;
  margin-top:5px;
}
.field-error{
  margin:-8px 0 12px;
  font-size:12.5px;
  font-weight:600;
  color:#A2452F;
  background:#FFF1EC;
  border-radius:10px;
  padding:7px 11px;
}

.input{
  width:100%;
  min-height:48px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--tint);
  padding:12px 14px;
  font-size:16px;
  line-height:1.5;
  outline:none;
  transition:border-color var(--t), box-shadow var(--t), background-color var(--t);
  resize:vertical;
}
.input::placeholder{ color:#A9A2BE; }
.input:focus{
  border-color:var(--lilac);
  background:#fff;
  box-shadow:0 0 0 3px rgba(201,182,255,.34);
}
.select{
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B84A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat:no-repeat;
  background-position:left 14px center;
  padding-inline-start:14px;
  padding-inline-end:38px;
}
.select:disabled{ opacity:.6; }

.cat-picker{ display:flex; flex-wrap:wrap; gap:7px; }
.cat-chip{
  min-height:40px;
  padding:0 13px;
  border-radius:999px;
  background:var(--tint);
  border:1px solid var(--line);
  color:var(--ink-soft);
  font-size:12.5px;
  font-weight:600;
  transition:background-color var(--t), color var(--t), border-color var(--t), transform var(--t);
}
.cat-chip:active{ transform:scale(.96); }
.cat-chip[aria-pressed="true"]{
  background:var(--lilac);
  border-color:var(--lilac);
  color:#2E2545;
  box-shadow:0 6px 14px rgba(201,182,255,.45);
}

.swatches{ display:flex; gap:10px; flex-wrap:wrap; }
.swatch{
  width:44px; height:44px;
  border-radius:14px;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.6);
  transition:transform var(--t), box-shadow var(--t);
}
.swatch:active{ transform:scale(.94); }
.swatch[aria-pressed="true"]{
  transform:scale(1.06);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.92), 0 0 0 3px var(--ink);
}

.switch{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 14px;
  border-radius:16px;
  background:var(--tint);
  border:1px solid var(--line);
  margin-bottom:14px;
  cursor:pointer;
}
.switch-text{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.switch-text strong{ font-size:14px; font-weight:700; }
.switch-text em{ font-style:normal; font-size:11.5px; color:var(--muted); }
.switch input{
  appearance:none;
  -webkit-appearance:none;
  flex:0 0 auto;
  width:48px; height:28px;
  border-radius:999px;
  background:#E7E0F3;
  position:relative;
  cursor:pointer;
  transition:background-color .2s ease-out;
  margin:0;
}
.switch input::after{
  content:'';
  position:absolute;
  top:3px;
  inset-inline-start:3px;
  width:22px; height:22px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 6px rgba(58,52,80,.22);
  transition:transform .2s ease-out;
}
.switch input:checked{ background:var(--violet); }
.switch input:checked::after{ transform:translateX(-20px); }

.sheet-actions{
  display:flex;
  gap:8px;
  margin-top:4px;
}
.sheet-actions .btn{ flex:1 1 0; }

.confirm-msg{
  margin:0 0 16px;
  font-size:14px;
  color:var(--ink-soft);
  line-height:1.7;
}

/* ============================ التنبيه ============================ */
.toast{
  position:fixed;
  left:50%;
  bottom:88px;
  z-index:200;
  transform:translate(-50%,12px);
  max-width:calc(100% - 32px);
  padding:10px 18px;
  border-radius:999px;
  background:var(--ink);
  color:#fff;
  font-size:13px;
  font-weight:600;
  text-align:center;
  box-shadow:0 12px 24px rgba(58,52,80,.28);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease-out, transform .24s ease-out;
}
.toast.show{ opacity:1; transform:translate(-50%,0); }
@media (min-width:980px){
  .toast{ bottom:34px; }
}

/* ============================ تقليل الحركة ============================ */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
}